🛵
E-bike 文档
  • 🏡Home
  • 🎯项目开发计划
  • 🤔问题定义及可行性分析
  • 📝软件需求说明书
  • ⛳软件测试计划
  • 🛡️测试分析报告
  • 🔌后端接口定义
  • ⚙️设计说明书
  • 💂‍♀️用户手册
Powered by GitBook
On this page

后端接口定义

后端接口定义文档用于定义后端服务的接口,包括接口的URL、请求方法(如GET、POST等)、请求参数、返回数据格式。

Previous测试分析报告Next设计说明书

Last updated 12 months ago

1 概述

本文档是软件后端接口定义文档,遵循Swagger2.0协议,是对Swagger自动生成的API文档的详细标注。该文档主要起到如下作用:

  • 对开发团队/第三方开发者

    • 前端可以根据本文档进行后端接口调用

    • 测试可以根据本文档进行接口测试

    • 后端可以参考该文档进行迭代开发

  • 对用户

    • 用户可以了解后端系统的可用功能

本文档由 负责编写。

2 用户模块

2.1 用户注册和登录

2.2 用户个人信息

2.3 绑定电动车通行证

2.4 删除用户(需要管理员权限)

3 电动车信息模块

3.1 电动车基本信息

3.2 电动车图片

3.3 电动车商家渠道

4 社交模块

4.1 车小圈帖子

4.2 车小圈帖子评论

4.3 车小圈用户互动

4.4 车小圈首页

5 二手交易模块

6 维修模块

6.1 维修预约

6.2 维修商家

6.3 维修贴士

7 安全和举报模块

🔌
唐锦洲
get

获取所有用户的列表

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
application/json
get
GET /api/v1/users/profile/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
200

获取成功

{
  "success": true,
  "results": {}
}
get

获取指定用户的详细信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this user.

Responses
200
获取成功
application/json
404
用户未找到
application/json
get
GET /api/v1/users/profile/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
{
  "username": "text",
  "password": "text",
  "email": "name@gmail.com",
  "telephone": "text",
  "nickname": "text",
  "signature": "text",
  "avatar": "https://example.com",
  "birthday": "2025-05-24",
  "gender": "M",
  "vehicle_permit": {
    "permit_number": "text",
    "issued_date": "2025-05-24",
    "expiry_date": "2025-05-24",
    "owner_name": "text"
  },
  "following": [
    1
  ],
  "follower": [
    1
  ]
}
delete

删除指定用户

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this user.

Responses
204
删除成功
application/json
404
用户未找到
application/json
delete
DELETE /api/v1/users/profile/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
{
  "success": true
}
delete

解绑用户车辆通行证信息

Authorizations
Responses
204
解绑成功
application/json
404
通行证未找到
application/json
delete
DELETE /api/v1/users/unbind-permit/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
{
  "success": true
}
delete

删除用户

Authorizations
Path parameters
idanyRequired
Responses
204
用户删除成功
application/json
404
用户未找到
application/json
delete
DELETE /api/v1/users/delete/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
{
  "success": true
}
get

获取所有电动车的列表

Authorizations
Query parameters
brandstringOptional

brand

ratingstringOptional

rating

release_datestringOptional

release_date

min_pricestringOptional

min_price

max_pricestringOptional

max_price

orderingstringOptional

Which field to use when ordering the results.

pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
get
GET /api/v1/bikes/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
200

获取成功

No content

get

获取所有电动车ID列表

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
获取失败
get
GET /api/v1/bikes/id/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取指定电动车的详细信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this bike.

Responses
200
获取成功
400
获取失败
get
GET /api/v1/bikes/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

delete

删除指定电动车

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this bike.

Responses
204
删除成功
404
电动车未找到
delete
DELETE /api/v1/bikes/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

delete

删除电动车图片

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this bike image.

Responses
204
删除成功
404
图片未找到
delete
DELETE /api/v1/bikes/images/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取所有渠道的列表

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
get
GET /api/v1/bikes/channel/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
200

获取成功

No content

get

获取所有渠道ID列表

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
get
GET /api/v1/bikes/channel/id/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
200

获取成功

No content

get

获取指定渠道的详细信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this channel.

Responses
200
获取成功
404
渠道未找到
get
GET /api/v1/bikes/channel/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

delete

删除指定渠道

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this channel.

Responses
204
删除成功
404
渠道未找到
delete
DELETE /api/v1/bikes/channel/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取所有车小圈帖子

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/social/post/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取用户发布过的帖子

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/social/post/mine/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取指定的车小圈帖子

Authorizations
Path parameters
idanyRequired

A UUID string identifying this post.

Responses
200
获取成功
404
帖子未找到
get
GET /api/v1/social/post/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

delete

删除指定的车小圈帖子

Authorizations
Path parameters
idanyRequired

A UUID string identifying this post.

Responses
204
删除成功
404
帖子未找到
delete
DELETE /api/v1/social/post/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取所有评论

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/social/comment/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取指定的车小圈帖子评论

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this comment.

Responses
200
获取成功
404
评论未找到
get
GET /api/v1/social/comment/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

delete

删除指定的车小圈帖子评论

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this comment.

Responses
204
删除成功
404
评论未找到
delete
DELETE /api/v1/social/comment/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取当前用户的所有点赞过的帖子

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/social/post/likes/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取当前用户的所有收藏过的帖子

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/social/post/favorites/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

post

修改当前用户对特定帖子点赞/收藏状态

Authorizations
Responses
201
操作成功
204
操作取消
400
请求无效
post
POST /api/v1/social/post/interaction/toggle/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

post

获取特定帖子的点赞/收藏数量

Authorizations
Responses
200
获取成功
400
请求无效
post
POST /api/v1/social/post/interaction/count/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取首页的车小圈帖子,支持指定页码

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

page_sizeintegerOptional

Number of results to return per page.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/social/homepage/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

post

发布新的商品

Authorizations
Responses
201
发布成功
400
请求无效
500
服务器内部错误
post
POST /api/v1/exchange/goods/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取当前用户发布的所有商品

Authorizations
Responses
200
获取成功
get
GET /api/v1/exchange/goods/mine/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
200

获取成功

No content

get

获取指定商品的详细信息

Authorizations
Path parameters
hashanyRequired

A unique value identifying this goods.

Responses
200
获取成功
400
请求无效
404
商品未找到
get
GET /api/v1/exchange/goods/{hash}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

delete
Authorizations
Path parameters
hashanyRequired

A unique value identifying this goods.

Responses
204Success
delete
DELETE /api/v1/exchange/goods/{hash}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*
204Success

No content

get

获取用户的所有预约

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/maintenance/appointments/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取指定的预约详情

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this appointment.

Responses
200
获取成功
404
预约未找到
get
GET /api/v1/maintenance/appointments/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

delete

删除指定的预约

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this appointment.

Responses
204
删除成功
404
预约未找到
delete
DELETE /api/v1/maintenance/appointments/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取所有服务商家

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/maintenance/shops/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取指定的服务商家详情

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this service shop.

Responses
200
获取成功
404
商家未找到
get
GET /api/v1/maintenance/shops/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

delete

删除指定的服务商家

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this service shop.

Responses
204
删除成功
404
商家未找到
delete
DELETE /api/v1/maintenance/shops/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取所有服务提示

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/maintenance/tips/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取指定的服务提示详情

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this service tip.

Responses
200
获取成功
404
提示未找到
get
GET /api/v1/maintenance/tips/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

delete

删除指定的服务提示

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this service tip.

Responses
204
删除成功
404
提示未找到
delete
DELETE /api/v1/maintenance/tips/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取所有举报报告

Authorizations
Query parameters
pageintegerOptional

A page number within the paginated result set.

Responses
200
获取成功
400
请求无效
get
GET /api/v1/safety/reports/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

get

获取指定举报报告的详细信息

Authorizations
Path parameters
idanyRequired

A UUID string identifying this 举报.

