Merge branch 'dev' into 'master'

修改实体bug

See merge request eshop/biz_service_ebtp_extend!38
This commit is contained in:
张银雪
2021-04-25 16:35:30 +08:00

View File

@ -1,5 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.controller; package com.chinaunicom.mall.ebtp.extend.templatewarehouse.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidTemplateWarehouse; import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidTemplateWarehouse;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.ClientVersionCheck; import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.ClientVersionCheck;
@ -90,10 +91,11 @@ public class TemplateWarehouseController {
@ApiOperation("查询最低最高版本号") @ApiOperation("查询最低最高版本号")
@GetMapping("/client/check") @GetMapping("/client/check")
public BaseResponse<ClientVersionCheck> getClientByVersion() { public BaseResponse<ClientVersionCheck> getClientByVersion() {
List<ClientVersionCheck> checkList = clientVersionCheckService.list(); QueryWrapper<ClientVersionCheck> query = new QueryWrapper<>(new ClientVersionCheck());
if (checkList.isEmpty()){ ClientVersionCheck check = clientVersionCheckService.getOne(query);
if (check == null){
return BaseResponse.fail(new ClientVersionCheck()); return BaseResponse.fail(new ClientVersionCheck());
} }
return BaseResponse.success(checkList.get(0)); return BaseResponse.success(check);
} }
} }