diff --git a/libs/registration.py b/libs/registration.py index e0220a4..90932b6 100644 --- a/libs/registration.py +++ b/libs/registration.py @@ -214,7 +214,7 @@ def registration_to_paas(): - app_code = "mg" + app_code = "p" api_info_url = f"/api/{app_code}/v1/probe/meta/urls/" func_info = client.do_action_v2(**dict( method='GET', @@ -222,8 +222,6 @@ def registration_to_paas(): )) if func_info.status_code == 200: temp_func_list = func_info.json().get('data') - # func_list.append(dict(method_type='ALL', name=f"{app_code}-管理员", uri=f"/api/{app_code}/*")) - # func_list.append(dict(method_type='GET', name=f"{app_code}-查看所有", uri=f"/api/{app_code}/*")) for f in temp_func_list: if 'name' not in f or f.get('name') == '暂无': continue for m, v in method_dict.items(): diff --git a/mg/handlers/apps_v4_handler.py b/mg/handlers/apps_v4_handler.py index 4fe65a1..ed06d11 100644 --- a/mg/handlers/apps_v4_handler.py +++ b/mg/handlers/apps_v4_handler.py @@ -73,14 +73,16 @@ def get(self, *args, **kwargs): def post(self, *args, **kwargs): data = json.loads(self.request.body.decode("utf-8")) - data.setdefault("classify", "SaaS") + data.setdefault("classify", "其他") + data['frontend_code'] = data.get('frontend_code') or "no" res = opt_obj.handle_add(data) self.write(res) def put(self, *args, **kwargs): data = json.loads(self.request.body.decode("utf-8")) - data.setdefault("classify", "SaaS") + data.setdefault("classify", "其他") + data['frontend_code'] = data.get('frontend_code') or "no" res = opt_obj.handle_update(data) self.write(res) diff --git a/models/paas_model.py b/models/paas_model.py index f03bdd9..4cb3309 100644 --- a/models/paas_model.py +++ b/models/paas_model.py @@ -25,12 +25,13 @@ class AppsModel(TimeBaseModel, Base): # 应用名称表 id = Column('id', Integer, primary_key=True, autoincrement=True) name = Column('name', String(100), unique=True) - app_code = Column('app_code', String(100), index=True) # + app_code = Column('app_code', String(100), index=True) # 后端code + frontend_code = Column('frontend_code', String(100), index=True) # 前端code href = Column('href', String(255), default='') # 前端直接跳转的URL 没用接入的应用使用 # path = Column('path', String(255), default='') # 文件加载地址 img = Column('img', String(255), default='') # 图片地址 icon = Column('icon', String(255), default='') # 图标 - classify = Column('classify', String(50), default='SaaS', index=True) # 分类 + classify = Column('classify', String(50), default='其他', index=True) # 分类 description = Column('description', String(250), default='') # 描述、备注