Skip to content

Commit 7979d84

Browse files
hyoseong-Choinano-mmparkjaehak
authored
CLAP-318 2차카테고리 단일조회 API
* CLAP-110 Feature : 담당자별 작업 처리량 조회 API 구현 <footer> - 관련: #73 * CLAP-111 Refactor : 통계 조회 API 리팩토링 및 기능 수정 <footer> - 관련: #74 * 내 작업한 내용에 대한 설명 * 담당자 조회 API 구현 * CLAP-111 Refactor : 통계 조회 API 주소 통합, 리팩토링, 예외처리 <footer> - 관련: #74 * Bug : 프로퍼티파일 수정 * CLAP-104 CI/CD : CI에서 s3.yml 파일 생성하도록 수정 * CLAP-146 Feature : 카테고리 목록 조회 API 구현 <footer> - 관련: #118 * CLAP-147 Feature : 카테고리 수정 API 구현 <footer> - 관련: #119 * CLAP-147 Feature : 카테고리 추가, 수정 API 리뷰반영 수정 <footer> - 관련: #119 * CLAP-148 Feature : 카테고리 삭제 API 구현 <footer> - 관련: #120 * CLAP-148 Feature : 카테고리 삭제 API 수정 <footer> - 관련: #120 * CLAP-148 Docs : 카테고리 API 스웨거 수정 <footer> - 관련: #120 * CLAP-107 Bug : CI test yml파일 key 중복 수정 <footer> - 관련: #60 * CLAP-148 Feature : 카테고리 CUD 리뷰 반영 수정, 조회 반환 양식 수정 <footer> - 관련: #120 * CLAP-214 Cleanup : 통계, 카테고리 미흡한부분 리팩토링 <footer> - 관련: #216 * CLAP-214 Fix : 통계조회 API 파라미터 바인딩 오류 수정 <footer> - 관련: #216 * CLAP-214 Fix : addConverter 수정 <footer> - 관련: #216 * CLAP-214 Hotfix : 추가한 파일들 제거 <footer> - 관련: #216 * CLAP-214 Hotfix : FindStatisticsController 스위치문 수정 <footer> - 관련: #216 * CLAP-214 Hotfix : AddCategoryService 지연로딩 오류 수정 <footer> - 관련: #216 * CLAP-214 Hotfix : DeleteCategoryService 카테고리 삭제 로직 수정 <footer> - 관련: #216 * CLAP-249 Refactor : 통계 조회 서비스 리팩토링 <footer> - 관련: #265 * CLAP-250 Test : 통계 조회 테스트코드 작성 <footer> - 관련: #266 * CLAP-214 Hotifx : 카테고리 수정 로직 수정 <footer> - 관련: #216 * CLAP-214 Hotifx : 카테고리 수정 로직 수정 <footer> - 관련: #216 * CLAP-256 fix: 스웨거 명세 추가 * CLAP-214 Hotifx : 카테고리 저장 트랜잭션 추가 <footer> - 관련: #216 * CLAP-214 Hotifx : 카테고리 저장 시간 수정 <footer> - 관련: #216 * CLAP-285 Hotifx : 모든 카테고리 조회 <footer> - 관련: #331 * CLAP-214 Hotifx : 카테고리 조회 Secured 설정 <footer> - 관련: #216 * CLAP-256 fix: convert 동작 mapper 추가 * CLAP-256 fix: 충돌해결 * CLAP-256 fix: 불필요한 테스트 파일 제거 * CLAP-256 fix: mapper statuslabel 수정 * CLAP-256 Fix : 팀 작업 현황 필터링 조회 수정 <footer> - 관련: #281 * CLAP-299 Feature : 사용자 작업 취소 <footer> - 관련: #352 * CLAP-299 Fix: 사용자 작업 취소 api 주소 수정 <footer> - 관련: #352 * CLAP-256 전체 작업수 계산 로직 개선 * fix: env 파일 제거 * fix: 어노테이션 수정 * fix: @RestController 제거 * fix: @ApplicationService로 수정 * CLAP-256 Fix : TeamStatusService 누락된 import 수정 <footer> - 관련: #281 * CLAP-256 Fix : TeamStatusService Secured 추가 <footer> - 관련: #281 * fix: 팀 작업 현황 필터링 조회 수정 및 정렬 기능 개선 * Delete src/main/resources/env.properties * Delete src/test/resources/application.yml * 충돌 해결: develop 브랜치와 병합 * Update application.yml * Revert application.yml files to match develop branch * CLAP-256 fix: Update application.yml * CLAP-256 fix: Update application.yml * CLAP-256 Fix : 팀 현황 필터조회 기여도순 정렬 수정 <footer> - 관련: #281 * CLAP-309 Fix : 엘라스틱서치에 저장할 작업 정보 수정 <footer> - 관련: #378 * CLAP-309 Fix : 엘라스틱서치에 저장 누락되는것 수정 <footer> - 관련: #378 * CLAP-test * CLAP-318 Fix : 2차카테고리 입력 양식(설명 예시) 추가 <footer> - 관련: #392 * CLAP-318 Test : 2차카테고리 입력 양식(설명 예시) 추가한 테스트코드 수정 <footer> - 관련: #392 * CLAP-318 Feature : 2차카테고리 단일조회 API <footer> - 관련: #392 * CLAP-318 Feature : 2차카테고리 경로 수정 원복 <footer> - 관련: #392 --------- Co-authored-by: nano-mm <nano123@gachon.ac.kr> Co-authored-by: parkjaehak <atom8426@gmail.com>
1 parent 975d5f3 commit 7979d84

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

