HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🧚
[1기]최종 프로젝트 데브코스
/
👼
[팀2] 극락이들
/
👹
극훈
/
Diary 생성 api

Diary 생성 api

상태
완료
담당자
  • 일기 생성시 각 사진에 대한 api 콜은 아래와 같습니다.
 
request
post : api/v1/images // Header { "Content-type" : "Multipart/form-data", // 수정진행 "Authorization" : "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdtiC_Ug0ngasdasdsadasdasdasd" }
 
request-multipart
notion image
response
status code 201 { "message": "IMAGE_UPLOAD_SUCCESS", "serverDateTime": "2021-12-14T01:46:11.6080123", "data": { "uploadImageUrl": "https://jungdam-image.s3.ap-northeast-2.amazonaws.com/temp/4676856e-b54d-48cc-96e4-50fd2f8f9e6c" } }
 
 

  • 각 사진에 대한 api 콜이 완료된 이후에 최종적인 api 콜입니다.
 
 
request
post : api/v1/albums/{albumId}/diaries // Header { "Content-type" : "application/json", "Authorization" : "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdtiC_Ug0ngasdasdsadasdasdasd" } // Body { "diaryTitle" : "행복1111", "diaryContent" : "행복해111라", "diaryPhotos" : [ "https://jungdam-image.s3.ap-northeast-2.amazonaws.com/temp/4676856e-b54d-48cc-96e4-50fd2f8f9e6c", "https://jungdam-image.s3.ap-northeast-2.amazonaws.com/temp/4676856e-b54d-48cc-96e4-50fd2f8f933c" ], "recordedAt" : "2021-12-13" }
Response
status code : 201 // Header { "Content-type" : "application/json" } // Body { "message": "DIARY_CREATE_SUCCESS", "serverDateTime": "2021-12-14T01:53:26.9522985", "data": { "albumId": 1, "diaryId": 19 } }
 

발생할 수 있는 예외
  1. title이 1부터 30글자안에 속하지 않을 때
    1. status code 400 { "message": "INVALID_DIARY_TITLE", "serverDateTime": "2021-12-14T01:57:28.75725" }
  1. content가 null 또는 비어있을 때
    1. status code 400 { "message": "INVALID_DIARY_CONTENT", "serverDateTime": "2021-12-14T01:57:28.75725" }
  1. 사용자가 없을 때
    1. status code 400 { "message": "NOT_EXIST_MEMBER", "serverDateTime": "2021-12-14T01:57:28.75725" }
  1. 앨범에 속한 인원이 아닐 때
    1. status code 400 { "message": "NOT_EXIST_PARTICIPANT", "serverDateTime": "2021-12-14T01:57:28.75725" }
  1. 앨범이 존재하지 않을 때
    1. status code 400 { "message": "NOT_EXIST_ALBUM", "serverDateTime": "2021-12-14T01:57:28.75725" }
  1. 이미 일기가 존재할 때
    1. status code 400 { "message": "DUPLICATION_DIARY_RECORDED_AT", "serverDateTime": "2021-12-14T01:57:28.75725" }