Skip to content

shuwenwei/hackweek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 

Repository files navigation

status:

0: 成功
1:失败

code:

1 :以到达最后一页
2:成功且不是最后一页
0:没有内容

/api/token

method: POST

headers

{
  "Content-Type": "application/json"
}

请求

{
  "username": "aaa",
  "password": "123456"
}

响应

{
  "message": "",
  "status": 0
}
{
  "message": "",
  "status": 1,
  "token": ""
}

/api/register

method: POST

{
  "Content-Type": "application/json"
}

请求

{
  "username": "aaa",
  "password": "123456"
}

响应

{
  "message": "",
  "status": 0
}
{
  "message": "",
  "status": 1
}

/api/event

method POST

headers

{
  "Authorization": "passport token"
}

示例

{
  "isPrivate": true,
  "isStory": true,
  "eventDate": "2019-11-22 11:00",
  "content": "ccc",
  "title": "ttt",
  "placeNumber": 1
}

响应

{
  "message": "",
  "status": 1    
}

/api/ground/events

method: GET

示例 /api/ground/events?pageNumber=1&place=1
不加place参数返回所有地点的公开内容 响应:

{
  "message": "",
  "code": 0
}
{
    "code": 1,
    "events": [
        {
            "author": "aaa",
            "content": "ccc",
            "event_date": "2019-11-22 11:00",
            "is_private": false,
            "is_story": true,
            "place_number": 1,
            "post_date": "2019-11-22 11:00",
            "title": "tttt",
            "event_id": 2
        },
        {
            "author": "aaa",
            "content": "ccc",
            "event_date": "2019-11-22 11:00",
            "is_private": false,
            "is_story": true,
            "place_number": 1,
            "post_date": "2019-11-22 11:00",
            "title": "tttt",
            "event_id": 1
        }
    ],
    "message": "已经是最后一页"
}

/api/user/history

method: GET

示例 /api/user/history?username=aaa&pageNumber=1 headers

{
  "Authorization": "passport token"
}

响应

{
    "code": 1,
    "events": [
        {
            "author": "aaa",
            "content": "ccc",
            "event_date": "2019-11-22 11:00",
            "is_private": false,
            "is_story": true,
            "place_number": 1,
            "post_date": "2019-11-22 10:40",
            "title": "tttt",
            "event_id": 3
        },
        {
            "author": "aaa",
            "content": "ccc",
            "event_date": "2019-11-22 11:00",
            "is_private": false,
            "is_story": true,
            "place_number": 1,
            "post_date": "2019-11-22 11:00",
            "title": "tttt",
            "event_id": 2
        },
        {
            "author": "aaa",
            "content": "ccc",
            "event_date": "2019-11-22 11:00",
            "is_private": true,
            "is_story": true,
            "place_number": 1,
            "post_date": "2019-11-22 11:00",
            "title": "tttt",
            "event_id": 1
        }
    ],
    "message": "已经是最后一页"
}
{
  "message": "",
  "code": 0
}

/api/event/comment

method:POST

headers

{
  "Authorization": "passport token"
}
{
    "eid":1,
    "commentContent":"afwawfawfawf"
}
{
    "message": "发送成功",
    "status": 1
}

/api/event/comments

method:GET

示例 /api/event/comments?eid=1
响应

{
    "comments": [
        {
            "comment_author": "aaa",
            "comment_content": "afwawfawfawf",
            "title_of_event": "tttt"
        },
        {
            "comment_author": "aaa",
            "comment_content": "afwawfawfaaeaefaefwf",
            "title_of_event": "tttt"
        },
        {
            "comment_author": "aaa",
            "comment_content": "afwawfawfaaeafawawfaefaefwf",
            "title_of_event": "tttt"
        }
    ],
    "message": "获取成功",
    "status": 1
}
{
  "message": "",
  "status": 0
}

/api/user/comments

method:GET

示例 /api/user/comments?username=aaa
响应

{
    "comments": [
        {
            "comment_author": "aaa",
            "comment_content": "afwawfawfawf",
            "title_of_event": "tttt"
        },
        {
            "comment_author": "aaa",
            "comment_content": "afwawfawfaaeaefaefwf",
            "title_of_event": "tttt"
        },
        {
            "comment_author": "aaa",
            "comment_content": "afwawfawfaaeafawawfaefaefwf",
            "title_of_event": "tttt"
        }
    ],
    "message": "获取成功",
    "status": 1
}
{
  "message": "",
  "status": 0
}

/api/password

method:PUT

{
  "username": "aaa",
  "password": "123456",
  "newPassword": "12345"
}

响应

{
  "message": "修改成功",
  "status": 1
}
{
  "message": "修改失败",
  "status": 0
}

/api/username

method: GET

示例 : /api/username?username=aaa" 响应

{
  "message": "用户名已存在",
  "status": 0
}
{
  "message": "用户名不能为空",
  "status": 0
}
{
  "message": "用户名可用",
  "status": 1
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published