Skip to content

API reference

EveElseIf edited this page Mar 18, 2022 · 2 revisions

先用中文写吧。。。记得全程都要使用https。

注意单条信息的api如果查询不到会返回空,状态码是204 no content。如果是查询多条信息的api会返回[],即空数组,但是状态码是200。

注意信息的排序都是按照自增主键id倒序排序。

注意空字符串都是以""表示而不是null

get /api/announce

获取最新的一条公告

响应示例

{
    "id": 10,
    "title": "测试",
    "cotent": "随便发一条",
    "author": "admin",
    "createdTime": "2022-03-14T21:32:00.7996567"
}

get /api/announce?id=1

获取id为1的公告(id从1开始)

响应示例

{
    "id": 1,
    "title": "测试",
    "cotent": "随便发一条",
    "author": "admin",
    "createdTime": "2022-03-14T21:32:00.7996567"
}

get /api/announce?page=1

获取第1页公告,每页最多五个(page从1开始)

响应示例

[
    {
        "id": 13,
        "title": "a",
        "cotent": "a",
        "author": "admin",
        "createdTime": "2022-03-14T21:32:00.7996567"
    },
    {
        "id": 12,
        "title": "a",
        "cotent": "a",
        "author": "admin",
        "createdTime": "2022-03-14T21:31:57.3996515"
    },
    {
        "id": 11,
        "title": "a",
        "cotent": "a",
        "author": "admin",
        "createdTime": "2022-03-14T21:31:55.0639804"
    },
    {
        "id": 10,
        "title": "a",
        "cotent": "a",
        "author": "admin",
        "createdTime": "2022-03-14T21:31:52.4573374"
    },
    {
        "id": 9,
        "title": "a",
        "cotent": "a",
        "author": "admin",
        "createdTime": "2022-03-14T21:31:49.5045377"
    }
]

get /api/feedback?page=1

获取第1页反馈,每页最多5个(page从1开始)

响应示例

[
    {
        "id": 16,
        "content": "呜呜呜呜呜呜呜呜呜呜呜",
        "nickName": "不知道起啥名字", // 这是反馈者自己起的名字
        "contact": "[email protected]", // 反馈者自己写的联系方式
        "createdTime": "2022-03-14T21:18:41.2754261",
        "appVersion": "1.2.3",
        "os": "android",
        "phoneModel": "小米13",
        "reply": "你呜啥啊",
        "replyerName": "admin"
    },
剩下的直接省略吧。。。
]

get /api/feedback?id=1

获取id为1的反馈(id从1开始)

响应示例

{
    "id": 1,
    "content": "呜呜呜呜呜呜呜呜呜呜呜",
    "nickName": "不知道起啥名字", // 这是反馈者自己起的名字
    "contact": "[email protected]", // 反馈者自己写的联系方式
    "createdTime": "2022-03-14T21:18:41.2754261",
    "appVersion": "1.2.3",
    "os": "android",
    "phoneModel": "小米13",
    "reply": "", // 这里为空说明还没回复
    "replyerName": ""
}

post /api/feedback

创建一个反馈

json示例

{
    "content":"测试",
    "appversion":"1.2.3",
    "os":"ios",
    "nickname":"unidy2002", // 可空
    "contact":"[email protected]", // 可空
    "phonemodel":"iphone14"
}

成功创建会返回201 created


get /api/qrcode

获取加群用的二维码的url信息

响应示例

https://weixin.qq.com/g/AwYAAH_eDiTXufc8v5OE4RLBZrJztZOVNwhJhHPZIg8RhdgEsaFwq0fDiFd0npY5

get /api/socket?sectionid=11

获取sectionid为11的所有插座信息,其中status是available,unavailable,unknown三者之一

响应示例

[
    {
        "seatId": 3229,
        "sectionId": 11,
        "createdTime": "2020-12-23T13:42:07",
        "updatedTime": "2020-12-23T13:42:07",
        "status": "available"
    },
    {
        "seatId": 3230,
        "sectionId": 11,
        "createdTime": "2020-12-23T13:42:07",
        "updatedTime": "2020-12-23T13:42:07",
        "status": "unavailable"
    },
    {
        "seatId": 3231,
        "sectionId": 11,
        "createdTime": "2020-12-23T13:42:07",
        "updatedTime": "2020-12-23T13:42:07",
        "status": "unknown"
    },
省略省略。。。
]

post /api/socket

根据seatid更改某个插座的可用状态

json示例

{
    "seatid":3229,
    "isavailable":false
}

如果找不到seatid对应项会返回204 no content。


get /api/version/{os}

获取某个系统的thuinfo最新版本,os可以是android或者ios,不区分大小写。

相应示例

安卓

v2.6.4

iOS

2.5.1

没错安卓的版本号比ios多个v(