diff --git a/setup.py b/setup.py index 10c8238..77958c7 100644 --- a/setup.py +++ b/setup.py @@ -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.') diff --git a/websdk2/apis/mgv4_apis.py b/websdk2/apis/mgv4_apis.py index a9599da..bf3a11a 100644 --- a/websdk2/apis/mgv4_apis.py +++ b/websdk2/apis/mgv4_apis.py @@ -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-基础功能-公用收藏接口-添加修改') diff --git a/websdk2/base_handler.py b/websdk2/base_handler.py index 90c08d4..b550d7c 100644 --- a/websdk2/base_handler.py +++ b/websdk2/base_handler.py @@ -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: diff --git a/websdk2/model_utils.py b/websdk2/model_utils.py index 3ef29bf..db1a243 100644 --- a/websdk2/model_utils.py +++ b/websdk2/model_utils.py @@ -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: