Skip to content

Commit

Permalink
[Refactor/#291] refactor name of status enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Han-Jeong committed Jun 10, 2024
1 parent f8d6cce commit abd5ec9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -21,5 +21,5 @@ public interface TeamQueryService {

List<Participation> getParticipationList(Member leader, Long teamId);

Status getParticipationStatus(Member member, Long teamId);
ParticipationStatus getParticipationStatus(Member member, Long teamId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -58,9 +58,9 @@ public static TeamSummaryListDto toSummaryListDto(Page<Team> teamPage) {
.build();
}

public static ParticipationStatusResponse toStatusDto(Status status) {
public static ParticipationStatusResponse toStatusDto(ParticipationStatus participationStatus) {
return ParticipationStatusResponse.builder()
.status(status)
.participationStatus(participationStatus)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.example.waggle.domain.schedule.presentation.dto.team;

public enum Status {
public enum ParticipationStatus {
PENDING, ACCEPTED, NONE
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static class TeamSummaryListDto {
@Schema
public static class ParticipationStatusResponse {

private Status status;
private ParticipationStatus participationStatus;
}

}

0 comments on commit abd5ec9

Please sign in to comment.