Skip to content

Latest commit

 

History

History
1425 lines (1166 loc) · 31.2 KB

File metadata and controls

1425 lines (1166 loc) · 31.2 KB

nodejs-httpserver

Develope http-streaming-server

Completed - 1

(2020/05/18 ~ 2020/05/27)


  • users

    • Get/ ./users/

    • Response JSON about all of users

      image

    • Get/ ./users/:id/

    • Response JSON about a user

      image

    • Post/ ./users/

    • Register a user ( Inster a user )

      image

    • Put/ ./users/

    • Update data of a user

      image

    • Delete/ ./users/

    • Delete a user

      image

      image


    • Post/ ./users/auth/
    • Check authorization(login) of a user
    • Android 에서 테스트 완료
  • contents ( image or video )

    • Get/ ./contents/:contentId

    • Response content with content ID

      image

    • Get/ contents/capsule-id/:capsuleId

    • Response contentID

    • Post/ ./contents/

    • Upload a content or a nubmer of contents

    • with multipart/form-data

      image

    • Put/ ./contents/ Dont need

    • Dont develope

    • Delete/ ./contents/contentId

    • Delete a content

Completed - 2

( 2020/05/28 ~ 2020/06/03 )


  • capsules

    • Get/ ./capsules/

    • Response JSON about all of Capsules

      image

    • Get/ ./capsules/capsuleID

    • Response JSON about a Capsule

      image

    • Get/ ./capsules/location?lat=__&lng=__

    • Response Json about capsules within 5KM

      image

    • Get/ ./capsules/user?user_id=__

    • Response Json about capsules of a user

      image

    • Post/ ./capsules

    • Post a capsule temporarily

      image

    • Put/ ./capsules

    • Complete a posted capsule

    • with multipart/form-data

      image

      • 결과

      image

    • Delete/ ./capsules

    • Delete all about a capsule

      image

      • 결과

      image

Completed - 3

( 2020/7/5 ~ 2020/7/8 )


Follow - 1

Post Follow

  • Post/ ./follow/

    • user's follow is added 1
    • dest's follwer is added 1
    • create a row of follow table in DB
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

{
    "nick_name" : "__",
    "dest_nick_name" : "__" 
}

Response Form Sample

    [
        {
        nick_name: "nick11",
        first_name: "민성",
        last_name: "박",
        date_created: "2020-06-14T19:17:46.000Z",
        date_updated: "2020-06-14T19:17:46.000Z",
        follow: 1,
        follower: 0,
        image_url: "http://118.44.168.218:7070/contents/1592162266492.jpg",
        image_name: "1592162266492.jpg"
        },

        {
            ...
        },

        {
            ...
        }
    ]

Delete follow

  • Delete/ ./follow?nick_name="__"&dest_nick_name="__"

    • user's follow is subtracted 1
    • dest's follower is subtracted 1
    • delete a row of follow table in DB
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/like?nick_name="__"&dest_nick_name="__"

Response Form Sample

{
   "success": true
}

Post Like

  • Post/ ./like/

    • like of the capsule of user is added 1
    • create a row of like table in DB
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form sample

{
    "capsule_id" : __,
    "nick_name" : "__" 
}

Response Form sample

{
   "success": true
}

Delete Like

  • Delete/ ./like?capsule_id=__&nick_name="__"

    • like of the capsule of user is subtracted 1
    • delete a row of like table in DB
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form sample

http://address:port/like?capsule_id=__&nick_name="__"

Response Form sample

{
   "success": true
}

Completed - 4

( 2020/7/8 ~ 2020/7/10 )


Follow - 2

Get Follow List

  • Get/ ./follow/followlist/:nickName

    • response followlist of A user has nickName
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/follow/followlist/"Input the Nick"

