This commit is contained in:
2024-10-21 17:07:25 +08:00
parent 2292d25d74
commit 6730204aa3
7 changed files with 26 additions and 25 deletions

View File

@@ -154,8 +154,8 @@ service admin-api {
type (
UserListRequest {
Page int64 `json:"page"` // 分页页码
PageSize int64 `json:"pageSize"` // 每页大小
Page int64 `form:"page"` // 分页页码
PageSize int64 `form:"pageSize"` // 每页大小
}
UserListResponse {
List []UserItem `json:"list"`
@@ -172,8 +172,8 @@ type (
UpdatedAt string `json:"updatedAt"` // 更新时间
}
rechargeRequest {
UserId int64 `json:userId`
Amount int64 `json:amount`
UserId int64 `json:"userId"`
Amount int64 `json:"amount"`
}
)
@@ -184,7 +184,7 @@ type (
)
service admin-api {
@handler getUserList
post /user/list (UserListRequest) returns (UserListResponse)
get /user/list (UserListRequest) returns (UserListResponse)
@handler recharge
post /user/recharge (rechargeRequest)

View File

@@ -99,7 +99,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
[]rest.Middleware{serverCtx.AuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
Method: http.MethodGet,
Path: "/user/list",
Handler: user.GetUserListHandler(serverCtx),
},

View File

@@ -111,8 +111,8 @@ type UserItem struct {
}
type UserListRequest struct {
Page int64 `json:"page"` // 分页页码
PageSize int64 `json:"pageSize"` // 每页大小
Page int64 `form:"page"` // 分页页码
PageSize int64 `form:"pageSize"` // 每页大小
}
type UserListResponse struct {
@@ -121,6 +121,6 @@ type UserListResponse struct {
}
type RechargeRequest struct {
UserId int64 `json:userId`
Amount int64 `json:amount`
UserId int64 `json:"userId"`
Amount int64 `json:"amount"`
}