Responses
200
获取成功
404
报告未找到
get
GET /api/v1/safety/reports/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Accept: */*

No content

  • 1 概述
  • 2 用户模块
  • 2.1 用户注册和登录
  • POST/users/login/
  • POST/users/register/
  • POST/users/refresh/
  • 2.2 用户个人信息
  • GET/users/profile/
  • GET/users/profile/{id}/
  • PUT/users/profile/{id}/
  • DELETE/users/profile/{id}/
  • PATCH/users/profile/{id}/
  • 2.3 绑定电动车通行证
  • POST/users/bind-permit/
  • DELETE/users/unbind-permit/
  • 2.4 删除用户(需要管理员权限)
  • DELETE/users/delete/{id}/
  • 3 电动车信息模块
  • 3.1 电动车基本信息
  • GET/bikes/
  • POST/bikes/
  • GET/bikes/id/
  • GET/bikes/{id}/
  • PUT/bikes/{id}/
  • DELETE/bikes/{id}/
  • PATCH/bikes/{id}/
  • 3.2 电动车图片
  • POST/bikes/images/
  • DELETE/bikes/images/{id}/
  • 3.3 电动车商家渠道
  • GET/bikes/channel/
  • POST/bikes/channel/
  • GET/bikes/channel/id/
  • GET/bikes/channel/{id}/
  • PUT/bikes/channel/{id}/
  • DELETE/bikes/channel/{id}/
  • PATCH/bikes/channel/{id}/
  • 4 社交模块
  • 4.1 车小圈帖子
  • GET/social/post/
  • POST/social/post/
  • GET/social/post/mine/
  • GET/social/post/{id}/
  • PUT/social/post/{id}/
  • DELETE/social/post/{id}/
  • PATCH/social/post/{id}/
  • 4.2 车小圈帖子评论
  • GET/social/comment/
  • POST/social/comment/
  • GET/social/comment/{id}/
  • PUT/social/comment/{id}/
  • DELETE/social/comment/{id}/
  • PATCH/social/comment/{id}/
  • 4.3 车小圈用户互动
  • GET/social/post/likes/
  • GET/social/post/favorites/
  • POST/social/post/interaction/toggle/
  • POST/social/post/interaction/count/
  • POST/social/follow/toggle/
  • 4.4 车小圈首页
  • GET/social/homepage/
  • 5 二手交易模块
  • POST/exchange/goods/
  • GET/exchange/goods/mine/
  • GET/exchange/goods/{hash}/
  • PUT/exchange/goods/{hash}/
  • DELETE/exchange/goods/{hash}/
  • PATCH/exchange/goods/{hash}/
  • 6 维修模块
  • 6.1 维修预约
  • GET/maintenance/appointments/
  • POST/maintenance/appointments/
  • GET/maintenance/appointments/{id}/
  • PUT/maintenance/appointments/{id}/
  • DELETE/maintenance/appointments/{id}/
  • PATCH/maintenance/appointments/{id}/
  • 6.2 维修商家
  • GET/maintenance/shops/
  • POST/maintenance/shops/
  • GET/maintenance/shops/{id}/
  • PUT/maintenance/shops/{id}/
  • DELETE/maintenance/shops/{id}/
  • PATCH/maintenance/shops/{id}/
  • 6.3 维修贴士
  • GET/maintenance/tips/
  • POST/maintenance/tips/
  • GET/maintenance/tips/{id}/
  • PUT/maintenance/tips/{id}/
  • DELETE/maintenance/tips/{id}/
  • PATCH/maintenance/tips/{id}/
  • 7 安全和举报模块
  • GET/safety/reports/
  • POST/safety/reports/
  • GET/safety/reports/{id}/
  • PUT/safety/reports/{id}/
  • PATCH/safety/reports/{id}/
post

用户登录获取JWT

Authorizations
Body
usernamestring · min: 1Required
passwordstring · min: 1Required
Responses
200
登录成功
application/json
401
认证失败
application/json
post
POST /api/v1/users/login/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "username": "text",
  "password": "text"
}
{
  "success": true,
  "results": {
    "refresh": "text",
    "access": "text"
  }
}
post

创建新用户

Authorizations
Body
usernamestring · min: 1 · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
passwordstring · min: 1 · max: 128Required
emailstring · email · max: 254Optional
telephonestring · max: 11Optional
nicknamestring · max: 50Optional
signaturestringOptional
avatarstring · uriRead-onlyOptional
birthdaystring · dateOptional
genderstring · enumOptionalPossible values:
followinginteger[]Optional
followerinteger[]Optional
Responses
201
用户创建成功
application/json
400
请求无效
application/json
post
POST /api/v1/users/register/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 302

{
  "username": "text",
  "password": "text",
  "email": "name@gmail.com",
  "telephone": "text",
  "nickname": "text",
  "signature": "text",
  "birthday": "2025-05-24",
  "gender": "M",
  "vehicle_permit": {
    "permit_number": "text",
    "issued_date": "2025-05-24",
    "expiry_date": "2025-05-24",
    "owner_name": "text"
  },
  "following": [
    1
  ],
  "follower": [
    1
  ]
}
{
  "username": "text",
  "password": "text",
  "email": "name@gmail.com",
  "telephone": "text",
  "nickname": "text",
  "signature": "text",
  "avatar": "https://example.com",
  "birthday": "2025-05-24",
  "gender": "M",
  "vehicle_permit": {
    "permit_number": "text",
    "issued_date": "2025-05-24",
    "expiry_date": "2025-05-24",
    "owner_name": "text"
  },
  "following": [
    1
  ],
  "follower": [
    1
  ]
}
post

Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.

Authorizations
Body
refreshstring · min: 1Required
accessstring · min: 1Read-onlyOptional
Responses
201Success
application/json
post
POST /api/v1/users/refresh/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 18

{
  "refresh": "text"
}
201Success
{
  "refresh": "text",
  "access": "text"
}
put

更新指定用户的详细信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this user.

Body
usernamestring · min: 1 · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
passwordstring · min: 1 · max: 128Required
emailstring · email · max: 254Optional
telephonestring · max: 11Optional
nicknamestring · max: 50Optional
signaturestringOptional
avatarstring · uriRead-onlyOptional
birthdaystring · dateOptional
genderstring · enumOptionalPossible values:
followinginteger[]Optional
followerinteger[]Optional
Responses
200
更新成功
application/json
400
请求无效
application/json
put
PUT /api/v1/users/profile/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 302

{
  "username": "text",
  "password": "text",
  "email": "name@gmail.com",
  "telephone": "text",
  "nickname": "text",
  "signature": "text",
  "birthday": "2025-05-24",
  "gender": "M",
  "vehicle_permit": {
    "permit_number": "text",
    "issued_date": "2025-05-24",
    "expiry_date": "2025-05-24",
    "owner_name": "text"
  },
  "following": [
    1
  ],
  "follower": [
    1
  ]
}
{
  "username": "text",
  "password": "text",
  "email": "name@gmail.com",
  "telephone": "text",
  "nickname": "text",
  "signature": "text",
  "avatar": "https://example.com",
  "birthday": "2025-05-24",
  "gender": "M",
  "vehicle_permit": {
    "permit_number": "text",
    "issued_date": "2025-05-24",
    "expiry_date": "2025-05-24",
    "owner_name": "text"
  },
  "following": [
    1
  ],
  "follower": [
    1
  ]
}
patch

部分更新指定用户的详细信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this user.

Body
usernamestring · min: 1 · max: 150Required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

Pattern: ^[\w.@+-]+$
passwordstring · min: 1 · max: 128Required
emailstring · email · max: 254Optional
telephonestring · max: 11Optional
nicknamestring · max: 50Optional
signaturestringOptional
avatarstring · uriRead-onlyOptional
birthdaystring · dateOptional
genderstring · enumOptionalPossible values:
followinginteger[]Optional
followerinteger[]Optional
Responses
200
部分更新成功
application/json
400
请求无效
application/json
patch
PATCH /api/v1/users/profile/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 302

{
  "username": "text",
  "password": "text",
  "email": "name@gmail.com",
  "telephone": "text",
  "nickname": "text",
  "signature": "text",
  "birthday": "2025-05-24",
  "gender": "M",
  "vehicle_permit": {
    "permit_number": "text",
    "issued_date": "2025-05-24",
    "expiry_date": "2025-05-24",
    "owner_name": "text"
  },
  "following": [
    1
  ],
  "follower": [
    1
  ]
}
{
  "username": "text",
  "password": "text",
  "email": "name@gmail.com",
  "telephone": "text",
  "nickname": "text",
  "signature": "text",
  "avatar": "https://example.com",
  "birthday": "2025-05-24",
  "gender": "M",
  "vehicle_permit": {
    "permit_number": "text",
    "issued_date": "2025-05-24",
    "expiry_date": "2025-05-24",
    "owner_name": "text"
  },
  "following": [
    1
  ],
  "follower": [
    1
  ]
}
post

绑定用户车辆通行证信息

Authorizations
Body
permit_numberstring · min: 1 · max: 100Required
issued_datestring · dateOptional
expiry_datestring · dateOptional
owner_namestring · max: 150Optional
Responses
201
绑定成功
application/json
400
请求无效
application/json
post
POST /api/v1/users/bind-permit/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 98

{
  "permit_number": "text",
  "issued_date": "2025-05-24",
  "expiry_date": "2025-05-24",
  "owner_name": "text"
}
{
  "permit_number": "text",
  "issued_date": "2025-05-24",
  "expiry_date": "2025-05-24",
  "owner_name": "text"
}
post

创建新的电动车

Authorizations
Body
idintegerRead-onlyOptional
brandstring · max: 100Optional
modelstring · max: 100Optional
pricestring · decimalOptional
ratingnumberOptional
release_datestring · dateOptional
descriptionstringOptional
Responses
201
创建成功
400
请求无效
post
POST /api/v1/bikes/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 133

{
  "brand": "text",
  "model": "text",
  "price": "text",
  "rating": 1,
  "release_date": "2025-05-24",
  "description": "text",
  "bike_images": [
    {
      "bike": 1
    }
  ]
}

No content

put

更新指定电动车的信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this bike.

Body
idintegerRead-onlyOptional
brandstring · max: 100Optional
modelstring · max: 100Optional
pricestring · decimalOptional
ratingnumberOptional
release_datestring · dateOptional
descriptionstringOptional
Responses
200
更新成功
400
请求无效
404
电动车未找到
put
PUT /api/v1/bikes/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 133

{
  "brand": "text",
  "model": "text",
  "price": "text",
  "rating": 1,
  "release_date": "2025-05-24",
  "description": "text",
  "bike_images": [
    {
      "bike": 1
    }
  ]
}

No content

patch

部分更新指定电动车的信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this bike.

Body
idintegerRead-onlyOptional
brandstring · max: 100Optional
modelstring · max: 100Optional
pricestring · decimalOptional
ratingnumberOptional
release_datestring · dateOptional
descriptionstringOptional
Responses
200
部分更新成功
400
请求无效
404
电动车未找到
patch
PATCH /api/v1/bikes/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 133

{
  "brand": "text",
  "model": "text",
  "price": "text",
  "rating": 1,
  "release_date": "2025-05-24",
  "description": "text",
  "bike_images": [
    {
      "bike": 1
    }
  ]
}

No content

post

创建电动车图片

Authorizations
Body
idintegerRead-onlyOptional
bikeintegerRequired
imagestring · uriRead-onlyOptional
Responses
201
创建成功
400
请求无效
post
POST /api/v1/bikes/images/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 10

{
  "bike": 1
}

No content

post

创建新的渠道

Authorizations
Body
idintegerRead-onlyOptional
bikeintegerRequired
namestring · min: 1 · max: 100Required
urlstring · uri · min: 1 · max: 200Required
service_infostring · min: 1Required
Responses
201
创建成功
400
请求无效
post
POST /api/v1/bikes/channel/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 74

{
  "bike": 1,
  "name": "text",
  "url": "https://example.com",
  "service_info": "text"
}

No content

put

更新指定渠道的信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this channel.

Body
idintegerRead-onlyOptional
bikeintegerRequired
namestring · min: 1 · max: 100Required
urlstring · uri · min: 1 · max: 200Required
service_infostring · min: 1Required
Responses
200
更新成功
400
请求无效
404
渠道未找到
put
PUT /api/v1/bikes/channel/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 74

{
  "bike": 1,
  "name": "text",
  "url": "https://example.com",
  "service_info": "text"
}

No content

patch

部分更新指定渠道的信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this channel.

Body
idintegerRead-onlyOptional
bikeintegerRequired
namestring · min: 1 · max: 100Required
urlstring · uri · min: 1 · max: 200Required
service_infostring · min: 1Required
Responses
200
部分更新成功
400
请求无效
404
渠道未找到
patch
PATCH /api/v1/bikes/channel/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 74

{
  "bike": 1,
  "name": "text",
  "url": "https://example.com",
  "service_info": "text"
}

No content

post

创建车小圈帖子

Authorizations
Body
idstring · uuidRead-onlyOptional
userstringRead-onlyOptional
titlestring · min: 1 · max: 255Optional
contentstring · min: 1Optional
created_atstring · date-timeRead-onlyOptional
updated_atstring · date-timeRead-onlyOptional
locationstring · max: 255Optional
likes_countintegerOptionalDefault: 0
views_countintegerOptionalDefault: 0
commentsinteger[]Read-onlyOptional
Responses
201
帖子创建成功
400
请求无效
post
POST /api/v1/social/post/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 136

{
  "title": "text",
  "content": "text",
  "tags": [
    {
      "name": "text",
      "slug": "text"
    }
  ],
  "location": "text",
  "likes_count": 0,
  "views_count": 0,
  "images": [
    {}
  ]
}

No content

put

更新指定的车小圈帖子

Authorizations
Path parameters
idanyRequired

A UUID string identifying this post.

Body
idstring · uuidRead-onlyOptional
userstringRead-onlyOptional
titlestring · min: 1 · max: 255Optional
contentstring · min: 1Optional
created_atstring · date-timeRead-onlyOptional
updated_atstring · date-timeRead-onlyOptional
locationstring · max: 255Optional
likes_countintegerOptionalDefault: 0
views_countintegerOptionalDefault: 0
commentsinteger[]Read-onlyOptional
Responses
200
更新成功
400
请求无效
404
帖子未找到
put
PUT /api/v1/social/post/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 136

{
  "title": "text",
  "content": "text",
  "tags": [
    {
      "name": "text",
      "slug": "text"
    }
  ],
  "location": "text",
  "likes_count": 0,
  "views_count": 0,
  "images": [
    {}
  ]
}

No content

patch

部分更新指定的车小圈帖子

Authorizations
Path parameters
idanyRequired

A UUID string identifying this post.

Body
idstring · uuidRead-onlyOptional
userstringRead-onlyOptional
titlestring · min: 1 · max: 255Optional
contentstring · min: 1Optional
created_atstring · date-timeRead-onlyOptional
updated_atstring · date-timeRead-onlyOptional
locationstring · max: 255Optional
likes_countintegerOptionalDefault: 0
views_countintegerOptionalDefault: 0
commentsinteger[]Read-onlyOptional
Responses
200
部分更新成功
400
请求无效
404
帖子未找到
patch
PATCH /api/v1/social/post/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 136

{
  "title": "text",
  "content": "text",
  "tags": [
    {
      "name": "text",
      "slug": "text"
    }
  ],
  "location": "text",
  "likes_count": 0,
  "views_count": 0,
  "images": [
    {}
  ]
}

No content

post

为帖子创建新评论

Authorizations
Body
idintegerRead-onlyOptional
poststring · uuidRequired
contentstring · min: 1Required
created_atstring · date-timeRead-onlyOptional
likes_countintegerOptionalDefault: 0
parentintegerOptional
repliesinteger[]Read-onlyOptional
usernamestringRead-onlyOptional
post_titlestringRead-onlyOptional
Responses
201
评论创建成功
400
请求无效
post
POST /api/v1/social/comment/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "post": "123e4567-e89b-12d3-a456-426614174000",
  "content": "text",
  "likes_count": 0,
  "parent": 1
}

No content

put

更新指定的车小圈帖子评论

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this comment.

Body
idintegerRead-onlyOptional
poststring · uuidRequired
contentstring · min: 1Required
created_atstring · date-timeRead-onlyOptional
likes_countintegerOptionalDefault: 0
parentintegerOptional
repliesinteger[]Read-onlyOptional
usernamestringRead-onlyOptional
post_titlestringRead-onlyOptional
Responses
200
更新成功
400
请求无效
404
评论未找到
put
PUT /api/v1/social/comment/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "post": "123e4567-e89b-12d3-a456-426614174000",
  "content": "text",
  "likes_count": 0,
  "parent": 1
}

No content

patch

部分更新指定的车小圈帖子评论

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this comment.

Body
idintegerRead-onlyOptional
poststring · uuidRequired
contentstring · min: 1Required
created_atstring · date-timeRead-onlyOptional
likes_countintegerOptionalDefault: 0
parentintegerOptional
repliesinteger[]Read-onlyOptional
usernamestringRead-onlyOptional
post_titlestringRead-onlyOptional
Responses
200
部分更新成功
400
请求无效
404
评论未找到
patch
PATCH /api/v1/social/comment/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "post": "123e4567-e89b-12d3-a456-426614174000",
  "content": "text",
  "likes_count": 0,
  "parent": 1
}

No content

post

修改当前用户对另一用户的关注状态

Authorizations
Body
user_idintegerRequired
Responses
200
操作成功
400
请求无效
post
POST /api/v1/social/follow/toggle/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 13

{
  "user_id": 1
}

No content

put
Authorizations
Path parameters
hashanyRequired

A unique value identifying this goods.

Body
ownerintegerRequired
hashstring · min: 1 · max: 32Required
contentstring · min: 1 · max: 300Required
moneystring · min: 1 · max: 10Required
origin_moneystring · min: 1 · max: 10Required
send_moneystring · min: 1 · max: 10Required
classifystring · min: 1 · max: 200Required
edit_datestring · date-timeRead-onlyOptional
Responses
200Success
application/json
put
PUT /api/v1/exchange/goods/{hash}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 117

{
  "owner": 1,
  "hash": "text",
  "content": "text",
  "money": "text",
  "origin_money": "text",
  "send_money": "text",
  "classify": "text"
}
200Success
{
  "owner": 1,
  "hash": "text",
  "content": "text",
  "money": "text",
  "origin_money": "text",
  "send_money": "text",
  "classify": "text",
  "edit_date": "2025-05-24T11:00:26.735Z"
}
patch
Authorizations
Path parameters
hashanyRequired

A unique value identifying this goods.

Body
ownerintegerRequired
hashstring · min: 1 · max: 32Required
contentstring · min: 1 · max: 300Required
moneystring · min: 1 · max: 10Required
origin_moneystring · min: 1 · max: 10Required
send_moneystring · min: 1 · max: 10Required
classifystring · min: 1 · max: 200Required
edit_datestring · date-timeRead-onlyOptional
Responses
200Success
application/json
patch
PATCH /api/v1/exchange/goods/{hash}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 117

{
  "owner": 1,
  "hash": "text",
  "content": "text",
  "money": "text",
  "origin_money": "text",
  "send_money": "text",
  "classify": "text"
}
200Success
{
  "owner": 1,
  "hash": "text",
  "content": "text",
  "money": "text",
  "origin_money": "text",
  "send_money": "text",
  "classify": "text",
  "edit_date": "2025-05-24T11:00:26.735Z"
}
post

创建新的预约

Authorizations
Body
idintegerRead-onlyOptional
service_typestring · min: 1 · max: 255Required
appointment_timestring · date-timeRequired
statusstring · enumOptionalDefault: pendingPossible values:
created_atstring · date-timeRead-onlyOptional
updated_atstring · date-timeRead-onlyOptional
status_changedstring · date-timeOptional
userintegerRequired
shopintegerRequired
Responses
201
创建成功
400
请求无效
post
POST /api/v1/maintenance/appointments/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 150

{
  "service_type": "text",
  "appointment_time": "2025-05-24T11:00:26.735Z",
  "status": "pending",
  "status_changed": "2025-05-24T11:00:26.735Z",
  "user": 1,
  "shop": 1
}

No content

put

更新指定的预约信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this appointment.

Body
idintegerRead-onlyOptional
service_typestring · min: 1 · max: 255Required
appointment_timestring · date-timeRequired
statusstring · enumOptionalDefault: pendingPossible values:
created_atstring · date-timeRead-onlyOptional
updated_atstring · date-timeRead-onlyOptional
status_changedstring · date-timeOptional
userintegerRequired
shopintegerRequired
Responses
200
更新成功
400
请求无效
404
预约未找到
put
PUT /api/v1/maintenance/appointments/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 150

{
  "service_type": "text",
  "appointment_time": "2025-05-24T11:00:26.735Z",
  "status": "pending",
  "status_changed": "2025-05-24T11:00:26.735Z",
  "user": 1,
  "shop": 1
}

No content

patch

部分更新指定的预约信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this appointment.

Body
idintegerRead-onlyOptional
service_typestring · min: 1 · max: 255Required
appointment_timestring · date-timeRequired
statusstring · enumOptionalDefault: pendingPossible values:
created_atstring · date-timeRead-onlyOptional
updated_atstring · date-timeRead-onlyOptional
status_changedstring · date-timeOptional
userintegerRequired
shopintegerRequired
Responses
200
部分更新成功
400
请求无效
404
预约未找到
patch
PATCH /api/v1/maintenance/appointments/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 150

{
  "service_type": "text",
  "appointment_time": "2025-05-24T11:00:26.735Z",
  "status": "pending",
  "status_changed": "2025-05-24T11:00:26.735Z",
  "user": 1,
  "shop": 1
}

No content

post

创建新的服务商家

Authorizations
Body
idintegerRead-onlyOptional
namestring · min: 1 · max: 255Required
locationstring · max: 255Optional
service_descriptionstringOptional
contact_infostring · min: 1 · max: 255Required
userintegerRequired
Responses
201
创建成功
400
请求无效
post
POST /api/v1/maintenance/shops/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 93

{
  "name": "text",
  "location": "text",
  "service_description": "text",
  "contact_info": "text",
  "user": 1
}

No content

put

更新指定的服务商家信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this service shop.

Body
idintegerRead-onlyOptional
namestring · min: 1 · max: 255Required
locationstring · max: 255Optional
service_descriptionstringOptional
contact_infostring · min: 1 · max: 255Required
userintegerRequired
Responses
200
更新成功
400
请求无效
404
商家未找到
put
PUT /api/v1/maintenance/shops/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 93

{
  "name": "text",
  "location": "text",
  "service_description": "text",
  "contact_info": "text",
  "user": 1
}

No content

patch

部分更新指定的服务商家信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this service shop.

Body
idintegerRead-onlyOptional
namestring · min: 1 · max: 255Required
locationstring · max: 255Optional
service_descriptionstringOptional
contact_infostring · min: 1 · max: 255Required
userintegerRequired
Responses
200
部分更新成功
400
请求无效
404
商家未找到
patch
PATCH /api/v1/maintenance/shops/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 93

{
  "name": "text",
  "location": "text",
  "service_description": "text",
  "contact_info": "text",
  "user": 1
}

No content

post

创建新的服务提示

Authorizations
Body
idintegerRead-onlyOptional
titlestring · min: 1 · max: 255Required
contentstring · min: 1Required
categorystring · max: 100Optional
Responses
201
创建成功
400
请求无效
post
POST /api/v1/maintenance/tips/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "title": "text",
  "content": "text",
  "category": "text"
}

No content

put

更新指定的服务提示信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this service tip.

Body
idintegerRead-onlyOptional
titlestring · min: 1 · max: 255Required
contentstring · min: 1Required
categorystring · max: 100Optional
Responses
200
更新成功
400
请求无效
404
提示未找到
put
PUT /api/v1/maintenance/tips/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "title": "text",
  "content": "text",
  "category": "text"
}

No content

patch

部分更新指定的服务提示信息

Authorizations
Path parameters
idanyRequired

A unique integer value identifying this service tip.

Body
idintegerRead-onlyOptional
titlestring · min: 1 · max: 255Required
contentstring · min: 1Required
categorystring · max: 100Optional
Responses
200
部分更新成功
400
请求无效
404
提示未找到
patch
PATCH /api/v1/maintenance/tips/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "title": "text",
  "content": "text",
  "category": "text"
}

No content

post

创建或更新举报报告

Authorizations
Body
idstring · uuidRead-onlyOptional
locationstring · min: 1 · max: 255Required
descriptionstring · min: 1Required
timestampstring · date-timeOptional
statusstring · enumOptionalDefault: pendingPossible values:
imagestring · uriRead-onlyOptional
userintegerRequired
Responses
200
报告更新成功
201
报告创建成功
400
请求无效
post
POST /api/v1/safety/reports/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 107

{
  "location": "text",
  "description": "text",
  "timestamp": "2025-05-24T11:00:26.735Z",
  "status": "pending",
  "user": 1
}

No content

put

更新指定举报报告的信息

Authorizations
Path parameters
idanyRequired

A UUID string identifying this 举报.

Body
idstring · uuidRead-onlyOptional
locationstring · min: 1 · max: 255Required
descriptionstring · min: 1Required
timestampstring · date-timeOptional
statusstring · enumOptionalDefault: pendingPossible values:
imagestring · uriRead-onlyOptional
userintegerRequired
Responses
200
更新成功
400
请求无效
404
报告未找到
put
PUT /api/v1/safety/reports/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 107

{
  "location": "text",
  "description": "text",
  "timestamp": "2025-05-24T11:00:26.735Z",
  "status": "pending",
  "user": 1
}

No content

patch

部分更新指定举报报告的信息

Authorizations
Path parameters
idanyRequired

A UUID string identifying this 举报.

Body
idstring · uuidRead-onlyOptional
locationstring · min: 1 · max: 255Required
descriptionstring · min: 1Required
timestampstring · date-timeOptional
statusstring · enumOptionalDefault: pendingPossible values:
imagestring · uriRead-onlyOptional
userintegerRequired
Responses
200
部分更新成功
400
请求无效
404
报告未找到
patch
PATCH /api/v1/safety/reports/{id}/ HTTP/1.1
Host: www.ebike.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 107

{
  "location": "text",
  "description": "text",
  "timestamp": "2025-05-24T11:00:26.735Z",
  "status": "pending",
  "user": 1
}

No content