Response Form Sample

    [
        {
        nick_name: "nick11",
        first_name: "민성",
        last_name: "박",
        date_created: "2020-06-14T19:17:46.000Z",
        date_updated: "2020-06-14T19:17:46.000Z",
        follow: 1,
        follower: 0,
        image_url: "http://118.44.168.218:7070/contents/1592162266492.jpg",
        image_name: "1592162266492.jpg"
        },

        {
            ...
        },

        {
            ...
        }
    ]

Get Follower List

  • Get/ ./follow/followerlist/:nickName

    • response followerlist of A user has nickName
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/follow/followerlist/"Input the Nick"

Response Form Sample

    [
        {
        nick_name: "nick11",
        first_name: "민성",
        last_name: "박",
        date_created: "2020-06-14T19:17:46.000Z",
        date_updated: "2020-06-14T19:17:46.000Z",
        follow: 1,
        follower: 0,
        image_url: "http://118.44.168.218:7070/contents/1592162266492.jpg",
        image_name: "1592162266492.jpg"
        },

        {
            ...
        },

        {
            ...
        }
    ]

Get Capsules with Nick Name

  • Get/ ./capsules/nick/:nickName

    • response capsulelist of A user has nickName
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/capsule/nick/"Input the Nick"

Response Form Sample

[
    {
        capsule_id: 63,
        user_id: "hhheum",
        nick_name: "nick12",
        title: "hhh",
        text: "hhh",
        likes: 0,
        views: 0,
        date_created: "2020-07-07T13:37:01.000Z",
        date_opened: "2020-07-07T13:37:01.000Z",
        status_temp: 0,
        lat: 56,
        lng: 100,
        content: [
            {
                content_id: null,
                url: null
            }
        ]
    },
    {
        capsule_id: 62,
        user_id: "hhheum",
        nick_name: "nick12",
        title: "소영이랑 첫 여행!!",
        text: "소영이랑 첫 여행으로 부산에 캡슐!! 너무 더워서 기억에 남던 여행~~ 다음에 올때는 우리가 어떻게 달라져있을지 궁금하다~~",
        likes: 0,
        views: 0,
        date_created: "2020-07-01T05:22:17.000Z",
        date_opened: "2020-07-01T05:22:17.000Z",
        status_temp: 0,
        lat: 35.1567,
        lng: 129.1524,
        content: [
            {
                content_id: 58,
                url: "http://118.44.168.218:7070/contents/1593581760709.jpg"
            },
            {
                content_id: 59,
                url: "http://118.44.168.218:7070/contents/1593581760717.jpg"
            }
        ]
    }
]

Post Capsules

  • Post/ ./capsules

    • Post a capsule stored temporally
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

{
	"nick_name" : "__",
	"lat": __,
	"lng": __
}

Response Form Sample

{
    "success": true
}

Get Comment

  • Get/ ./comment/list/:capsule_id

    • response list of comments
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/comment/list/"Input the Capsule Id"

Response Form Sample

[
    {
        nick_name: "nick12",
        comment: "comment Test1",
        date_created: "2020-07-09T15:44:27.000Z",
        date_updated: "2020-07-09T15:44:27.000Z",
        replies: [ ]
    },
    {
        nick_name: "nick12",
        comment: "comment Test2",
        date_created: "2020-07-09T15:44:31.000Z",
        date_updated: "2020-07-09T15:44:31.000Z",
        replies: [
            {
                nick_name: "nick12",
                comment: "comment Test9",
                date_created: "2020-07-09T15:46:13.000Z",
                date_updated: "2020-07-09T15:46:13.000Z"
            }
        ]
    },
    {
        nick_name: "nick12",
        comment: "comment Test3",
        date_created: "2020-07-09T15:44:33.000Z",
        date_updated: "2020-07-09T15:44:33.000Z",
        replies: [ ]
    },
    {
        nick_name: "nick12",
        comment: "comment Test4",
        date_created: "2020-07-09T15:44:36.000Z",
        date_updated: "2020-07-09T15:44:36.000Z",
        replies: [
            {
                nick_name: "nick12",
                comment: "comment Test6",
                date_created: "2020-07-09T15:46:01.000Z",
                date_updated: "2020-07-09T15:46:01.000Z"
            },
            {
                nick_name: "nick12",
                comment: "comment Test7",
                date_created: "2020-07-09T15:46:05.000Z",
                date_updated: "2020-07-09T15:46:05.000Z"
            },
            {
                nick_name: "nick12",
                comment: "comment Test8",
                date_created: "2020-07-09T15:46:08.000Z",
                date_updated: "2020-07-09T15:46:08.000Z"
            }
        ]
    },
    {
        nick_name: "nick12",
        comment: "comment Test5",
        date_created: "2020-07-09T15:44:40.000Z",
        date_updated: "2020-07-09T15:44:40.000Z",
        replies: [ ]
    }
]

