mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-07-10 23:12:25 +08:00
first commit
This commit is contained in:
18
backend/app/utils/response.py
Normal file
18
backend/app/utils/response.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from app.utils.status_code import StatusCode
|
||||
|
||||
class ResponseWrapper:
|
||||
@staticmethod
|
||||
def success(data=None, msg="success", code=StatusCode.SUCCESS):
|
||||
return {
|
||||
"code": int(code),
|
||||
"msg": msg,
|
||||
"data": data
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def error(msg="error", code=StatusCode.FAIL, data=None):
|
||||
return {
|
||||
"code": int(code),
|
||||
"msg": msg,
|
||||
"data": data
|
||||
}
|
||||
Reference in New Issue
Block a user