ParkingLotController.java 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package com.its.api.its.controller.parking;
  2. import com.its.api.its.model.dto.common.UsageCountDto;
  3. import com.its.api.its.model.dto.parking.ParkingLotDto;
  4. import com.its.api.its.service.parking.ParkingLotService;
  5. import io.swagger.annotations.Api;
  6. import io.swagger.annotations.ApiOperation;
  7. import io.swagger.annotations.ApiParam;
  8. import lombok.RequiredArgsConstructor;
  9. import org.springframework.validation.annotation.Validated;
  10. import org.springframework.web.bind.annotation.*;
  11. import javax.validation.Valid;
  12. import java.util.List;
  13. @Api(tags = "19.주차장-1.주차장관리-0.정보관리")
  14. @Validated
  15. @RestController
  16. @RequiredArgsConstructor
  17. @RequestMapping("/api/parking/manager/info")
  18. public class ParkingLotController {
  19. private final ParkingLotService service;
  20. @ApiOperation(value = "주차장 전체조회(PARKINGLOT)", response = ParkingLotDto.class)
  21. @GetMapping(value = "", produces = {"application/json; charset=utf8"})
  22. public List<ParkingLotDto> findAll() {
  23. return service.findAll();
  24. }
  25. @ApiOperation(value = "주차장 개별조회(PARKINGLOT)", response = ParkingLotDto.class)
  26. @GetMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
  27. public ParkingLotDto findById(
  28. @ApiParam(name = "id", value = "주차장 ID", example = "PAR0000001", required = true)
  29. @PathVariable final String id) {
  30. return this.service.findById(id);
  31. }
  32. @ApiOperation(value = "주차장 사용여부 조회(신규 아이디 만들때 사용)", response = UsageCountDto.class)
  33. @GetMapping(value = "/usage/{id}", produces = {"application/json; charset=utf8"})
  34. public UsageCountDto findUsageId(
  35. @ApiParam(name = "id", value = "주차장 ID", example = "PAR0000001", required = true)
  36. @PathVariable final String id) {
  37. return this.service.findUsageId(id);
  38. }
  39. /*@ApiOperation(value = "주차장 정보변경(PARKINGLOT)", response = ParkingLotDto.class)
  40. @PutMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
  41. public ParkingLotDto updateById(@PathVariable final String id, @RequestBody @Valid final ParkingLotDto.ParkingLotUpdReq req) {
  42. return this.service.updateById(id, req);
  43. }*/
  44. /*@ApiOperation(value = "주차장 정보변경/생성-목록(PARKINGLOT)", response = ParkingLotDto.class)
  45. @PostMapping(value = "", produces = {"application/json; charset=utf8"})
  46. public List<ParkingLotDto> mergeInfoList(@RequestBody @Valid final List<ParkingLotDto.ParkingLotUpdReq> listReq) {
  47. return this.service.mergeInfoList(listReq);
  48. }*/
  49. @ApiOperation(value = "주차장 정보변경/생성-개별(PARKINGLOT)", response = ParkingLotDto.class)
  50. @PostMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
  51. public ParkingLotDto mergeInfo(
  52. @ApiParam(name = "id", value = "주차장 ID", example = "PAR0000001", required = true)
  53. @PathVariable("id") String id,
  54. @RequestBody @Valid final ParkingLotDto.ParkingLotUpdReq req) {
  55. return this.service.mergeInfo(req);
  56. }
  57. @ApiOperation(value = "주차장 정보삭제-개별(PARKINGLOT)", response = ParkingLotDto.class)
  58. @DeleteMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
  59. public ParkingLotDto deleteDataById(
  60. @ApiParam(name = "id", value = "주차장 ID", example = "PAR0000001", required = true)
  61. @PathVariable("id") String id) {
  62. return this.service.deleteById(id);
  63. }
  64. /* @ApiOperation(value = "주차장 정보삭제-목록(PARKINGLOT)", response = ParkingLotDto.class)
  65. @DeleteMapping(value = "", produces = {"application/json; charset=utf8"})
  66. public List<ParkingLotDto> deleteDataByIds(@RequestBody @Valid final List<String> ids) {
  67. return this.service.deleteByIds(ids);
  68. }*/
  69. }