MCPcopy
hub / github.com/1Panel-dev/MaxKB / Result

Class Result

apps/common/result/result.py:25–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24
25class Result(JsonResponse):
26 charset = 'utf-8'
27 """
28 接口统一返回对象
29 """
30
31 def __init__(self, code=200, message=_('Success'), data=None, response_status=status.HTTP_200_OK, **kwargs):
32 back_info_dict = {"code": code, "message": message, 'data': data}
33 super().__init__(data=back_info_dict, status=response_status, **kwargs)
34
35
36def success(data, **kwargs):

Callers 5

page_not_foundFunction · 0.90
postMethod · 0.90
executeMethod · 0.90
successFunction · 0.70
errorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected