|
|
package version
|
|
|
|
|
|
import (
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/ability/models"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/ability/protocol"
|
|
|
"strconv"
|
|
|
)
|
|
|
|
|
|
func GetLatestVersionInfo(request *protocol.GetLatestVersionInfoRequest)(rsp *protocol.GetLatestVersionInfoResponse,err error){
|
|
|
var (
|
|
|
versionInfo *protocol.VersionInfo
|
|
|
)
|
|
|
versionInfo,err = GetVersionInfo(request.VersionNo,request.Channel)
|
|
|
if err!=nil{
|
|
|
return
|
|
|
}
|
|
|
rsp =&protocol.GetLatestVersionInfoResponse{
|
|
|
Version:versionInfo,
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
//获取版本信息
|
|
|
func GetVersionInfo(versionNo,channel int)(v *protocol.VersionInfo,err error){
|
|
|
cfgAppVersion,err :=models.GetCfgAppVersion(versionNo,channel)
|
|
|
if err!=nil{
|
|
|
return
|
|
|
}
|
|
|
v =&protocol.VersionInfo{
|
|
|
VersionName:cfgAppVersion.VersionName,
|
|
|
VersionNo:strconv.Itoa(cfgAppVersion.VersionNo),
|
|
|
Title:cfgAppVersion.Title,
|
|
|
Content:cfgAppVersion.Content,
|
|
|
DownloadPage:cfgAppVersion.DownloadPage,
|
|
|
DownloadFile:cfgAppVersion.DownloadFile,
|
|
|
UpdateType:cfgAppVersion.Type,
|
|
|
}
|
|
|
return
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|