File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 121
121
* [ Docker入门教程101: 用途,架构,安装和使用] ( https://github.com/jincheng9/disributed-system-notes/tree/main/docker/01 )
122
122
* [ Docker入门教程101: 基于Docker部署Go项目] ( https://github.com/jincheng9/disributed-system-notes/tree/main/docker/02 )
123
123
124
+ ### Doc Tools
124
125
126
+ #### Swagger
127
+
128
+ * [ gin-swagger常见问题] ( ./workspace/swagger )
129
+
130
+
125
131
126
132
## 外文翻译
127
133
Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments