package controller import ( "github.com/gin-gonic/gin" "trading-go/model" "trading-go/response" ) // Upload // @Tags 图片模块 // @Summary 上传图片 // @Accept multipart/form-data // @Produce application/json // @Param pic formData file true "图片" // @Success 200 {object} response.Response // @Router /pic/upload [post] func Upload(c *gin.Context) { _, _ = c.FormFile("file") response.Success(c.Writer, "success", model.Pic{}) } // GetAllPic // @Tags 图片模块 // @Summary 获取所有图片 // @Produce application/json // @Success 200 {object} response.Response // @Router /pic [get] func GetAllPic(c *gin.Context) { var pics []model.Pic pics = append(pics, model.Pic{}) pics = append(pics, model.Pic{}) response.Success(c.Writer, "success", pics) } // DPic // @Tags 图片模块 // @Summary 删除图片 // @Produce application/json // @Param id path int64 true "图片id" // @Success 200 {object} response.Response // @Router /pic/delete/{id} [delete] func DPic(c *gin.Context) { response.Success(c.Writer, "success", nil) }