자몽 웹사이트 API
  • Welcome!
  • Reference
    • API Reference
      • User
      • Volunteer
      • Post
      • Application
Powered by GitBook
On this page
  • POST
  • 봉사활동 등록
  • 봉사활동 이미지 등록
  • 봉사활동 신청
  • 관심있는 봉사에 추가
  • 봉사에 댓글 등록
  • GET
  • 전체 봉사활동 조회
  • 봉사활동 조회
  • PATCH
  • 봉사활동 정보 변경
  • 봉사활동 이미지 변경
  • DELETE
  • 봉사활동 삭제
  1. Reference
  2. API Reference

Volunteer

봉사 활동 관련 요청

POST

봉사활동 등록

POST URL/v1/volunteers

새로운 봉사활동을 등록합니다.

form-data

KEY request

Headers

Name
Type
Description

Content-Type

String

application/json

Request Body

Name
Type
Description

title*

String

봉사 제목

volunteerDate*

Long

봉사 일시

applicationDate*

Long

신청 일시

maximumPeople*

Long

모집 최대 인원 (default = 0)

content*

String

봉사 내용

currentPeople

Long

현재 봉사 신청 인원 (default = 0)

 {
        "id": 1,
        "title": "봉사 제목",
        "picture": {
            "id": 1,
            "url": "https://jamong-bucket.s3.ap-northeast-2.amazonaws.com/ee1e5e11-da2f-4025-8c06-a1f5c52ee459IMG_20201208_094450.jpg",
            "fileName": "ee1e5e11-da2f-4025-8c06-a1f5c52ee459IMG_20201208_094450.jpg"
        },
        "volunteerDate": 1654408800,
        "applicationDate": 1654408800,
        "maximumPeople": 20,
        "currentPeople": 0
}

봉사활동 이미지 등록

POST URL/v1/volunteers

봉사활동 이미지를 등록합니다.

form-data

KEY file

{
    "https://jamong-bucket.s3.ap-northeast-2.amazonaws.com/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202022-04-16%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%208.36.221654611002334.png"
}

봉사활동 신청

POST URL/v1/volunteers/{id}/apply

Request Body

Name
Type
Description

email*

String

유저 이메일로 해당 봉사를 신청합니다.

{
    // Response
}

관심있는 봉사에 추가

POST URL/v1/volunteers/{id}/favorites

{
    // Response
}

봉사에 댓글 등록

POST URL/v1/volunteers/{id}/comments

Request Body

Name
Type
Description

email*

String

사용자 이메일 주소

content*

String

댓글 내

GET

전체 봉사활동 조회

GET URL/v1/volunteers

데이터 베이스에있는 봉사활동들을 페이지에 맞게 조회합니다. page_number 파라미터값을 입력하지 않는다면, 자동으로 1부터 10까지의 게시물을 조회합니다.

Query Parameters

Name
Type
Description

from

Long

페이징 시작 번호

to

Long

페이징 마지막 번호

ordering

String

정렬 기준 컬럼 (앞에 -를 붙이면 내림차순 정렬)

Headers

Name
Type
Description

totalPage*

Integer

테이블에 있는 전체 봉사활동 개수

[
    {
        "id": 1,
        "title": "봉사 제목",
        "picture": {
            "id": 1,
            "url": "https://jamong-bucket.s3.ap-northeast-2.amazonaws.com/ee1e5e11-da2f-4025-8c06-a1f5c52ee459IMG_20201208_094450.jpg",
            "fileName": "ee1e5e11-da2f-4025-8c06-a1f5c52ee459IMG_20201208_094450.jpg"
        },
        "volunteerDate": 1654408800,
        "applicationDate": 1654408800,
        "maximumPeople": 20,
        "currentPeople": 0
    },
    {
        "id": 2,
        "title": "봉사 제목",
        "picture": {
            "id": 2,
            "url": "https://jamong-bucket.s3.ap-northeast-2.amazonaws.com/f5c2b07b-28ce-4b4c-aa83-c87d222a331dIMG_20201208_094450.jpg",
            "fileName": "f5c2b07b-28ce-4b4c-aa83-c87d222a331dIMG_20201208_094450.jpg"
        },
        "volunteerDate": 1654408800,
        "applicationDate": 1654408800,
        "maximumPeople": 20,
        "currentPeople": 0
    },
    {
        "id": 3,
        "title": "봉사 제목",
        "picture": null,
        "volunteerDate": 1654408800,
        "applicationDate": 1654408800,
        "maximumPeople": 20,
        "currentPeople": 0
    }
]
{
    // Response
}

PageNo는 1이면 1 -10, 2이면 11-20과 같이 페이지에 맞는 봉사활동을 10개씩 가져옵니다.

봉사활동 조회

GET URL/v1/volunteers/{id}

id에 해당하는 봉사활동을 조회합니다.

pictures는 대표이미지인 첫번째 사진만 표시됩니다.

{
    "id": 1,
    "title": "봉사 제목",
    "content": "봉사 내용입니다.",
    "pictures": [],
    "volunteerDate": 1654408800,
    "applicationDate": 1654408800,
    "maximumPeople": 20,
    "currentPeople": 0,
    "applicants": [
        {
            "createdDate": "2022-07-01T15:33:25.499",
            "modifiedDate": "2022-07-01T15:33:25.499",
            "id": 1,
            "naverId": null,
            "profileImage": null,
            "gender": "M",
            "email": "lkjxxx@naver.com",
            "mobile": "010-5913-xxxx",
            "mobileE164": "+82105913xxxx",
            "name": "이민재",
            "role": "GUEST",
            "cardinalNumber": "NEW"
        }
    ]
}

PATCH

주의사항 : form-data는 PATCH 메서드를 지원하지 않아 해당 게시물 주소로 반드시 POST로 요청을 보내주어야 합니다.

봉사활동 정보 변경

POST URL/v1/volunteers/{id}

id에 해당하는 봉사활동의 데이터를 변경합니다.

form-data

KEY request

Request Body

Name
Type
Description

title

String

봉사 제목

content

String

봉사 내용

picture

String

봉사 관련 사진

volunteerDate

Long

봉사 일시

applicationDate

Long

신청일시

maximumPeople

Long

모집 최대 인원 (default = 0)

currentPeople

Long

현재 봉사 신청 인

{
    // Response
}
{
    // Response
}

봉사활동 이미지 변경

POST URL/v1/volunteers{id}

봉사활동 이미지를 변합니다.

form-data

KEY file

DELETE

봉사활동 삭제

DELETE URL/v1/volunteers/{id}

id에 해당하는 봉사활동의 정보를 데이터베이스에서 삭제합니다.

{
    // Response
}
{
    // Response
}
PreviousUserNextPost

Last updated 2 years ago