feat:完善项目

This commit is contained in:
henry
2021-11-04 16:44:42 +08:00
parent c41adc075a
commit fe7c9ad983
8 changed files with 61 additions and 32 deletions

View File

@ -12,7 +12,6 @@ type Upload struct{}
/**
* @apiDefine Upload 上传管理
*/
/**
* @api {post} /api/v1/upload 上传接口
* @apiVersion 1.0.0
@ -23,12 +22,12 @@ type Upload struct{}
*
* @apiParam {File} file 文件信息
*
* @apiSuccess (200) {Number} code 成功响应状态码!
* @apiSuccess (200) {String} msg 成功提示
* @apiSuccess (200) {Object} data 具体信息
* @apiSuccess (200) {Number} data.url 文件访问地址
* @apiSuccess (200) {String} data.filepath 文件地址
* @apiSuccess (200) {String} data.filename 文件名称
* @apiSuccess (200) {Number} code 成功响应状态码!
* @apiSuccess (200) {String} msg 成功提示
*
* @apiSuccessExample {json} Success response:
* HTTPS 200 OK
@ -36,12 +35,13 @@ type Upload struct{}
* "code": 200
* "msg": "ok"
* "data":{
* "url": "http://192.168.99.185:8010/upload/20210401/ad228811386cb8cd089a9d668d2885cd.png",
* "filepath": "/upload/20210401/ad228811386cb8cd089a9d668d2885cd.png",
* "filename": "8251863448d7ed13393bf0aae2211272.jpg"
* "url": "http://192.168.99.185:8010/upload/20210401/ad228811386cb8cd089a9d668d2885cd.png",
* "filepath": "/upload/20210401/ad228811386cb8cd089a9d668d2885cd.png",
* "filename": "8251863448d7ed13393bf0aae2211272.jpg"
* }
* }
*/
func (a *Upload) Upload(c *gin.Context) {
file, err := c.FormFile("file")