Skip to content

API Docs ‐ VoteContent

6suhyeon edited this page Jul 29, 2024 · 3 revisions

API Documentation

Endpoints

1. Save Vote Content

- 투표하기

  • Endpoint: /vote-content
  • Method: POST
  • Request:
    • userId : UUID
    • voteId : UUID
    • voteItemList : VoteItem(voteItemId)
      • voteItemId : UUID
  • Request Example:
{
    "userId" : "30dff0b5-5d89-41d4-bfef-bbfbbf249f4b",
    "voteId" : "8030f0f2-9dad-4b3c-8b7c-76a8c5fd2c2b",
    "voteItemList" : ["b3bd9f36-1e69-4ac9-9da7-cc8b37d8f271", "13c224e6-7264-4a0a-83c4-b21df5fa69ff"]
}
  • Response:
    • success : Boolean
    • message : String
    • userId : UUID (unique)
  • Response Example:
  • Response Success Example
{
    "success": true,
    "voterId": "30dff0b5-5d89-41d4-bfef-bbfbbf249f4b",
    "message": "투표하기 성공"
}
  • Response Failure Example
{
    "success": false,
    "message": "투표하기 시 DAO 저장 실패",
    "voterId": null
}

2. Get Vote Content Result

- 투표 결과 조회

  • Endpoint: /vote-content/vote/{voteId}

  • Method: GET

  • Request: : None

  • Response:

    • success : Boolean
    • message : String
    • voteInfo : Vote(voteId, voteIntro, endAt, voteCount, voteItemList)
      • voteId : UUID
      • voteIntro : String
      • endAt : LocalDateTime
      • voteCount : Integer
      • voteItemList : VoteItem(voteItemId, voteItemCount)
        • voteItemId : UUID
        • voteItemCount : Integer
  • Response Example:

  • Response Success Example

{
    "success": true,
    "voteInfo": {
        "voteId": "f9122fb5-2ba7-4422-916d-11c839fb9fa6",
        "voteIntro": "",
        "endAt": "2024-07-20T11:00:00",
        "voteCount": 2,
        "voteItemList": [
            {
                "voteItemId": "4bbe3793-2c2d-46ae-8386-bb29bd1ed312",
                "voteItemCount": 2
            },
            {
                "voteItemId": "cf0602d1-1cce-4fa8-95ed-be458dddcbbe",
                "voteItemCount": 0
            }
        ]
    },
    "message": "투표 결과 조회 성공"
}
  • Response Failure Example
{
    "success": false,
    "message": "투표 결과 조회 시 DAO 검색 실패",
    "voteInfo": null
}

3. Get Vote Content

- 투표 세부사항 조회

  • Endpoint: /vote-content/vote/{voteId}/user/{userId}

  • Method: GET

  • Request: : None

  • Response:

    • success : Boolean
    • message : String
    • voteInfo : Vote(voteId, voteIntro, endAt, voteCount, isDuplication, voteItemList)
      • voteId : UUID
      • voteIntro : String
      • endAt : LocalDateTime
      • voteCount : Integer
      • isDuplication : Boolean
      • voteList : VoteItem(voteItemId, voteItemContent)
        • voteItemId : UUID
        • voteItemContent : String
  • Response Example:

  • Response Success Example

{
    "success": true,
    "voteInfo": {
        "voteId": "f9122fb5-2ba7-4422-916d-11c839fb9fa6",
        "voteIntro": "동물",
        "endAt": "2024-07-20T11:00:00",
        "isDuplication": true,
        "voteItemList": [
            {
                "voteItemId": "4bbe3793-2c2d-46ae-8386-bb29bd1ed312",
                "voteItemContent": "강아지"
            },
            {
                "voteItemId": "cf0602d1-1cce-4fa8-95ed-be458dddcbbe",
                "voteItemContent": "고양이"
            }
        ]
    },
    "message": "투표 세부 조회 성공"
}
  • Response Failure Example
{
    "success": false,
    "message": "투표 세부사항 조회 시 DAO 검색 실패",
    "voteInfo": null
}

Clone this wiki locally