v1.1
This commit is contained in:
@@ -9,10 +9,10 @@ info (
|
||||
//============================> user v1 <============================
|
||||
// 用户基本类型定义
|
||||
type User {
|
||||
Id int64 `json:"id"`
|
||||
Mobile string `json:"mobile"`
|
||||
NickName string `json:"nickName"`
|
||||
UserType int64 `json:"userType"`
|
||||
Id string `json:"id"`
|
||||
Mobile string `json:"mobile"`
|
||||
NickName string `json:"nickName"`
|
||||
UserType int64 `json:"userType"`
|
||||
}
|
||||
|
||||
//no need login
|
||||
@@ -21,6 +21,9 @@ type User {
|
||||
group: user
|
||||
)
|
||||
service main {
|
||||
@doc "unified auth"
|
||||
@handler auth
|
||||
post /user/auth (AuthReq) returns (AuthResp)
|
||||
@doc "mobile code login"
|
||||
@handler mobileCodeLogin
|
||||
post /user/mobileCodeLogin (MobileCodeLoginReq) returns (MobileCodeLoginResp)
|
||||
@@ -38,6 +41,18 @@ service main {
|
||||
}
|
||||
|
||||
type (
|
||||
AuthReq {
|
||||
Platform string `json:"platform"` // browser|wxh5|wxmini
|
||||
Code string `json:"code,optional"`
|
||||
}
|
||||
AuthResp {
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
UserType int64 `json:"userType"`
|
||||
HasMobile bool `json:"hasMobile"`
|
||||
IsAgent bool `json:"isAgent"`
|
||||
}
|
||||
MobileCodeLoginReq {
|
||||
Mobile string `json:"mobile"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
|
||||
Reference in New Issue
Block a user