|
|
|
@ -136,7 +136,7 @@ class GptsApp(BaseModel): |
|
|
|
|
owner_avatar_url: Optional[str] = None |
|
|
|
|
recommend_questions: Optional[List[RecommendQuestion]] = [] |
|
|
|
|
admins: List[str] = Field(default_factory=list) |
|
|
|
|
app_type: Optional[str] = None |
|
|
|
|
# app_type: Optional[str] = None |
|
|
|
|
|
|
|
|
|
# By default, keep the last two rounds of conversation records as the context |
|
|
|
|
keep_start_rounds: int = 0 |
|
|
|
@ -202,7 +202,7 @@ class GptsAppQuery(GptsApp): |
|
|
|
|
app_codes: Optional[List[str]] = [] |
|
|
|
|
hot_map: Optional[Dict[str, int]] = {} |
|
|
|
|
need_owner_info: Optional[str] = "true" |
|
|
|
|
app_type: Optional[str] = None |
|
|
|
|
# app_type: Optional[str] = None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GptsAppResponse(BaseModel): |
|
|
|
@ -336,7 +336,7 @@ class GptsAppEntity(Model): |
|
|
|
|
) |
|
|
|
|
admins = Column(Text, nullable=True, comment="administrators") |
|
|
|
|
|
|
|
|
|
app_type = Column(String(10), nullable=True, comment="分类") |
|
|
|
|
# app_type = Column(String(10), nullable=True, comment="分类") |
|
|
|
|
|
|
|
|
|
__table_args__ = (UniqueConstraint("app_name", name="uk_gpts_app"),) |
|
|
|
|
|
|
|
|
@ -363,7 +363,7 @@ class GptsAppDetailEntity(Model): |
|
|
|
|
onupdate=datetime.utcnow, |
|
|
|
|
comment="last update time", |
|
|
|
|
) |
|
|
|
|
app_type = Column(String(10), nullable=True, comment="分类") |
|
|
|
|
# app_type = Column(String(10), nullable=True, comment="分类") |
|
|
|
|
|
|
|
|
|
__table_args__ = ( |
|
|
|
|
UniqueConstraint( |
|
|
|
@ -694,12 +694,12 @@ class GptsAppDao(BaseDao): |
|
|
|
|
recommend_questions: List[RecommendQuestionEntity] = None, |
|
|
|
|
): |
|
|
|
|
|
|
|
|
|
type_label = None |
|
|
|
|
if app_info.app_type: |
|
|
|
|
# 这里假设你有一个字典表DAO类可以查询 |
|
|
|
|
dict_dao = TypeDao() # 需要实现这个类 |
|
|
|
|
dict_item = dict_dao.select_type_by_value(app_info.app_type) |
|
|
|
|
type_label = dict_item.label if dict_item else None |
|
|
|
|
# type_label = None |
|
|
|
|
# if app_info.app_type: |
|
|
|
|
# # 这里假设你有一个字典表DAO类可以查询 |
|
|
|
|
# dict_dao = TypeDao() # 需要实现这个类 |
|
|
|
|
# dict_item = dict_dao.select_type_by_value(app_info.app_type) |
|
|
|
|
# type_label = dict_item.label if dict_item else None |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
"app_code": app_info.app_code, |
|
|
|
@ -735,8 +735,8 @@ class GptsAppDao(BaseDao): |
|
|
|
|
else [] |
|
|
|
|
), |
|
|
|
|
"admins": [], |
|
|
|
|
"app_type": app_info.app_type, |
|
|
|
|
"type_label": type_label, #用于前端显示,type对应的汉字标签 |
|
|
|
|
# "app_type": app_info.app_type, |
|
|
|
|
# "type_label": type_label, #用于前端显示,type对应的汉字标签 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
def _group_app_details(self, app_codes, session): |
|
|
|
@ -879,7 +879,7 @@ class GptsAppDao(BaseDao): |
|
|
|
|
param_need=( |
|
|
|
|
json.dumps(gpts_app.param_need) if gpts_app.param_need else None |
|
|
|
|
), |
|
|
|
|
app_type=gpts_app.app_type |
|
|
|
|
# app_type=gpts_app.app_type |
|
|
|
|
) |
|
|
|
|
session.add(app_entity) |
|
|
|
|
|
|
|
|
@ -951,7 +951,7 @@ class GptsAppDao(BaseDao): |
|
|
|
|
app_entity.param_need = json.dumps(gpts_app.param_need) |
|
|
|
|
app_entity.keep_start_rounds = gpts_app.keep_start_rounds |
|
|
|
|
app_entity.keep_end_rounds = gpts_app.keep_end_rounds |
|
|
|
|
app_entity.app_type = gpts_app.app_type |
|
|
|
|
# app_entity.app_type = gpts_app.app_type |
|
|
|
|
session.merge(app_entity) |
|
|
|
|
|
|
|
|
|
old_details = session.query(GptsAppDetailEntity).filter( |
|
|
|
|