|
@@ -2,62 +2,64 @@ package com.its.op.common.controller;
|
|
|
|
|
|
|
|
import com.its.op.common.dto.TbAtrdDto;
|
|
import com.its.op.common.dto.TbAtrdDto;
|
|
|
import com.its.op.common.service.TbAtrdService;
|
|
import com.its.op.common.service.TbAtrdService;
|
|
|
-import com.its.op.common.vo.TbAtrdQueryVo;
|
|
|
|
|
-import com.its.op.common.vo.TbAtrdUpdateVo;
|
|
|
|
|
-import com.its.op.common.vo.TbAtrdVo;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
-import javax.validation.constraints.NotNull;
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
@Api(tags = "간선도로")
|
|
@Api(tags = "간선도로")
|
|
|
@Validated
|
|
@Validated
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
-@RequestMapping("/tbAtrd")
|
|
|
|
|
|
|
+@RequestMapping("/api/tb_atrd")
|
|
|
public class TbAtrdController {
|
|
public class TbAtrdController {
|
|
|
|
|
|
|
|
- private final TbAtrdService tbAtrdService;
|
|
|
|
|
|
|
+ private final TbAtrdService service;
|
|
|
|
|
|
|
|
- @PostMapping
|
|
|
|
|
- @ApiOperation("Save 간선도로")
|
|
|
|
|
- public String save(@Valid @RequestBody TbAtrdVo vo) {
|
|
|
|
|
- return tbAtrdService.save(vo).toString();
|
|
|
|
|
|
|
+ @ApiOperation(value = "간선도로 전체조회(TB_ATRD)", response = TbAtrdDto.class)
|
|
|
|
|
+ @GetMapping(value = "", produces = {"application/json; charset=utf8"})
|
|
|
|
|
+ public List<TbAtrdDto> findAll() {
|
|
|
|
|
+ return service.findAll();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @DeleteMapping("/{id}")
|
|
|
|
|
- @ApiOperation("Delete 간선도로")
|
|
|
|
|
- public void delete(@Valid @NotNull @PathVariable("id") String id) {
|
|
|
|
|
- tbAtrdService.delete(id);
|
|
|
|
|
|
|
+ @ApiOperation(value = "간선도로 개별조회(TB_ATRD)", response = TbAtrdDto.class)
|
|
|
|
|
+ @GetMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
|
|
|
|
|
+ public TbAtrdDto findById(@PathVariable final String id) {
|
|
|
|
|
+ return this.service.findById(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PutMapping("/{id}")
|
|
|
|
|
- @ApiOperation("Update 간선도로")
|
|
|
|
|
- public void update(@Valid @NotNull @PathVariable("id") String id,
|
|
|
|
|
- @Valid @RequestBody TbAtrdUpdateVo vo) {
|
|
|
|
|
- tbAtrdService.update(id, vo);
|
|
|
|
|
|
|
+ @ApiOperation(value = "간선도로 정보변경(TB_ATRD)", response = TbAtrdDto.class)
|
|
|
|
|
+ @PutMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
|
|
|
|
|
+ public TbAtrdDto updateById(@PathVariable final String id, @RequestBody @Valid final TbAtrdDto.TbAtrdUpdReq req) {
|
|
|
|
|
+ return this.service.updateById(id, req);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping("/{id}")
|
|
|
|
|
- @ApiOperation("Retrieve by ID 간선도로")
|
|
|
|
|
- public TbAtrdDto getById(@Valid @NotNull @PathVariable("id") String id) {
|
|
|
|
|
- return tbAtrdService.getById(id);
|
|
|
|
|
|
|
+ @ApiOperation(value = "간선도로 정보변경/생성-목록(TB_ATRD)", response = TbAtrdDto.class)
|
|
|
|
|
+ @PostMapping(value = "", produces = {"application/json; charset=utf8"})
|
|
|
|
|
+ public List<TbAtrdDto> mergeInfoList(@RequestBody @Valid final List<TbAtrdDto.TbAtrdUpdReq> listReq) {
|
|
|
|
|
+ return this.service.mergeInfoList(listReq);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping
|
|
|
|
|
- @ApiOperation("Retrieve by query 간선도로")
|
|
|
|
|
- public Page<TbAtrdDto> query(@Valid TbAtrdQueryVo vo) {
|
|
|
|
|
- return tbAtrdService.query(vo);
|
|
|
|
|
|
|
+ @ApiOperation(value = "간선도로 정보변경/생성-개별(TB_ATRD)", response = TbAtrdDto.class)
|
|
|
|
|
+ @PostMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
|
|
|
|
|
+ public TbAtrdDto mergeInfo(@PathVariable("id") String id, @RequestBody @Valid final TbAtrdDto.TbAtrdUpdReq req) {
|
|
|
|
|
+ return this.service.mergeInfo(req);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "간선도로 정보삭제-개별(TB_ATRD)", response = TbAtrdDto.class)
|
|
|
|
|
+ @DeleteMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
|
|
|
|
|
+ public TbAtrdDto deleteDataById(@PathVariable("id") String id) {
|
|
|
|
|
+ return this.service.deleteById(id);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "간선도로 정보삭제-목록(TB_ATRD)", response = TbAtrdDto.class)
|
|
|
|
|
+ @DeleteMapping(value = "", produces = {"application/json; charset=utf8"})
|
|
|
|
|
+ public List<TbAtrdDto> deleteDataByIds(@RequestBody @Valid final List<String> ids) {
|
|
|
|
|
+ return this.service.deleteByIds(ids);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /*@GetMapping
|
|
|
|
|
- @ApiOperation("Retrieve by query 간선도로")
|
|
|
|
|
- public Page<TbAtrdDto> query(@Valid TbAtrdQueryVo vo) {
|
|
|
|
|
- return tbAtrdService.query(vo);
|
|
|
|
|
- }*/
|
|
|
|
|
}
|
|
}
|