12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- package com.its.api.its.controller.parking;
- import com.its.api.its.model.dto.common.UsageCountDto;
- import com.its.api.its.model.dto.parking.ParkingLotDto;
- import com.its.api.its.service.parking.ParkingLotService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import lombok.RequiredArgsConstructor;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.*;
- import javax.validation.Valid;
- import java.util.List;
- @Api(tags = "19.주차장-1.주차장관리-0.정보관리")
- @Validated
- @RestController
- @RequiredArgsConstructor
- @RequestMapping("/api/parking/manager/info")
- public class ParkingLotController {
- private final ParkingLotService service;
- @ApiOperation(value = "주차장 전체조회(PARKINGLOT)", response = ParkingLotDto.class)
- @GetMapping(value = "", produces = {"application/json; charset=utf8"})
- public List<ParkingLotDto> findAll() {
- return service.findAll();
- }
- @ApiOperation(value = "주차장 개별조회(PARKINGLOT)", response = ParkingLotDto.class)
- @GetMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
- public ParkingLotDto findById(
- @ApiParam(name = "id", value = "주차장 ID", example = "PAR0000001", required = true)
- @PathVariable final String id) {
- return this.service.findById(id);
- }
- @ApiOperation(value = "주차장 사용여부 조회(신규 아이디 만들때 사용)", response = UsageCountDto.class)
- @GetMapping(value = "/usage/{id}", produces = {"application/json; charset=utf8"})
- public UsageCountDto findUsageId(
- @ApiParam(name = "id", value = "주차장 ID", example = "PAR0000001", required = true)
- @PathVariable final String id) {
- return this.service.findUsageId(id);
- }
- /*@ApiOperation(value = "주차장 정보변경(PARKINGLOT)", response = ParkingLotDto.class)
- @PutMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
- public ParkingLotDto updateById(@PathVariable final String id, @RequestBody @Valid final ParkingLotDto.ParkingLotUpdReq req) {
- return this.service.updateById(id, req);
- }*/
- /*@ApiOperation(value = "주차장 정보변경/생성-목록(PARKINGLOT)", response = ParkingLotDto.class)
- @PostMapping(value = "", produces = {"application/json; charset=utf8"})
- public List<ParkingLotDto> mergeInfoList(@RequestBody @Valid final List<ParkingLotDto.ParkingLotUpdReq> listReq) {
- return this.service.mergeInfoList(listReq);
- }*/
- @ApiOperation(value = "주차장 정보변경/생성-개별(PARKINGLOT)", response = ParkingLotDto.class)
- @PostMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
- public ParkingLotDto mergeInfo(
- @ApiParam(name = "id", value = "주차장 ID", example = "PAR0000001", required = true)
- @PathVariable("id") String id,
- @RequestBody @Valid final ParkingLotDto.ParkingLotUpdReq req) {
- return this.service.mergeInfo(req);
- }
- @ApiOperation(value = "주차장 정보삭제-개별(PARKINGLOT)", response = ParkingLotDto.class)
- @DeleteMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
- public ParkingLotDto deleteDataById(
- @ApiParam(name = "id", value = "주차장 ID", example = "PAR0000001", required = true)
- @PathVariable("id") String id) {
- return this.service.deleteById(id);
- }
- /* @ApiOperation(value = "주차장 정보삭제-목록(PARKINGLOT)", response = ParkingLotDto.class)
- @DeleteMapping(value = "", produces = {"application/json; charset=utf8"})
- public List<ParkingLotDto> deleteDataByIds(@RequestBody @Valid final List<String> ids) {
- return this.service.deleteByIds(ids);
- }*/
- }
|