| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- syntax = "v1"
- info(
- title: // TODO: add title
- desc: // TODO: add description
- author: "double.huang"
- email: "2637309949@qq.com"
- )
- type WXLoginResponse {
- OpenID string `json:"openid"`
- SessionKey string `json:"session_key"`
- UnionID string `json:"unionid"`
- ErrCode int `json:"errcode"`
- ErrMsg string `json:"errmsg"`
- }
- type Watermark {
- AppID string `json:"appid"`
- TimeStamp int64 `json:"timestamp"`
- }
- type WXUserInfo {
- OpenID string `json:"openId,omitempty"`
- NickName string `json:"nickName"`
- AvatarUrl string `json:"avatarUrl"`
- Gender int64 `json:"gender"`
- Country string `json:"country"`
- Province string `json:"province"`
- City string `json:"city"`
- UnionID string `json:"unionId,omitempty"`
- Language string `json:"language"`
- Watermark Watermark `json:"watermark,omitempty"`
- }
- type ResUserInfo {
- UserInfo WXUserInfo `json:"userInfo"`
- RawData string `json:"rawData"`
- Signature string `json:"signature"`
- EncryptedData string `json:"encryptedData"`
- IV string `json:"iv"`
- }
- type authLoginBody {
- Code string `json:"code"`
- UserInfo ResUserInfo `json:"userInfo"`
- }
- type AuthUserInfo {
- ID int64 `json:"id"`
- UserName string `json:"username"`
- NickName string `json:"nickname"`
- Gender int64 `json:"gender"`
- Avatar string `json:"avatar"`
- Birthday int64 `json:"birthday"`
- }
- type authResponse {
- Token string `json:"token"`
- UserInfo AuthUserInfo `json:"userInfo"`
- }
- type request {
- // TODO: add members here and delete this comment
- Id int64 `form:"id"`
- }
- type response {
- // TODO: add members here and delete this comment
- Id int64 `json:"id"`
- }
- service i2bill-api {
- @handler LoginByWeixin // TODO
- post /api/auth/loginByWeixin(authLoginBody) returns(authResponse)
- }
- @server(
- jwt: JwtAuth
- )
- service i2bill-api {
- @handler GetUser // TODO: set handler name and delete this comment
- get /api/users/id/:userId(request) returns(response)
- }
|