Skip to content

Commit 11cfe7a

Browse files
committed
update
1 parent d58b71a commit 11cfe7a

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@
121121
* [Docker入门教程101: 用途,架构,安装和使用](https://github.com/jincheng9/disributed-system-notes/tree/main/docker/01)
122122
* [Docker入门教程101: 基于Docker部署Go项目](https://github.com/jincheng9/disributed-system-notes/tree/main/docker/02)
123123

124+
### Doc Tools
124125

126+
#### Swagger
127+
128+
* [gin-swagger常见问题](./workspace/swagger)
129+
130+
125131

126132
## 外文翻译
127133

workspace/swagger/readme.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# gin-swagger常见问题
2+
3+
### Fetch error *Internal Server Error doc*.*json*
4+
5+
需要在Gin路由设置的源文件导入`swag init`命令生成的docs包
6+
7+
```go
8+
import _ module_name/docs
9+
```
10+
11+
12+
13+
## gin-swagger支持multipart/form-data里带文件参数
14+
15+
Param Type: `formData`
16+
17+
Data Type: `file`
18+
19+
```markdown
20+
// UpdateProfile godoc
21+
// @Summary UpdateProfile updates user info
22+
// @Description check username and token, then update user profile
23+
// @Accept multipart/form-data
24+
// @Produce json
25+
// @param username path string true "username"
26+
// @param token formData string true "token"
27+
// @param nickname formData string false "nickname"
28+
// @param image formData file false "image"
29+
// @Success 200 {object} map[string]interface{}
30+
// @Router /update/{username} [POST]
31+
```
32+
33+
* https://github.com/swaggo/swag/blob/master/README.md
34+
35+
* https://swagger.io/docs/specification/2-0/file-upload/
36+

0 commit comments

Comments
 (0)