二维码/条形码的生成

This commit is contained in:
Rosy-zhudan
2019-08-29 11:54:21 +08:00
parent acd94aa5d3
commit 71f918568c
2 changed files with 110 additions and 1 deletions

View File

@@ -279,3 +279,20 @@ func (c *CmsController) QueryConfigs() {
return retVal, "", err
})
}
// @Title 生成二维码或条形码
// @Description 生成二维码或条形码
// @Param token header string true "认证token"
// @Param width formData int true "图片宽"
// @Param height formData int true "图片高"
// @Param codetype formData string true "编码类型(二维码qr; 条形码bar)"
// @Param srcData formData string true "二维码/条形码数据源"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /CreateQrAndBarCode [post]
func (c *CmsController) CreateQrAndBarCode() {
c.callCreateQrAndBarCode(func(params *tCmsCreateQrAndBarCodeParams) (retVal interface{}, errCode string, err error) {
retVal, err = jxutils.CreateQrAndBarCode(params.Width, params.Height, params.Codetype, params.SrcData)
return retVal, "", err
})
}