83 lines
1.6 KiB
Plaintext
83 lines
1.6 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: "用户中心服务"
|
|
desc: "用户中心服务"
|
|
author: "Liangzai"
|
|
email: "2440983361@qq.com"
|
|
version: "v1"
|
|
)
|
|
|
|
import (
|
|
"user/user.api"
|
|
"auth/auth.api"
|
|
)
|
|
|
|
//============================> user v1 <============================
|
|
//no need login
|
|
@server (
|
|
prefix: api/v1
|
|
group: user
|
|
)
|
|
service main {
|
|
@doc "register"
|
|
@handler register
|
|
post /user/register (RegisterReq) returns (RegisterResp)
|
|
|
|
@doc "mobile login"
|
|
@handler mobileLogin
|
|
post /user/mobileLogin (MobileLoginReq) returns (MobileLoginResp)
|
|
|
|
@doc "mobile code login"
|
|
@handler mobileCodeLogin
|
|
post /user/mobileCodeLogin (MobileCodeLoginReq) returns (MobileCodeLoginResp)
|
|
|
|
@doc "wechat mini auth"
|
|
@handler wxMiniAuth
|
|
post /user/wxMiniAuth (WXMiniAuthReq) returns (WXMiniAuthResp)
|
|
|
|
|
|
@doc "wechat h5 auth"
|
|
@handler wxH5Auth
|
|
post /user/wxh5Auth (WXH5AuthReq) returns (WXH5AuthResp)
|
|
}
|
|
|
|
//need login
|
|
@server (
|
|
prefix: api/v1
|
|
group: user
|
|
jwt: JwtAuth
|
|
)
|
|
service main {
|
|
@doc "get user info"
|
|
@handler detail
|
|
get /user/detail returns (UserInfoResp)
|
|
|
|
@doc "get new token"
|
|
@handler getToken
|
|
post /user/getToken returns (MobileCodeLoginResp)
|
|
}
|
|
|
|
//============================> auth v1 <============================
|
|
@server (
|
|
prefix: api/v1
|
|
group: auth
|
|
)
|
|
service main {
|
|
@doc "get mobile verify code"
|
|
@handler sendSms
|
|
post /auth/sendSms (sendSmsReq)
|
|
}
|
|
|
|
|
|
|
|
//============================> notification v1 <============================
|
|
@server (
|
|
prefix: api/v1
|
|
group: notification
|
|
)
|
|
service main {
|
|
@doc "get notifications"
|
|
@handler getNotifications
|
|
get /notification/list returns (GetNotificationsResp)
|
|
} |