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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ public interface UserService {
* @param content 反馈内容
* @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
* @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
public RestResp<Void> saveFeedBack(Long userId, String content) {
public RestResp<Void> saveFeedback(Long userId, String content) {
UserFeedback userFeedback = new UserFeedback();
userFeedback.setUserId(userId);
userFeedback.setContent(content);
@ -125,7 +125,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public RestResp<Void> deleteFeedBack(Long userId, Long id) {
public RestResp<Void> deleteFeedback(Long userId, Long id) {
QueryWrapper<UserFeedback> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(DatabaseConsts.CommonColumnEnum.ID.getName(), id)
.eq(DatabaseConsts.UserFeedBackTable.COLUMN_USER_ID,userId);