Skip to content

Commit

Permalink
2024年12月13日 优化应用管理
Browse files Browse the repository at this point in the history
  • Loading branch information
ss1917 committed Dec 13, 2024
1 parent 0f1be90 commit 0852a65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 1 addition & 3 deletions libs/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,14 @@


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',
url=api_info_url,
))
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():
Expand Down
6 changes: 4 additions & 2 deletions mg/handlers/apps_v4_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions models/paas_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='') # 描述、备注


Expand Down

0 comments on commit 0852a65

Please sign in to comment.