liuxiaolong
2019-12-19 94bcda3ef533ac0ab0f5c0786554a9efe4c27f4d
controllers/syssetcont.go
@@ -543,4 +543,31 @@
   } else {
      util.ResponseFormat(c, code.ComError, "")
   }
}
// @Security ApiKeyAuth
// @Summary 开始升级
// @Description 开始升级
// @Accept multipart/form-data
// @Produce json
// @Tags sysset
// @Param identifier formData string true "整个文件的唯一标识,目前是md5"
// @Param filename formData string true "文件名称"
// @Success 200 {string} json "{"code":200, msg:"", success:true}"
// @Failure 500 {string} json "{"code":500, msg:"", success:false}"
// @Router /data/api-v/sysset/upgrade [post]
func (sset SysSetController) Upgrade(c *gin.Context) {
   identifier := c.Request.FormValue("identifier")
   filename := c.Request.FormValue("filename")
   if identifier == "" || filename == "" {
      util.ResponseFormat(c,code.RequestParamError,"")
      return
   }
   var sv service.SysService
   if b,err := sv.Upgrade(identifier, filename);b {
      util.ResponseFormat(c,code.UpgradeSuccess,"升级成功")
   } else {
      util.ResponseFormat(c,code.UpgradeFail,err.Error())
   }
}