Url | Method | Description | Authorization |
---|---|---|---|
/auth/signin | GET | sign in (log in) | None |
/auth/signout | GET | sign out (log out) | None |
/auth/signup | POST | sign up (register) | None |
Url | Method | Description | Authorization |
---|---|---|---|
/users | GET | get user list | None |
/users | POST | update current user | Required |
/users/:id | GET | get user by id | None |
Url | Method | Description | Authorization |
---|---|---|---|
/comments | GET | get comment list | None |
/comments | POST | add comment | Required |
/comments/:id | GET | get comment by id | None |
/comments/:id | DELETE | delete comment by id | Required |
/comments/:id/like | POST | like comment by id | Required |
/comments/:id/dislike | POST | dislike comment by id | Required |
Url | Method | Description | Authorization |
---|---|---|---|
/files/prodile | POST | upload profile image | None |
- Response Form
{
"request": "/request_path",
"status": status code (int)
}
- Status Code
Code | Description |
---|---|
200 | Success |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
409 | Conflict |
500 | Server Error |
{
"request": "/request_path",
"status": status code (int),
"reason": "reason for this error"
}
- POST /auth/signin
- Parameter
Key | Value Type | Required | Default |
---|---|---|---|
id | String | yes | |
password | String | yes |
- Response
{
"request": "/auth/signin",
"status": 200,
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/test.jpg"
}
}
- GET /auth/signout
- Response
{
"request": "/auth/signout",
"status": 200
}
- POST /auth/signup
- Parameter
Key | Value Type | Required | Default |
---|---|---|---|
id | String(3-20) | yes | |
password | String(3-20) | yes | |
name | String(1-20) | yes | |
description | String | no | |
profile_image_url | String | no |
- Response
{
"request": "/auth/signup",
"status": 200,
"user": {
"uid": 50,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
}
}
- GET /users
- Parameter
Key | Value Type | Required | Default |
---|---|---|---|
page | Integer | no | 1 |
size | Integer | no | 15 |
- Response
{
"request": "/users",
"status": 200,
"size": 15,
"totalPage": 1,
"page": 1,
"last": true,
"first": true,
"users": [
{
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
}
]
}
- POST /users
- Parameter
Key | Value Type | Required | Default |
---|---|---|---|
uid | Integer | yes | |
id | String | yes | |
password | String(3-20) | yes | |
name | String(1-20) | yes | |
description | String | no | |
profile_image_url | String | no |
- Response
{
"request": "/users",
"status": 200,
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
}
}
- GET /users/{id:[0-9]+}
- Response
{
"request": "/users/1",
"status": 200,
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
}
}
- GET /comments
- Parameter
Key | Value Type | Required | Default |
---|---|---|---|
page | Integer | no | 1 |
size | Integer | no | 15 |
- Response
{
"request": "/comments",
"status": 200,
"size": 15,
"totalPage": 1,
"page": 1,
"last": true,
"first": true,
"comments": [
{
"cid": 1,
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
},
"comment": "i'm Harry!",
"like": 1,
"dislike": 0,
"created_at": "2016-06-15 15:42:29"
}
]
}
- POST /comments
- Parameter
Key | Value Type | Required | Default |
---|---|---|---|
commentStr | String | yes |
- Response
{
"request": "/comments",
"status": 200,
"comment": {
"cid": 122,
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
},
"comment": "I'm Harry!",
"like": 0,
"dislike": 0,
"created_at": "2016-06-16 04:43:10"
}
}
- GET /comments/{id:[0-9]+}
- Response
{
"request": "/comments/1",
"status": 200,
"comment": {
"cid": 1,
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
},
"comment": "i'm Harry!",
"like": 1,
"dislike": 0,
"created_at": "2016-06-15 15:42:29"
}
}
- DELETE /comments/{id:[0-9]+}
- Response
{
"request": "/comments/1",
"status": 200,
"cid": 1
}
- GET /comments/{id:[0-9]+}/like
- Response
{
"request": "/comments/1/like",
"status": 200,
"opinion": {
"type": "LIKE",
"comment": {
"cid": 1,
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
},
"comment": "i'm Harry!",
"like": 3,
"dislike": 2,
"created_at": "2016-06-15 15:42:29"
},
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
}
}
}
- GET /comments/{id:[0-9]+}/dislike
- Response
{
"request": "/comments/1/dislike",
"status": 200,
"opinion": {
"type": "DISLIKE",
"comment": {
"cid": 1,
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
},
"comment": "i'm Harry!",
"like": 3,
"dislike": 3,
"created_at": "2016-06-15 15:42:29"
},
"user": {
"uid": 1,
"id": "harry.jk",
"name": "Harry",
"description": "Software Engineer",
"profile_image_url": "/resources/harry.jpg"
}
}
}
- POST /files/profile
- Parameter
Key | Value Type | Required | Default |
---|---|---|---|
file | MultipartFile | yes |
- Response
{
"request": "/files/profile",
"status": 200,
"image": "/resources/profile/ffa745e8fc2558a4281985f6da8eae9a994bea1ejpg"
}