Commit 22014ac8 authored by hanbing's avatar hanbing

方案管理-灯组配置-service层基础

parent 02901842
...@@ -23,10 +23,12 @@ import javax.ws.rs.core.MediaType; ...@@ -23,10 +23,12 @@ import javax.ws.rs.core.MediaType;
@RequestMapping("/crossConfig") @RequestMapping("/crossConfig")
@RestController @RestController
public class CrossConfigController { public class CrossConfigController {
private final CrossConfigServiceImpl crossConfigServiceImpl;
public CrossConfigController(CrossConfigServiceImpl crossConfigServiceImpl) {
this.crossConfigServiceImpl = crossConfigServiceImpl; private final CrossConfigServiceImpl crossConfigService;
public CrossConfigController(CrossConfigServiceImpl crossConfigService) {
this.crossConfigService = crossConfigService;
} }
@ApiOperation(value = "保存渠化配置", notes = "保存渠化配置", response = JsonViewObject.class, @ApiOperation(value = "保存渠化配置", notes = "保存渠化配置", response = JsonViewObject.class,
...@@ -37,7 +39,7 @@ public class CrossConfigController { ...@@ -37,7 +39,7 @@ public class CrossConfigController {
@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class), @ApiResponse(code = 200, message = "OK", response = JsonViewObject.class),
}) })
public JsonViewObject saveLaneInfo(@RequestBody SaveLaneInfoDTO saveLaneInfoDTO) { public JsonViewObject saveLaneInfo(@RequestBody SaveLaneInfoDTO saveLaneInfoDTO) {
crossConfigServiceImpl.saveLaneInfo(saveLaneInfoDTO); crossConfigService.saveLaneInfo(saveLaneInfoDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(); return jsonViewObject.success();
...@@ -48,10 +50,10 @@ public class CrossConfigController { ...@@ -48,10 +50,10 @@ public class CrossConfigController {
@PostMapping(value = "/listLaneInfo", @PostMapping(value = "/listLaneInfo",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class), @ApiResponse(code = 200, message = "OK", response = SaveLaneInfoDTO.class),
}) })
public JsonViewObject listLaneInfo(@RequestBody CrossIdDTO crossIdDTO) { public JsonViewObject listLaneInfo(@RequestBody CrossIdDTO crossIdDTO) {
SaveLaneInfoDTO saveLaneInfoDTO = crossConfigServiceImpl.listLaneInfo(crossIdDTO); SaveLaneInfoDTO saveLaneInfoDTO = crossConfigService.listLaneInfo(crossIdDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(saveLaneInfoDTO); return jsonViewObject.success(saveLaneInfoDTO);
......
package net.wanji.web.controller.scheme; package net.wanji.web.controller.scheme;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.web.common.entity.JsonViewObject;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.SaveLightsInfoDTO;
import net.wanji.web.service.scheme.impl.LightsConfigServiceImpl;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.ws.rs.core.MediaType;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/12/20 10:14 * @date 2022/12/20 10:14
...@@ -12,6 +23,38 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -12,6 +23,38 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/lightsConfig") @RequestMapping("/lightsConfig")
@RestController @RestController
public class LightsConfigController { public class LightsConfigController {
private final LightsConfigServiceImpl lightsConfigService;
public LightsConfigController(LightsConfigServiceImpl lightsConfigService) {
this.lightsConfigService = lightsConfigService;
}
@ApiOperation(value = "保存灯组配置", notes = "保存灯组配置", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/saveLightsInfo",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class),
})
public JsonViewObject saveLightsInfo(@RequestBody SaveLightsInfoDTO saveLightsInfoDTO) {
lightsConfigService.saveLightsInfo(saveLightsInfoDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success();
}
@ApiOperation(value = "灯组配置列表", notes = "灯组配置列表", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/listLightsInfo",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = SaveLightsInfoDTO.class),
})
public JsonViewObject listLightsInfo(@RequestBody CrossIdDTO crossIdDTO) {
SaveLightsInfoDTO saveLightsInfoDTO = lightsConfigService.listLightsInfo(crossIdDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(saveLightsInfoDTO);
}
} }
...@@ -7,8 +7,6 @@ import lombok.NoArgsConstructor; ...@@ -7,8 +7,6 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/** /**
* 方案管理-路口配置-保存渠化配置输入参数
*
* @author Kent HAN * @author Kent HAN
* @date 2022/12/20 10:17 * @date 2022/12/20 10:17
*/ */
......
package net.wanji.web.dto;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Kent HAN
* @date 2023/1/3 10:22
*/
@NoArgsConstructor
@Data
public class SaveLightsInfoDTO {
}
package net.wanji.web.service.scheme; package net.wanji.web.service.scheme;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.SaveLightsInfoDTO;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2023/1/3 9:59 * @date 2023/1/3 9:59
*/ */
public interface LightsConfigService { public interface LightsConfigService {
void saveLightsInfo(SaveLightsInfoDTO saveLightsInfoDTO);
SaveLightsInfoDTO listLightsInfo(CrossIdDTO crossIdDTO);
} }
package net.wanji.web.service.scheme.impl; package net.wanji.web.service.scheme.impl;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.SaveLightsInfoDTO;
import net.wanji.web.service.scheme.LightsConfigService; import net.wanji.web.service.scheme.LightsConfigService;
import org.springframework.stereotype.Service;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2023/1/3 10:00 * @date 2023/1/3 10:00
*/ */
@Service
public class LightsConfigServiceImpl implements LightsConfigService { public class LightsConfigServiceImpl implements LightsConfigService {
@Override
public void saveLightsInfo(SaveLightsInfoDTO saveLightsInfoDTO) {
}
@Override
public SaveLightsInfoDTO listLightsInfo(CrossIdDTO crossIdDTO) {
return null;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment