Beispiel #1
0
class StockDto(db.Model):
    __tablename__ = 'stock'
    __table_args__={'mysql_collate' : 'utf8_general_ci'}

    no : int = db.Column(db.Integer, primary_key = True, index = True)
    date : str = db.Column(db.String(10))
    close : int = db.Column(db.Integer)
    volume : int = db.Column(db.Integer)
    keyword : str = db.Column(db.String(10))

    # def __init__(self, no, date, close, volume, keyword):
    #     self.no = no
    #     self.date = date
    #     self.close = close
    #     self.volume = volume
    #     self.keyword = keyword
    
    def __repr__(self):
        return f'Stock(no={self.no}, date={self.date}, close={self.close}, volume={self.volume}, keyword={self.keyword})'

    def __str__(self):
        return f'Stock(no={self.no}, date={self.date}, close={self.close}, volume={self.volume}, keyword={self.keyword})'

    @property
    def json(self):
        return {
        'no' : self.no,
        'date' : self.date,
        'close' : self.close,
        'volume' : self.volume,
        'keyword' : self.keyword
    }
class EmotionDto(db.Model):
    __tablename__ = 'emotion'
    __table_args__ = {'mysql_collate': 'utf8_general_ci'}
    no: int = db.Column(db.Integer, primary_key=True, index=True)
    tag: str = db.Column(db.String(10))
    weight: int = db.Column(db.Integer)
    type: str = db.Column(db.String(10))
    keyword: str = db.Column(db.String(10))

    def __repr__(self):
        return f'Emotion(no={self.no}, tag={self.tag}, weight={self.weight}, \
            type={self.type}, keyword={self.keyword})'

    def __str__(self):
        return f'Emotion(no={self.no}, tag={self.tag}, weight={self.weight}, \
            type={self.type}, keyword={self.keyword})'

    @property
    def json(self):
        return {
            "no": self.no,
            "tag": self.tag,
            "weight": self.weight,
            "type": self.type,
            "keyword": self.keyword
        }
Beispiel #3
0
class StockDto(db.Model):
    __tablename__ = 'stock'
    __table_args__ = {'mysql_collate': 'utf8_general_ci'}

    no: int = db.Column(db.Integer, primary_key=True, index=True)
    date: str = db.Column(db.String(10))
    close: int = db.Column(db.Integer)
    open: int = db.Column(db.Integer)
    high: int = db.Column(db.Integer)
    low: int = db.Column(db.Integer)
    volume: int = db.Column(db.Integer)
    keyword: str = db.Column(db.String(10))

    def __repr__(self):
        return f"Stock(no={self.no}, date={self.date}, close={self.close}, open={self.open}, high={self.high}, low={self.low}, volume={self.volume}, keyword={self.keyword})"

    def __str__(self):
        return f"Stock(no={self.no}, date={self.date}, close={self.close}, open={self.open}, high={self.high}, low={self.low}, volume={self.volume}, keyword={self.keyword})"

    @property
    def json(self):
        return {
            "no": self.no,
            "date": self.date,
            "close": self.close,
            "open": self.open,
            "high": self.high,
            "low": self.low,
            "volume": self.volume,
            "keyword": self.keyword
        }
class StockNewsDto(db.Model):
    __tablename__ = 'stock_news'
    __table_args__ = {'mysql_collate': 'utf8_general_ci'}
    no: int = db.Column(db.Integer, primary_key=True, index=True)
    title: str = db.Column(db.String(100))
    keyword: str = db.Column(db.String(10))

    def __repr__(self):
        return f"Emotion(no={self.no}, title={self.title}, keyword={self.keyword})"

    def __str__(self):
        return f"Emotion(no={self.no}, title={self.title}, keyword={self.keyword})"

    @property
    def json(self):
        return {"no": self.no, "title": self.title, "keyword": self.keyword}
Beispiel #5
0
class StockNewsDto(db.Model):
    __tablename__ = 'stock_news'
    __table_args__ = {'mysql_collate': 'utf8_general_ci'}
    no: int = db.Column(db.Integer, primary_key=True, index=True)
    title: str = db.Column(db.String(100))
    keyword: str = db.Column(db.String(10))

    # def __init__(self, no, positive, pos_count, negative, neg_count, keyword):
    #     self.no = no
    #     self.title = title
    #     self.keyword = keyword

    def __repr__(self):
        return f'Emotion(no={self.no}, title={self.title}, keyword={self.keyword})'

    def __str__(self):
        return f'Emotion(no={self.no}, title={self.title}, keyword={self.keyword})'

    @property
    def json(self):
        return {'no': self.no, 'title': self.title, 'keyword': self.keyword}
class ExchangeDto(db.Model):
    __tablename__ = 'exchange'
    __table_args__={'mysql_collate' : 'utf8_general_ci'}
    no : int = db.Column(db.Integer, primary_key = True, index = True)
    date : str = db.Column(db.String(10))
    usd : str = db.Column(db.String(10))
    jpy : str = db.Column(db.String(10))
    eur : str = db.Column(db.String(10))
    cny : str = db.Column(db.String(10))

    def __repr__(self):
        return f"Stock(no={self.no}, date={self.date}, usd={self.usd}, jpy={self.jpy}, eur={self.eur}, cny={self.cny})"

    def __str__(self):
        return f"Stock(no={self.no}, date={self.date}, usd={self.usd}, jpy={self.jpy}, eur={self.eur}, cny={self.cny})"

    @property
    def json(self):
        return {
        "no" : self.no,
        "date" : self.date,
        "usd" : self.usd,
        "jpy" : self.jpy,
        "eur" : self.eur,
        "cny" : self.cny
    }
class ExchangeDto(db.Model):
    __tablename__ = 'exchange'
    __table_args__ = {'mysql_collate': 'utf8_general_ci'}
    no: int = db.Column(db.Integer, primary_key=True, index=True)
    date: str = db.Column(db.String(10))
    usd: float = db.Column(db.Float)
    jpy: float = db.Column(db.Float)
    eur: float = db.Column(db.Float)
    cny: float = db.Column(db.Float)

    # def __init__(self, no, date, close, volume, keyword):
    #     self.no = no
    #     self.date = date
    #     self.close = close
    #     self.volume = volume
    #     self.keyword = keyword

    def __repr__(self):
        return f'Stock(no={self.no}, date={self.date}, usd={self.usd}, jpy={self.jpy}, eur={self.eur}, cny={self.cny})'

    def __str__(self):
        return f'Stock(no={self.no}, date={self.date}, usd={self.usd}, jpy={self.jpy}, eur={self.eur}, cny={self.cny})'

    @property
    def json(self):
        return {
            'no': self.no,
            'date': self.date,
            'usd': self.usd,
            'jpy': self.jpy,
            'eur': self.eur,
            'cny': self.cny
        }
Beispiel #8
0
class UserDto(db.Model):

    __tablename__ = 'users'
    __table_args__ = {'mysql_collate': 'utf8_general_ci'}

    email: str = db.Column(db.String(100), primary_key=True, index=True)
    name: str = db.Column(db.String(100))
    password: str = db.Column(db.String(10))
    type: str = db.Column(db.String(10))
    gender: str = db.Column(db.String(10))
    age: int = db.Column(db.Integer)

    def __init__(self, email, name, password, type, gender, age):
        self.email = email
        self.name = name
        self.password = password
        self.type = type
        self.gender = gender
        self.age = age

    def __repr__(self):
        return f"User(email={self.email}, name={self.name}, password={self.password}, \
        type={self.type}, gender={self.gender}, age={self.age})"

    def __str__(self):
        return f"User(email={self.email}, name={self.name}, password={self.password}, \
        type={self.type}, gender={self.gender}, age={self.age})"

    @property
    def json(self):
        return {
            "email": self.email,
            "name": self.name,
            "password": self.password,
            "type": self.type,
            "gender": self.gender,
            "age": self.age
        }
Beispiel #9
0
class ReviewDto(db.Model):
    __tablename__ = 'review'
    __table_args__ = {'mysql_collate': 'utf8_general_ci'}

    name: str = db.Column(db.String(100), primary_key=True, index=True)
    money: int = db.Column(db.Integer)
    type: str = db.Column(db.String(10))
    date: str = db.Column(db.String(100))
    price: int = db.Column(db.Integer)
    cnt: int = db.Column(db.Integer)

    # def __init__(self, name, money, type, date, price, cnt):
    #     self.name = name
    #     self.money = money
    #     self.type = type
    #     self.date = date
    #     self.price = price
    #     self.cnt = cnt

    def __repr__(self):
        return f"Review(name={self.name}, money={self.money}, type={self.type}, \
        date={self.date}, price={self.price}, cnt={self.cnt})"

    def __str__(self):
        return f"Review(name={self.name}, money={self.money}, type={self.type}, \
        date={self.date}, price={self.price}, cnt={self.cnt})"

    @property
    def json(self):
        return {
            "name": self.name,
            "money": self.money,
            "type": self.type,
            "date": self.date,
            "price": self.price,
            "cnt": self.cnt
        }
Beispiel #10
0
class EmotionDto(db.Model):
    __tablename__ = 'emotion'
    __table_args__ = {'mysql_collate': 'utf8_general_ci'}
    no: int = db.Column(db.Integer, primary_key=True, index=True)
    positive: str = db.Column(db.String(10))
    pos_count: int = db.Column(db.Integer)
    negative: str = db.Column(db.String(10))
    neg_count: int = db.Column(db.Integer)
    keyword: str = db.Column(db.String(10))

    # def __init__(self, no, positive, pos_count, negative, neg_count, keyword):
    #     self.no = no
    #     self.positive = positive
    #     self.pos_count = pos_count
    #     self.negative = negative
    #     self.neg_count = neg_count
    #     self.keyword = keyword

    def __repr__(self):
        return f'Emotion(no={self.no}, positive={self.positive}, pos_count={self.pos_count}, negative={self.negative},\
            neg_count={self.neg_count}, keyword={self.keyword})'

    def __str__(self):
        return f'Emotion(no={self.no}, positive={self.positive}, pos_count={self.pos_count}, negative={self.negative},\
            neg_count={self.neg_count}, keyword={self.keyword})'

    @property
    def json(self):
        return {
            'no': self.no,
            'positive': self.positive,
            'pos_count': self.pos_count,
            'negative': self.negative,
            'neg_count': self.neg_count,
            'keyword': self.keyword
        }