feat: 引入签名认证、加密工具包及大量goctl代码生成模板,并更新API、Admin和Node服务逻辑。
This commit is contained in:
+32
-17
@@ -6,26 +6,40 @@ info (
|
||||
|
||||
type (
|
||||
UserLoginReq {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Identifier string `json:"identifier"`
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
IP string `header:"X-Original-Forwarded-For,optional"`
|
||||
UserAgent string `header:"User-Agent,optional"`
|
||||
LoginType string `header:"Login-Type,optional"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
|
||||
LoginResp {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
UserRegisterReq {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Code string `json:"code"`
|
||||
ReferCode string `json:"refer_code,optional"`
|
||||
}
|
||||
|
||||
AuthResp {
|
||||
Token string `json:"token"`
|
||||
Expire int64 `json:"expire"`
|
||||
Identifier string `json:"identifier"`
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Invite string `json:"invite,optional"`
|
||||
Code string `json:"code,optional"`
|
||||
IP string `header:"X-Original-Forwarded-For,optional"`
|
||||
UserAgent string `header:"User-Agent,optional"`
|
||||
LoginType string `header:"Login-Type,optional"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
|
||||
ResetPasswordReq {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Code string `json:"code"`
|
||||
Identifier string `json:"identifier"`
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Code string `json:"code,optional"`
|
||||
IP string `header:"X-Original-Forwarded-For,optional"`
|
||||
UserAgent string `header:"User-Agent,optional"`
|
||||
LoginType string `header:"Login-Type,optional"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
)
|
||||
|
||||
@@ -35,11 +49,12 @@ type (
|
||||
)
|
||||
service ppanel-api {
|
||||
@handler UserLoginHandler
|
||||
post /login (UserLoginReq) returns (AuthResp)
|
||||
post /login (UserLoginReq) returns (LoginResp)
|
||||
|
||||
@handler UserRegisterHandler
|
||||
post /register (UserRegisterReq) returns (AuthResp)
|
||||
post /register (UserRegisterReq) returns (LoginResp)
|
||||
|
||||
@handler ResetPasswordHandler
|
||||
post /reset_password (ResetPasswordReq)
|
||||
post /reset (ResetPasswordReq) returns (LoginResp)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user