| | |
| | | } 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()) |
| | | } |
| | | } |