API 설계
API 설계 (1)
백둥이~~!
- (필요)
날짜별로 완료한 루틴 상세 조회
(응답 routine)에 대한 API요청이 필요할 것 같습니다.
루틴완료 날짜별 상세 조회
,루틴완료 날짜별 전체 조회
(응답 routineCompletion)- 필요 없지 않을까요!?
- (필요)
날짜별 완료한 루틴의 루틴완료 정보 조회
날짜
/루틴ID
을 주면 해당 날짜의 루틴 완료정보를 받아오는 API요청
나의 루틴 페이지
- 전체 루틴 탭에서는 모든 루틴이 보인다
- 월, 수, 금에 수행할 루틴인데 화요일에 누른다면 블러 처리 또는 alert 처리
- 오늘은 수행하지 않아도 되는 루틴입니다!
- 해야할 루틴에는 해당 요일 + Done이 false인 루틴만 렌더링
- 완료한 루틴에는 해당 요일 + Done이 true인 루틴만 렌더링
- 좋아요 테이블이 따로 있을까요!?
🚧 프론트와 백엔드 변수명 동기화
변수명 동기화 해봐요~! 😄
😺 프론트 모델 타입
export interface UserType { userId: number; name: string; // userName => name으로 변경 nickname: string; // nickName => nickname으로 변경 profileImage: string; // profileImageUrl => profileImage으로 변경 email: string; } // 가안 // export interface UserType2 { // userId: number; // userName: string; // nickName: string; // profileImageUrl: string; // email: string; // likePosts: [postId, postId]; // likeComments: [commentId, commentId]; // } export interface RoutineType { routineId: number; name: string; // title => name으로 변경 emoji: string; color: string; startGoalTime: string; durationGoalTime: number; weeks: string[]; routineCategories: string[]; missions: MissionType[]; // routineCompletions: RoutineCompletionType[]; } export interface MissionType { missionId: number; emoji: string; title: string; color: string; durationGoalTime: number; missionStatus: MissionStatusType; } export interface RoutineStatusType { // RoutineCompletionType => RoutineStatusType으로 변경 routineCompletionId: number; routineInfo: RoutineInfoType; date: string; startTime: string; endTime: string; userDurationTime: number; missionCompletions: MissionCompletionType[]; } export interface RoutineInfoType { title: string; emoji: string; color: string; startGoalTime: string; durationGoalTime: number; routineCategories: string[]; } export interface MissionStatusType { missionCompletionId: number; missionId: number; date: string; durationGoalTime: number; userDurationTime: number; } export interface RoutinePostType { routinePostId: number; title: string; userId: number; routineId: number; createdAt: string; updatedAt: string; comments: CommentType[]; likes: PostLikeType[]; } // 가안 // export interface RoutinePostType { // routinePostId: number; // title: string; // user: User; // 이름, 이미지 // routineInfo: RoutineInfoType; // createdAt: string; // updatedAt: string; // comments: CommentType[]; // likes: PostLikeType[]; // } export interface CommentType { commentId: number; text: string; userId: string; createdAt: string; updatedAt: string; likes: CommentLikeType[]; } // 가안 // export interface CommentType { // commentId: number; // text: string; // user: UserType; // 이름, 이미지 // createdAt: string; // updatedAt: string; // likes: CommentLikeType[]; // } export interface PostLikeType { postLikeId: number; postId: number; userId: number; } export interface CommentLikeType { commentLikeId: number; commentId: number; userId: number; }
프롱이 질문
- 루틴 진행 페이지에서 미션1, 2를 완료하고 뒤로 가면 미션 1, 2가 초기화된다 그런 경우 미션 1을 다시 시작할 때 post, patch 요청을 보냈을 경우, 이미 저장된 mission-status 데이터는 대체가 되는건지? 이전 데이터가 삭제되는건지 궁금합니다
- Delete를 보내줘야함!!!(2번!!!)
- 루틴 완료 등록으로 response를 받아와서 요약 페이지를 보여줄 수는 있지만, 요약 모달에서는 루틴이 끝나지 않은 상태이기 때문에 루틴 완료 등록 post를 보낼 수 없다. 그래서 조회를 할 수 있는 API가 필요하다
- missionInfo는 mission-status 안에 존재하도록!!!