Skip to content

Commit de43f60

Browse files
committed
feat(center): center Query Usecase 및 Service에 center 정보 조회 기능 추가
1 parent 59ae6cc commit de43f60

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/main/java/com/somemore/center/service/query/CenterQueryService.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.somemore.center.service.query;
22

33
import com.somemore.center.domain.Center;
4+
import com.somemore.center.dto.response.CenterForCommunityResponseDto;
45
import com.somemore.center.dto.response.CenterProfileResponseDto;
56
import com.somemore.center.dto.response.PreferItemResponseDto;
67
import com.somemore.center.repository.CenterRepository;
@@ -45,4 +46,14 @@ private Center getCenterById(UUID centerId) {
4546
.orElseThrow(() -> new BadRequestException(NOT_EXISTS_CENTER.getMessage()));
4647
}
4748

49+
@Override
50+
public String getNameById(UUID id) {
51+
return centerRepository.findNameById(id);
52+
}
53+
54+
@Override
55+
public CenterForCommunityResponseDto getCenterDetailForCommunity(UUID id) {
56+
Center center = getCenterById(id);
57+
return CenterForCommunityResponseDto.fromEntity(center);
58+
}
4859
}

src/main/java/com/somemore/center/usecase/query/CenterQueryUseCase.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.somemore.center.usecase.query;
22

3+
import com.somemore.center.dto.response.CenterForCommunityResponseDto;
34
import com.somemore.center.dto.response.CenterProfileResponseDto;
45

56
import java.util.UUID;
@@ -8,4 +9,6 @@ public interface CenterQueryUseCase {
89

910
CenterProfileResponseDto getCenterProfileByCenterId(UUID centerId);
1011
void validateCenterExists(UUID centerId);
12+
String getNameById(UUID id);
13+
CenterForCommunityResponseDto getCenterDetailForCommunity(UUID id);
1114
}

0 commit comments

Comments
 (0)