Post Capsules

  • Post/ ./comment

    • Create a Comment
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

  • case 1 (Parent Comment)
{
    "user_id" : "__",
    "capsule_id" : __,
    "nick_name" : "__",
    "conmment": ""
}
  • case 2 (Child Comment : reply)
{
    "user_id" : "__",
    "capsule_id" : __,
    "nick_name" : "__",
    "conmment": "",
    "parent_id": __
}

Response Form Sample

{
   "success": true
}

Delete Comment

  • Delete/ ./comment/:id

    • Delete a Comment
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/comment/"Input the Comment ID"

Response Form Sample

{
   "success": true
}

Delete Reply

  • Delete/ ./comment/reply/:id

    • Delete a Reply
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/comment/reply/"Input the Comment ID"

Response Form Sample

{
   "success": true
}

Users


Post Users Authorization

  • Post/ ./users/auth

    • Post authrization info
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

{
   "user_id": "__",
   "password": __,
}

Response Form Sample

{
   "nick_name": "__"
}

Completed - 5

(2020/07/11 ~ 2020/7/26)

  • Update Get-Comment-list Router(Add user_image_url) and Post-Comment,Reply (delete user_id)
  • Update Get-capsules Router (with location, with nick_name, with capsule id)
  • Add Session Router (Restful server and android app)
  • Add Logout Router (Destroy Session)

Comment list


Get Comment

  • Get/ ./comment/list/:capsule_id

    • response list of comments
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/comment/list/"Input the Capsule Id"

Response Form Sample

[
    {
        nick_name: "nick11",
        comment: "Test1",
        date_created: "2020-07-15T11:49:04.000Z",
        date_updated: "2020-07-15T11:49:04.000Z",
        user_image_url: "http://211.248.58.81:7070/contents/1592162266492.jpg",
        replies: [
            {
                nick_name: "nick11",
                comment: "Test5",
                date_created: "2020-07-15T11:49:39.000Z",
                date_updated: "2020-07-15T11:49:39.000Z",
                user_image_url: "http://211.248.58.81:7070/contents/1592162266492.jpg"
            },
            {
                nick_name: "nick11",
                comment: "Test6",
                date_created: "2020-07-15T11:49:43.000Z",
                date_updated: "2020-07-15T11:49:43.000Z",
                user_image_url: "http://211.248.58.81:7070/contents/1592162266492.jpg"
            },
            {
                nick_name: "nick11",
                comment: "Test7",
                date_created: "2020-07-15T11:49:46.000Z",
                date_updated: "2020-07-15T11:49:46.000Z",
                user_image_url: "http://211.248.58.81:7070/contents/1592162266492.jpg"
            },
            {
                nick_name: "nick12",
                comment: "Test10",
                date_created: "2020-07-15T11:50:10.000Z",
                date_updated: "2020-07-15T11:50:10.000Z",
                user_image_url: "http://211.248.58.81:7070/contents/1592162405325.jpg"
            },
            {
                nick_name: "nick11",
                comment: "Test8",
                date_created: "2020-07-15T11:49:52.000Z",
                date_updated: "2020-07-15T11:49:52.000Z",
                user_image_url: "http://211.248.58.81:7070/contents/1592162266492.jpg"
            },
            {
                nick_name: "nick13",
                comment: "Test10",
                date_created: "2020-07-15T11:50:16.000Z",
                date_updated: "2020-07-15T11:50:16.000Z",
                user_image_url: "http://211.248.58.81:7070/contents/1592162490258.jpg"
            }
        ]
    },
    {
        nick_name: "nick11",
        comment: "Test2",
        date_created: "2020-07-15T11:49:06.000Z",
        date_updated: "2020-07-15T11:49:06.000Z",
        user_image_url: "http://211.248.58.81:7070/contents/1592162266492.jpg",
        replies: [ ]
    },
    {
        nick_name: "nick11",
        comment: "Test3",
        date_created: "2020-07-15T11:49:09.000Z",
        date_updated: "2020-07-15T11:49:09.000Z",
        user_image_url: "http://211.248.58.81:7070/contents/1592162266492.jpg",
        replies: [
            {
            nick_name: "nick11",
            comment: "Test9",
            date_created: "2020-07-15T11:49:59.000Z",
            date_updated: "2020-07-15T11:49:59.000Z",
            user_image_url: "http://211.248.58.81:7070/contents/1592162266492.jpg"
            }
        ]
    }
]

