From 0852a65ec55464dce5efa33436ebf8134554d779 Mon Sep 17 00:00:00 2001 From: shenshuo <191715030@qq.com> Date: Fri, 13 Dec 2024 10:30:01 +0800 Subject: [PATCH] =?UTF-8?q?2024=E5=B9=B412=E6=9C=8813=E6=97=A5=20=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BA=94=E7=94=A8=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/registration.py | 4 +--- mg/handlers/apps_v4_handler.py | 6 ++++-- models/paas_model.py | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) 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='') # 描述、备注