mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 09:05:59 +08:00
update app
This commit is contained in:
@@ -228,19 +228,20 @@ func GetDownloadURL(c *gin.Context) {
|
||||
app, err := imdb.GetNewestVersion(req.Type)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "getNewestVersion failed", err.Error())
|
||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "getNewestVersion failed" + err.Error()})
|
||||
return
|
||||
}
|
||||
if app.Version != req.Version {
|
||||
resp.Data.HasNewVersion = true
|
||||
if app.ForceUpdate == true {
|
||||
resp.Data.ForceUpdate = true
|
||||
if app != nil {
|
||||
if app.Version != req.Version && app.Version != "" {
|
||||
resp.Data.HasNewVersion = true
|
||||
if app.ForceUpdate == true {
|
||||
resp.Data.ForceUpdate = true
|
||||
}
|
||||
resp.Data.YamlURL = config.Config.Credential.Minio.Endpoint + "/" + config.Config.Credential.Minio.AppBucket + "/" + app.YamlName
|
||||
resp.Data.FileURL = config.Config.Credential.Minio.Endpoint + "/" + config.Config.Credential.Minio.AppBucket + "/" + app.FileName
|
||||
c.JSON(http.StatusOK, resp)
|
||||
} else {
|
||||
resp.Data.HasNewVersion = false
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
resp.Data.YamlURL = config.Config.Credential.Minio.Endpoint + "/" + config.Config.Credential.Minio.AppBucket + "/" + app.YamlName
|
||||
resp.Data.FileURL = config.Config.Credential.Minio.Endpoint + "/" + config.Config.Credential.Minio.AppBucket + "/" + app.FileName
|
||||
c.JSON(http.StatusOK, resp)
|
||||
} else {
|
||||
resp.Data.HasNewVersion = false
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 0, "errMsg": "not found app version"})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user