fix: unify user ID type to string and rename service to users-api

This commit is contained in:
zetaloop
2026-04-22 22:03:49 +08:00
parent 59256897e9
commit b3db04c9cc
11 changed files with 59 additions and 28 deletions
+10 -10
View File
@@ -70,7 +70,7 @@ type (
EmptyResp {}
// 用户信息核心模型 (User)
User {
Id int64 `json:"id"`
Id string `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
@@ -142,13 +142,13 @@ type (
// =================================================================================
type (
GetUserReq {
Id int64 `path:"id"`
Id string `path:"id"`
}
FollowUserReq {
Id int64 `path:"id"`
Id string `path:"id"`
}
UnfollowUserReq {
Id int64 `path:"id"`
Id string `path:"id"`
}
)
@@ -159,7 +159,7 @@ type (
group: auth
prefix: /api/v1/auth
)
service user-api {
service users-api {
@doc "用户注册"
@handler Register
post /register (RegisterReq) returns (RegisterResp)
@@ -177,7 +177,7 @@ service user-api {
group: auth
prefix: /api/v1/auth
)
service user-api {
service users-api {
@doc "退出登录"
@handler Logout
post /logout (LogoutReq) returns (EmptyResp)
@@ -188,7 +188,7 @@ service user-api {
prefix: /api/v1/users
middleware: Logger
)
service user-api {
service users-api {
@doc "获取当前登录用户信息"
@handler GetMe
get /me returns (User)
@@ -223,7 +223,7 @@ service user-api {
group: user
prefix: /api/v1/users
)
service user-api {
service users-api {
@doc "获取指定用户信息"
@handler GetUserInfo
get /:id (GetUserReq) returns (User)
@@ -233,7 +233,7 @@ service user-api {
group: verification_user
prefix: /api/v1/users
)
service user-api {
service users-api {
@doc "提交或修改角色认证申请 (支持幂等更新)"
@handler ApplyVerification
post /me/verification (ApplyVerificationReq) returns (VerificationEmptyResp)
@@ -247,7 +247,7 @@ service user-api {
group: verification_admin
prefix: /api/v1/admin
)
service user-api {
service users-api {
@doc "管理员获取认证申请列表 (分页)"
@handler GetVerifications
get /verifications (GetPendingListReq) returns (GetPendingListResp)