Skip to content

Commit

Permalink
🔥 Remove: Participant custom palette 컬럼 삭제로 인한 코드 삭제
Browse files Browse the repository at this point in the history
<footer>
- 관련: #428
  • Loading branch information
joowojr committed Jan 12, 2025
1 parent 3aad8cf commit 977a8b2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private static MeetingScheduleResponse.UserParticipantDetailDto toUserParticipan
.isGuest(participant.getUser() instanceof Anonymous)
.tag(participant.getUser().getTag())
.nickname(participant.getUser().getNickname())
.colorId(participant.getPalette() != null ? participant.getPalette().getId() : null)
.colorId(participant.getUser().getId())
.isOwner(getParticipantIsOwner(participant.getIsOwner()))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@ public class ParticipantMaker {
private final CategoryService categoryService;
private final ParticipantService participantService;

public void makeScheduleOwner(Schedule schedule, Member member, Long categoryId, Long paletteId) {
public void makeScheduleOwner(Schedule schedule, Member member, Long categoryId) {
Category category;
if (categoryId != null) {
category = categoryService.readCategoryByMemberAndId(categoryId, member);
} else
category = categoryService.readMeetingCategoryByMember(member);
Palette palette = paletteId != null ? paletteService.getPalette(paletteId) : null;

Participant participant;
if(schedule.getIsMeetingSchedule()){
participant = Participant.of(ParticipantRole.OWNER.getValue(), member, schedule, category, palette, schedule.getTitle(), schedule.getImageUrl());
} else participant = Participant.of(ParticipantRole.OWNER.getValue(), member, schedule, category, palette, null, null);
participant = Participant.of(ParticipantRole.OWNER.getValue(), member, schedule, category, schedule.getTitle(), schedule.getImageUrl());
} else participant = Participant.of(ParticipantRole.OWNER.getValue(), member, schedule, category,null, null);
participantService.createParticipant(participant);
}

Expand All @@ -47,16 +46,15 @@ public void makeMeetingScheduleParticipants(Schedule schedule, List<Member> memb
.map(member -> {
Category category = categoryService.readMeetingCategoryByMember(member);
return Participant.of(ParticipantRole.NON_OWNER.getValue(), member, schedule,
category, member.getPalette(), schedule.getTitle(), schedule.getImageUrl());
category, schedule.getTitle(), schedule.getImageUrl());
})
.collect(Collectors.toList());
participantService.createParticipants(participants);
}

public Participant makeGuestParticipant(Schedule schedule, Anonymous anonymous, Long paletteId) {
Palette palette = paletteService.getPalette(paletteId);
public Participant makeGuestParticipant(Schedule schedule, Anonymous anonymous) {
Participant participant = Participant.of(ParticipantRole.NON_OWNER.getValue(), anonymous, schedule,
null, palette, schedule.getTitle(), schedule.getImageUrl());
null, schedule.getTitle(), schedule.getImageUrl());
Participant savedParticipant = participantService.createParticipant(participant);
schedule.setGuestParticipantsInfo(anonymous.getNickname());
return savedParticipant;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class ParticipantManageService {
private final FriendshipService friendshipService;
private final ParticipantService participantService;

public void createScheduleOwner(Member member, Schedule schedule, Long categoryId, Long paletteId) {
participantMaker.makeScheduleOwner(schedule, member, categoryId, paletteId);
public void createScheduleOwner(Member member, Schedule schedule, Long categoryId) {
participantMaker.makeScheduleOwner(schedule, member, categoryId);
}

public void createMeetingParticipants(Member owner, Schedule schedule, List<Long> memberIds){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ public Schedule getMeetingSchedule(Long scheduleId) {
public Schedule createPersonalSchedule(PersonalScheduleRequest.PostPersonalScheduleDto request, Member member) {
Period period = getValidatedPeriod(request.getPeriod().getStartDate(), request.getPeriod().getEndDate());
Schedule schedule = scheduleMaker.createPersonalSchedule(request, period, member.getNickname());
participantManageService.createScheduleOwner(member, schedule, request.getCategoryId(), null);
participantManageService.createScheduleOwner(member, schedule, request.getCategoryId());
return schedule;
}

public Schedule createMeetingSchedule(MeetingScheduleRequest.PostMeetingScheduleDto request, Member owner) {
Period period = getValidatedPeriod(request.getPeriod().getStartDate(), request.getPeriod().getEndDate());
Schedule schedule = scheduleMaker.createMeetingSchedule(request, period, owner.getNickname());
participantManageService.createScheduleOwner(owner, schedule, null, owner.getPalette().getId());
participantManageService.createScheduleOwner(owner, schedule, null);
return schedule;
}

Expand Down

0 comments on commit 977a8b2

Please sign in to comment.