feat: implement full API - all admin/user routes, RBAC, sync service, collector, MySQL config, superadmin hanbin credentials
9d66536 Download app/schemas/common.py from binhugg2/api: direct link, hf CLI and curl.
- Browser
- Download file 460 Bytes
-
https://huggingface.co/spaces/binhugg2/api/resolve/main/app/schemas/common.py
- Command line
-
hf download hf://spaces/binhugg2/api/app/schemas/common.py
-
curl -L -o common.py https://huggingface.co/spaces/binhugg2/api/resolve/main/app/schemas/common.py
460 Bytes
| from pydantic import BaseModel | |
| class ApiResponse(BaseModel): | |
| code: int = 0 | |
| msg: str = "success" | |
| data: object = None | |
| def ok(cls, data=None, msg: str = "success"): | |
| return cls(code=0, msg=msg, data=data) | |
| def fail(cls, code: int, msg: str, data=None): | |
| return cls(code=code, msg=msg, data=data) | |
| class PaginatedData(BaseModel): | |
| list: list | |
| total: int | |
| page: int | |
| page_size: int |