docs: 接口文档修改

This commit is contained in:
xiongxiaoyang 2022-06-27 18:33:44 +08:00
parent 80480bc026
commit e795d26aa5
7 changed files with 44 additions and 44 deletions

View File

@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.*;
* @author xiongxiaoyang
* @date 2022/5/23
*/
@Tag(name = "author", description = "作家后台-作者模块")
@Tag(name = "AuthorController", description = "作家后台-作者模块")
@SecurityRequirement(name = SystemConfigConsts.HTTP_AUTH_HEADER_NAME)
@RestController
@RequestMapping(ApiRouterConsts.API_AUTHOR_URL_PREFIX)
@ -42,7 +42,7 @@ public class AuthorController {
/**
* 作家注册接口
*/
@Operation(description = "作家注册接口")
@Operation(summary = "作家注册接口")
@PostMapping("register")
public RestResp<Void> register(@Valid @RequestBody AuthorRegisterReqDto dto) {
dto.setUserId(UserHolder.getUserId());
@ -52,7 +52,7 @@ public class AuthorController {
/**
* 查询作家状态接口
*/
@Operation(description = "作家状态查询接口")
@Operation(summary = "作家状态查询接口")
@GetMapping("status")
public RestResp<Integer> getStatus() {
return authorService.getStatus(UserHolder.getUserId());
@ -61,7 +61,7 @@ public class AuthorController {
/**
* 小说发布接口
*/
@Operation(description = "小说发布接口")
@Operation(summary = "小说发布接口")
@PostMapping("book")
public RestResp<Void> publishBook(@Valid @RequestBody BookAddReqDto dto) {
return bookService.saveBook(dto);
@ -70,7 +70,7 @@ public class AuthorController {
/**
* 小说发布列表查询接口
*/
@Operation(description = "小说发布列表查询接口")
@Operation(summary = "小说发布列表查询接口")
@GetMapping("books")
public RestResp<PageRespDto<BookInfoRespDto>> listBooks(@ParameterObject PageReqDto dto) {
return bookService.listAuthorBooks(dto);
@ -79,7 +79,7 @@ public class AuthorController {
/**
* 小说章节发布接口
*/
@Operation(description = "小说章节发布接口")
@Operation(summary = "小说章节发布接口")
@PostMapping("book/chapter/{bookId}")
public RestResp<Void> publishBookChapter(@Parameter(description = "小说ID") @PathVariable("bookId") Long bookId, @Valid @RequestBody ChapterAddReqDto dto) {
dto.setBookId(bookId);
@ -89,9 +89,9 @@ public class AuthorController {
/**
* 小说章节发布列表查询接口
*/
@Operation(description = "小说章节发布列表查询接口")
@Operation(summary = "小说章节发布列表查询接口")
@GetMapping("book/chapters/{bookId}")
public RestResp<PageRespDto<BookChapterRespDto>> listBookChapters(@Parameter(description = "小说ID") @PathVariable("bookId") Long bookId, PageReqDto dto) {
public RestResp<PageRespDto<BookChapterRespDto>> listBookChapters(@Parameter(description = "小说ID") @PathVariable("bookId") Long bookId,@ParameterObject PageReqDto dto) {
return bookService.listBookChapters(bookId, dto);
}

View File

@ -19,7 +19,7 @@ import java.util.List;
* @author xiongxiaoyang
* @date 2022/5/14
*/
@Tag(name = "book", description = "前台门户-小说模块")
@Tag(name = "BookController", description = "前台门户-小说模块")
@RestController
@RequestMapping(ApiRouterConsts.API_FRONT_BOOK_URL_PREFIX)
@RequiredArgsConstructor
@ -30,7 +30,7 @@ public class BookController {
/**
* 小说分类列表查询接口
*/
@Operation(description = "小说分类列表查询接口")
@Operation(summary = "小说分类列表查询接口")
@GetMapping("category/list")
public RestResp<List<BookCategoryRespDto>> listCategory(@Parameter(description = "作品方向",required = true) Integer workDirection) {
return bookService.listCategory(workDirection);
@ -39,7 +39,7 @@ public class BookController {
/**
* 小说信息查询接口
*/
@Operation(description = "小说信息查询接口")
@Operation(summary = "小说信息查询接口")
@GetMapping("{id}")
public RestResp<BookInfoRespDto> getBookById(@Parameter(description = "小说 ID") @PathVariable("id") Long bookId) {
return bookService.getBookById(bookId);
@ -48,7 +48,7 @@ public class BookController {
/**
* 增加小说点击量接口
*/
@Operation(description = "增加小说点击量接口")
@Operation(summary = "增加小说点击量接口")
@PostMapping("visit")
public RestResp<Void> addVisitCount(@Parameter(description = "小说ID") Long bookId) {
return bookService.addVisitCount(bookId);
@ -57,7 +57,7 @@ public class BookController {
/**
* 小说最新章节相关信息查询接口
*/
@Operation(description = "小说最新章节相关信息查询接口")
@Operation(summary = "小说最新章节相关信息查询接口")
@GetMapping("last_chapter/about")
public RestResp<BookChapterAboutRespDto> getLastChapterAbout(@Parameter(description = "小说ID") Long bookId) {
return bookService.getLastChapterAbout(bookId);
@ -66,7 +66,7 @@ public class BookController {
/**
* 小说推荐列表查询接口
*/
@Operation(description = "小说推荐列表查询接口")
@Operation(summary = "小说推荐列表查询接口")
@GetMapping("rec_list")
public RestResp<List<BookInfoRespDto>> listRecBooks(@Parameter(description = "小说ID") Long bookId) throws NoSuchAlgorithmException {
return bookService.listRecBooks(bookId);
@ -75,7 +75,7 @@ public class BookController {
/**
* 小说章节列表查询接口
*/
@Operation(description = "小说章节列表查询接口")
@Operation(summary = "小说章节列表查询接口")
@GetMapping("chapter/list")
public RestResp<List<BookChapterRespDto>> listChapters(@Parameter(description = "小说ID") Long bookId) {
return bookService.listChapters(bookId);
@ -84,7 +84,7 @@ public class BookController {
/**
* 小说内容相关信息查询接口
*/
@Operation(description = "小说内容相关信息查询接口")
@Operation(summary = "小说内容相关信息查询接口")
@GetMapping("content/{chapterId}")
public RestResp<BookContentAboutRespDto> getBookContentAbout(@Parameter(description = "章节ID") @PathVariable("chapterId") Long chapterId) {
return bookService.getBookContentAbout(chapterId);
@ -93,7 +93,7 @@ public class BookController {
/**
* 获取上一章节ID接口
*/
@Operation(description = "获取上一章节ID接口")
@Operation(summary = "获取上一章节ID接口")
@GetMapping("pre_chapter_id/{chapterId}")
public RestResp<Long> getPreChapterId(@Parameter(description = "章节ID") @PathVariable("chapterId") Long chapterId) {
return bookService.getPreChapterId(chapterId);
@ -102,7 +102,7 @@ public class BookController {
/**
* 获取下一章节ID接口
*/
@Operation(description = "获取下一章节ID接口")
@Operation(summary = "获取下一章节ID接口")
@GetMapping("next_chapter_id/{chapterId}")
public RestResp<Long> getNextChapterId(@Parameter(description = "章节ID") @PathVariable("chapterId") Long chapterId) {
return bookService.getNextChapterId(chapterId);
@ -111,7 +111,7 @@ public class BookController {
/**
* 小说点击榜查询接口
*/
@Operation(description = "小说点击榜查询接口")
@Operation(summary = "小说点击榜查询接口")
@GetMapping("visit_rank")
public RestResp<List<BookRankRespDto>> listVisitRankBooks() {
return bookService.listVisitRankBooks();
@ -120,7 +120,7 @@ public class BookController {
/**
* 小说新书榜查询接口
*/
@Operation(description = "小说新书榜查询接口")
@Operation(summary = "小说新书榜查询接口")
@GetMapping("newest_rank")
public RestResp<List<BookRankRespDto>> listNewestRankBooks() {
return bookService.listNewestRankBooks();
@ -129,7 +129,7 @@ public class BookController {
/**
* 小说更新榜查询接口
*/
@Operation(description = "小说更新榜查询接口")
@Operation(summary = "小说更新榜查询接口")
@GetMapping("update_rank")
public RestResp<List<BookRankRespDto>> listUpdateRankBooks() {
return bookService.listUpdateRankBooks();
@ -138,7 +138,7 @@ public class BookController {
/**
* 小说最新评论查询接口
*/
@Operation(description = "小说最新评论查询接口")
@Operation(summary = "小说最新评论查询接口")
@GetMapping("comment/newest_list")
public RestResp<BookCommentRespDto> listNewestComments(@Parameter(description = "小说ID") Long bookId) {
return bookService.listNewestComments(bookId);

View File

@ -20,7 +20,7 @@ import java.util.List;
* @author xiongxiaoyang
* @date 2022/5/12
*/
@Tag(name = "home", description = "前台门户-首页模块")
@Tag(name = "HomeController", description = "前台门户-首页模块")
@RestController
@RequestMapping(ApiRouterConsts.API_FRONT_HOME_URL_PREFIX)
@RequiredArgsConstructor
@ -31,7 +31,7 @@ public class HomeController {
/**
* 首页小说推荐查询接口
*/
@Operation(description = "首页小说推荐查询接口")
@Operation(summary = "首页小说推荐查询接口")
@GetMapping("books")
public RestResp<List<HomeBookRespDto>> listHomeBooks() {
return homeService.listHomeBooks();
@ -40,7 +40,7 @@ public class HomeController {
/**
* 首页友情链接列表查询接口
*/
@Operation(description = "首页友情链接列表查询接口")
@Operation(summary = "首页友情链接列表查询接口")
@GetMapping("friend_Link/list")
public RestResp<List<HomeFriendLinkRespDto>> listHomeFriendLinks() {
return homeService.listHomeFriendLinks();

View File

@ -21,7 +21,7 @@ import java.util.List;
* @author xiongxiaoyang
* @date 2022/5/12
*/
@Tag(name = "news", description = "前台门户-新闻模块")
@Tag(name = "NewsController", description = "前台门户-新闻模块")
@RestController
@RequestMapping(ApiRouterConsts.API_FRONT_NEWS_URL_PREFIX)
@RequiredArgsConstructor
@ -32,7 +32,7 @@ public class NewsController {
/**
* 最新新闻列表查询接口
*/
@Operation(description = "最新新闻列表查询接口")
@Operation(summary = "最新新闻列表查询接口")
@GetMapping("latest_list")
public RestResp<List<NewsInfoRespDto>> listLatestNews() {
return newsService.listLatestNews();
@ -41,7 +41,7 @@ public class NewsController {
/**
* 新闻信息查询接口
*/
@Operation(description = "新闻信息查询接口")
@Operation(summary = "新闻信息查询接口")
@GetMapping("{id}")
public RestResp<NewsInfoRespDto> getNews(@Parameter(description = "新闻ID") @PathVariable Long id) {
return newsService.getNews(id);

View File

@ -19,7 +19,7 @@ import java.io.IOException;
* @author xiongxiaoyang
* @date 2022/5/17
*/
@Tag(name = "resource", description = "前台门户-资源模块")
@Tag(name = "ResourceController", description = "前台门户-资源模块")
@RestController
@RequestMapping(ApiRouterConsts.API_FRONT_RESOURCE_URL_PREFIX)
@RequiredArgsConstructor
@ -30,7 +30,7 @@ public class ResourceController {
/**
* 获取图片验证码接口
*/
@Operation(description = "获取图片验证码接口")
@Operation(summary = "获取图片验证码接口")
@GetMapping("img_verify_code")
public RestResp<ImgVerifyCodeRespDto> getImgVerifyCode() throws IOException {
return resourceService.getImgVerifyCode();
@ -39,7 +39,7 @@ public class ResourceController {
/**
* 图片上传接口
* */
@Operation(description = "图片上传接口")
@Operation(summary = "图片上传接口")
@PostMapping("/image")
RestResp<String> uploadImage(@Parameter(description = "上传文件") @RequestParam("file") MultipartFile file) {
return resourceService.uploadImage(file);

View File

@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
* @author xiongxiaoyang
* @date 2022/5/27
*/
@Tag(name = "search", description = "前台门户-搜索模块")
@Tag(name = "SearchController", description = "前台门户-搜索模块")
@RestController
@RequestMapping(ApiRouterConsts.API_FRONT_SEARCH_URL_PREFIX)
@RequiredArgsConstructor
@ -31,7 +31,7 @@ public class SearchController {
/**
* 小说搜索接口
*/
@Operation(description = "小说搜索接口")
@Operation(summary = "小说搜索接口")
@GetMapping("books")
public RestResp<PageRespDto<BookInfoRespDto>> searchBooks(@ParameterObject BookSearchReqDto condition) {
return searchService.searchBooks(condition);

View File

@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.*;
* @author xiongxiaoyang
* @date 2022/5/17
*/
@Tag(name = "user", description = "前台门户-会员模块")
@Tag(name = "UserController", description = "前台门户-会员模块")
@SecurityRequirement(name = SystemConfigConsts.HTTP_AUTH_HEADER_NAME)
@RestController
@RequestMapping(ApiRouterConsts.API_FRONT_USER_URL_PREFIX)
@ -41,7 +41,7 @@ public class UserController {
/**
* 用户注册接口
*/
@Operation(description = "用户注册接口")
@Operation(summary = "用户注册接口")
@PostMapping("register")
public RestResp<UserRegisterRespDto> register(@Valid @RequestBody UserRegisterReqDto dto) {
return userService.register(dto);
@ -50,7 +50,7 @@ public class UserController {
/**
* 用户登录接口
*/
@Operation(description = "用户登录接口")
@Operation(summary = "用户登录接口")
@PostMapping("login")
public RestResp<UserLoginRespDto> login(@Valid @RequestBody UserLoginReqDto dto) {
return userService.login(dto);
@ -59,7 +59,7 @@ public class UserController {
/**
* 用户信息查询接口
*/
@Operation(description = "用户信息查询接口")
@Operation(summary = "用户信息查询接口")
@GetMapping
public RestResp<UserInfoRespDto> getUserInfo() {
return userService.getUserInfo(UserHolder.getUserId());
@ -68,7 +68,7 @@ public class UserController {
/**
* 用户信息修改接口
*/
@Operation(description = "用户信息修改接口")
@Operation(summary = "用户信息修改接口")
@PutMapping
public RestResp<Void> updateUserInfo(@Valid @RequestBody UserInfoUptReqDto dto) {
dto.setUserId(UserHolder.getUserId());
@ -78,7 +78,7 @@ public class UserController {
/**
* 用户反馈提交接口
*/
@Operation(description = "用户反馈提交接口")
@Operation(summary = "用户反馈提交接口")
@PostMapping("feedback")
public RestResp<Void> submitFeedback(@RequestBody String content) {
return userService.saveFeedback(UserHolder.getUserId(), content);
@ -87,7 +87,7 @@ public class UserController {
/**
* 用户反馈删除接口
*/
@Operation(description = "用户反馈删除接口")
@Operation(summary = "用户反馈删除接口")
@DeleteMapping("feedback/{id}")
public RestResp<Void> deleteFeedback(@Parameter(description = "反馈ID") @PathVariable Long id) {
return userService.deleteFeedback(UserHolder.getUserId(), id);
@ -96,7 +96,7 @@ public class UserController {
/**
* 发表评论接口
*/
@Operation(description = "发表评论接口")
@Operation(summary = "发表评论接口")
@PostMapping("comment")
public RestResp<Void> comment(@Valid @RequestBody UserCommentReqDto dto) {
dto.setUserId(UserHolder.getUserId());
@ -106,7 +106,7 @@ public class UserController {
/**
* 修改评论接口
*/
@Operation(description = "修改评论接口")
@Operation(summary = "修改评论接口")
@PutMapping("comment/{id}")
public RestResp<Void> updateComment(@Parameter(description = "评论ID") @PathVariable Long id, String content) {
return bookService.updateComment(UserHolder.getUserId(), id, content);
@ -115,7 +115,7 @@ public class UserController {
/**
* 删除评论接口
*/
@Operation(description = "删除评论接口")
@Operation(summary = "删除评论接口")
@DeleteMapping("comment/{id}")
public RestResp<Void> deleteComment(@Parameter(description = "评论ID") @PathVariable Long id) {
return bookService.deleteComment(UserHolder.getUserId(), id);
@ -126,7 +126,7 @@ public class UserController {
* 0-不在书架
* 1-已在书架
*/
@Operation(description = "查询书架状态接口")
@Operation(summary = "查询书架状态接口")
@GetMapping("bookshelf_status")
public RestResp<Integer> getBookshelfStatus(@Parameter(description = "小说ID") String bookId) {
return userService.getBookshelfStatus(UserHolder.getUserId(), bookId);