newsfeed.api (1.0.0)

Download OpenAPI specification:Download

Auth

로그인(토큰 생성), 로그아웃(토큰 소멸), 토큰 리프레시 등 api 서버 사용 자격을 위한 api 입니다.

login

로그인을 통해 'accessToken', 'refreshToke' 을 얻을 수 있습니다. responseBody(앱 전용) 와 response cookie(웹 전용) 를 통해 주어지기 때문에 상황에 맞게 사용할 수 있습니다.

Request Body schema: application/json
email
required
string

이메일

password
required
string [ 8 .. 15 ] characters

비밀번호

Responses

Request samples

Content type
application/json
{
  • "email": "student@gmail.com",
  • "password": "12341234"
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

refresh

refreshToken 을 통한 리프레시로 인해 새로운 'accessToken', 'refreshToken' 을 얻게 됩니다.

Request Body schema: application/json
refreshToken
required
string

리프레시 토큰

Responses

Request samples

Content type
application/json
{
  • "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTQzNTU0OGRlNzQ1OGQxMWU0MWNhMzciLCJhdXRob3JpdGllcyI6WyJzdHVkZW50Il0sImlhdCI6MTY5OTEwOTc5NSwiZXhwIjoxNzAxNzAxNzk1fQ.yrkYW0KFu6ETQGWfq2Pi72gHDoSG2-q0gkVfglBHpdk"
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

logout

로그아웃을 통해 유저 데이터베이스 내 'hashedRefreshToken' 을 삭제합니다. 또한 response cookie 에 저장되는 'accessToken', 'refreshToken' 을 삭제합니다.

Authorizations:
bearerToken

Responses

Response samples

Content type
application/json
{
  • "message": "ok"
}

User

유저 생성, 조회, 삭제 등을 할 수 있는 api 입니다. '학생', '선생'에 대한 권한을 선택하게 됩니다.

findOne

액세스 토큰을 기반으로 유저 본인의 정보를 조회합니다.

Authorizations:
bearerToken

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": [
    ]
}

create

이메일, 비밀번호, 권한선택(선생, 학생)을 통해 유저를 생성합니다.

Request Body schema: application/json
email
required
string

이메일

password
required
string

비밀번호

authorities
required
Array of strings

권한 정보

Responses

Request samples

Content type
application/json
{
  • "email": "student@gmail.com",
  • "password": "12341234",
  • "authorities": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

deleteOne

액세스 토큰을 기반으로 유저 정보를 삭제합니다.

Authorizations:
bearerToken

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

Page

학교 페이지를 생성, 조회, 수정, 삭제 등을 할 수 있는 api 입니다. '선생' 권한을 갖는 유저만 이용이 가능합니다.

findOne

페이지 아이디를 기반으로 해당 페이지를 조회합니다.

Authorizations:
bearerToken
path Parameters
pageId
required
string
Example: 65430340d668b572348bfa1b

페이지 아이디

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

deleteOne

페이지 아이디를 기반으로 페이지를 삭제합니다.

Authorizations:
bearerToken
path Parameters
pageId
required
string
Example: 65430340d668b572348bfa1b

페이지 아이디

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

updateOne

페이지 아이디를 기반으로 해당 페이지를 수정합니다.

Authorizations:
bearerToken
path Parameters
pageId
required
string
Example: 65430340d668b572348bfa1b

페이지 아이디

Request Body schema: application/json
schoolName
string

학교 이름

Responses

Request samples

Content type
application/json
{
  • "schoolName": "부평남중학교"
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

find

페이지 리스트를 조회합니다.(테스트에 용이하도록 만들었습니다.)

Authorizations:
bearerToken

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": [
    ]
}

create

페이지를 생성합니다.

Authorizations:
bearerToken
Request Body schema: application/json
location
required
string

지역

schoolName
required
string

학교 이름

Responses

Request samples

Content type
application/json
{
  • "location": "인천광역시 부평구 부평5동",
  • "schoolName": "부평남중학교"
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

News

학교 페이지 내 소식을 생성, 조회, 수정, 삭제 등을 할 수 있는 api 입니다. '선생' 권한을 갖는 유저만 이용이 가능합니다.

find

생성된 모든 소식 리스트를 조회합니다.(테스트가 용이하도록 만들었습니다.)

Authorizations:
bearerToken

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": [
    ]
}

deleteOne

소식 아이디를 기반으로 소식을 삭제합니다.

Authorizations:
bearerToken
path Parameters
newsId
required
string
Example: 6543558fde7458d11e41ca46

소식 아이디

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

updateOne

소식 아이디를 기반으로 소식을 수정합니다.

Authorizations:
bearerToken
path Parameters
newsId
required
string
Example: 6543558fde7458d11e41ca46

소식 아이디

Request Body schema: application/json
title
string

소식 제목

content
string

소식 내용

Responses

Request samples

Content type
application/json
{
  • "title": "news1",
  • "content": "1234"
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

create

특정 페이지에 소식을 생성합니다.

Authorizations:
bearerToken
Request Body schema: application/json
title
required
string

소식 제목

content
string

소식 내용

pageId
required
string

페이지 아이디

Responses

Request samples

Content type
application/json
{
  • "title": "news1",
  • "content": "1234",
  • "pageId": "65430340d668b572348bfa1b"
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

Subscription

학교 페이지에 대한 구독을 처리하는 api 입니다. 구독하기, 구독조회, 구독취소, 구독한 페이지 리스트 조회, 구독한 페이지 내 소식 리스트 조회, 구독한 모든 페이지에 대한 소식 조회 등을 할 수 있는 api 입니다. '학생' 권한을 갖는 유저만 이용이 가능합니다.

findSubscribedPages

구독한 모든 페이지를 조회합니다.

Authorizations:
bearerToken

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": [
    ]
}

findSubscribedPageNews

구독한 특정 페이지의 소식들을 최신순으로 조회합니다.

Authorizations:
bearerToken
path Parameters
pageId
required
string
Example: 65430340d668b572348bfa1b

페이지 아이디

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": [
    ]
}

findAllSubscribedPagesNews

구독한 모든 페이지들의 소식들을 최신순으로 조회합니다.

Authorizations:
bearerToken

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": [
    ]
}

deleteOne

구독 아이디를 기반으로 구독을 해지합니다.

Authorizations:
bearerToken
path Parameters
subscriptionId
required
string
Example: 65435a5b0692d7cba8a9f051

구독 아이디

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}

create

특정 페이지를 구독합니다.

Authorizations:
bearerToken
Request Body schema: application/json
pageId
required
string

페이지 아이디

Responses

Request samples

Content type
application/json
{
  • "pageId": "65430340d668b572348bfa1b"
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "payload": {
    }
}