feat: faker data: identification
This commit is contained in:
18
utils/response.py
Normal file
18
utils/response.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def response(resp: dict, status: int, headers=None):
|
||||
return resp, status, headers
|
||||
|
||||
|
||||
def success(code: int, msg: str, data: object):
|
||||
resp = {
|
||||
"code": code,
|
||||
"msg": msg,
|
||||
"data": data
|
||||
}
|
||||
return response(resp, 200)
|
||||
|
||||
|
||||
def succ(data: object):
|
||||
return success(200, 'success', data)
|
||||
Reference in New Issue
Block a user