Skip to content

Commit 5efb25f

Browse files
committed
refactor(recruit-board): 패키지 구조 변경(query, command 패키지 제거)
1 parent 8a65a51 commit 5efb25f

26 files changed

+82
-95
lines changed

src/main/java/com/somemore/domains/recruitboard/controller/RecruitBoardCommandApiController.java

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
11
package com.somemore.domains.recruitboard.controller;
22

33

4-
import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;
5-
4+
import com.somemore.domains.recruitboard.dto.request.RecruitBoardCreateRequestDto;
5+
import com.somemore.domains.recruitboard.dto.request.RecruitBoardLocationUpdateRequestDto;
6+
import com.somemore.domains.recruitboard.dto.request.RecruitBoardStatusUpdateRequestDto;
67
import com.somemore.domains.recruitboard.dto.request.RecruitBoardUpdateRequestDto;
7-
import com.somemore.domains.recruitboard.usecase.command.CreateRecruitBoardUseCase;
8-
import com.somemore.domains.recruitboard.usecase.command.DeleteRecruitBoardUseCase;
9-
import com.somemore.domains.recruitboard.usecase.command.UpdateRecruitBoardUseCase;
8+
import com.somemore.domains.recruitboard.usecase.CreateRecruitBoardUseCase;
9+
import com.somemore.domains.recruitboard.usecase.DeleteRecruitBoardUseCase;
10+
import com.somemore.domains.recruitboard.usecase.UpdateRecruitBoardUseCase;
1011
import com.somemore.global.auth.annotation.CurrentUser;
1112
import com.somemore.global.common.response.ApiResponse;
1213
import com.somemore.global.imageupload.dto.ImageUploadRequestDto;
1314
import com.somemore.global.imageupload.usecase.ImageUploadUseCase;
14-
import com.somemore.domains.recruitboard.dto.request.RecruitBoardCreateRequestDto;
15-
import com.somemore.domains.recruitboard.dto.request.RecruitBoardLocationUpdateRequestDto;
16-
import com.somemore.domains.recruitboard.dto.request.RecruitBoardStatusUpdateRequestDto;
1715
import io.swagger.v3.oas.annotations.Operation;
1816
import io.swagger.v3.oas.annotations.tags.Tag;
1917
import jakarta.validation.Valid;
20-
import java.time.LocalDateTime;
21-
import java.util.UUID;
2218
import lombok.RequiredArgsConstructor;
2319
import org.springframework.security.access.annotation.Secured;
24-
import org.springframework.web.bind.annotation.DeleteMapping;
25-
import org.springframework.web.bind.annotation.PatchMapping;
26-
import org.springframework.web.bind.annotation.PathVariable;
27-
import org.springframework.web.bind.annotation.PostMapping;
28-
import org.springframework.web.bind.annotation.PutMapping;
29-
import org.springframework.web.bind.annotation.RequestBody;
30-
import org.springframework.web.bind.annotation.RequestMapping;
31-
import org.springframework.web.bind.annotation.RequestPart;
32-
import org.springframework.web.bind.annotation.RestController;
20+
import org.springframework.web.bind.annotation.*;
3321
import org.springframework.web.multipart.MultipartFile;
3422

23+
import java.time.LocalDateTime;
24+
import java.util.UUID;
25+
26+
import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;
27+
3528
@Tag(name = "Recruit Board Command API", description = "봉사 활동 모집글 생성 수정 삭제 API")
3629
@RequiredArgsConstructor
3730
@RequestMapping("/api")

src/main/java/com/somemore/domains/recruitboard/controller/RecruitBoardQueryApiController.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
package com.somemore.domains.recruitboard.controller;
22

