概要
Api
Api 采用 golang + mysql 进行开发.
Http Header
Content-Type: application/json
Authorization: Bearer ${accessToken}
Accept: application/json
Http successful responses
Status Code: 2xx
info
200 OK, 201 Created, 202 Accepted, 204 No Content
Http client error responses
Status Code: 400
info
400 Bad Request, 401 Unauthorized , 403 Forbidden
Http query params
$filter 支持以下运算符:
1. eq 等于
2. ne 不等于
3. gt 大于
4. ge 大于等于
5. lt 小于
6. le 小于等于
7. and 和
8. or 或
9. not 不
10. () 括号
例子:
curl -X GET "https://${baseUrl}/user/?\$filter=id eq 1" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
$orderBy 支持以下运算符
1. asc
2. desc
例子:
curl -X GET "https://${baseUrl}/user/?\$orderBy=id desc" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
Mqtt
mqtt 服务采用 mosquitto v2.0.15