package com.hssx.cloudmodel.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.hssx.cloudmodel.entity.AppVersion; import com.hssx.cloudmodel.entity.vo.CompanyVO; import com.hssx.cloudmodel.service.AppVersionService; import com.hssx.cloudmodel.util.HttpRespMsg; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** *

* 前端控制器 *

* * @author 吴涛涛 * @since 2019-09-05 */ @Controller public class AppVersionController { @Autowired private AppVersionService appVersionService; @ApiOperation("比对版本") @RequestMapping("/checkVersion") @ResponseBody public HttpRespMsg addAndUpdateRole(AppVersion appVersion) { HttpRespMsg msg = new HttpRespMsg(); AppVersion platform = appVersionService.getOne(new QueryWrapper().eq("platform", appVersion.getPlatform())); if(platform == null){ msg.setError("数据不存在"); }else{ int i = appVersion.getVersion().compareTo(platform.getVersion()); if(i<0){ msg.data = platform; }else{ msg.setError("版本过低"); } } return msg; } }