Skip to content

cloud duster api wiki

JeonginKim edited this page Oct 15, 2024 · 4 revisions

cloud duster api 문서입니다.

추억 저장하기

Syntax

POST /memory
-d {
   'nickname': 'nickname',
   'image': 'image url',
   'text': '작별인사', 
   'location': 'string',
   'size': '보낼 사진의 용량'
}

location 값

  • MOUNTAIN: 산
  • SEA: 바다
  • SKY: 하늘

Response

업로드 성공 status code: 201

{
    "Memory added"
}

업로드 실패 status code: 500

{
   "Database error"
}

추억 불러오기

Syntax

GET /memories

cursor 기반으로 최신 데이터부터 불러온다. (limit 10개)

  • 최초 진입: 10개씩 불러온다.
  • 이후: 마지막 데이터부터 10개씩 불러온다.

cursor를 사용하는 경우

GET /memories?cursorId={id}

Response

불러오기 성공 status code: 200

{
    "items": [
        {
            "id": 5,
            "nickname": "이름3",
            "image_url": "https://cloudimage.kr.object.ncloudstorage.com/OYoy1wLf1cEugV-xWOuMM.jpeg",
            "message": "message2",
            "location": "SEA",
            "size": 1,
            "created_at": "2024-09-24T14:47:13.000Z"
        },
        {
            "id": 4,
            "nickname": "이름2",
            "image_url": "https://cloudimage.kr.object.ncloudstorage.com/xUmXHJaEV_fkzjHrquFKN.jpeg",
            "message": "message2",
            "location": "SEA",
            "size": 1,
            "created_at": "2024-09-24T14:26:39.000Z"
        },
        {
            "id": 3,
            "nickname": "이름2",
            "image_url": "https://cloudimage.kr.object.ncloudstorage.com/9D2q9DVyOHtxia-hnmejB.jpeg",
            "message": "message2",
            "location": "SEA",
            "size": 1,
            "created_at": "2024-09-22T17:23:07.000Z"
        },
        {
            "id": 2,
            "nickname": "이름",
            "image_url": "https://cloudimage.kr.object.ncloudstorage.com/m6WhQjSQ10LD6jD_RNR1-.jpeg",
            "message": "message",
            "location": "SKY",
            "size": 10,
            "created_at": "2024-09-22T17:04:15.000Z"
        },
        {
            "id": 1,
            "nickname": "이름",
            "image_url": "https://cloudimage.kr.object.ncloudstorage.com/_nGxMpijXgxmXh_FJZdMF.jpeg",
            "message": "message",
            "location": "SKY",
            "size": 10,
            "created_at": "2024-09-22T16:56:42.000Z"
        }
    ],
    "nextCursor": {
        "createdAt": "2024-09-22T16:56:42.000Z",
        "id": 1
    }
}

불러오기 실패

{
   "Database error"
}

장소별 추억 불러오기

Syntax

GET /memories?location=value

query string을 지정하여 특정 장소의 추억을 최신순으로 불러옵니다.

value 정의

  • SEA: 바다
  • SKY: 하늘
  • MOUNTAIN: 산

날짜별 추억 불러오기

Syntax

GET /memories?date=value

query string을 지정하여 특정 날짜의 값을 불러옵니다.

Value값 정의

  • TODAY: 오늘
  • YESTERDAY: 어제
  • DBY: 그저께(day before yesterday)

개별 추억 불러오기

Syntax

GET /memories/{id}

id로 개별 상세 기억 불러오기

Response 불러오기 성공 status code: 200

{
   "id": 5,
   "nickname": "이름3",
   "image_url": "https://cloudimage.kr.object.ncloudstorage.com/OYoy1wLf1cEugV-xWOuMM.jpeg",
   "message": "message2",
   "location": "SEA",
   "size": 1,
   "created_at": "2024-09-24T14:47:13.000Z"
}

지운 사진 개수 업데이트하기

Syntax

POST /update-photos-deleted-total
-d {
   "count": 2
}

Response 업데이트 성공 status code: 200

{
    "message": "누적된 photos_deleted_count 저장 완료",
    "totalPhotosDeleted": 12
}

업데이트 실패 status code: 500

{
   "서버 오류"
}

먼지 요약 정보 불러오기

Syntax

GET /cloud-cleanup-summary

Response 업데이트 성공 status code: 200

{
    "deletedPhotoCount": 12,
    "peopleCount": 1,
    "avgPhotoSize": 0.25
}

업데이트 실패 status code: 500

{
   "서버 에러"
}