代码优化
This commit is contained in:
parent
cb685a5fe4
commit
8125d67153
@ -19,8 +19,8 @@ import java.util.List;
|
||||
/**
|
||||
* 用户订单 控制层
|
||||
*
|
||||
* @author: yanglei
|
||||
* @since: 2025-10-15 17:15
|
||||
* @author yanglei
|
||||
* @since 2025-10-15 17:15
|
||||
*/
|
||||
|
||||
@RestController
|
||||
|
||||
@ -23,8 +23,8 @@ import java.util.Map;
|
||||
/**
|
||||
* 用户登录控制层
|
||||
*
|
||||
* @author: yanglei
|
||||
* @since: 2025-10-15 08:56
|
||||
* @author yanglei
|
||||
* @since 2025-10-15 08:56
|
||||
*/
|
||||
|
||||
@RestController
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.cdzy.user.service.impl;
|
||||
|
||||
import com.cdzy.common.enums.BikeUsageStatus;
|
||||
import com.cdzy.common.enums.Code;
|
||||
import com.cdzy.common.ex.EbikeException;
|
||||
import com.cdzy.common.model.response.JsonResult;
|
||||
@ -21,7 +20,6 @@ import com.ebike.feign.model.dto.FeignEbikeDto;
|
||||
import com.ebike.feign.model.dto.FeignEbikeUserBikeInfo;
|
||||
import com.ebike.feign.model.dto.FeignEbikeUserLockDto;
|
||||
import com.ebike.feign.model.dto.FeignOrderPaymentDto;
|
||||
import com.ebike.feign.model.vo.FeignEbikeBikeInfoVo;
|
||||
import com.ebike.feign.model.vo.FeignEbikeBikeRadiusVo;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
@ -43,8 +41,8 @@ import static com.cdzy.user.model.entity.table.EbikeOrderTableDef.EBIKE_ORDER;
|
||||
/**
|
||||
* 用户订单 服务层实现
|
||||
*
|
||||
* @author: yanglei
|
||||
* @since: 2025-10-15 17:07
|
||||
* @author yanglei
|
||||
* @since 2025-10-15 17:07
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@ -265,21 +263,6 @@ public class EbikeOrderImpl extends ServiceImpl<EbikeOrderMapper, EbikeOrder> im
|
||||
return totalCost;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验车辆是否可用
|
||||
*
|
||||
* @param bikeInfoVo 车辆信息
|
||||
*/
|
||||
private void validateBikeUsable(FeignEbikeBikeInfoVo bikeInfoVo) {
|
||||
if (bikeInfoVo == null) {
|
||||
throw new IllegalArgumentException("车辆信息不能为空");
|
||||
}
|
||||
Integer usageStatus = bikeInfoVo.getUsageStatus();
|
||||
if (usageStatus == null || usageStatus != BikeUsageStatus.WAIT) {
|
||||
throw new IllegalArgumentException("车辆当前状态不可用,状态码:" + usageStatus);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户骑行订单
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user