| | |
| | | // @router /version [get] |
| | | func (c *AppController) Version() { |
| | | curV := c.GetString("curVersion") |
| | | fmt.Println("curV:", curV) |
| | | platform := c.GetString("platform") |
| | | fmt.Println("platform:",platform,"curV:", curV) |
| | | if platform == "" { |
| | | platform = "android" |
| | | } |
| | | pType := -1 //未知的平台 |
| | | if platform == "android" { |
| | | pType = models.PlatType_Android |
| | | } else if platform == "ios" { |
| | | pType = models.PlatType_Ios |
| | | } |
| | | result := vo.Upgrade{} |
| | | var sv models.SysUpgrade |
| | | err := sv.GetLatest() |
| | | err := sv.GetLatest(pType) |
| | | if err != nil { |
| | | result.Msg = []string{} |
| | | } else { |