Post Comment

  • Post/ ./comment

    • Create a Comment
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

  • case 1 (Parent Comment)
{
    "capsule_id" : __,
    "nick_name" : "__",
    "conmment": ""
}
  • case 2 (Child Comment : reply)
{
    "capsule_id" : __,
    "nick_name" : "__",
    "conmment": "",
    "parent_id": __
}

Response Form Sample

{
   "success": true
}

Put LockedCapsules

  • Put/ ./capsules/lock

    • Put a capsule
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

  • Unauthorized user Response : Header with Code 401

Request Form Sample

{
    "capsule_id" : __,
    "text": "__",
    "title": "__",
    "expire": "YYYY-MM-DD hh:mm:ss",
    "members": [
        "friend1_nick",
        "friedn2_nick"
    ]
}

Response Form Sample

{
    "success": true
}

Put LockedCapsules With Images

  • Put/ ./capsules/lock/images

    • Put a capsule with image
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

  • Unauthorized user Response : Header with Code 401

Request Form Sample

@multipart
"capsule_id" : __,
"text": "__",
"title": "__",
"expire": "YYYY-MM-DD hh:mm:ss",
"members": [
    "friend1_nick",
    "friedn2_nick"
]
"file":

Response Form Sample

{
    "success": true
}

Check Authorized Session

  • Get/ ./comment/list/:capsule_id

    • response nick_name if session in header is valid;
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/comment/list/"Input the Capsule Id"

Response Form Sample

{
    "nick_name": "__"
}

Post User Logout

  • Post/ ./users/logout

    • Logout user's session
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

Response Form Sample

{
   "success": "__"
}

Completed - 6

(2020/07/27 ~ 2020/8/10)

  • Update Get-capsule with location (Add sharedCapsuleUser Members)
  • Update Get-capsule with nick_name (Add sharedCapsuleUser Members)
  • Update Get-capsule with capsule_id (Get -> Post, etc..)
  • Add Get-follow with follow for follow Member
  • Add Get-capsule with follow for follow Member
  • Add Get-capsule with follow Member
  • Add Get-capsule with follower Member
  • Add Post-capsule for Using key to open lockedCapsule

Get Capsules With Location

  • Get/ ./capsules/location?lnt=__&lat=__

    • Response capsules within 100 meter
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/capsules/location?lnt=__&lat=__

Response Form Sample

