Skip to content

Commit

Permalink
Merge pull request #63 from studio-recoding/!HOTFIX-schedule-return
Browse files Browse the repository at this point in the history
[⚠️!HOTFIX] 서울 시간대로 수정
  • Loading branch information
JeonHaeseung authored May 8, 2024
2 parents 5a8fb95 + b6da39c commit a2b026d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;

Expand Down Expand Up @@ -65,10 +66,12 @@ public GetScheduleListDto getOneDayUserSchedule(Long memberId, ZonedDateTime dat
/* 사용자가 직접 변경한 스케쥴 RDB에 저장하는 로직 */
public GetScheduleListDto changeSchedule(Long memberId, PutScheduleDto putScheduleDto, String date){
// 년도, 월, 일 추출
/*
String[] parts = date.split("-");
int year = Integer.parseInt(parts[0]);
int month = Integer.parseInt(parts[1]);
int day = Integer.parseInt(parts[2]);
*/

Schedule schedule = scheduleRepository.findScheduleById(putScheduleDto.getId());
Category category = categoryRepository.findCategoryById(putScheduleDto.getCategoryNum());
Expand All @@ -82,15 +85,15 @@ public GetScheduleListDto changeSchedule(Long memberId, PutScheduleDto putSchedu

return makeScheduleListDto(
scheduleRepository
.findOneDaySchedulesByMember_IdWithString(memberId, year, month, day));
.findOneDaySchedulesByMember_Id(memberId, schedule.getStartTime().withZoneSameInstant(ZoneId.of("Asia/Seoul"))));
}

/* 사용자가 직접 삭제한 스케쥴 */
public GetScheduleListDto deleteSchedule(Long memberId){
Schedule schedule = scheduleRepository.findScheduleById(memberId);
scheduleRepository.delete(schedule);

return getOneDayUserSchedule(memberId, schedule.getStartTime());
return getOneDayUserSchedule(memberId, schedule.getStartTime().withZoneSameInstant(ZoneId.of("Asia/Seoul")));
}

/* 사용자가 AI가 생성한 스케쥴을 Accept/Deny한 여부에 따라서 채팅 및 스케쥴 저장 */
Expand Down Expand Up @@ -155,7 +158,7 @@ public GetScheduleListDto postNewUserSchedule(Long memberId, PostScheduleDto pos
newSchedule.getMember().getId(),
newSchedule.getId());

return getOneDayUserSchedule(memberId, newSchedule.getStartTime());
return getOneDayUserSchedule(memberId, newSchedule.getStartTime().withZoneSameInstant(ZoneId.of("Asia/Seoul"));
}

/* 새로운 스케쥴을 VectorDB에 저장하는 API 호출 */
Expand Down

0 comments on commit a2b026d

Please sign in to comment.