# -*- coding: utf-8 -*-
from sqlalchemy import String, Column, Integer,DateTime,Text,Date,Time,ForeignKey,Float
from database import Base
from sqlalchemy.orm import relationship
from datetime import datetime



class OneShareApiEntity(Base):
    __tablename__ = "tp_oneshare_api"

    id = Column(Integer, primary_key=True, autoincrement=True,comment="id")
    passid = Column(String(50),comment="passid")
    passtoken = Column(String(50),comment="passtoken")
    servercode = Column(String(50),comment="接口编码")
    servertype = Column (Integer,comment="接口类型：1:普通接口;2:地图接口;3:自定义接口")
    params_default = Column(Text,comment="默认params")
    body_default = Column(Text,comment="默认body")
    headers_default = Column(Text,comment="默认headers")
    servername = Column(String(255),comment="接口名称")
    create_time = Column(DateTime, default=datetime.now, comment="创建时间")
    update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment="更新时间")


    class Config:
        orm_mode = True