From 8caed9a0e7fb3d85903e3b27d2bccc34d13e5d8bd4a5e4a2b803cff49121f196 Mon Sep 17 00:00:00 2001 From: attiya <2413103649@qq.com> Date: Tue, 21 Oct 2025 16:56:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EbikeBikeInfoController.java | 29 ++---------- .../operations/enums/BikeUsageStatus.java | 44 +++++++++++++++++++ .../impl/EbikeBikeInfoServiceImpl.java | 2 + 3 files changed, 50 insertions(+), 25 deletions(-) create mode 100644 ebike-operations/src/main/java/com/cdzy/operations/enums/BikeUsageStatus.java diff --git a/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeBikeInfoController.java b/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeBikeInfoController.java index 52e17f0..2caa82e 100644 --- a/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeBikeInfoController.java +++ b/ebike-operations/src/main/java/com/cdzy/operations/controller/EbikeBikeInfoController.java @@ -1,14 +1,14 @@ package com.cdzy.operations.controller; import com.cdzy.common.model.response.JsonResult; -import com.cdzy.operations.model.entity.EbikeBikeInfo; import com.cdzy.operations.model.vo.EbikeBikeBindVo; import com.cdzy.operations.service.EbikeBikeInfoService; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 车辆基本信息 控制层。 @@ -34,25 +34,4 @@ public class EbikeBikeInfoController { ebikeBikeInfoService.bind(bindVo); return JsonResult.success(); } - - /** - * 车辆列表 - * @return 列表 - */ - @GetMapping("list") - public JsonResult list() { - List list = ebikeBikeInfoService.list(); - return JsonResult.success(list); - } - - /** - * 生成车辆 - * @return 列表 - */ - @PostMapping("save") - public JsonResult save(@Validated @RequestBody EbikeBikeInfo ebikeBikeInfo) { - ebikeBikeInfoService.save(ebikeBikeInfo); - return JsonResult.success(); - } - } diff --git a/ebike-operations/src/main/java/com/cdzy/operations/enums/BikeUsageStatus.java b/ebike-operations/src/main/java/com/cdzy/operations/enums/BikeUsageStatus.java new file mode 100644 index 0000000..42a5954 --- /dev/null +++ b/ebike-operations/src/main/java/com/cdzy/operations/enums/BikeUsageStatus.java @@ -0,0 +1,44 @@ +package com.cdzy.operations.enums; + +/** + * @author attiya + * @since 2025-10-15 + */ +public interface BikeUsageStatus { + + /** + * 初始状态:绑定完成 + */ + int BIND = 0; + + /** + * 待单 + */ + int WAIT = 1; + + /** + * 骑行 + */ + int CYCLING = 2; + + /** + * 待维修 + */ + int REPAIR = 3; + + /** + * 调度中 + */ + int DISPATCH = 4; + + + /** + * 维修中 + */ + int UNDER_REPAIR = 5; + + /** + * 待投放 + */ + int DEPLOYED = 6; +} diff --git a/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeBikeInfoServiceImpl.java b/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeBikeInfoServiceImpl.java index 7966c44..e81fe06 100644 --- a/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeBikeInfoServiceImpl.java +++ b/ebike-operations/src/main/java/com/cdzy/operations/service/impl/EbikeBikeInfoServiceImpl.java @@ -5,6 +5,7 @@ import com.cdzy.common.ex.EbikeException; import com.cdzy.operations.enums.BatteryStatus; import com.cdzy.operations.enums.BikeQrStatus; import com.cdzy.operations.enums.BikeStatus; +import com.cdzy.operations.enums.BikeUsageStatus; import com.cdzy.operations.mapper.*; import com.cdzy.operations.model.entity.*; import com.cdzy.operations.model.vo.EbikeBikeBindVo; @@ -139,6 +140,7 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl