From abd5ec98b2969364c9d28e04b74a40a4c0609164 Mon Sep 17 00:00:00 2001 From: hann Date: Tue, 11 Jun 2024 05:34:12 +0900 Subject: [PATCH] [Refactor/#291] refactor name of status enum --- .../domain/schedule/application/TeamQueryService.java | 4 ++-- .../schedule/application/TeamQueryServiceImpl.java | 10 +++++----- .../schedule/presentation/converter/TeamConverter.java | 6 +++--- .../dto/team/{Status.java => ParticipationStatus.java} | 2 +- .../schedule/presentation/dto/team/TeamResponse.java | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) rename src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/{Status.java => ParticipationStatus.java} (74%) diff --git a/src/main/java/com/example/waggle/domain/schedule/application/TeamQueryService.java b/src/main/java/com/example/waggle/domain/schedule/application/TeamQueryService.java index 4d93ee98..55df8c70 100644 --- a/src/main/java/com/example/waggle/domain/schedule/application/TeamQueryService.java +++ b/src/main/java/com/example/waggle/domain/schedule/application/TeamQueryService.java @@ -3,7 +3,7 @@ import com.example.waggle.domain.member.persistence.entity.Member; import com.example.waggle.domain.schedule.persistence.entity.Participation; import com.example.waggle.domain.schedule.persistence.entity.Team; -import com.example.waggle.domain.schedule.presentation.dto.team.Status; +import com.example.waggle.domain.schedule.presentation.dto.team.ParticipationStatus; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -21,5 +21,5 @@ public interface TeamQueryService { List getParticipationList(Member leader, Long teamId); - Status getParticipationStatus(Member member, Long teamId); + ParticipationStatus getParticipationStatus(Member member, Long teamId); } diff --git a/src/main/java/com/example/waggle/domain/schedule/application/TeamQueryServiceImpl.java b/src/main/java/com/example/waggle/domain/schedule/application/TeamQueryServiceImpl.java index 8789e783..3b874894 100644 --- a/src/main/java/com/example/waggle/domain/schedule/application/TeamQueryServiceImpl.java +++ b/src/main/java/com/example/waggle/domain/schedule/application/TeamQueryServiceImpl.java @@ -6,7 +6,7 @@ import com.example.waggle.domain.schedule.persistence.dao.jpa.TeamRepository; import com.example.waggle.domain.schedule.persistence.entity.Participation; import com.example.waggle.domain.schedule.persistence.entity.Team; -import com.example.waggle.domain.schedule.presentation.dto.team.Status; +import com.example.waggle.domain.schedule.presentation.dto.team.ParticipationStatus; import com.example.waggle.exception.object.handler.TeamHandler; import com.example.waggle.exception.payload.code.ErrorStatus; import lombok.RequiredArgsConstructor; @@ -63,13 +63,13 @@ private static void validateIsLeader(Member leader, Team team) { } @Override - public Status getParticipationStatus(Member member, Long teamId) { + public ParticipationStatus getParticipationStatus(Member member, Long teamId) { if (teamMemberRepository.existsByMemberIdAndTeamId(member.getId(), teamId)) { - return Status.ACCEPTED; + return ParticipationStatus.ACCEPTED; } if (participationRepository.existsByMemberIdAndTeamId(member.getId(), teamId)) { - return Status.PENDING; + return ParticipationStatus.PENDING; } - return Status.NONE; + return ParticipationStatus.NONE; } } diff --git a/src/main/java/com/example/waggle/domain/schedule/presentation/converter/TeamConverter.java b/src/main/java/com/example/waggle/domain/schedule/presentation/converter/TeamConverter.java index 92a2ae3a..30e3fc5d 100644 --- a/src/main/java/com/example/waggle/domain/schedule/presentation/converter/TeamConverter.java +++ b/src/main/java/com/example/waggle/domain/schedule/presentation/converter/TeamConverter.java @@ -3,7 +3,7 @@ import com.example.waggle.domain.member.persistence.entity.Member; import com.example.waggle.domain.member.presentation.converter.MemberConverter; import com.example.waggle.domain.schedule.persistence.entity.Team; -import com.example.waggle.domain.schedule.presentation.dto.team.Status; +import com.example.waggle.domain.schedule.presentation.dto.team.ParticipationStatus; import com.example.waggle.domain.schedule.presentation.dto.team.TeamResponse.ParticipationStatusResponse; import com.example.waggle.domain.schedule.presentation.dto.team.TeamResponse.TeamDetailDto; import com.example.waggle.domain.schedule.presentation.dto.team.TeamResponse.TeamSummaryDto; @@ -58,9 +58,9 @@ public static TeamSummaryListDto toSummaryListDto(Page teamPage) { .build(); } - public static ParticipationStatusResponse toStatusDto(Status status) { + public static ParticipationStatusResponse toStatusDto(ParticipationStatus participationStatus) { return ParticipationStatusResponse.builder() - .status(status) + .participationStatus(participationStatus) .build(); } diff --git a/src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/Status.java b/src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/ParticipationStatus.java similarity index 74% rename from src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/Status.java rename to src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/ParticipationStatus.java index b29d5550..f07a22fb 100644 --- a/src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/Status.java +++ b/src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/ParticipationStatus.java @@ -1,5 +1,5 @@ package com.example.waggle.domain.schedule.presentation.dto.team; -public enum Status { +public enum ParticipationStatus { PENDING, ACCEPTED, NONE } diff --git a/src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/TeamResponse.java b/src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/TeamResponse.java index 9720c894..d35dc9e2 100644 --- a/src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/TeamResponse.java +++ b/src/main/java/com/example/waggle/domain/schedule/presentation/dto/team/TeamResponse.java @@ -63,7 +63,7 @@ public static class TeamSummaryListDto { @Schema public static class ParticipationStatusResponse { - private Status status; + private ParticipationStatus participationStatus; } }