[
    {
        capsule_id: 89,
        nick_name: "nick14",
        title: null,
        text: null,
        likes: 0,
        views: 0,
        date_created: "2020-07-27T07:08:27.000Z",
        date_opened: "2020-07-27T07:08:27.000Z",
        status_temp: 1,
        location: {
            x: 13.0000001,
            y: 13
        },
        expire: null,
        status_lock: 0,
        key_count: 0,
        used_key_count: 0,
        members: [ ]
    },
    {
        capsule_id: 87,
        nick_name: "nick14",
        title: "lockTest1",
        text: "lockTest1",
        likes: 0,
        views: 0,
        date_created: "2020-07-27T06:57:16.000Z",
        date_opened: "2020-07-27T06:57:16.000Z",
        status_temp: 0,
        location: {
            x: 13.0000001,
            y: 13.0000001
        },
        expire: "2020-12-12T02:11:11.000Z",
        status_lock: 1,
        key_count: 2,
        used_key_count: 0,
        members: [
            {
                nick_name : "nick16",
                status_key : 1
            },
            {
                nick_name : "nick17",
                status_key : 1
            }
        ]
    }
]

Get Capsules with Nick Name

  • Get/ ./capsules/nick/:nickName

    • Response capsulelist of A user has nickName
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/capsules/nick/"Input the nick"

Response Form Sample

[
    {
        capsule_id: 88,
        user_id: "mingso0",
        nick_name: "nick14",
        title: "lockTest1",
        text: "lockTest1",
        likes: 0,
        views: 0,
        date_created: "2020-07-27T07:08:22.000Z",
        date_opened: "2020-07-27T07:08:22.000Z",
        status_temp: 0,
        lat: 13.0000002,
        lng: 13.0000001,
        expire: "2020-12-12T02:11:11.000Z",
        status_lock: 1,
        key_count: 3,
        used_key_count: 0,
        content: [ ],
        members: [
            "nick16",
            "nick17",
            "nick18"
        ]
    },

    {
        capsule_id: 84,
        user_id: "mingso0",
        nick_name: "nick14",
        title: "lockTest1",
        text: "lockTest1",
        likes: 0,
        views: 0,
        date_created: "2020-07-20T12:15:34.000Z",
        date_opened: "2020-07-20T12:15:34.000Z",
        status_temp: 0,
        lat: 37.6057548522949,
        lng: 127.009429931641,
        expire: null,
        status_lock: 0,
        key_count: 0,
        used_key_count: 0,
        content: [ ],
        members: [
            "nick16",
            "nick17",
            "nick18"
        ]
    }
]

Post Capsules With Capsule_id, Nick_name

  • Post/ ./capsules/id
    • Response a capsule has this capsule_id including whether a user has Nick_name likes this capsule
  • Success Response : Header with Code 200
  • Fail Response : Header with Code 404

Request Form Sample

{
    capsule_id: __,
    nick_name: "__"
}

Response Form Sample

{
    capsule_id: 84,
    user_id: "mingso0",
    nick_name: "nick14",
    title: "lockTest1",
    text: "lockTest1",
    likes: 0,
    views: 0,
    date_created: "2020-07-20T12:15:34.000Z",
    date_opened: "2020-07-20T12:15:34.000Z",
    status_temp: 0,
    lat: 37.6057548522949,
    lng: 127.009429931641,
    expire: "2020-12-12T02:11:11.000Z",
    status_lock: 1,
    key_count: 3,
    used_key_count: 0,
    like_flag: 1,
    content: [ ],
    members: [
            {
                nick_name : "nick16",
                status_key : 1
            },
            {
                nick_name : "nick17",
                status_key : 1
            },
            {
                nick_name : "nick18",
                status_key : 1
            },
            {
                nick_name : "nick14",
                status_key : 1
            }
    ]
}

Get Follow List with Follow For Follow

  • Get/ ./follow/forfollow/list/:nickName

    • Response list of users who have f4f relation with a user has nickName
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/capsules/nick/"Input the nick"

