package controller import ( "net/http" "strings" "xiawan/wx/api/req" "xiawan/wx/api/service" "xiawan/wx/api/vo" "github.com/gin-gonic/gin" ) // UploadAppAttachApi 上传文件 func UploadAppAttachApi(ctx *gin.Context) { reqModel := new(req.UploadAppAttachModel) queryKey, isExist := ctx.GetQuery("key") if !isExist || strings.Trim(queryKey, "") == "" || strings.Trim(queryKey, "") == "null" { //确保每次都有Key ctx.JSON(http.StatusOK, vo.NewFailUUId("")) return } if !validateData(ctx, &reqModel) { return } result := service.UploadAppAttachService(queryKey, *reqModel) ctx.JSON(http.StatusOK, result) }