Skip to content

Commit

Permalink
修改API文档,新增参数解释
Browse files Browse the repository at this point in the history
  • Loading branch information
1303-yzym committed Jun 21, 2024
1 parent 2cc5ca5 commit 5bffc7f
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion backend/api/user/v1/user_change_nickname.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "github.com/gogf/gf/v2/frame/g"

type ChangeNicknameReq struct {
g.Meta `path:"/user/change-nick-name" method:"post" tags:"UserService" summary:"change-nick-name 修改昵称"`
Nickname string `v:"required"`
Nickname string `v:"required" dc:"昵称,required" "`
}
type ChangeNicknameRes struct {
OK bool
Expand Down
2 changes: 1 addition & 1 deletion backend/api/user/v1/user_check_nick_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import "github.com/gogf/gf/v2/frame/g"

type CheckNickNameReq struct {
g.Meta `path:"/user/check-nick-name" method:"post" tags:"UserService" summary:"check-nick-name 昵称是否可用"`
Nickname string `v:"required"`
Nickname string `v:"required" dc:"昵称,required"`
}
type CheckNickNameRes struct{}
2 changes: 1 addition & 1 deletion backend/api/user/v1/user_check_passport.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import "github.com/gogf/gf/v2/frame/g"

type CheckPassportReq struct {
g.Meta `path:"/user/check-passport" method:"post" tags:"UserService" summary:"check-passport 账户是否可用"`
Passport string `v:"required"`
Passport string `v:"required" dc:"账户,required"`
}
type CheckPassportRes struct{}
2 changes: 1 addition & 1 deletion backend/api/user/v1/user_delete_share.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "github.com/gogf/gf/v2/frame/g"

type DeleteShareReq struct {
g.Meta `path:"/user/delete-share" method:"post" tags:"UserService" summary:"delete-share 删除密钥分片"`
Index int `v:"required|min:0"`
Index int `v:"required|min:0" dc:"分片索引,从0开始,required"`
}

type DeleteShareRes struct {
Expand Down
3 changes: 1 addition & 2 deletions backend/api/user/v1/user_get_share.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import "github.com/gogf/gf/v2/frame/g"

type GetShareReq struct {
g.Meta `path:"/user/get-share" method:"post" tags:"UserService" summary:"get-share 获取秘钥分片"`
Index int `v:"required|min:0"`
// Passport string `v:"required"`
Index int `v:"required|min:0" dc:"分片索引,required"`
}
type GetShareRes struct {
Share string
Expand Down
2 changes: 1 addition & 1 deletion backend/api/user/v1/user_is_signed_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ type IsSignedInReq struct {
g.Meta `path:"/user/is-signed-in" method:"post" tags:"UserService" summary:"is-signed-in 是否已经登录"`
}
type IsSignedInRes struct {
OK bool `dc:"True if current user is signed in; or else false"`
OK bool `dc:"若登录成功,返回true"`
}
10 changes: 5 additions & 5 deletions backend/api/user/v1/user_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import "github.com/gogf/gf/v2/frame/g"

type RegisterReq struct {
g.Meta `path:"/user/register" method:"post" tags:"UserService" summary:"register 验证验证码是否正确并注册用户"`
Passport string `v:"required|length:0,320"`
Password string `v:"required|length:6,16"`
Code string `v:"required|length:6,6"`
Nickname string
Passport string `v:"required" dc:"账户,required"`
Password string `v:"required" dc:"密码,required"`
Code string `v:"required" dc:"验证码,required"`
Nickname string `dc:"昵称,可选"`
}

type RegisterRes struct {
OK bool
OK bool `dc:"若注册成功,返回true"`
}
8 changes: 4 additions & 4 deletions backend/api/user/v1/user_reset_password.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import "github.com/gogf/gf/v2/frame/g"

type ResetPasswordReq struct {
g.Meta `path:"/user/reset-password" method:"post" tags:"UserService" summary:"reset-password 重置密码"`
Passport string `v:"required|length:0,320"`
Password string `v:"required|length:6,16"`
Password2 string `v:"required|length:6,16|same:Password"`
Passport string `v:"required" dc:"账户,required"`
Password string `v:"required" dc:"密码,required"`
Password2 string `v:"required|same:Password" dc:"确认密码,required|确认密码与密码不一致"`
}
type ResetPasswordRes struct {
OK bool
OK bool `dc:"若重置密码成功,返回true"`
}
10 changes: 5 additions & 5 deletions backend/api/user/v1/user_reset_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import "github.com/gogf/gf/v2/frame/g"

type ResetRegisterReq struct {
g.Meta `path:"/user/reset-register" method:"post" tags:"UserService" summary:"reset-register 重置密钥的注册路由"`
Passport string `v:"required|length:0,320"`
Password string `v:"required|length:6,16"`
Code string `v:"required|length:6,6"`
Nickname string
Passport string `v:"required" dc:"账户,required"`
Password string `v:"required" dc:"密码,required"`
Code string `v:"required" dc:"验证码,required"`
Nickname string `dc:"昵称,可选"`
}

type ResetRegisterRes struct {
OK bool
OK bool `dc:"若注册成功,返回true"`
}
6 changes: 3 additions & 3 deletions backend/api/user/v1/user_send_share.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import "github.com/gogf/gf/v2/frame/g"

type SendShareReq struct {
g.Meta `path:"/user/send-share" method:"post" tags:"UserService" summary:"send-share 已注册账户存储密钥分片"`
Share string `v:"required"`
Index int `v:"required|min:0"`
Share string `v:"required" dc:"密钥分片,required"`
Index int `v:"required|min:0" dc:"分片索引,required"`
}

type SendShareRes struct {
OK bool
OK bool `dc:"若存储成功,返回true"`
}
4 changes: 2 additions & 2 deletions backend/api/user/v1/user_sign_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "github.com/gogf/gf/v2/frame/g"

type SignInReq struct {
g.Meta `path:"/user/sign-in" method:"post" tags:"UserService" summary:"sign-in 已注册账户登录"`
Passport string `v:"required|length:0,320"`
Password string `v:"required|length:6,30"`
Passport string `v:"required" dc:"账户,required"`
Password string `v:"required" dc:"密码,required"`
}
type SignInRes struct{}
10 changes: 5 additions & 5 deletions backend/api/user/v1/user_sign_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import "github.com/gogf/gf/v2/frame/g"

type SignUpReq struct {
g.Meta `path:"/user/sign-up" method:"post" tags:"UserService" summary:"sign-up 用户注册"`
Passport string `v:"required|length:0,320"`
Password string `v:"required|length:6,16"`
Password2 string `v:"required|length:6,16|same:Password"`
Nickname string
Passport string `v:"required" dc:"账户,required"`
Password string `v:"required" dc:"密码,required"`
Password2 string `v:"required|same:Password" dc:"确认密码,required"`
Nickname string `dc:"昵称,可选"`
}
type SignUpRes struct {
OK bool
OK bool `dc:"若注册成功,返回true"`
}
2 changes: 1 addition & 1 deletion backend/api/user/v1/user_social_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ type SocialRecoveryReq struct {
}

type SocialRecoveryRes struct {
OK bool
OK bool `dc:"若恢复成功,返回true"`
}
Binary file modified backend/main.exe
Binary file not shown.
Binary file modified backend/main.exe~
Binary file not shown.

0 comments on commit 5bffc7f

Please sign in to comment.