개발자 블로그

Project Description 본문

프로젝트/중고거래 플랫폼 Project

Project Description

hayongwoon 2022. 7. 8. 15:12
DB DIAGRAM

 

URI & Method Summary
API endpoint method
회원가입 users/signup/ POST
로그인 users/login/ POST
로그아웃 users/logout/ POST
프로필 users/<userId>/profile/ GET, PUT, DELETE
구매 목록 조회 users/<userId>/purchaselist/ GET
판매 목록 조회 users/<userId>/sellinglist/ GET
찜 목록 조회 users/<userId>/likelist/ GET
상품 products/ POST, GET
products/<productId>/ GET, PUT, DELETE
댓글 products/<productId>/comments/ POST, GET
products/<productId>/comments/<commentId>/ GET, PUT, DELETE
좋아요 products/<productId>/like/ POST, DELETE
거래 완료 products/<productId>/deal/ POST

 

API 문서

1. Domain: localhost

2. Port: 8000

3. API LIST

 

3.1 USER

- 회원 가입

더보기
  • endpoint: /users/signup/
  • method: POST
  • Request
{
    "username": "username",
    "password": "password",
    "phone": "01012345678",
    "fullname": "hayongwoon",
    "userprofile":{
        "get_watchlist":[1,2,3],
        "introduction": "hi my name is hayongwoon",
        "birthday": "1994-04-26",
        "age": 29
    }
}

- 로그인

더보기
  • endpoint: /users/login/
  • method: POST
  • Request
{
    "username":"username",
    "password":"password"
}

- 로그아웃

더보기
  • endpoint: /users/logout/
  • method: POST
  • Request: None

- 프로필 조회

더보기
  • endpoint: /users/<userId>/profile/
  • method: GET
  • Request: None

- 프로필 수정

더보기
  • endpoint: /users/<userId>/profile/
  • method: PUT
  • Request
{
    "username": "login_user",
    "password": "password",
    "phone": "phonenumber",
    "fullname": "hayongwoon",
    "userprofile": {
        "get_watchlist": [1 or 2 or 3],
        "introduction": "hi my name is hayongwoon",
        "birthday": "1994-03-26",
        "age": 19
    }
}

- 회원 계정 비활성화

더보기
  • endpoint: /users/<userId>/profile/
  • method: DELETE
  • Request: None

- 사용자 판매 목록

더보기
  • endpoint: /users/<userId>/sellinglist/
  • method: GET
  • Request: None

- 사용자 구매 목록

더보기
  • endpoint: /users/<userId>/purchaselist/
  • method: GET
  • Request: None

- 사용자 찜한 목록

더보기
  • endpoint: /users/<userId>/likelist/
  • method: GET
  • Request: None

 

3.2 PRODUCT

- 상품 등록

더보기
  • endpoint: /products/
  • method: POST
  • Request

- 단일 상품 조회

더보기
  • endpoint: /products/<productId>/
  • method: GET
  • Request: None

- 상품 수정

더보기
  • endpoint: /products/<productId>/
  • method: PUT
  • Request

- 상품 삭제

더보기
  • endpoint: /products/<productId>/
  • method: DELETE
  • Request: None

 

3.3 COMMENT

- 상품 댓글 등록

더보기
  • endpoint: /products/<productId>/comments/
  • method: POST
  • Request
{
    "content":"content test!!"
}

- 상품의 모든 댓글 조회

더보기
  • endpoint: /products/<productId>/comments/
  • method: GET
  • Request: None

- 상품의 단일 댓글 조회

더보기
  • endpoint: /products/<productId>/comments/<commentId>/
  • method: GET
  • Request: None

- 댓글 수정

더보기
  • endpoint: /products/<productId>/comments/<commentId>/
  • method: PUT
  • Request
{
    "content":"content put test"
}

- 댓글 삭제

더보기
  • endpoint: /products/<productId>/comments/<commentId>/
  • method: DELETE
  • Request: None

 

3.4 LIKE

- 상품 좋아요

더보기
  • endpoint: /products/<productId>/like/
  • method: POST
  • Request: None

- 상품 좋아요 취소

더보기
  • endpoint: /products/<productId>/like/
  • method: DELET
  • Request: None

 

3.5 SUCCESS DEAL 

- 판매 완료 및 판매자 평가

더보기
  • endpoint: /products/<productId>/deal/
  • method: POST
  • Request
{
    "review": "좋은 거래였습니다.",
    "rating": 5
}