Response Form Sample

[
    {
        nick_name: "nini22",
        first_name: "민성",
        last_name: "박",
        date_created: "2020-06-14T19:17:46.000Z",
        date_updated: "2020-07-19T02:56:31.000Z",
        follow: 1,
        follower: 1,
        image_url: "http://59.13.134.140:7070/contents/1592162266492.jpg",
        image_name: "1592162266492.jpg"
    },
    {
        nick_name: "nick13",
        first_name: "세종",
        last_name: "김",
        date_created: "2020-06-14T19:21:30.000Z",
        date_updated: "2020-06-14T19:21:30.000Z",
        follow: 1,
        follower: 1,
        image_url: "http://59.13.134.140:7070/contents/1592162490258.jpg",
        image_name: "1592162490258.jpg"
    }
]

Get Capsules with Follow For Follow and Nick Name

  • Get/ ./capsules/f4f/:nickName

    • Response list of capsules which friends made
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/capsules/nick/"Input the nick"

Response Form Sample

[
    {
        capsule_id: 33,
        user_id: "x_sungjun_x",
        nick_name: "nick15",
        title: "당일치기 제주도 !!",
        text: "소영이랑 첫 여행으로 부산에 캡슐!! 너무 더워서 기억에 남던 여행~~ 다음에 올때는 우리가 어떻게 달라져있을지 궁금하다~",
        likes: 0,
        views: 0,
        date_created: "2020-06-14T19:49:07.000Z",
        date_opened: "2020-06-14T19:49:07.000Z",
        status_temp: 0,
        lat: 37.431,
        lng: 126.6801,
        expire: null,
        status_lock: 0,
        key_count: 0,
        used_key_count: 0,
        content: [ ],
        members: [ ]
    },
    {
        capsule_id: 24,
        user_id: "x_sungjun_x",
        nick_name: "nick15",
        title: "당일치기 제주도 !!",
        text: "소영이랑 첫 여행으로 부산에 캡슐!! 너무 더워서 기억에 남던 여행~~ 다음에 올때는 우리가 어떻게 달라져있을지 궁금하다~",
        likes: 0,
        views: 0,
        date_created: "2020-06-14T19:28:57.000Z",
        date_opened: "2020-06-14T19:28:57.000Z",
        status_temp: 0,
        lat: 37.5382,
        lng: 126.9772,
        expire: null,
        status_lock: 0,
        key_count: 0,
        used_key_count: 0,
        content: [
            {
                content_id: 47,
                url: "http://59.13.134.140:7070/contents/1592162947453.jpg"
            }
        ],
        members: [ ]
    }
]

Get Capsules with Follow and Nick Name

  • Get/ ./capsules/follow/:nickName

    • Response list of capsules which a user of follow-list-members made
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/capsules/follow/"Input the nick"

Response Form Sample

[
    {
        capsule_id: 33,
        user_id: "x_sungjun_x",
        nick_name: "nick15",
        title: "당일치기 제주도 !!",
        text: "소영이랑 첫 여행으로 부산에 캡슐!! 너무 더워서 기억에 남던 여행~~ 다음에 올때는 우리가 어떻게 달라져있을지 궁금하다~",
        likes: 0,
        views: 0,
        date_created: "2020-06-14T19:49:07.000Z",
        date_opened: "2020-06-14T19:49:07.000Z",
        status_temp: 0,
        lat: 37.431,
        lng: 126.6801,
        expire: null,
        status_lock: 0,
        key_count: 0,
        used_key_count: 0,
        content: [ ],
        members: [ ]
    },
    {
        capsule_id: 24,
        user_id: "x_sungjun_x",
        nick_name: "nick15",
        title: "당일치기 제주도 !!",
        text: "소영이랑 첫 여행으로 부산에 캡슐!! 너무 더워서 기억에 남던 여행~~ 다음에 올때는 우리가 어떻게 달라져있을지 궁금하다~",
        likes: 0,
        views: 0,
        date_created: "2020-06-14T19:28:57.000Z",
        date_opened: "2020-06-14T19:28:57.000Z",
        status_temp: 0,
        lat: 37.5382,
        lng: 126.9772,
        expire: null,
        status_lock: 0,
        key_count: 0,
        used_key_count: 0,
        content: [
            {
                content_id: 47,
                url: "http://59.13.134.140:7070/contents/1592162947453.jpg"
            }
        ],
        members: [ ]
    }
]

