| | |
| | | @RequestMapping(value = "/appVersion/checkUpdate/{version}/{type}") |
| | | public R checkUpdate(@PathVariable("version") String version, |
| | | @PathVariable("type") Integer type) { |
| | | EntityWrapper<AppVersion> wrapper = new EntityWrapper<>(); |
| | | AppVersion appVersion = appVersionService.selectOne(wrapper); |
| | | if (Cools.isEmpty(appVersion)) { |
| | | return R.ok("已是最新版本"); |
| | | } |
| | | AppVersion latestApp = appVersionService.getLatestApp(type); |
| | | if (latestApp == null) { |
| | | return R.error(); |
| | | } |
| | | |
| | | if (latestApp.getVersion().equals(version)) { |
| | | return R.ok("已是最新版本"); |
| | | } |
| | | |
| | | return R.ok("有新版本,需要更新").add(latestApp); |
| | | // EntityWrapper<AppVersion> wrapper = new EntityWrapper<>(); |
| | | // AppVersion appVersion = appVersionService.selectOne(wrapper); |
| | | // if (Cools.isEmpty(appVersion)) { |
| | | // return R.ok("已是最新版本"); |
| | | // } |
| | | // AppVersion latestApp = appVersionService.getLatestApp(type); |
| | | // if (latestApp == null) { |
| | | // return R.error(); |
| | | // } |
| | | // |
| | | // if (latestApp.getVersion().equals(version)) { |
| | | // return R.ok("已是最新版本"); |
| | | // } |
| | | // |
| | | // return R.ok("有新版本,需要更新").add(latestApp); |
| | | return R.ok(); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |