refactor: 패키지 정리

dev
minuk926 3 years ago
parent d05c196e8b
commit d0881b869d

@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "MinUserinfoController", description = "사용자 관리")
@RestController
@RequestMapping("/api/v1/ctgy")
@RequestMapping("/api/v1/ctgy/user")
@Validated
@RequiredArgsConstructor
public class MinUserinfoController {
@ -47,7 +47,7 @@ public class MinUserinfoController {
@Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"),
@Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10")
})
@GetMapping(value="users", produces = MediaType.APPLICATION_JSON_VALUE)
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findMinUserinfos(
@Parameter(hidden = true)
@ModelAttribute("minUserinfoDto")
@ -58,7 +58,7 @@ public class MinUserinfoController {
}
@Operation(summary = "사용자 정보 조회" , description = "사용자 정보 조회")
@GetMapping("/user")
@GetMapping("/info")
@Secured(policy = SecurityPolicy.TOKEN)
@Transactional(readOnly = true)
public ResponseEntity<? extends IRestResponse> getUserInfo() {

@ -1,10 +1,9 @@
package com.xit.biz.ctgy.controller;
import com.xit.biz.ctgy.dto.MinSimsa680Dto;
import com.xit.biz.ctgy.dto.MinSimsa680GroupDto;
import com.xit.biz.ctgy.dto.struct.MinSimsa680GroupMapstruct;
import com.xit.biz.ctgy.dto.struct.MinSimsa680Mapstruct;
import com.xit.biz.ctgy.service.IMinSimsa680Service;
import com.xit.biz.ctgy.service.IParkingService;
import com.xit.core.api.IRestResponse;
import com.xit.core.api.RestResponse;
import io.swagger.v3.oas.annotations.Operation;
@ -17,7 +16,6 @@ import org.mapstruct.factory.Mappers;
import org.springframework.data.domain.Pageable;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -25,19 +23,19 @@ import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
@Tag(name = "MinCivBoard680Controller", description = "게시글 관리")
@Tag(name = "ParkingController", description = "주정차의견진술")
@RestController
@RequestMapping("/api/v1/ctgy/simsa")
@RequestMapping("/api/v1/ctgy/parking")
@Validated
@RequiredArgsConstructor
public class MinSimsa680Controller {
public class ParkingController {
private final IMinSimsa680Service service;
private final IParkingService service;
private final MinSimsa680Mapstruct mapstruct = Mappers.getMapper(MinSimsa680Mapstruct.class);
private final MinSimsa680GroupMapstruct groupMapstruct = Mappers.getMapper(MinSimsa680GroupMapstruct.class);
@Operation(summary = "심사(대상) 목록 조회" , description = "심사(대상) 목록 조회")
@Operation(summary = "주정차의견진술심의목록" , description = "주정차의견진술심의목록")
@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "msYear", description = "심사년도", required = true, example = "2021"),
@Parameter(in = ParameterIn.QUERY, name = "msChasu", description = "차수", required = false, example = " "),
@ -45,17 +43,17 @@ public class MinSimsa680Controller {
@Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10")
})
@GetMapping(value="review", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findMinSimsa680Groups(
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findSimsas(
@Valid
@Parameter(hidden = true)
final MinSimsa680GroupDto dto,
@Parameter(hidden = true)
final Pageable pageable) {
return RestResponse.of(service.findGroups(dto, pageable));
return RestResponse.of(service.findSimsas(dto, pageable));
}
@Operation(summary = "심사(대상) 상세 조회" , description = "심사(대상) 상세 조회")
@Operation(summary = "주정차의견진술심의목록-상세" , description = "주정차의견진술심의목록-상세")
@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "msSdate", description = "심사시작일", required = true, example = "2021-01-04"),
@Parameter(in = ParameterIn.QUERY, name = "msEdate", description = "심사종료일", required = true, example = "2021-01-05"),
@ -63,27 +61,27 @@ public class MinSimsa680Controller {
@Parameter(in = ParameterIn.QUERY, name = "msuTeam", description = "팀코드", required = true, example = "002")
})
@GetMapping(value="details", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findMinSimsa680Details(
public ResponseEntity<? extends IRestResponse> findSimsaDetails(
@Valid
@Parameter(hidden = true)
final MinSimsa680GroupDto dto) {
return RestResponse.of(service.findDetails(dto));
return RestResponse.of(service.findSimsaDetails(dto));
}
// TODO :: 파라메터 정의 필요
@Operation(summary = "심사(대상)자 조회" , description = "심사(대상)자 조회")
@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"),
@Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10")
})
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
@Transactional(readOnly = true)
public ResponseEntity<? extends IRestResponse> findMinSimsa680s(
@Parameter(hidden = true)
final MinSimsa680Dto minSimsa680Dto,
@Parameter(hidden = true)
final Pageable pageable) {
return RestResponse.of(service.findMinSimsa680s2(mapstruct.toEntity(minSimsa680Dto), pageable));
}
// @Operation(summary = "심사(대상)자 조회" , description = "심사(대상)자 조회")
// @Parameters({
// @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"),
// @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10")
// })
// @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
//// @Transactional(readOnly = true)
// public ResponseEntity<? extends IRestResponse> findMinSimsa680s(
// @Parameter(hidden = true)
// final MinSimsa680Dto minSimsa680Dto,
// @Parameter(hidden = true)
// final Pageable pageable) {
// return RestResponse.of(service.findMinSimsa680s2(mapstruct.toEntity(minSimsa680Dto), pageable));
// }
}

@ -3,5 +3,5 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.jpa.repository.JpaRepository;
public interface IMinSimsa680Repository extends JpaRepository<MinSimsa680, Long>, IMinSimsa680RepositoryCustom {
public interface IParkingRepository extends JpaRepository<MinSimsa680, Long>, IParkingRepositoryCustom {
}

@ -8,9 +8,9 @@ import org.springframework.data.domain.Pageable;
import java.util.List;
public interface IMinSimsa680RepositoryCustom {
Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto);
public interface IParkingRepositoryCustom {
Page<MinSimsa680GroupDto> findSimsas(MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findSimsaDetails(MinSimsa680GroupDto minSimsa680GroupDto);
Page<MinSimsaReviewGroupDto> findMinSimsa680s2(Pageable pageable);
}

@ -14,7 +14,6 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import java.time.LocalDate;
import java.util.List;
import static com.xit.biz.ctgy.entity.QMinSimsa680.minSimsa680;
@ -22,12 +21,12 @@ import static com.xit.biz.ctgy.entity.QMinSimsaUser680.minSimsaUser680;
import static com.xit.biz.ctgy.entity.QMinUserinfo.minUserinfo;
@RequiredArgsConstructor
public class IMinSimsa680RepositoryImpl implements IMinSimsa680RepositoryCustom {
public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
private final JPAQueryFactory queryFactory;
@Override
public Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable) {
public Page<MinSimsa680GroupDto> findSimsas(MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable) {
/*
SELECT MS_CHASU, MS_SDATE, MS_STARTSI, MS_EDATE, MS_CDATE, MS_CLOSESI, COUNT(*) CNT
FROM MIN_SIMSA680
@ -68,7 +67,7 @@ public class IMinSimsa680RepositoryImpl implements IMinSimsa680RepositoryCustom
return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal());
}
public List<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto dto) {
public List<MinSimsa680> findSimsaDetails(MinSimsa680GroupDto dto) {
BooleanBuilder builder = new BooleanBuilder();
builder.and(minSimsa680.msSdate.eq(dto.getMsSdate()));

@ -8,11 +8,11 @@ import org.springframework.data.domain.Pageable;
import java.util.List;
public interface IMinSimsa680Service {
public interface IParkingService {
//Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable);
Page<MinSimsa680GroupDto> findGroups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findDetails(MinSimsa680GroupDto minSimsa680GroupDto);
Page<MinSimsa680GroupDto> findSimsas(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findSimsaDetails(MinSimsa680GroupDto minSimsa680GroupDto);
Page<MinSimsa680> findAll(MinSimsa680 minSimsa680, Pageable pageable);

@ -3,11 +3,14 @@ package com.xit.biz.ctgy.service.impl;
import com.xit.biz.ctgy.dto.MinSimsa680GroupDto;
import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import com.xit.biz.ctgy.repository.IMinSimsa680Repository;
import com.xit.biz.ctgy.service.IMinSimsa680Service;
import com.xit.biz.ctgy.repository.IParkingRepository;
import com.xit.biz.ctgy.service.IParkingService;
import com.xit.core.support.jpa.JpaUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.*;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.ExampleMatcher;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -17,9 +20,9 @@ import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatc
@Service
@RequiredArgsConstructor
public class MinSimsa680Service implements IMinSimsa680Service {
public class ParkingService implements IParkingService {
private final IMinSimsa680Repository repository;
private final IParkingRepository repository;
@Transactional(readOnly = true)
public Page<MinSimsa680> findAll(MinSimsa680 entity, Pageable pageable) {
@ -34,13 +37,13 @@ public class MinSimsa680Service implements IMinSimsa680Service {
}
@Transactional(readOnly = true)
public Page<MinSimsa680GroupDto> findGroups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) {
return repository.findMinSimsa680Groups(minSimsa680GroupDto, pageable);
public Page<MinSimsa680GroupDto> findSimsas(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) {
return repository.findSimsas(minSimsa680GroupDto, pageable);
}
@Transactional(readOnly = true)
public List<MinSimsa680> findDetails(MinSimsa680GroupDto minSimsa680GroupDto) {
return repository.findMinSimsa680Details(minSimsa680GroupDto);
public List<MinSimsa680> findSimsaDetails(MinSimsa680GroupDto minSimsa680GroupDto) {
return repository.findSimsaDetails(minSimsa680GroupDto);
}
@Transactional(readOnly = true)
Loading…
Cancel
Save