perf: 规范接口路径

This commit is contained in:
xiongxiaoyang 2022-05-20 06:28:38 +08:00
parent a3a6d3f326
commit 195846bc0f
7 changed files with 25 additions and 25 deletions

View File

@ -28,7 +28,7 @@ public class BookController {
/** /**
* 小说分类列表查询接口 * 小说分类列表查询接口
*/ */
@GetMapping("categoryList") @GetMapping("category/list")
public RestResp<List<BookCategoryRespDto>> listCategory(Integer workDirection) { public RestResp<List<BookCategoryRespDto>> listCategory(Integer workDirection) {
return bookService.listCategory(workDirection); return bookService.listCategory(workDirection);
} }
@ -36,7 +36,7 @@ public class BookController {
/** /**
* 小说搜索接口 * 小说搜索接口
*/ */
@GetMapping("search") @GetMapping("search_list")
public RestResp<PageRespDto<BookInfoRespDto>> searchBooks(BookSearchReqDto condition) { public RestResp<PageRespDto<BookInfoRespDto>> searchBooks(BookSearchReqDto condition) {
return bookService.searchBooks(condition); return bookService.searchBooks(condition);
} }
@ -44,8 +44,8 @@ public class BookController {
/** /**
* 小说信息查询接口 * 小说信息查询接口
*/ */
@GetMapping("{bookId}") @GetMapping("{id}")
public RestResp<BookInfoRespDto> getBookById(@PathVariable("bookId") Long bookId) { public RestResp<BookInfoRespDto> getBookById(@PathVariable("id") Long bookId) {
return bookService.getBookById(bookId); return bookService.getBookById(bookId);
} }
@ -60,7 +60,7 @@ public class BookController {
/** /**
* 小说最新章节相关信息查询接口 * 小说最新章节相关信息查询接口
*/ */
@GetMapping("lastChapterAbout") @GetMapping("last_chapter/about")
public RestResp<BookChapterAboutRespDto> getLastChapterAbout(Long bookId) { public RestResp<BookChapterAboutRespDto> getLastChapterAbout(Long bookId) {
return bookService.getLastChapterAbout(bookId); return bookService.getLastChapterAbout(bookId);
} }
@ -68,7 +68,7 @@ public class BookController {
/** /**
* 小说推荐列表查询接口 * 小说推荐列表查询接口
*/ */
@GetMapping("recList") @GetMapping("rec_list")
public RestResp<List<BookInfoRespDto>> listRecBooks(Long bookId) throws NoSuchAlgorithmException { public RestResp<List<BookInfoRespDto>> listRecBooks(Long bookId) throws NoSuchAlgorithmException {
return bookService.listRecBooks(bookId); return bookService.listRecBooks(bookId);
} }
@ -76,7 +76,7 @@ public class BookController {
/** /**
* 小说章节列表查询接口 * 小说章节列表查询接口
*/ */
@GetMapping("chapterList") @GetMapping("chapter/list")
public RestResp<List<BookChapterRespDto>> listChapters(Long bookId) { public RestResp<List<BookChapterRespDto>> listChapters(Long bookId) {
return bookService.listChapters(bookId); return bookService.listChapters(bookId);
} }
@ -92,7 +92,7 @@ public class BookController {
/** /**
* 获取上一章节ID接口 * 获取上一章节ID接口
*/ */
@GetMapping("preChapterId/{chapterId}") @GetMapping("pre_chapter_id/{chapterId}")
public RestResp<Long> getPreChapterId(@PathVariable("chapterId") Long chapterId) { public RestResp<Long> getPreChapterId(@PathVariable("chapterId") Long chapterId) {
return bookService.getPreChapterId(chapterId); return bookService.getPreChapterId(chapterId);
} }
@ -100,7 +100,7 @@ public class BookController {
/** /**
* 获取下一章节ID接口 * 获取下一章节ID接口
*/ */
@GetMapping("nextChapterId/{chapterId}") @GetMapping("next_chapter_id/{chapterId}")
public RestResp<Long> nextChapterId(@PathVariable("chapterId") Long chapterId) { public RestResp<Long> nextChapterId(@PathVariable("chapterId") Long chapterId) {
return bookService.nextChapterId(chapterId); return bookService.nextChapterId(chapterId);
} }
@ -108,7 +108,7 @@ public class BookController {
/** /**
* 小说点击榜查询接口 * 小说点击榜查询接口
*/ */
@GetMapping("visitRank") @GetMapping("visit_rank")
public RestResp<List<BookRankRespDto>> listVisitRankBooks() { public RestResp<List<BookRankRespDto>> listVisitRankBooks() {
return bookService.listVisitRankBooks(); return bookService.listVisitRankBooks();
} }
@ -116,7 +116,7 @@ public class BookController {
/** /**
* 小说新书榜查询接口 * 小说新书榜查询接口
*/ */
@GetMapping("newestRank") @GetMapping("newest_rank")
public RestResp<List<BookRankRespDto>> listNewestRankBooks() { public RestResp<List<BookRankRespDto>> listNewestRankBooks() {
return bookService.listNewestRankBooks(); return bookService.listNewestRankBooks();
} }
@ -124,7 +124,7 @@ public class BookController {
/** /**
* 小说更新榜查询接口 * 小说更新榜查询接口
*/ */
@GetMapping("updateRank") @GetMapping("update_rank")
public RestResp<List<BookRankRespDto>> listUpdateRankBooks() { public RestResp<List<BookRankRespDto>> listUpdateRankBooks() {
return bookService.listUpdateRankBooks(); return bookService.listUpdateRankBooks();
} }

View File

@ -36,7 +36,7 @@ public class HomeController {
/** /**
* 首页友情链接列表查询接口 * 首页友情链接列表查询接口
*/ */
@GetMapping("friendLinks") @GetMapping("friend_Link/list")
public RestResp<List<HomeFriendLinkRespDto>> listHomeFriendLinks() { public RestResp<List<HomeFriendLinkRespDto>> listHomeFriendLinks() {
return homeService.listHomeFriendLinks(); return homeService.listHomeFriendLinks();
} }

View File

@ -28,7 +28,7 @@ public class NewsController {
/** /**
* 最新新闻列表查询接口 * 最新新闻列表查询接口
*/ */
@GetMapping("latestList") @GetMapping("latest_list")
public RestResp<List<NewsInfoRespDto>> listLatestNews() { public RestResp<List<NewsInfoRespDto>> listLatestNews() {
return newsService.listLatestNews(); return newsService.listLatestNews();
} }

View File

@ -28,7 +28,7 @@ public class ResourceController {
* 获取图片验证码接口 * 获取图片验证码接口
* @return * @return
*/ */
@GetMapping("imgVerifyCode") @GetMapping("img_verify_code")
public RestResp<ImgVerifyCodeRespDto> getImgVerifyCode() throws IOException { public RestResp<ImgVerifyCodeRespDto> getImgVerifyCode() throws IOException {
return resourceService.getImgVerifyCode(); return resourceService.getImgVerifyCode();
} }

View File

@ -57,17 +57,17 @@ public class UserController {
/** /**
* 用户反馈提交接口 * 用户反馈提交接口
*/ */
@PostMapping("feedBack") @PostMapping("feedback")
public RestResp<Void> submitFeedBack(@RequestBody String content) { public RestResp<Void> submitFeedback(@RequestBody String content) {
return userService.saveFeedBack(UserHolder.getUserId(), content); return userService.saveFeedback(UserHolder.getUserId(), content);
} }
/** /**
* 用户反馈删除接口 * 用户反馈删除接口
* */ * */
@DeleteMapping("feedBack/{id}") @DeleteMapping("feedback/{id}")
public RestResp<Void> deleteFeedBack(@PathVariable Long id) { public RestResp<Void> deleteFeedback(@PathVariable Long id) {
return userService.deleteFeedBack(UserHolder.getUserId(), id); return userService.deleteFeedback(UserHolder.getUserId(), id);
} }
} }

View File

@ -34,7 +34,7 @@ public interface UserService {
* @param content 反馈内容 * @param content 反馈内容
* @return void * @return void
* */ * */
RestResp<Void> saveFeedBack(Long userId, String content); RestResp<Void> saveFeedback(Long userId, String content);
/** /**
* 用户信息修改 * 用户信息修改
@ -49,5 +49,5 @@ public interface UserService {
* @param id 反馈ID * @param id 反馈ID
* @return void * @return void
* */ * */
RestResp<Void> deleteFeedBack(Long userId, Long id); RestResp<Void> deleteFeedback(Long userId, Long id);
} }

View File

@ -103,7 +103,7 @@ public class UserServiceImpl implements UserService {
} }
@Override @Override
public RestResp<Void> saveFeedBack(Long userId, String content) { public RestResp<Void> saveFeedback(Long userId, String content) {
UserFeedback userFeedback = new UserFeedback(); UserFeedback userFeedback = new UserFeedback();
userFeedback.setUserId(userId); userFeedback.setUserId(userId);
userFeedback.setContent(content); userFeedback.setContent(content);
@ -125,7 +125,7 @@ public class UserServiceImpl implements UserService {
} }
@Override @Override
public RestResp<Void> deleteFeedBack(Long userId, Long id) { public RestResp<Void> deleteFeedback(Long userId, Long id) {
QueryWrapper<UserFeedback> queryWrapper = new QueryWrapper<>(); QueryWrapper<UserFeedback> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(DatabaseConsts.CommonColumnEnum.ID.getName(), id) queryWrapper.eq(DatabaseConsts.CommonColumnEnum.ID.getName(), id)
.eq(DatabaseConsts.UserFeedBackTable.COLUMN_USER_ID,userId); .eq(DatabaseConsts.UserFeedBackTable.COLUMN_USER_ID,userId);