3-
import static org.springframework.data.domain.Sort.Direction.DESC;
4-
5-
import com.somemore.domains.recruitboard.dto.condition.RecruitBoardNearByCondition;
6-
import com.somemore.domains.recruitboard.dto.condition.RecruitBoardSearchCondition;
7-
import com.somemore.domains.recruitboard.usecase.query.RecruitBoardQueryUseCase;
8-
import com.somemore.global.common.response.ApiResponse;
93
import com.somemore.domains.recruitboard.domain.RecruitStatus;
104
import com.somemore.domains.recruitboard.domain.VolunteerCategory;
5+
import com.somemore.domains.recruitboard.dto.condition.RecruitBoardNearByCondition;
6+
import com.somemore.domains.recruitboard.dto.condition.RecruitBoardSearchCondition;
117
import com.somemore.domains.recruitboard.dto.response.RecruitBoardDetailResponseDto;
128
import com.somemore.domains.recruitboard.dto.response.RecruitBoardResponseDto;
139
import com.somemore.domains.recruitboard.dto.response.RecruitBoardWithCenterResponseDto;
1410
import com.somemore.domains.recruitboard.dto.response.RecruitBoardWithLocationResponseDto;
11+
import com.somemore.domains.recruitboard.usecase.RecruitBoardQueryUseCase;
12+
import com.somemore.global.common.response.ApiResponse;
1513
import io.swagger.v3.oas.annotations.Operation;
1614
import io.swagger.v3.oas.annotations.tags.Tag;
17-
import java.util.UUID;
1815
import lombok.RequiredArgsConstructor;
1916
import org.springframework.data.domain.Page;
2017
import org.springframework.data.domain.Pageable;
2118
import org.springframework.data.web.PageableDefault;
22-
import org.springframework.web.bind.annotation.GetMapping;
23-
import org.springframework.web.bind.annotation.PathVariable;
24-
import org.springframework.web.bind.annotation.RequestMapping;
25-
import org.springframework.web.bind.annotation.RequestParam;
26-
import org.springframework.web.bind.annotation.RestController;
19+
import org.springframework.web.bind.annotation.*;
20+
21+
import java.util.UUID;
22+
23+
import static org.springframework.data.domain.Sort.Direction.DESC;
2724

2825
@Tag(name = "Recruit Board Query API", description = "봉사 활동 모집 조회 관련 API")
2926
@RequiredArgsConstructor
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package com.somemore.domains.recruitboard.service.command;
1+
package com.somemore.domains.recruitboard.service;
22

33
import com.somemore.domains.location.usecase.command.CreateLocationUseCase;
44
import com.somemore.domains.recruitboard.domain.RecruitBoard;
55
import com.somemore.domains.recruitboard.dto.request.RecruitBoardCreateRequestDto;
66
import com.somemore.domains.recruitboard.event.CreateRecruitBoardEvent;
77
import com.somemore.domains.recruitboard.repository.RecruitBoardRepository;
88
import com.somemore.domains.recruitboard.service.validator.RecruitBoardValidator;
9-
import com.somemore.domains.recruitboard.usecase.command.CreateRecruitBoardUseCase;
9+
import com.somemore.domains.recruitboard.usecase.CreateRecruitBoardUseCase;
1010
import com.somemore.global.common.event.DomainEventSubType;
1111
import com.somemore.global.common.event.ServerEventPublisher;
1212
import com.somemore.global.common.event.ServerEventType;
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
package com.somemore.domains.recruitboard.service.command;
1+
package com.somemore.domains.recruitboard.service;
22

33
import com.somemore.domains.recruitboard.domain.RecruitBoard;
4-
import com.somemore.domains.recruitboard.repository.RecruitBoardRepository;
54
import com.somemore.domains.recruitboard.service.validator.RecruitBoardValidator;
6-
import com.somemore.domains.recruitboard.usecase.command.DeleteRecruitBoardUseCase;
7-
import com.somemore.domains.recruitboard.usecase.query.RecruitBoardQueryUseCase;
8-
import com.somemore.global.exception.BadRequestException;
5+
import com.somemore.domains.recruitboard.usecase.DeleteRecruitBoardUseCase;
6+
import com.somemore.domains.recruitboard.usecase.RecruitBoardQueryUseCase;
97
import lombok.RequiredArgsConstructor;
108
import org.springframework.stereotype.Service;
119
import org.springframework.transaction.annotation.Transactional;
1210

1311
import java.util.UUID;
1412

15-
import static com.somemore.global.exception.ExceptionMessage.NOT_EXISTS_RECRUIT_BOARD;
16-
1713
@RequiredArgsConstructor
1814
@Transactional
1915
@Service
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
package com.somemore.domains.recruitboard.service.query;
2-
3-
import static com.somemore.global.exception.ExceptionMessage.NOT_EXISTS_RECRUIT_BOARD;
1+
package com.somemore.domains.recruitboard.service;
42

53
import com.somemore.domains.center.usecase.query.CenterQueryUseCase;
4+
import com.somemore.domains.recruitboard.domain.RecruitBoard;
65
import com.somemore.domains.recruitboard.dto.condition.RecruitBoardNearByCondition;
76
import com.somemore.domains.recruitboard.dto.condition.RecruitBoardSearchCondition;
8-
import com.somemore.domains.recruitboard.usecase.query.RecruitBoardQueryUseCase;
9-
import com.somemore.global.exception.BadRequestException;
10-
import com.somemore.domains.recruitboard.domain.RecruitBoard;
117
import com.somemore.domains.recruitboard.dto.response.RecruitBoardDetailResponseDto;
128
import com.somemore.domains.recruitboard.dto.response.RecruitBoardResponseDto;
139
import com.somemore.domains.recruitboard.dto.response.RecruitBoardWithCenterResponseDto;
@@ -16,14 +12,18 @@
1612
import com.somemore.domains.recruitboard.repository.mapper.RecruitBoardDetail;
1713
import com.somemore.domains.recruitboard.repository.mapper.RecruitBoardWithCenter;
1814
import com.somemore.domains.recruitboard.repository.mapper.RecruitBoardWithLocation;
19-
20-
import java.util.List;
21-
import java.util.UUID;
15+
import com.somemore.domains.recruitboard.usecase.RecruitBoardQueryUseCase;
16+
import com.somemore.global.exception.BadRequestException;
2217
import lombok.RequiredArgsConstructor;
2318
import org.springframework.data.domain.Page;
2419
import org.springframework.stereotype.Service;
2520
import org.springframework.transaction.annotation.Transactional;
2621

22+
import java.util.List;
23+
import java.util.UUID;
24+
25+
import static com.somemore.global.exception.ExceptionMessage.NOT_EXISTS_RECRUIT_BOARD;
26+
2727
@RequiredArgsConstructor
2828
@Transactional(readOnly = true)
2929
@Service
@@ -70,7 +70,7 @@ public Page<RecruitBoardDetailResponseDto> getRecruitBoardsNearby(
7070

7171
@Override
7272
public Page<RecruitBoardResponseDto> getRecruitBoardsByCenterId(UUID centerId,
73-
RecruitBoardSearchCondition condition) {
73+
RecruitBoardSearchCondition condition) {
7474
centerQueryUseCase.validateCenterExists(centerId);
7575

7676
Page<RecruitBoard> boards = recruitBoardRepository.findAllByCenterId(centerId, condition);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package com.somemore.domains.recruitboard.service.command;
1+
package com.somemore.domains.recruitboard.service;
22

33
import com.somemore.domains.location.usecase.command.UpdateLocationUseCase;
44
import com.somemore.domains.recruitboard.domain.RecruitBoard;
55
import com.somemore.domains.recruitboard.domain.RecruitStatus;
66
import com.somemore.domains.recruitboard.dto.request.RecruitBoardLocationUpdateRequestDto;
77
import com.somemore.domains.recruitboard.dto.request.RecruitBoardUpdateRequestDto;
88
import com.somemore.domains.recruitboard.service.validator.RecruitBoardValidator;
9-
import com.somemore.domains.recruitboard.usecase.command.UpdateRecruitBoardUseCase;
10-
import com.somemore.domains.recruitboard.usecase.query.RecruitBoardQueryUseCase;
9+
import com.somemore.domains.recruitboard.usecase.RecruitBoardQueryUseCase;
10+
import com.somemore.domains.recruitboard.usecase.UpdateRecruitBoardUseCase;
1111
import lombok.RequiredArgsConstructor;
1212
import org.springframework.stereotype.Service;
1313
import org.springframework.transaction.annotation.Transactional;
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
package com.somemore.domains.recruitboard.usecase.command;
1+
package com.somemore.domains.recruitboard.usecase;
22

33
import com.somemore.domains.recruitboard.dto.request.RecruitBoardCreateRequestDto;
4+
45
import java.util.UUID;
56

67
public interface CreateRecruitBoardUseCase {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.somemore.domains.recruitboard.usecase.command;
1+
package com.somemore.domains.recruitboard.usecase;
22

33
import java.util.UUID;
44

0 commit comments

Comments
 (0)