재구성 해본 api
User
Body:
{
"user": {
"id": 0,
"username": "string",
"nickname": "string",
"auth_id": "string",
"snowball_count": 0,
"main_snowball_id": 0,
"snowball_list": [
0
],
"message_count": 0
},
"main_snowball": {
"title": "string",
"id": 0,
"is_message_private": true,
"main_decoration_id": 0,
"main_decoration_color": "string",
"bottom_decoration_id": 0,
"bottom_decoration_color": "string",
"message_list": [
{
"id": 0,
"decoration_id": 0,
"decoration_color": "string",
"letter_id": 0,
"content": "string",
"sender": "string",
"opened": "2023-12-05T07:44:14.115Z",
"created": "2023-12-05T07:44:14.115Z",
"sentiment": "string",
"confidence": 0,
"location": 0
}
]
}
}
닉네임을 설정하지 않거나 첫 유저인 경우
Request
Response
{
"nickname": "string"
}
Snowball
POST : 스노우볼 생성
Request Body:
{
"title": "string",
"main_decoration_id": 0,
"main_decoration_color": "#FFFFFF",
"bottom_decoration_id": 0,
"bottom_decoration_color": "#FFFFFF",
"is_message_private": true
}
Response :
{
"title": "string",
"id": 0,
"is_message_private": true,
"main_decoration_id": 0,
"main_decoration_color": "string",
"bottom_decoration_id": 0,
"bottom_decoration_color": "string",
"message_list": []
}
PUT /{snowball_id} : 스노우볼 설정 업데이트
Request Body:
{
"title": "string",
"is_message_private": true
}
Response:
{
"snowball_id": 0,
"title": "string",
"is_message_private": true
}
GET /{snowball_id} : 스노우볼 조회
200 OK
Body:
{
"title": "string",
"id": 0,
"is_message_private": true,
"main_decoration_id": 0,
"main_decoration_color": "string",
"bottom_decoration_id": 0,
"bottom_decoration_color": "string",
"message_list": [
{
"id": 0,
"decoration_id": 0,
"decoration_color": "string",
"letter_id": 0,
"content": "string",
"sender": "string",
"opened": "2023-12-05T07:48:07.142Z",
"created": "2023-12-05T07:48:07.142Z",
"sentiment": "string",
"confidence": 0,
"location": 0
}
]
}
PUT /{snowball_id}/decoration : 스노우볼 메인 장식 업데이트
Request Body:
{
"main_decoration_id": 0,
"main_decoration_color": "#FFFFFF",
"bottom_decoration_id": 0,
"bottom_decoration_color": "#FFFFFF"
}
Response:
{
"main_decoration_id": 0,
"main_decoration_color": "#FFFFFF",
"bottom_decoration_id": 0,
"bottom_decoration_color": "#FFFFFF"
}
Message:
POST /message/{snowball_id} : 메세지 생성
Request Body:
{
"sender": "string",
"content": "string",
"decoration_id": 1,
"decoration_color": "#FFFFFF",
"letter_id": 1
}
Response:
201 Created
Body: 갱신한 정보
{
"sender": "string",
"content": "string",
"location": 0,
"sentiment": "string",
"confidence": 0
}
DELETE /{message_id} : 메세지 삭제
GET : 메세지 조회
Response:
[
{
"id": 0,
"decoration_id": 0,
"decoration_color": "string",
"letter_id": 0,
"content": "string",
"sender": "string",
"opened": "2023-12-05T07:48:21.674Z",
"created": "2023-12-05T07:48:21.674Z",
"sentiment": "string",
"confidence": 0,
"location": 0
}
]
PUT /{message_id} : 메세지 오픈 처리
"id": 0,
"decoration_id": 0,
"decoration_color": "string",
"letter_id": 0,
"content": "string",
"sender": "string",
"opened": "2023-12-05T07:49:12.729Z",
"created": "2023-12-05T07:49:12.729Z",
"sentiment": "string",
"confidence": 0,
"location": 0
}
flowchart TD
A[App Module] <--- B[Auth Module]
A <--- C[User Module]
C <--- D[Snowball Module]
D <--- E[Message Module]