src/main/java/clap/server/adapter/inbound/web/admin/FindCategoryController.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.springframework.http.ResponseEntity;
1414
import org.springframework.security.access.annotation.Secured;
1515
import org.springframework.web.bind.annotation.GetMapping;
16+
import org.springframework.web.bind.annotation.PathVariable;
1617
import org.springframework.web.bind.annotation.RequestMapping;
1718

1819
import java.util.List;
@@ -33,17 +34,24 @@ public ResponseEntity<List<FindAllCategoryResponse>> findAllCategory() {
3334
return ResponseEntity.ok(findAllCategoryUsecase.findAllCategory());
3435
}
3536

36-
@Operation(summary = "1차 카테고리 조회")
37+
@Operation(summary = "1차 카테고리 목록 조회")
3738
@GetMapping("/main-category")
3839
@Secured({"ROLE_USER", "ROLE_MANAGER", "ROLE_ADMIN"})
3940
public ResponseEntity<List<FindMainCategoryResponse>> findMainCategory() {
4041
return ResponseEntity.ok(findmainCategoryUsecase.findMainCategory());
4142
}
4243

43-
@Operation(summary = "2차 카테고리 조회")
44+
@Operation(summary = "2차 카테고리 목록 조회")
4445
@GetMapping("/sub-category")
4546
@Secured({"ROLE_USER", "ROLE_MANAGER", "ROLE_ADMIN"})
4647
public ResponseEntity<List<FindSubCategoryResponse>> findSubCategory() {
4748
return ResponseEntity.ok(findsubCategoryUsecase.findSubCategory());
4849
}
50+
51+
@Operation(summary = "2차 카테고리 단일 조회")
52+
@GetMapping("/sub-categories/{categoryId}")
53+
@Secured({"ROLE_USER", "ROLE_MANAGER", "ROLE_ADMIN"})
54+
public ResponseEntity<FindSubCategoryResponse> findOneSubCategory(@PathVariable Long categoryId) {
55+
return ResponseEntity.ok(findsubCategoryUsecase.findOneSubCategory(categoryId));
56+
}
4957
}

src/main/java/clap/server/application/port/inbound/admin/FindSubCategoryUsecase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66

77
public interface FindSubCategoryUsecase {
88
List<FindSubCategoryResponse> findSubCategory();
9+
FindSubCategoryResponse findOneSubCategory(Long categoryId);
910
}

src/main/java/clap/server/application/service/admin/FindSubCategoryService.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import clap.server.application.port.inbound.admin.FindSubCategoryUsecase;
66
import clap.server.application.port.outbound.task.LoadCategoryPort;
77
import clap.server.common.annotation.architecture.ApplicationService;
8+
import clap.server.exception.ApplicationException;
9+
import clap.server.exception.code.TaskErrorCode;
810
import lombok.RequiredArgsConstructor;
911
import org.springframework.transaction.annotation.Transactional;
1012

@@ -16,11 +18,19 @@ public class FindSubCategoryService implements FindSubCategoryUsecase {
1618
private final LoadCategoryPort loadCategoryPort;
1719

1820
@Override
19-
@Transactional
21+
@Transactional(readOnly = true)
2022
public List<FindSubCategoryResponse> findSubCategory() {
2123
return loadCategoryPort.findSubCategory()
2224
.stream()
2325
.map(CategoryResponseMapper::toFindSubCategoryResponse)
2426
.toList();
2527
}
28+
29+
@Override
30+
@Transactional(readOnly = true)
31+
public FindSubCategoryResponse findOneSubCategory(Long categoryId) {
32+
return CategoryResponseMapper.toFindSubCategoryResponse(loadCategoryPort
33+
.findById(categoryId)
34+
.orElseThrow(() -> new ApplicationException(TaskErrorCode.CATEGORY_NOT_FOUND)));
35+
}
2636
}

0 commit comments

Comments
 (0)