From ce57ddfe16bc40e58e4c78fae5b30e4a57813298 Mon Sep 17 00:00:00 2001 From: sikadi <13315935+sikadi_love@user.noreply.gitee.com> Date: Fri, 1 Dec 2023 20:21:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hiclelaunch.java => VehicleConnectionReq.java} | 2 +- .../controller/VehiclelaunchController.java | 6 +++--- .../shiyi/launch/mapper/VehicleaunchMapper.java | 6 +++--- .../launch/service/VehiclelaunchService.java | 5 +++-- .../service/impl/VehiclelaunchServiceimpl.java | 15 +++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) rename fate-launch-common/src/main/java/com/shiyi/launch/domain/{Vehiclelaunch.java => VehicleConnectionReq.java} (95%) diff --git a/fate-launch-common/src/main/java/com/shiyi/launch/domain/Vehiclelaunch.java b/fate-launch-common/src/main/java/com/shiyi/launch/domain/VehicleConnectionReq.java similarity index 95% rename from fate-launch-common/src/main/java/com/shiyi/launch/domain/Vehiclelaunch.java rename to fate-launch-common/src/main/java/com/shiyi/launch/domain/VehicleConnectionReq.java index 47f8cf9..d74bab8 100644 --- a/fate-launch-common/src/main/java/com/shiyi/launch/domain/Vehiclelaunch.java +++ b/fate-launch-common/src/main/java/com/shiyi/launch/domain/VehicleConnectionReq.java @@ -15,7 +15,7 @@ import lombok.experimental.SuperBuilder; @AllArgsConstructor @NoArgsConstructor @SuperBuilder -public class Vehiclelaunch { +public class VehicleConnectionReq { /** * 车辆Vin diff --git a/fate-launch-server/src/main/java/com/shiyi/launch/controller/VehiclelaunchController.java b/fate-launch-server/src/main/java/com/shiyi/launch/controller/VehiclelaunchController.java index 211bad6..9a12b26 100644 --- a/fate-launch-server/src/main/java/com/shiyi/launch/controller/VehiclelaunchController.java +++ b/fate-launch-server/src/main/java/com/shiyi/launch/controller/VehiclelaunchController.java @@ -1,7 +1,7 @@ package com.shiyi.launch.controller; import com.fate.common.core.domain.Result; -import com.shiyi.launch.domain.Vehiclelaunch; +import com.shiyi.launch.domain.VehicleConnectionReq; import com.shiyi.launch.service.VehiclelaunchService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; @@ -28,8 +28,8 @@ public class VehiclelaunchController { * 车辆上线 */ @PostMapping("vehiclelaunch") - public Result vehiclelaunchs(@RequestBody Vehiclelaunch vehiclelaunch){ - String topic = vehiclelaunchService.vehiclelaunch(vehiclelaunch); + public Result vehicleConnection(@RequestBody VehicleConnectionReq vehicleConnectionReq){ + String topic = vehiclelaunchService.vehicleConnection(vehicleConnectionReq); return Result.success(topic); } diff --git a/fate-launch-server/src/main/java/com/shiyi/launch/mapper/VehicleaunchMapper.java b/fate-launch-server/src/main/java/com/shiyi/launch/mapper/VehicleaunchMapper.java index 55d9820..968c2df 100644 --- a/fate-launch-server/src/main/java/com/shiyi/launch/mapper/VehicleaunchMapper.java +++ b/fate-launch-server/src/main/java/com/shiyi/launch/mapper/VehicleaunchMapper.java @@ -1,7 +1,7 @@ package com.shiyi.launch.mapper; import com.shiyi.launch.domain.Car; -import com.shiyi.launch.domain.Vehiclelaunch; +import com.shiyi.launch.domain.VehicleConnectionReq; import org.apache.ibatis.annotations.Mapper; /** @@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper; **/ @Mapper public interface VehicleaunchMapper { - Car save(Vehiclelaunch vehiclelaunch); + Car save(VehicleConnectionReq vehicleConnectionReq); - int into(Vehiclelaunch vehiclelaunch); + int into(VehicleConnectionReq vehicleConnectionReq); } diff --git a/fate-launch-server/src/main/java/com/shiyi/launch/service/VehiclelaunchService.java b/fate-launch-server/src/main/java/com/shiyi/launch/service/VehiclelaunchService.java index 7da8911..6577662 100644 --- a/fate-launch-server/src/main/java/com/shiyi/launch/service/VehiclelaunchService.java +++ b/fate-launch-server/src/main/java/com/shiyi/launch/service/VehiclelaunchService.java @@ -1,6 +1,6 @@ package com.shiyi.launch.service; -import com.shiyi.launch.domain.Vehiclelaunch; +import com.shiyi.launch.domain.VehicleConnectionReq; /** * @Description : @@ -8,5 +8,6 @@ import com.shiyi.launch.domain.Vehiclelaunch; * @Date: 2023-11-30 20:01 */ public interface VehiclelaunchService { - String vehiclelaunch(Vehiclelaunch vehiclelaunch); + + String vehicleConnection(VehicleConnectionReq vehicleConnectionReq); } diff --git a/fate-launch-server/src/main/java/com/shiyi/launch/service/impl/VehiclelaunchServiceimpl.java b/fate-launch-server/src/main/java/com/shiyi/launch/service/impl/VehiclelaunchServiceimpl.java index bfb2ef5..c43f76e 100644 --- a/fate-launch-server/src/main/java/com/shiyi/launch/service/impl/VehiclelaunchServiceimpl.java +++ b/fate-launch-server/src/main/java/com/shiyi/launch/service/impl/VehiclelaunchServiceimpl.java @@ -1,8 +1,7 @@ package com.shiyi.launch.service.impl; import com.fate.common.core.utils.StringUtils; -import com.shiyi.launch.domain.Car; -import com.shiyi.launch.domain.Vehiclelaunch; +import com.shiyi.launch.domain.VehicleConnectionReq; import com.shiyi.launch.mapper.VehicleaunchMapper; import com.shiyi.launch.service.VehiclelaunchService; import org.springframework.beans.factory.annotation.Autowired; @@ -23,28 +22,28 @@ public class VehiclelaunchServiceimpl implements VehiclelaunchService { private VehicleaunchMapper vehicleaunchMapper; @Override - public String vehiclelaunch(Vehiclelaunch vehiclelaunch) { + public String vehicleConnection(VehicleConnectionReq vehicleConnectionReq) { // 先去查询车辆的vin 在不在 ,如果不在就连接不上 - if (StringUtils.isEmpty(vehiclelaunch.getVin())){ + if (StringUtils.isEmpty(vehicleConnectionReq.getVin())){ return "vin为空"; } long time = new Date().getTime(); - vehiclelaunch.setTimestamp(String.valueOf(time)); + vehicleConnectionReq.setTimestamp(String.valueOf(time)); String uuid = UUID.randomUUID().toString().replaceAll("-","").substring(0,8); - vehiclelaunch.setNonce(uuid); + vehicleConnectionReq.setNonce(uuid); - int i = vehicleaunchMapper.into(vehiclelaunch); + int i = vehicleaunchMapper.into(vehicleConnectionReq); if(i < 0){ return "失败"; } - String fate = "fate" + vehiclelaunch.getVin().substring(3,7) + vehiclelaunch.getNonce(); + String fate = "fate" + vehicleConnectionReq.getVin().substring(3,7) + vehicleConnectionReq.getNonce(); return fate; }