1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| from datetime import datetime
| from enum import IntEnum
| from sqlalchemy import Column, String, Enum as SQLAlchemyEnum, Integer, BigInteger, DateTime, Text, Float, Boolean
| from app.models.base_model import Base
|
| class AppType(IntEnum):
| BASIC = 0
| RAGFLOW = 1
| BISHENG = 2
|
|
|
| class AppRegisterModel(Base):
| __tablename__ = "app_register"
| id = Column(Integer, primary_key=True)
| name = Column(String(255))
| app_type = Column(Integer, nullable=False)
| status = Column(Integer, nullable=False, default=1)
| created_at = Column(DateTime, default=datetime.now())
| updated_at = Column(DateTime, default=datetime.now(), onupdate=datetime.now())
|
|
| # to_dict 方法
| def to_dict(self):
| return {
| 'id': self.id,
| 'name': self.name,
| 'agent_type': self.agent_type,
| 'type': self.type
| }
|
|