Get Capsules with Follower and Nick Name

  • Get/ ./capsules/follow/:nickName

    • Response list of capsules which a user of follower-list-members made
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

Request Form Sample

http://address:port/capsules/follower/"Input the nick"

Response Form Sample

[
    {
        capsule_id: 33,
        user_id: "x_sungjun_x",
        nick_name: "nick15",
        title: "당일치기 제주도 !!",
        text: "소영이랑 첫 여행으로 부산에 캡슐!! 너무 더워서 기억에 남던 여행~~ 다음에 올때는 우리가 어떻게 달라져있을지 궁금하다~",
        likes: 0,
        views: 0,
        date_created: "2020-06-14T19:49:07.000Z",
        date_opened: "2020-06-14T19:49:07.000Z",
        status_temp: 0,
        lat: 37.431,
        lng: 126.6801,
        expire: null,
        status_lock: 0,
        key_count: 0,
        used_key_count: 0,
        content: [ ],
        members: [ ]
    },
    {
        capsule_id: 24,
        user_id: "x_sungjun_x",
        nick_name: "nick15",
        title: "당일치기 제주도 !!",
        text: "소영이랑 첫 여행으로 부산에 캡슐!! 너무 더워서 기억에 남던 여행~~ 다음에 올때는 우리가 어떻게 달라져있을지 궁금하다~",
        likes: 0,
        views: 0,
        date_created: "2020-06-14T19:28:57.000Z",
        date_opened: "2020-06-14T19:28:57.000Z",
        status_temp: 0,
        lat: 37.5382,
        lng: 126.9772,
        expire: null,
        status_lock: 0,
        key_count: 0,
        used_key_count: 0,
        content: [
            {
                content_id: 47,
                url: "http://59.13.134.140:7070/contents/1592162947453.jpg"
            }
        ],
        members: [ ]
    }
]

Post Key - LockedCapsules

  • Post/ ./capsules/lock/key

    • Use key to open LockedCapsule
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

  • Unauthorized user Response : Header with Code 401

Request Form Sample

{
	"nick_name" : "__",
    "capsule_id" : __
}

Response Form Sample

{
    "success": true
}

Put A User With Image no password

  • Put/ ./users/image/nick

    • Put a user with image
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

  • Unauthorized user Response : Header with Code 401

Request Form Sample

@multipart
{
    "pre_nick_name": "__",
    "new_nick_name": "__",
    "file": __
}

Response Form Sample

{
    "success": "__"
}

Put A User With Nick Name

  • Put/ ./users/nick

    • Put a user with nick name
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

  • Unauthorized user Response : Header with Code 401

Request Form Sample

{
    "pre_nick_name": "__",
    "new_nick_name": "__"
}

Response Form Sample

{
    "success": "__"
}

Put Image Of A User

  • Put/ ./users/only/image

    • Put image of a user
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

  • Unauthorized user Response : Header with Code 401

Request Form Sample

@multipart
{
    "nick_name": "__",
    "file": __
}

Response Form Sample

{
    "success": "__"
}

Put A User With Password

  • Put/ ./users/nick

    • Put a user with password
  • Success Response : Header with Code 200

  • Fail Response : Header with Code 404

  • Unauthorized user Response : Header with Code 401

Request Form Sample

{
    "nick_name": "__",
    "password": "__"
}

Response Form Sample

{
    "success": "__"
}