API命名规范: 如果路径中有{xxx},例:/getUserByID/{id},则表示id要使用REST架构来传, 除此外为RequestParam或ResponseBody,分别对应GET和POST (只要没有标'POST'的都是GET或其他请求)
/login =>login(User user
) boolean POST 判断用户账号密码是否正确,true则登录,存cookie
name
和password
字段/register =>reg(User user
) boolean POST 判断用户名是否重复,false则添加新用户(表示未重名)
name
, password
, type
字段name
, password
, type
, clazz
, sess
字段/getUserByID/{id} =>allByID(Integer id) User 通过id获取user的一切信息
/logout =>logout() void 去除cookie,注销账号
/getCookieUser =>getUser() User 获取当前cookie的User的一切信息
/getUserNameByID/{id} =>nameByID(Integer id
) String通过id只获取用户名
/getIDByName/{name} => getIDByName(String name
) Integer 通过name获取id
/getUserByName/{name} => uByName(String name
)User 通过name获取所有数据
/updateUser =>updateUser(User user
) 更新用户信息 POST
/comment => comment(Comment comment
) void POST 用于添加评论
aid
, text
字段/queryComment/{aid} =>queryc(Integer aid
) List 通过文章id查询评论
/deleteComment/{id}=>delete(Integer id
)void 通过id删除comment(适用于删除chat,直接填id即可)
/countCommentByUID/{uid} => byUID(Integer uid
)通过uid查询评论数量
/reply => reply(Reply reply
) void POST 用于添加回复
from
, text
, to
字段/queryReply/{from} =>queryc(Integer from
)List 通过评论id查询回复
/getReplyByArticleID/{aid} =>byAID(Integer aid) List 通过文章id查询回复
由于数据结构方面的设计,reply不支持直接删除(除非你删除reply所在的comment)
/addArticle => add(Article article
)void POST用于添加文章
uid
title
content
des
tag
img
/updateArticle => update(Article article
) void POST 用于更新文章
id
img
tag
content
title
des
/deleteArticle/{id} => delete(Integer id
) void DELETE 用于删除文章
/passArticle/{id} => passOne(Integer id)void 用于审核文章
/passAll => passAll()void 审核所有未审核的文章
/getArticleByPass/{pass} => getpList(boolean pass
) List 获得所有(已审核/未审核)的文章,看你给的参数是啥
id
,author
,title
,time
,记得传参
/getAllArticle => getAllA() List 获取所有文章
id
,author
, title
, des
, view
, like
, time
,(用于首页的文章列表)/getArticleByID/{id} => allDataForArticleByID(Integer id
) Article 通过id获取一个Article的所有信息,同时会增加访问量
/getArticleByAuthor/{aid} => allArticleForOneAuthor(Integer aid
) List
/getArticleForIndex =>forIndex(Integer now
,Integer size
)ThreeTuple<List,Integer,Integer>获取分页所需数据(已经分页了的)
/like => like(Integer aid
) 查询一个文章的赞的数量,aid必填
/byLike/{size} byLike(Integer size)List 通过点赞数排序
/setTop=> stop(boolean top
,Integer id
) void 设置置顶/取消置顶
/getTop=> top() List 获取置顶的文章
/getCache=> getCache void 控制台输出缓存的数据
/cache => cache void 同步缓存到数据库
/search => search(String text
,Integer now
,Integer size
)
/chat=> add(Chat chat
)void 添加chat POST RequestBody
/queryChat=>query(int now
,int size
)获取非回复的留言(已分页) PageInfo
/upload => upload(MultipartFile file
,username
,uid
) POST
/addUserByExcel => excel(String path
,Integer clazz
,Integer sess
) Object POST 通过excel导入学生数据,并且返回日志
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。