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; }