返回数据总条数

This commit is contained in:
淮新 2024-05-09 09:51:34 +08:00
parent 2f714b9800
commit 21e7b680ec
2 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,7 @@ class SyncDirection(Controller):
)
return SYNCResponse(
code_status=Status.SUCCESS.code,
total=len(repos),
data=repos,
msg=Status.SUCCESS.msg
)
@ -130,6 +131,7 @@ class SyncDirection(Controller):
return SYNCResponse(
code_status=Status.SUCCESS.code,
total=len(branches),
data=branches,
msg=Status.SUCCESS.msg
)
@ -281,6 +283,7 @@ class SyncDirection(Controller):
)
return SYNCResponse(
code_status=Status.SUCCESS.code,
total=len(data),
data=data,
msg=Status.SUCCESS.msg
)

View File

@ -77,6 +77,7 @@ class SYNCException(Exception):
class SYNCResponse(BaseModel):
code_status: Optional[int] = 0
data: Optional[Data] = None
total: Optional[int] = None
msg: Optional[str] = ''