Skip to content

Commit ed7ded1

Browse files
author
奇淼(piexlmax
authored
Merge pull request flipped-aurora#877 from 854350999/v2.4.x
优化swagger
2 parents 47d8542 + 5fa1f3c commit ed7ded1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

server/api/v1/system/sys_captcha.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ var store = base64Captcha.DefaultMemStore
1515

1616
type BaseApi struct{}
1717

18+
// Captcha
1819
// @Tags Base
1920
// @Summary 生成验证码
2021
// @Security ApiKeyAuth
2122
// @accept application/json
2223
// @Produce application/json
23-
// @Success 200 {string} string "{"success":true,"data":{},"msg":"验证码获取成功"}"
24+
// @Success 200 {object} response.Response{data=systemRes.SysCaptchaResponse} "生成一个随机验证码,返回包括随机生成id,base64 图像字符串,验证码长度"
2425
// @Router /base/captcha [post]
2526
func (b *BaseApi) Captcha(c *gin.Context) {
2627
// 字符,公式,验证码配置
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package response
22

33
type SysCaptchaResponse struct {
4-
CaptchaId string `json:"captchaId"`
5-
PicPath string `json:"picPath"`
6-
CaptchaLength int `json:"captchaLength""`
4+
CaptchaId string `json:"captchaId" example:"axxbbas"` // 随机数id
5+
PicPath string `json:"picPath" example:"data:img/png;base64,///"` // base64 图像字符串
6+
CaptchaLength int `json:"captchaLength" example:"6"` // 验证码长度
77
}

0 commit comments

Comments
 (0)