Skip to content

Commit

Permalink
2024年10月9日 更新一下基类
Browse files Browse the repository at this point in the history
  • Loading branch information
ss1917 committed Oct 9, 2024
1 parent 5497eba commit 5bd01cf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import sys
from distutils.core import setup

VERSION = '1.0.6'
VERSION = '1.0.7'

if sys.version_info < (2, 7) or (3, 0) <= sys.version_info < (3, 6):
print('This program requires at least Python 2.7 or 3.6 to run.')
Expand Down
19 changes: 19 additions & 0 deletions websdk2/apis/mgv4_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,22 @@ class AdminV4APIS:
field_help={
},
description='获取所有角色和角色内内用户信息')

get_favorites_v4 = dict(method='GET',
url=f'{route_prefix}/v4/favorites/',
params={
},
field_help={
},
description='PAAS-基础功能-公用收藏接口-查看')

opt_favorites_v4 = dict(method='POST',
url=f'{route_prefix}/v4/favorites/',
body={
"key": "",
"app_code": "overall",
"value": {}
},
field_help={
},
description='PAAS-基础功能-公用收藏接口-添加修改')
3 changes: 3 additions & 0 deletions websdk2/base_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def get_req_body_dict(self):
if self.request.method in ("POST", "PUT", "PATCH", "DELETE"):
try:
self.req_data = json.loads(self.request.body.decode("utf-8"))
for key in ['_index', '_rowKey', 'update_time']:
self.req_data.pop(key, None)
return self.req_data
except json.JSONDecodeError as err:
logging.error(f"Error parsing JSON data in request {self.request.method} at {self.request.path}: {err}")
except Exception as err:
Expand Down
7 changes: 3 additions & 4 deletions websdk2/model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ def prepare(self):

@staticmethod
def del_data(data) -> dict:
if '_index' in data:
del data['_index']
if '_rowKey' in data:
del data['_rowKey']
keys_to_remove = ['_index', '_rowKey']
for key in keys_to_remove:
data.pop(key, None)
return data

def handle_add(self, data: dict) -> dict:
Expand Down

0 comments on commit 5bd01cf

Please sign in to comment.