# 工时系统 **Repository Path**: community_9/be ## Basic Information - **Project Name**: 工时系统 - **Description**: 后端部分代码 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-07-24 - **Last Updated**: 2024-03-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### **暑假工时系统** **组员: 叶佳庆 徐冰冰 万林枫 黄自达 ** **采用接口文档:** ``` 1.用户登录注册管理 1.1登录 1.接口描述 接口请求 url : /login Content-Type : application/json 请求方式 :POST 描述 :根据邮箱(也即账户)和密码登录 2.输入参数 参数名称 必选 类型 描述 email 是 String 账户 password 是 String 密码 3.输出示例 { "code": 200, "message": "登录成功!", "content": { "uid": 10, "user_name": "猜猜我是谁", "profile": "https://s3.ax1x.com/2020/12/01/DfHNo4.jpg", "email": "1670149054@qq.com", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTAsImV4cCI6MTY2MjQwMjU2NX0.gMdQ4UvZwE-Xt_0Lt3-ncw6w-JwxxZHAY344zair-eo" } } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 user_id Long 用户id user_name String 昵称 profile String 头像 email String 邮箱/账户 token String 令牌 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 **注册** 1.接口描述 接口请求 url : /register Content-Type : application/json 请求方式 :POST 描述 :用户用邮箱注册 接收验证码后,将验证码输入,核对完成后即注册完成,跳转页面设置昵称和密码,即可成功登录,以后输入账户,密码即可登录 2.输入参数 参数名称 必选 类型 描述 说明 user_name 是 String 昵称 password 是 String 密码 passwordAgain 是 String 确认密码 email 是 String 邮箱 3.输出示例 { "code": 200, "message": "注册成功!", "content": null } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 发送验证码 1.接口描述 接口请求 url : /sendCode Content-Type :RequestParam 请求方式 :POST/GET 描述 :发送验证码 2.输入参数 参数名称 必选 类型 描述 email 是 String 邮箱 3.输出示例 { "code": 200, "message": "验证码发送成功!", "content": null } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 找回密码 1.接口描述 接口请求 url : /retrievePassword Content-Type : RequestParam 请求方式 :POST 描述 :找回密码 2.输入参数 请求头参数 参数名称 必选 类型 描述 请求体参数: 参数名称 必选 类型 描述 password 是 String 密码 passwordAgain 是 String 确认密码 3.输出示例 { "code": 200, "message": "修改密码成功!", "content": null } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 修改密码 1.接口描述 接口请求 url :/resetPassword Content-Type :RequestParam 请求方式 :POST 描述 :重置密码 2.输入参数 参数名称 必选 类型 描述 password 是 String 通过密码 newpassword 是 String 新密码 newpasswordAgain是 String 新密码确认 3.输出示例 { "code": 200, "message": "修改密码成功!", "content": null } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 2.用户资料管理 2.1/获取 /获取资料 1.接口描述 接口请求 url :/getInformation content-type :application/json 请求方式 :POST 描述 :发送验证码 2.输入参数 请求头 token 是 String 令牌 参数名称 必选 类型 描述 user_id 是 int 用户id 3.输出示例 { "code": 200, "message": "获取/修改成功", "content": { "uid":10, "user_name":"无名氏", "gender":"女", "age":"32", "profile":"http://host:8084/path(文件路径)", } } 4.输出参数 参数名称 类型 描述 user_id int 用户id user_name String 名字 gender string 性别 age String 年纪 profile String 照片地址 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 2.2/修改 /修改/完善资料 1.接口描述 接口请求 url :/revise content-type :application/json 请求方式 :POST 描述 :发送验证码 2.输入参数 请求头 token 是 String 令牌 参数名称 必选 类型 描述 user_id 是 int 用户id user_name 是 String 名字 gender 是 string 性别 age 是 String 年纪 profile 是 multipartFile 照片文件 3.输出示例 { "code": 200, "message": "获取/修改成功", "content": { "uid":10, "user_name":"wumingshi", "gender":"女", "age":"32", "profile":"http://host:8084/path(文件路径)", } } 4.输出参数 参数名称 类型 描述 user_id int 用户id user_name String 名字 gender string 性别 age String 年纪 profile String 照片地址 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.社区论坛管理 //这边发布新帖在下面,顺序有点乱,不好意思,因为在写接口的过程中出现了点问题 3.0搜索帖子 3.0 查询 /搜索帖子 获取参数 1.接口描述 接口请求 url :/searchPost content-type :application/json 请求方式 :POST 描述 :查询想要看到的帖子(模糊查询),仅支持对标题的搜索,也就是说我们底层时仅仅从数据库内select 同时,可能会出现出现多个结果的情况,在输出示例中仅仅给出来一个。 2.输入参数 请求头 token 是 String 令牌 IncomingText 是 String 用户搜索时输入的文本 参数名称 必选 类型 描述 3.输出示例 { "code": 200, "message": "搜索成功", "content":[ { "post_id":2342432, "Post_title":"一颗小叶" }, { "post_id":8763824, "Post_title":"一颗小叶" }, { "post_id":9823463, "Post_title":"一颗小叶" }, ...... ] } 4.输出参数 参数名称 类型 描述 post_id bigint 帖子的id Post_title String 数据库查询完内容后,返回的一个个标题 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.1.1发布新帖 发布新帖 1.接口描述 接口请求 url :/postPost content-type :application/json 请求方式 :POST 描述 :编辑文字(有标题和正文之分)和图片(只能发不超过九张)并发布 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 label_id 是 int 标签id user_id 是 int 用户id title 是 String 标题 article 是 String 文章内容 3.输出示例 { "code": 200, "message": "帖子发送成功!", "content":"发布成功" } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 1.接口描述 接口请求 url :/postPicture content-type :multipart/form-data 请求方式 :POST 描述 :上传图片 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 post_id 是 bigint 帖子id post_profile1 multipartFile 照片文件 post_profile2 multipartFile 照片文件 post_profile3 multipartFile 照片文件 post_profile4 multipartFile 照片文件 post_profile5 multipartFile 照片文件 post_profile6 multipartFile 照片文件 post_profile7 multipartFile 照片文件 post_profile8 multipartFile 照片文件 post_profile9 multipartFile 照片文件 3.输出示例 { "code": 200, "message": "图片上传成功!", "content":"上传成功" } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.1.2 页面显示所有已发布的帖子 页面显示所有已发布的帖子 1.接口描述 接口请求 url :/showPublishedPost content-type :application/json 请求方式 :GET 描述 :将所有已发布的帖子的标题和作者显示在页面上,按照发布时间排序(显示的是所有帖子,返回一个集合) 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 user_id 是 int 用户id 3.输出示例 { "code": 200, "message": " ", "content":[ { "title":"这是标题", "user_name":"作者昵称", "post_time":"2021-3-23-10:00:45", "label_content":"这是标签内容", "post_id":344546553, }, { "title":"这是标题", "user_name":"作者昵称", "post_time":"2021-3-23-16:00:45", "label_content":"这是标签内容", "post_id":34468073, }, { "title":"这是标题", "user_name":"作者昵称", "post_time":"2021-3-23-23:00:45", "label_content":"这是标签内容", "post_id":1241356853, }, ....... ] } 4.输出参数 参数名称 类型 描述 post_id bigint 帖子id label_content String 标签内容 user_name String 帖子作者的昵称 title String 帖子的标题 post_time DateTime 贴子发布的时间 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.1.3页面显示一个帖子的具体内容 页面显示一个帖子的具体内容 1.接口描述 接口请求 url :/showPostDetails content-type :application/json 请求方式 :GET 描述 :点击一个帖子的标题,页面跳转,显示该帖子的详细内容 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 post_id 是 bigint 帖子的id 3.输出示例 { "code": 200, "message": " ", "content": [ { "title":"这是标题", "user_name":"作者昵称", "article":"这是帖子的内容", "praised_num":100, "collected_num ":100, "post_time":"2021-3-23-13:40:45", "label_content":"这是标签内容", "comment_id":43251536443, "comment_praised_num":10, "content":" ", "post_id":345635432435, "post_profile1":"http://host:8084/path(文件路径)" "post_profile2":"http://host:8084/path(文件路径)" "post_profile3":"http://host:8084/path(文件路径)" "post_profile4":"http://host:8084/path(文件路径)" "post_profile5":"http://host:8084/path(文件路径)" "post_profile6":"http://host:8084/path(文件路径)" "post_profile7":"http://host:8084/path(文件路径) " "post_profile8":"http://host:8084/path(文件路径)" "post_profile9":"http://host:8084/path(文件路径)" }, { "title":"这是标题", "user_name":"作者昵称", "article":"这是帖子的内容", "praised_num":100, "collected_num ":100, "post_time":"2021-3-23-11:00:45", "label_content":"这是标签内容", "comment_id":432534536443, "comment_praised_num":10, "content":" ", "post_id":23496435, "post_profile1":"http://host:8084/path(文件路径)" "post_profile2":"http://host:8084/path(文件路径)" "post_profile3":"http://host:8084/path(文件路径)" "post_profile4":"http://host:8084/path(文件路径)" "post_profile5":"http://host:8084/path(文件路径)" "post_profile6":"http://host:8084/path(文件路径)" "post_profile7":"http://host:8084/path(文件路径) " "post_profile8":"http://host:8084/path(文件路径)" "post_profile9":"http://host:8084/path(文件路径)" }, { "title":"这是标题", "user_name":"作者昵称", "article":"这是帖子的内容", "praised_num":100, "collected_num ":100, "post_time":"2021-3-23-14:00:45", "label_content":"这是标签内容", "comment_id":43251525443, "comment_praised_num":10, "content":" ", "post_id":3242342435, "post_profile1":"http://host:8084/path(文件路径)" "post_profile2":"http://host:8084/path(文件路径)" "post_profile3":"http://host:8084/path(文件路径)" "post_profile4":"http://host:8084/path(文件路径)" "post_profile5":"http://host:8084/path(文件路径)" "post_profile6":"http://host:8084/path(文件路径)" "post_profile7":"http://host:8084/path(文件路径) " "post_profile8":"http://host:8084/path(文件路径)" "post_profile9":"http://host:8084/path(文件路径)" }, ...... ] } 4.输出参数 参数名称 类型 描述 post_id bigint 帖子id comment_id bigint 评论的id content String 评论的内容 comment_praised_num int 评论的点赞数 label_content String 标签内容 user_name String 帖子作者的昵称 title String 帖子的标题 article String 帖子的内容 praised_num int 帖子的点赞数 collect_num int 帖子的收藏数 post_time DateTime 贴子发布的时间 post_profile1 String 照片地址 post_profile2 String 照片地址 post_profile3 String 照片地址 post_profile4 String 照片地址 post_profile5 String 照片地址 post_profile6 String 照片地址 post_profile7 String 照片地址 post_profile8 String 照片地址 post_profile9 String 照片地址 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.1.4查看自己写的所有帖子 查看自己写的所有帖子 1.接口描述 接口请求 url :/checkOwnPost content-type :application/json 请求方式 :GET 描述 :用户查看自己发布过的所有帖子,显示所有帖子标题,点击标题后 可以看到详细内容(返回的也是一个list集合) 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 user_id 是 int 用户id 3.输出示例 { "code": 200, "message": " ", "content": [ { "title":"这是标题", "user_name":"作者昵称", "post_time":"2021-3-23-13:00:50", "label_content":"这是标签内容", "post_id":4127861329974, }, { "title":"这是标题", "user_name":"作者昵称", "post_time":"2021-3-23-23:00:45", "label_content":"这是标签内容", "post_id":41278614935794, }, { "title":"这是标题", "user_name":"作者昵称", "post_time":"2021-3-23-15:00:45", "label_content":"这是标签内容", "post_id":41278698856974, }, ...... ] } 4.输出参数 参数名称 类型 描述 post_id bigint 帖子id label_content String 标签内容 user_name String 帖子作者的昵称 title String 帖子的标题 post_time DateTime 贴子发布的时间 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.2删除帖子 删除帖子 1.接口描述 接口请求 url :/deletePost content-type :RequestParam 请求方式 :Delete 描述 :删除帖子。 2.输入参数 请求头 token 是 String 令牌 参数名称 必选 类型 描述 id 是 bigint 帖子的id 3.输出示例 { "code": 200, "message": "删除成功!", "content": null } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.3添加评论 添加评论 1.接口描述 接口请求 url :/addComment content-type :RequestParam 请求方式 :POST 描述 :添加评论,但仅仅只能回复文字,或者emoj。 2.输入参数 请求头 token 是 String 令牌 参数名称 必选 类型 描述 post_id 是 bigint 帖子id user_id 是 int 评论人id post_time 是 DateTime 帖子发布时间 comment_creat_time 是 String 评论时间 3.输出示例 { "code": 200, "message": "添加评论成功!", "content": {"uid":10 "user_id":10, "commentcreat_time":"2021-3-23-13:00:45", } } 4.输出参数 参数名称 类型 描述 user_id String 评论人id commentcreat_time String 评论时间 comment_id bigint 添加评论的id code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.4优秀/精华评论 优秀/精华评论 1.接口描述 接口请求 url :/greatComment content-type :RequestParam 请求方式 :POST 描述 :将每条评论下的获赞数最多的评论置顶,并标上精华评论标签 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 post_id 是 bigint 帖子id priased_num 是 int 评论的获赞数 comment_id 是 bigint 评论id comment_creat_time 是 Stringe 评论的时间 3.输出示例 { "code": 200, "message":"", "content": " " "uid":1234521234576876, "post_id":123143245421, "content":"", } 4.输出参数 参数名称 类型 描述 post_id bigint 帖子id comment_id bigint 评论id content String 评论内容 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.5删除评论 1.接口描述 接口请求 url :/deleteComment content-type :RequestParam 请求方式 :Delete 描述 :删除评论。 2.输入参数 token 是 String 令牌 参数名称 必选 类型 描述 comment_id 是 bigint 评论的id 3.输出示例 { "code": 200, "message": "删除成功!", "content": null } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.6添加标签 添加标签 1.接口描述 接口请求 url :/addTag content-type :RequestParam 请求方式 :POST 描述 :添加标签。 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 content 是 String 标签内容 3.输出示例 { "code": 200, "message": "添加成功!", "content": null } 4.输出参数 参数名称 类型 描述 label_id int 标签id code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.7点赞 1.接口描述 接口请求 url :/thumbsUp content-type :RequestParam 请求方式 :POST 描述 :点赞。 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 praise_time 是 DateTime 点赞时间 user_id 是 int 用户id post_id 是 bigint 帖子id comment_id bigint 评论id state 是 int 用于判断点赞是否存在(点一次成功,再点一次赞就取消) 3.输出示例 { "code": 200, "message": "点赞成功!", "content": null "state":1 } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 state int 用于判断点赞是否存在(点一次成功,再点一次赞就取消) content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.8收藏 1.接口描述 接口请求 url :/collect content-type :RequestParam 请求方式 :POST 描述 :收藏。 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 post_id 是 bigint 帖子id collect_time 是 DateTime 收藏时间 user_id 是 int 用户id 3.输出示例 { "code": 200, "message": "收藏成功!", "content": null } 4.输出参数 参数名称 类型 描述 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 //点赞收藏的代码已经部署完毕 3.9查看所有标签页 3.0 查询 /查看所有标签页 获取参数 1.接口描述 接口请求 url :/getAllTheLabels content-type :application/json 请求方式 :GET 描述 :用户点击标签按钮后得知所有的标签 标签是数组 实例仅写了一个 2.输入参数 请求头 token 是 String 令牌 参数名称 必选 类型 描述 无 3.输出示例 { "code": 200, "message": "查看成功", "content":[ { "label_content":"校园", }, { "label_content":"招新", }, { "label_content":"活动", }, ...... ] } 4.输出参数 参数名称 类型 描述 label_content String 单个标签的内容 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.10查看点赞的帖子 3.0 查询 /查看所有点赞内容 获取参数 1.接口描述 接口请求 url :/CheckPraised content-type :application/json 请求方式 :GET 描述 :用户点击一个特定按钮后可以查看所有点赞过的帖子,所有帖子只展示标题。 2.输入参数 请求头 token 是 String 令牌 参数名称 必选 类型 描述 无 3.输出示例 { "code": 200, "message": "查看成功", "content": [ { "post_id":5231543, "praise_content":"我是被点赞的帖子的标题1", }, { "post_id":6543632, "praise_content":"我是被点赞的帖子的标题2", }, { "post_id":2864387, "praise_content":"我是被点赞的帖子的标题3", }, ...... ] } 4.输出参数 参数名称 类型 描述 post_id bigint 帖子的id praise_content String 被点赞的帖子的标题 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.11查看收藏的帖子 接口描述 接口请求 url :/checkCollected content-type :application/json 请求方式 :GET 描述 :用户点击一个特定按钮后可以查看所有收藏过的帖子,所有帖子只展示标题。 2.输入参数 请求头参数 token 是 String 令牌 参数名称 必选 类型 描述 无 3.输出示例 { "code": 200, "message": "查看成功!", "content":[ { "content": "收藏的帖子的title1" "post_id":23746384, }, { "content": "收藏的帖子的title2" "post_id":3429632, }, { "content": "收藏的帖子的title3" "post_id":986534648, }, ...... ] } 4.输出参数 参数名称 类型 描述 post_id bigint 帖子的id title String 所有收藏的帖子的title code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常 3.12在标签页面选择帖子进行查看后的页面展示 /标签页面选择帖子进行查看后的页面展示 获取参数 1.接口描述 接口请求 url :/PostByLabel content-type :application/json 请求方式 :GET 描述 :用户点击标签按钮后得知所有的Posts 帖子是数组 实例仅写了一个 2.输入参数 请求头 token 是 String 令牌 参数名称 必选 类型 描述 无 3.输出示例 { "code": 200, "message": "查看成功", "content":[ { "post_title":" ", "post_id":986534648, }, { "post_title":" ", "post_id":986534648, }, { "post_title":" ", "post_id":986534648, }, ...... ] } 4.输出参数 参数名称 类型 描述 post_id bigint 帖子的id post_title String 帖子的标题 code int 状态码 message String 状态码说明 content 泛型 返回泛型数据,自定义类型 5.备注 状态码 状态码备注 200 操作成功 70000 参数缺失 70001 业务异常 99999 系统异常```