-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from youbudong/main
fix: header parameters
- Loading branch information
Showing
4 changed files
with
150 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,6 @@ Thumbs.db | |
*.ipr | ||
|
||
# | ||
.swagger-codegen | ||
.swagger-codegen | ||
swagtest | ||
*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
info( | ||
title: "type title here" | ||
desc: "type desc here" | ||
author: "type author here" | ||
email: "type email here" | ||
version: "type version here" | ||
title: "type title here" | ||
desc: "type desc here" | ||
author: "type author here" | ||
email: "type email here" | ||
version: "type version here" | ||
) | ||
|
||
|
||
type ( | ||
|
||
//注册请求结构 | ||
RegisterReq { | ||
Username string `json:"username"` | ||
Password string `json:"password"` | ||
Mobile string `json:"mobile"` | ||
} | ||
|
||
LoginReq { | ||
Username string `json:"username"` //测试 | ||
Password string `json:"password"`//测试2 | ||
} | ||
UserInfoReq { | ||
Id string `path:"id"` | ||
} | ||
//注册请求结构 | ||
RegisterReq { | ||
Username string `json:"username"` | ||
Password string `json:"password"` | ||
Mobile string `json:"mobile"` | ||
} | ||
|
||
LoginReq { | ||
Username string `json:"username"` //测试 | ||
Password string `json:"password"` //测试2 | ||
AppId string `header:"appId"` //APPID-TEST | ||
} | ||
UserInfoReq { | ||
Id string `path:"id"` | ||
} | ||
|
||
UserInfoReply { | ||
Name string `json:"name"` | ||
Age int `json:"age"` | ||
Birthday string `json:"birthday"` | ||
Description string `json:"description"` | ||
Tag []string `json:"tag"` | ||
Tags [][]string `json:"tags"` | ||
} | ||
UserInfoReply { | ||
Name string `json:"name"` | ||
Age int `json:"age"` | ||
Birthday string `json:"birthday"` | ||
Description string `json:"description"` | ||
Tag []string `json:"tag"` | ||
Tags [][]string `json:"tags"` | ||
} | ||
|
||
UserSearchReq { | ||
KeyWord string `form:"keyWord"` // 关键词 | ||
} | ||
UserSearchReq { | ||
KeyWord string `form:"keyWord"` // 关键词 | ||
} | ||
|
||
ErrorResponse { | ||
Code string `json:"code"` | ||
Message string `json:"message"` | ||
} | ||
ErrorResponse { | ||
Code string `json:"code"` | ||
Message string `json:"message"` | ||
} | ||
) | ||
|
||
@server( | ||
prefix: /api | ||
prefix: /api | ||
) | ||
|
||
service user-api { | ||
@doc( | ||
summary: 注册 | ||
) | ||
@handler register | ||
post /user/register (RegisterReq) | ||
@doc( | ||
summary: 注册 | ||
) | ||
@handler register | ||
post /user/register (RegisterReq) | ||
|
||
@doc( | ||
summary: 登录 | ||
) | ||
@handler login | ||
post /user/login (LoginReq) | ||
@doc( | ||
summary: 登录 | ||
) | ||
@handler login | ||
post /user/login (LoginReq) | ||
|
||
@doc( | ||
summary: 获取用户信息 | ||
) | ||
@handler getUserInfo | ||
/* | ||
@respdoc-400 ( | ||
100101: out of authority | ||
100102: user not exist | ||
) // Error code list | ||
*/ | ||
/* @respdoc-500 (ErrorResponse) // Server Error */ | ||
get /user/:id (UserInfoReq) returns (UserInfoReply) | ||
@doc( | ||
summary: 获取用户信息 | ||
) | ||
@handler getUserInfo | ||
/* | ||
@respdoc-400 ( | ||
100101: out of authority | ||
100102: user not exist | ||
) // Error code list | ||
*/ | ||
/* @respdoc-500 (ErrorResponse) // Server Error */ | ||
get /user/:id (UserInfoReq) returns (UserInfoReply) | ||
|
||
@doc( | ||
summary: 用户搜索 | ||
) | ||
@handler searchUser | ||
get /user/search (UserSearchReq) returns (UserInfoReply) | ||
@doc( | ||
summary: 用户搜索 | ||
) | ||
@handler searchUser | ||
get /user/search (UserSearchReq) returns (UserInfoReply) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters