mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
feat: 集成 springdoc-openapi 自动生成 API 文档
This commit is contained in:
parent
c572650107
commit
dec50ab0a0
19
pom.xml
19
pom.xml
@ -24,6 +24,7 @@
|
|||||||
<shardingsphere-jdbc.version>5.1.1</shardingsphere-jdbc.version>
|
<shardingsphere-jdbc.version>5.1.1</shardingsphere-jdbc.version>
|
||||||
<redisson.version>3.17.4</redisson.version>
|
<redisson.version>3.17.4</redisson.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@ -174,6 +175,13 @@
|
|||||||
<artifactId>spring-boot-starter-aop</artifactId>
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- OpenAPI 3 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
|
<version>2.0.0-M4-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
@ -240,6 +248,17 @@
|
|||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>sonatype-nexus-snapshots-2</id>
|
||||||
|
<name>Sonatype Nexus Snapshots 2</name>
|
||||||
|
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
<releases>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</releases>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<pluginRepositories>
|
<pluginRepositories>
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
package io.github.xxyopen.novel;
|
package io.github.xxyopen.novel;
|
||||||
|
|
||||||
|
import io.github.xxyopen.novel.core.constant.SystemConfigConsts;
|
||||||
|
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
||||||
|
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
|
||||||
|
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
||||||
|
import io.swagger.v3.oas.annotations.info.Info;
|
||||||
|
import io.swagger.v3.oas.annotations.info.License;
|
||||||
|
import io.swagger.v3.oas.annotations.security.SecurityScheme;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.CommandLineRunner;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
@ -13,10 +20,11 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.util.matcher.AnyRequestMatcher;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@OpenAPIDefinition(info = @Info(title = "novel 项目接口文档", version = "v3.2.0", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0")))
|
||||||
|
@SecurityScheme(type = SecuritySchemeType.APIKEY, in = SecuritySchemeIn.HEADER, name = SystemConfigConsts.HTTP_AUTH_HEADER_NAME, description = "登录 token")
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@MapperScan("io.github.xxyopen.novel.dao.mapper")
|
@MapperScan("io.github.xxyopen.novel.dao.mapper")
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
|
@ -5,6 +5,7 @@ import io.github.xxyopen.novel.core.common.req.PageReqDto;
|
|||||||
import io.github.xxyopen.novel.core.common.resp.PageRespDto;
|
import io.github.xxyopen.novel.core.common.resp.PageRespDto;
|
||||||
import io.github.xxyopen.novel.core.common.resp.RestResp;
|
import io.github.xxyopen.novel.core.common.resp.RestResp;
|
||||||
import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
||||||
|
import io.github.xxyopen.novel.core.constant.SystemConfigConsts;
|
||||||
import io.github.xxyopen.novel.dto.req.AuthorRegisterReqDto;
|
import io.github.xxyopen.novel.dto.req.AuthorRegisterReqDto;
|
||||||
import io.github.xxyopen.novel.dto.req.BookAddReqDto;
|
import io.github.xxyopen.novel.dto.req.BookAddReqDto;
|
||||||
import io.github.xxyopen.novel.dto.req.ChapterAddReqDto;
|
import io.github.xxyopen.novel.dto.req.ChapterAddReqDto;
|
||||||
@ -12,8 +13,13 @@ import io.github.xxyopen.novel.dto.resp.BookChapterRespDto;
|
|||||||
import io.github.xxyopen.novel.dto.resp.BookInfoRespDto;
|
import io.github.xxyopen.novel.dto.resp.BookInfoRespDto;
|
||||||
import io.github.xxyopen.novel.service.AuthorService;
|
import io.github.xxyopen.novel.service.AuthorService;
|
||||||
import io.github.xxyopen.novel.service.BookService;
|
import io.github.xxyopen.novel.service.BookService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springdoc.core.annotations.ParameterObject;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,6 +28,8 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @date 2022/5/23
|
* @date 2022/5/23
|
||||||
*/
|
*/
|
||||||
|
@Tag(name = "author", description = "作家后台-作者模块")
|
||||||
|
@SecurityRequirement(name = SystemConfigConsts.HTTP_AUTH_HEADER_NAME)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(ApiRouterConsts.API_AUTHOR_URL_PREFIX)
|
@RequestMapping(ApiRouterConsts.API_AUTHOR_URL_PREFIX)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -34,6 +42,7 @@ public class AuthorController {
|
|||||||
/**
|
/**
|
||||||
* 作家注册接口
|
* 作家注册接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "作家注册接口")
|
||||||
@PostMapping("register")
|
@PostMapping("register")
|
||||||
public RestResp<Void> register(@Valid @RequestBody AuthorRegisterReqDto dto) {
|
public RestResp<Void> register(@Valid @RequestBody AuthorRegisterReqDto dto) {
|
||||||
dto.setUserId(UserHolder.getUserId());
|
dto.setUserId(UserHolder.getUserId());
|
||||||
@ -43,6 +52,7 @@ public class AuthorController {
|
|||||||
/**
|
/**
|
||||||
* 查询作家状态接口
|
* 查询作家状态接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "作家状态查询接口")
|
||||||
@GetMapping("status")
|
@GetMapping("status")
|
||||||
public RestResp<Integer> getStatus() {
|
public RestResp<Integer> getStatus() {
|
||||||
return authorService.getStatus(UserHolder.getUserId());
|
return authorService.getStatus(UserHolder.getUserId());
|
||||||
@ -51,6 +61,7 @@ public class AuthorController {
|
|||||||
/**
|
/**
|
||||||
* 小说发布接口
|
* 小说发布接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说发布接口")
|
||||||
@PostMapping("book")
|
@PostMapping("book")
|
||||||
public RestResp<Void> publishBook(@Valid @RequestBody BookAddReqDto dto) {
|
public RestResp<Void> publishBook(@Valid @RequestBody BookAddReqDto dto) {
|
||||||
return bookService.saveBook(dto);
|
return bookService.saveBook(dto);
|
||||||
@ -59,16 +70,18 @@ public class AuthorController {
|
|||||||
/**
|
/**
|
||||||
* 小说发布列表查询接口
|
* 小说发布列表查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说发布列表查询接口")
|
||||||
@GetMapping("books")
|
@GetMapping("books")
|
||||||
public RestResp<PageRespDto<BookInfoRespDto>> listBooks(PageReqDto dto) {
|
public RestResp<PageRespDto<BookInfoRespDto>> listBooks(@ParameterObject PageReqDto dto) {
|
||||||
return bookService.listAuthorBooks(dto);
|
return bookService.listAuthorBooks(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说章节发布接口
|
* 小说章节发布接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说章节发布接口")
|
||||||
@PostMapping("book/chapter/{bookId}")
|
@PostMapping("book/chapter/{bookId}")
|
||||||
public RestResp<Void> publishBookChapter(@PathVariable("bookId") Long bookId, @Valid @RequestBody ChapterAddReqDto dto) {
|
public RestResp<Void> publishBookChapter(@Parameter(description = "小说ID") @PathVariable("bookId") Long bookId, @Valid @RequestBody ChapterAddReqDto dto) {
|
||||||
dto.setBookId(bookId);
|
dto.setBookId(bookId);
|
||||||
return bookService.saveBookChapter(dto);
|
return bookService.saveBookChapter(dto);
|
||||||
}
|
}
|
||||||
@ -76,8 +89,9 @@ public class AuthorController {
|
|||||||
/**
|
/**
|
||||||
* 小说章节发布列表查询接口
|
* 小说章节发布列表查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说章节发布列表查询接口")
|
||||||
@GetMapping("book/chapters/{bookId}")
|
@GetMapping("book/chapters/{bookId}")
|
||||||
public RestResp<PageRespDto<BookChapterRespDto>> listBookChapters(@PathVariable("bookId") Long bookId, PageReqDto dto) {
|
public RestResp<PageRespDto<BookChapterRespDto>> listBookChapters(@Parameter(description = "小说ID") @PathVariable("bookId") Long bookId, PageReqDto dto) {
|
||||||
return bookService.listBookChapters(bookId, dto);
|
return bookService.listBookChapters(bookId, dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,9 @@ import io.github.xxyopen.novel.core.common.resp.RestResp;
|
|||||||
import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
||||||
import io.github.xxyopen.novel.dto.resp.*;
|
import io.github.xxyopen.novel.dto.resp.*;
|
||||||
import io.github.xxyopen.novel.service.BookService;
|
import io.github.xxyopen.novel.service.BookService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -16,6 +19,7 @@ import java.util.List;
|
|||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @date 2022/5/14
|
* @date 2022/5/14
|
||||||
*/
|
*/
|
||||||
|
@Tag(name = "book", description = "前台门户-小说模块")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(ApiRouterConsts.API_FRONT_BOOK_URL_PREFIX)
|
@RequestMapping(ApiRouterConsts.API_FRONT_BOOK_URL_PREFIX)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -26,78 +30,88 @@ public class BookController {
|
|||||||
/**
|
/**
|
||||||
* 小说分类列表查询接口
|
* 小说分类列表查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说分类列表查询接口")
|
||||||
@GetMapping("category/list")
|
@GetMapping("category/list")
|
||||||
public RestResp<List<BookCategoryRespDto>> listCategory(Integer workDirection) {
|
public RestResp<List<BookCategoryRespDto>> listCategory(@Parameter(description = "作品方向",required = true) Integer workDirection) {
|
||||||
return bookService.listCategory(workDirection);
|
return bookService.listCategory(workDirection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说信息查询接口
|
* 小说信息查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说信息查询接口")
|
||||||
@GetMapping("{id}")
|
@GetMapping("{id}")
|
||||||
public RestResp<BookInfoRespDto> getBookById(@PathVariable("id") Long bookId) {
|
public RestResp<BookInfoRespDto> getBookById(@Parameter(description = "小说 ID") @PathVariable("id") Long bookId) {
|
||||||
return bookService.getBookById(bookId);
|
return bookService.getBookById(bookId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加小说点击量接口
|
* 增加小说点击量接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "增加小说点击量接口")
|
||||||
@PostMapping("visit")
|
@PostMapping("visit")
|
||||||
public RestResp<Void> addVisitCount(Long bookId) {
|
public RestResp<Void> addVisitCount(@Parameter(description = "小说ID") Long bookId) {
|
||||||
return bookService.addVisitCount(bookId);
|
return bookService.addVisitCount(bookId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说最新章节相关信息查询接口
|
* 小说最新章节相关信息查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说最新章节相关信息查询接口")
|
||||||
@GetMapping("last_chapter/about")
|
@GetMapping("last_chapter/about")
|
||||||
public RestResp<BookChapterAboutRespDto> getLastChapterAbout(Long bookId) {
|
public RestResp<BookChapterAboutRespDto> getLastChapterAbout(@Parameter(description = "小说ID") Long bookId) {
|
||||||
return bookService.getLastChapterAbout(bookId);
|
return bookService.getLastChapterAbout(bookId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说推荐列表查询接口
|
* 小说推荐列表查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说推荐列表查询接口")
|
||||||
@GetMapping("rec_list")
|
@GetMapping("rec_list")
|
||||||
public RestResp<List<BookInfoRespDto>> listRecBooks(Long bookId) throws NoSuchAlgorithmException {
|
public RestResp<List<BookInfoRespDto>> listRecBooks(@Parameter(description = "小说ID") Long bookId) throws NoSuchAlgorithmException {
|
||||||
return bookService.listRecBooks(bookId);
|
return bookService.listRecBooks(bookId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说章节列表查询接口
|
* 小说章节列表查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说章节列表查询接口")
|
||||||
@GetMapping("chapter/list")
|
@GetMapping("chapter/list")
|
||||||
public RestResp<List<BookChapterRespDto>> listChapters(Long bookId) {
|
public RestResp<List<BookChapterRespDto>> listChapters(@Parameter(description = "小说ID") Long bookId) {
|
||||||
return bookService.listChapters(bookId);
|
return bookService.listChapters(bookId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说内容相关信息查询接口
|
* 小说内容相关信息查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说内容相关信息查询接口")
|
||||||
@GetMapping("content/{chapterId}")
|
@GetMapping("content/{chapterId}")
|
||||||
public RestResp<BookContentAboutRespDto> getBookContentAbout(@PathVariable("chapterId") Long chapterId) {
|
public RestResp<BookContentAboutRespDto> getBookContentAbout(@Parameter(description = "章节ID") @PathVariable("chapterId") Long chapterId) {
|
||||||
return bookService.getBookContentAbout(chapterId);
|
return bookService.getBookContentAbout(chapterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取上一章节ID接口
|
* 获取上一章节ID接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "获取上一章节ID接口")
|
||||||
@GetMapping("pre_chapter_id/{chapterId}")
|
@GetMapping("pre_chapter_id/{chapterId}")
|
||||||
public RestResp<Long> getPreChapterId(@PathVariable("chapterId") Long chapterId) {
|
public RestResp<Long> getPreChapterId(@Parameter(description = "章节ID") @PathVariable("chapterId") Long chapterId) {
|
||||||
return bookService.getPreChapterId(chapterId);
|
return bookService.getPreChapterId(chapterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取下一章节ID接口
|
* 获取下一章节ID接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "获取下一章节ID接口")
|
||||||
@GetMapping("next_chapter_id/{chapterId}")
|
@GetMapping("next_chapter_id/{chapterId}")
|
||||||
public RestResp<Long> getNextChapterId(@PathVariable("chapterId") Long chapterId) {
|
public RestResp<Long> getNextChapterId(@Parameter(description = "章节ID") @PathVariable("chapterId") Long chapterId) {
|
||||||
return bookService.getNextChapterId(chapterId);
|
return bookService.getNextChapterId(chapterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说点击榜查询接口
|
* 小说点击榜查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说点击榜查询接口")
|
||||||
@GetMapping("visit_rank")
|
@GetMapping("visit_rank")
|
||||||
public RestResp<List<BookRankRespDto>> listVisitRankBooks() {
|
public RestResp<List<BookRankRespDto>> listVisitRankBooks() {
|
||||||
return bookService.listVisitRankBooks();
|
return bookService.listVisitRankBooks();
|
||||||
@ -106,6 +120,7 @@ public class BookController {
|
|||||||
/**
|
/**
|
||||||
* 小说新书榜查询接口
|
* 小说新书榜查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说新书榜查询接口")
|
||||||
@GetMapping("newest_rank")
|
@GetMapping("newest_rank")
|
||||||
public RestResp<List<BookRankRespDto>> listNewestRankBooks() {
|
public RestResp<List<BookRankRespDto>> listNewestRankBooks() {
|
||||||
return bookService.listNewestRankBooks();
|
return bookService.listNewestRankBooks();
|
||||||
@ -114,6 +129,7 @@ public class BookController {
|
|||||||
/**
|
/**
|
||||||
* 小说更新榜查询接口
|
* 小说更新榜查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说更新榜查询接口")
|
||||||
@GetMapping("update_rank")
|
@GetMapping("update_rank")
|
||||||
public RestResp<List<BookRankRespDto>> listUpdateRankBooks() {
|
public RestResp<List<BookRankRespDto>> listUpdateRankBooks() {
|
||||||
return bookService.listUpdateRankBooks();
|
return bookService.listUpdateRankBooks();
|
||||||
@ -122,8 +138,9 @@ public class BookController {
|
|||||||
/**
|
/**
|
||||||
* 小说最新评论查询接口
|
* 小说最新评论查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说最新评论查询接口")
|
||||||
@GetMapping("comment/newest_list")
|
@GetMapping("comment/newest_list")
|
||||||
public RestResp<BookCommentRespDto> listNewestComments(Long bookId) {
|
public RestResp<BookCommentRespDto> listNewestComments(@Parameter(description = "小说ID") Long bookId) {
|
||||||
return bookService.listNewestComments(bookId);
|
return bookService.listNewestComments(bookId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@ import io.github.xxyopen.novel.core.common.resp.RestResp;
|
|||||||
import io.github.xxyopen.novel.dto.resp.HomeBookRespDto;
|
import io.github.xxyopen.novel.dto.resp.HomeBookRespDto;
|
||||||
import io.github.xxyopen.novel.dto.resp.HomeFriendLinkRespDto;
|
import io.github.xxyopen.novel.dto.resp.HomeFriendLinkRespDto;
|
||||||
import io.github.xxyopen.novel.service.HomeService;
|
import io.github.xxyopen.novel.service.HomeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -18,6 +20,7 @@ import java.util.List;
|
|||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @date 2022/5/12
|
* @date 2022/5/12
|
||||||
*/
|
*/
|
||||||
|
@Tag(name = "home", description = "前台门户-首页模块")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(ApiRouterConsts.API_FRONT_HOME_URL_PREFIX)
|
@RequestMapping(ApiRouterConsts.API_FRONT_HOME_URL_PREFIX)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -28,6 +31,7 @@ public class HomeController {
|
|||||||
/**
|
/**
|
||||||
* 首页小说推荐查询接口
|
* 首页小说推荐查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "首页小说推荐查询接口")
|
||||||
@GetMapping("books")
|
@GetMapping("books")
|
||||||
public RestResp<List<HomeBookRespDto>> listHomeBooks() {
|
public RestResp<List<HomeBookRespDto>> listHomeBooks() {
|
||||||
return homeService.listHomeBooks();
|
return homeService.listHomeBooks();
|
||||||
@ -36,6 +40,7 @@ public class HomeController {
|
|||||||
/**
|
/**
|
||||||
* 首页友情链接列表查询接口
|
* 首页友情链接列表查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "首页友情链接列表查询接口")
|
||||||
@GetMapping("friend_Link/list")
|
@GetMapping("friend_Link/list")
|
||||||
public RestResp<List<HomeFriendLinkRespDto>> listHomeFriendLinks() {
|
public RestResp<List<HomeFriendLinkRespDto>> listHomeFriendLinks() {
|
||||||
return homeService.listHomeFriendLinks();
|
return homeService.listHomeFriendLinks();
|
||||||
|
@ -4,6 +4,9 @@ import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
|||||||
import io.github.xxyopen.novel.core.common.resp.RestResp;
|
import io.github.xxyopen.novel.core.common.resp.RestResp;
|
||||||
import io.github.xxyopen.novel.dto.resp.NewsInfoRespDto;
|
import io.github.xxyopen.novel.dto.resp.NewsInfoRespDto;
|
||||||
import io.github.xxyopen.novel.service.NewsService;
|
import io.github.xxyopen.novel.service.NewsService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@ -18,6 +21,7 @@ import java.util.List;
|
|||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @date 2022/5/12
|
* @date 2022/5/12
|
||||||
*/
|
*/
|
||||||
|
@Tag(name = "news", description = "前台门户-新闻模块")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(ApiRouterConsts.API_FRONT_NEWS_URL_PREFIX)
|
@RequestMapping(ApiRouterConsts.API_FRONT_NEWS_URL_PREFIX)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -28,6 +32,7 @@ public class NewsController {
|
|||||||
/**
|
/**
|
||||||
* 最新新闻列表查询接口
|
* 最新新闻列表查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "最新新闻列表查询接口")
|
||||||
@GetMapping("latest_list")
|
@GetMapping("latest_list")
|
||||||
public RestResp<List<NewsInfoRespDto>> listLatestNews() {
|
public RestResp<List<NewsInfoRespDto>> listLatestNews() {
|
||||||
return newsService.listLatestNews();
|
return newsService.listLatestNews();
|
||||||
@ -36,8 +41,9 @@ public class NewsController {
|
|||||||
/**
|
/**
|
||||||
* 新闻信息查询接口
|
* 新闻信息查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "新闻信息查询接口")
|
||||||
@GetMapping("{id}")
|
@GetMapping("{id}")
|
||||||
public RestResp<NewsInfoRespDto> getNews(@PathVariable Long id) {
|
public RestResp<NewsInfoRespDto> getNews(@Parameter(description = "新闻ID") @PathVariable Long id) {
|
||||||
return newsService.getNews(id);
|
return newsService.getNews(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,9 @@ import io.github.xxyopen.novel.core.common.resp.RestResp;
|
|||||||
import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
||||||
import io.github.xxyopen.novel.dto.resp.ImgVerifyCodeRespDto;
|
import io.github.xxyopen.novel.dto.resp.ImgVerifyCodeRespDto;
|
||||||
import io.github.xxyopen.novel.service.ResourceService;
|
import io.github.xxyopen.novel.service.ResourceService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@ -16,6 +19,7 @@ import java.io.IOException;
|
|||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @date 2022/5/17
|
* @date 2022/5/17
|
||||||
*/
|
*/
|
||||||
|
@Tag(name = "resource", description = "前台门户-资源模块")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(ApiRouterConsts.API_FRONT_RESOURCE_URL_PREFIX)
|
@RequestMapping(ApiRouterConsts.API_FRONT_RESOURCE_URL_PREFIX)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -26,6 +30,7 @@ public class ResourceController {
|
|||||||
/**
|
/**
|
||||||
* 获取图片验证码接口
|
* 获取图片验证码接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "获取图片验证码接口")
|
||||||
@GetMapping("img_verify_code")
|
@GetMapping("img_verify_code")
|
||||||
public RestResp<ImgVerifyCodeRespDto> getImgVerifyCode() throws IOException {
|
public RestResp<ImgVerifyCodeRespDto> getImgVerifyCode() throws IOException {
|
||||||
return resourceService.getImgVerifyCode();
|
return resourceService.getImgVerifyCode();
|
||||||
@ -34,8 +39,9 @@ public class ResourceController {
|
|||||||
/**
|
/**
|
||||||
* 图片上传接口
|
* 图片上传接口
|
||||||
* */
|
* */
|
||||||
|
@Operation(description = "图片上传接口")
|
||||||
@PostMapping("/image")
|
@PostMapping("/image")
|
||||||
RestResp<String> uploadImage(@RequestParam("file") MultipartFile file) {
|
RestResp<String> uploadImage(@Parameter(description = "上传文件") @RequestParam("file") MultipartFile file) {
|
||||||
return resourceService.uploadImage(file);
|
return resourceService.uploadImage(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,10 @@ import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
|||||||
import io.github.xxyopen.novel.dto.req.BookSearchReqDto;
|
import io.github.xxyopen.novel.dto.req.BookSearchReqDto;
|
||||||
import io.github.xxyopen.novel.dto.resp.BookInfoRespDto;
|
import io.github.xxyopen.novel.dto.resp.BookInfoRespDto;
|
||||||
import io.github.xxyopen.novel.service.SearchService;
|
import io.github.xxyopen.novel.service.SearchService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springdoc.core.annotations.ParameterObject;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @date 2022/5/27
|
* @date 2022/5/27
|
||||||
*/
|
*/
|
||||||
|
@Tag(name = "search", description = "前台门户-搜索模块")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(ApiRouterConsts.API_FRONT_SEARCH_URL_PREFIX)
|
@RequestMapping(ApiRouterConsts.API_FRONT_SEARCH_URL_PREFIX)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -27,8 +31,9 @@ public class SearchController {
|
|||||||
/**
|
/**
|
||||||
* 小说搜索接口
|
* 小说搜索接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "小说搜索接口")
|
||||||
@GetMapping("books")
|
@GetMapping("books")
|
||||||
public RestResp<PageRespDto<BookInfoRespDto>> searchBooks(BookSearchReqDto condition) {
|
public RestResp<PageRespDto<BookInfoRespDto>> searchBooks(@ParameterObject BookSearchReqDto condition) {
|
||||||
return searchService.searchBooks(condition);
|
return searchService.searchBooks(condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package io.github.xxyopen.novel.controller.front;
|
|||||||
import io.github.xxyopen.novel.core.auth.UserHolder;
|
import io.github.xxyopen.novel.core.auth.UserHolder;
|
||||||
import io.github.xxyopen.novel.core.common.resp.RestResp;
|
import io.github.xxyopen.novel.core.common.resp.RestResp;
|
||||||
import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
import io.github.xxyopen.novel.core.constant.ApiRouterConsts;
|
||||||
|
import io.github.xxyopen.novel.core.constant.SystemConfigConsts;
|
||||||
import io.github.xxyopen.novel.dto.req.UserCommentReqDto;
|
import io.github.xxyopen.novel.dto.req.UserCommentReqDto;
|
||||||
import io.github.xxyopen.novel.dto.req.UserInfoUptReqDto;
|
import io.github.xxyopen.novel.dto.req.UserInfoUptReqDto;
|
||||||
import io.github.xxyopen.novel.dto.req.UserLoginReqDto;
|
import io.github.xxyopen.novel.dto.req.UserLoginReqDto;
|
||||||
@ -12,6 +13,10 @@ import io.github.xxyopen.novel.dto.resp.UserLoginRespDto;
|
|||||||
import io.github.xxyopen.novel.dto.resp.UserRegisterRespDto;
|
import io.github.xxyopen.novel.dto.resp.UserRegisterRespDto;
|
||||||
import io.github.xxyopen.novel.service.BookService;
|
import io.github.xxyopen.novel.service.BookService;
|
||||||
import io.github.xxyopen.novel.service.UserService;
|
import io.github.xxyopen.novel.service.UserService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -22,6 +27,8 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @date 2022/5/17
|
* @date 2022/5/17
|
||||||
*/
|
*/
|
||||||
|
@Tag(name = "user", description = "前台门户-会员模块")
|
||||||
|
@SecurityRequirement(name = SystemConfigConsts.HTTP_AUTH_HEADER_NAME)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(ApiRouterConsts.API_FRONT_USER_URL_PREFIX)
|
@RequestMapping(ApiRouterConsts.API_FRONT_USER_URL_PREFIX)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -34,6 +41,7 @@ public class UserController {
|
|||||||
/**
|
/**
|
||||||
* 用户注册接口
|
* 用户注册接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "用户注册接口")
|
||||||
@PostMapping("register")
|
@PostMapping("register")
|
||||||
public RestResp<UserRegisterRespDto> register(@Valid @RequestBody UserRegisterReqDto dto) {
|
public RestResp<UserRegisterRespDto> register(@Valid @RequestBody UserRegisterReqDto dto) {
|
||||||
return userService.register(dto);
|
return userService.register(dto);
|
||||||
@ -42,6 +50,7 @@ public class UserController {
|
|||||||
/**
|
/**
|
||||||
* 用户登录接口
|
* 用户登录接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "用户登录接口")
|
||||||
@PostMapping("login")
|
@PostMapping("login")
|
||||||
public RestResp<UserLoginRespDto> login(@Valid @RequestBody UserLoginReqDto dto) {
|
public RestResp<UserLoginRespDto> login(@Valid @RequestBody UserLoginReqDto dto) {
|
||||||
return userService.login(dto);
|
return userService.login(dto);
|
||||||
@ -50,6 +59,7 @@ public class UserController {
|
|||||||
/**
|
/**
|
||||||
* 用户信息查询接口
|
* 用户信息查询接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "用户信息查询接口")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public RestResp<UserInfoRespDto> getUserInfo() {
|
public RestResp<UserInfoRespDto> getUserInfo() {
|
||||||
return userService.getUserInfo(UserHolder.getUserId());
|
return userService.getUserInfo(UserHolder.getUserId());
|
||||||
@ -58,6 +68,7 @@ public class UserController {
|
|||||||
/**
|
/**
|
||||||
* 用户信息修改接口
|
* 用户信息修改接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "用户信息修改接口")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public RestResp<Void> updateUserInfo(@Valid @RequestBody UserInfoUptReqDto dto) {
|
public RestResp<Void> updateUserInfo(@Valid @RequestBody UserInfoUptReqDto dto) {
|
||||||
dto.setUserId(UserHolder.getUserId());
|
dto.setUserId(UserHolder.getUserId());
|
||||||
@ -67,6 +78,7 @@ public class UserController {
|
|||||||
/**
|
/**
|
||||||
* 用户反馈提交接口
|
* 用户反馈提交接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "用户反馈提交接口")
|
||||||
@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);
|
||||||
@ -75,14 +87,16 @@ public class UserController {
|
|||||||
/**
|
/**
|
||||||
* 用户反馈删除接口
|
* 用户反馈删除接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "用户反馈删除接口")
|
||||||
@DeleteMapping("feedback/{id}")
|
@DeleteMapping("feedback/{id}")
|
||||||
public RestResp<Void> deleteFeedback(@PathVariable Long id) {
|
public RestResp<Void> deleteFeedback(@Parameter(description = "反馈ID") @PathVariable Long id) {
|
||||||
return userService.deleteFeedback(UserHolder.getUserId(), id);
|
return userService.deleteFeedback(UserHolder.getUserId(), id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发表评论接口
|
* 发表评论接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "发表评论接口")
|
||||||
@PostMapping("comment")
|
@PostMapping("comment")
|
||||||
public RestResp<Void> comment(@Valid @RequestBody UserCommentReqDto dto) {
|
public RestResp<Void> comment(@Valid @RequestBody UserCommentReqDto dto) {
|
||||||
dto.setUserId(UserHolder.getUserId());
|
dto.setUserId(UserHolder.getUserId());
|
||||||
@ -92,16 +106,18 @@ public class UserController {
|
|||||||
/**
|
/**
|
||||||
* 修改评论接口
|
* 修改评论接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "修改评论接口")
|
||||||
@PutMapping("comment/{id}")
|
@PutMapping("comment/{id}")
|
||||||
public RestResp<Void> updateComment(@PathVariable Long id, String content) {
|
public RestResp<Void> updateComment(@Parameter(description = "评论ID") @PathVariable Long id, String content) {
|
||||||
return bookService.updateComment(UserHolder.getUserId(), id, content);
|
return bookService.updateComment(UserHolder.getUserId(), id, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除评论接口
|
* 删除评论接口
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "删除评论接口")
|
||||||
@DeleteMapping("comment/{id}")
|
@DeleteMapping("comment/{id}")
|
||||||
public RestResp<Void> deleteComment(@PathVariable Long id) {
|
public RestResp<Void> deleteComment(@Parameter(description = "评论ID") @PathVariable Long id) {
|
||||||
return bookService.deleteComment(UserHolder.getUserId(), id);
|
return bookService.deleteComment(UserHolder.getUserId(), id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,8 +126,9 @@ public class UserController {
|
|||||||
* 0-不在书架
|
* 0-不在书架
|
||||||
* 1-已在书架
|
* 1-已在书架
|
||||||
*/
|
*/
|
||||||
|
@Operation(description = "查询书架状态接口")
|
||||||
@GetMapping("bookshelf_status")
|
@GetMapping("bookshelf_status")
|
||||||
public RestResp<Integer> getBookshelfStatus(@RequestBody String bookId) {
|
public RestResp<Integer> getBookshelfStatus(@Parameter(description = "小说ID") String bookId) {
|
||||||
return userService.getBookshelfStatus(UserHolder.getUserId(), bookId);
|
return userService.getBookshelfStatus(UserHolder.getUserId(), bookId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.core.common.req;
|
package io.github.xxyopen.novel.core.common.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,17 +15,20 @@ public class PageReqDto {
|
|||||||
/**
|
/**
|
||||||
* 请求页码,默认第 1 页
|
* 请求页码,默认第 1 页
|
||||||
* */
|
* */
|
||||||
|
@Parameter(description = "请求页码,默认第 1 页")
|
||||||
private int pageNum = 1;
|
private int pageNum = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 每页大小,默认每页 10 条
|
* 每页大小,默认每页 10 条
|
||||||
* */
|
* */
|
||||||
|
@Parameter(description = "每页大小,默认每页 10 条")
|
||||||
private int pageSize = 10;
|
private int pageSize = 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否查询所有,默认不查所有
|
* 是否查询所有,默认不查所有
|
||||||
* 为 true 时,pageNum 和 pageSize 无效
|
* 为 true 时,pageNum 和 pageSize 无效
|
||||||
* */
|
* */
|
||||||
|
@Parameter(hidden = true)
|
||||||
private boolean fetchAll = false;
|
private boolean fetchAll = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package io.github.xxyopen.novel.core.common.resp;
|
package io.github.xxyopen.novel.core.common.resp;
|
||||||
|
|
||||||
import io.github.xxyopen.novel.core.common.constant.ErrorCodeEnum;
|
import io.github.xxyopen.novel.core.common.constant.ErrorCodeEnum;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -17,16 +18,19 @@ public class RestResp<T> {
|
|||||||
/**
|
/**
|
||||||
* 响应码
|
* 响应码
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "错误码,00000-没有错误")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应消息
|
* 响应消息
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "响应消息")
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应数据
|
* 响应数据
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "响应数据")
|
||||||
private T data;
|
private T data;
|
||||||
|
|
||||||
private RestResp() {
|
private RestResp() {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.req;
|
package io.github.xxyopen.novel.dto.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -17,33 +18,38 @@ public class AuthorRegisterReqDto {
|
|||||||
/**
|
/**
|
||||||
* 笔名
|
* 笔名
|
||||||
*/
|
*/
|
||||||
@NotBlank(message="笔名不能为空!")
|
@Schema(description = "笔名", required = true)
|
||||||
|
@NotBlank(message = "笔名不能为空!")
|
||||||
private String penName;
|
private String penName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号码
|
* 手机号码
|
||||||
*/
|
*/
|
||||||
@NotBlank(message="手机号不能为空!")
|
@Schema(description = "手机号码", required = true)
|
||||||
@Pattern(regexp="^1[3|4|5|6|7|8|9][0-9]{9}$",message="手机号格式不正确!")
|
@NotBlank(message = "手机号不能为空!")
|
||||||
|
@Pattern(regexp = "^1[3|4|5|6|7|8|9][0-9]{9}$", message = "手机号格式不正确!")
|
||||||
private String telPhone;
|
private String telPhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* QQ或微信账号
|
* QQ或微信账号
|
||||||
*/
|
*/
|
||||||
@NotBlank(message="QQ或微信账号不能为空!")
|
@Schema(description = "QQ或微信账号", required = true)
|
||||||
|
@NotBlank(message = "QQ或微信账号不能为空!")
|
||||||
private String chatAccount;
|
private String chatAccount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电子邮箱
|
* 电子邮箱
|
||||||
*/
|
*/
|
||||||
@NotBlank(message="电子邮箱不能为空!")
|
@Schema(description = "电子邮箱", required = true)
|
||||||
@Email(message="邮箱格式不正确!")
|
@NotBlank(message = "电子邮箱不能为空!")
|
||||||
|
@Email(message = "邮箱格式不正确!")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作品方向;0-男频 1-女频
|
* 作品方向;0-男频 1-女频
|
||||||
*/
|
*/
|
||||||
@NotNull(message="作品方向不能为空!")
|
@Schema(description = "作品方向;0-男频 1-女频", required = true)
|
||||||
|
@NotNull(message = "作品方向不能为空!")
|
||||||
@Min(0)
|
@Min(0)
|
||||||
@Max(1)
|
@Max(1)
|
||||||
private Integer workDirection;
|
private Integer workDirection;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.req;
|
package io.github.xxyopen.novel.dto.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -16,42 +17,49 @@ public class BookAddReqDto {
|
|||||||
/**
|
/**
|
||||||
* 作品方向;0-男频 1-女频
|
* 作品方向;0-男频 1-女频
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "作品方向;0-男频 1-女频", required = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
private Integer workDirection;
|
private Integer workDirection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类别ID
|
* 类别ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别ID", required = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类别名
|
* 类别名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别名", required = true)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String categoryName;
|
private String categoryName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说封面地址
|
* 小说封面地址
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说封面地址", required = true)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String picUrl;
|
private String picUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说名
|
* 小说名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说名", required = true)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String bookName;
|
private String bookName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 书籍描述
|
* 书籍描述
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "书籍描述", required = true)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String bookDesc;
|
private String bookDesc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否收费;1-收费 0-免费
|
* 是否收费;1-收费 0-免费
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "是否收费;1-收费 0-免费", required = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
private Integer isVip;
|
private Integer isVip;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package io.github.xxyopen.novel.dto.req;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.github.xxyopen.novel.core.common.req.PageReqDto;
|
import io.github.xxyopen.novel.core.common.req.PageReqDto;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
@ -19,36 +20,43 @@ public class BookSearchReqDto extends PageReqDto {
|
|||||||
/**
|
/**
|
||||||
* 搜索关键字
|
* 搜索关键字
|
||||||
*/
|
*/
|
||||||
|
@Parameter(description = "搜索关键字")
|
||||||
private String keyword;
|
private String keyword;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作品方向
|
* 作品方向
|
||||||
*/
|
*/
|
||||||
|
@Parameter(description = "作品方向")
|
||||||
private Integer workDirection;
|
private Integer workDirection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分类ID
|
* 分类ID
|
||||||
*/
|
*/
|
||||||
|
@Parameter(description = "分类ID")
|
||||||
private Integer categoryId;
|
private Integer categoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否收费,1:收费,0:免费
|
* 是否收费,1:收费,0:免费
|
||||||
*/
|
*/
|
||||||
|
@Parameter(description = "是否收费,1:收费,0:免费")
|
||||||
private Integer isVip;
|
private Integer isVip;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说更新状态,0:连载中,1:已完结
|
* 小说更新状态,0:连载中,1:已完结
|
||||||
*/
|
*/
|
||||||
|
@Parameter(description = "小说更新状态,0:连载中,1:已完结")
|
||||||
private Integer bookStatus;
|
private Integer bookStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字数最小值
|
* 字数最小值
|
||||||
*/
|
*/
|
||||||
|
@Parameter(description = "字数最小值")
|
||||||
private Integer wordCountMin;
|
private Integer wordCountMin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字数最大值
|
* 字数最大值
|
||||||
*/
|
*/
|
||||||
|
@Parameter(description = "字数最大值")
|
||||||
private Integer wordCountMax;
|
private Integer wordCountMax;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,6 +65,7 @@ public class BookSearchReqDto extends PageReqDto {
|
|||||||
* 如果使用Post请求,@RequestBody接收请求体参数,默认解析日期格式为yyyy-MM-dd HH:mm:ss ,
|
* 如果使用Post请求,@RequestBody接收请求体参数,默认解析日期格式为yyyy-MM-dd HH:mm:ss ,
|
||||||
* 如果需要接收其他格式的参数,则可以使用@JsonFormat注解
|
* 如果需要接收其他格式的参数,则可以使用@JsonFormat注解
|
||||||
* */
|
* */
|
||||||
|
@Parameter(description = "最小更新时间")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date updateTimeMin;
|
private Date updateTimeMin;
|
||||||
@ -64,5 +73,6 @@ public class BookSearchReqDto extends PageReqDto {
|
|||||||
/**
|
/**
|
||||||
* 排序字段
|
* 排序字段
|
||||||
*/
|
*/
|
||||||
|
@Parameter(description = "排序字段")
|
||||||
private String sort;
|
private String sort;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.req;
|
package io.github.xxyopen.novel.dto.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -17,17 +18,20 @@ public class ChapterAddReqDto {
|
|||||||
/**
|
/**
|
||||||
* 小说ID
|
* 小说ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说ID", required = true)
|
||||||
private Long bookId;
|
private Long bookId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节名
|
* 章节名
|
||||||
*/
|
*/
|
||||||
@NotBlank
|
@NotBlank
|
||||||
|
@Schema(description = "章节名", required = true)
|
||||||
private String chapterName;
|
private String chapterName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节内容
|
* 章节内容
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "章节内容", required = true)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Length(min = 50)
|
@Length(min = 50)
|
||||||
private String chapterContent;
|
private String chapterContent;
|
||||||
@ -35,6 +39,7 @@ public class ChapterAddReqDto {
|
|||||||
/**
|
/**
|
||||||
* 是否收费;1-收费 0-免费
|
* 是否收费;1-收费 0-免费
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "是否收费;1-收费 0-免费", required = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
private Integer isVip;
|
private Integer isVip;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.req;
|
package io.github.xxyopen.novel.dto.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -15,9 +16,11 @@ public class UserCommentReqDto {
|
|||||||
|
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "小说ID", required = true)
|
||||||
@NotNull(message="小说ID不能为空!")
|
@NotNull(message="小说ID不能为空!")
|
||||||
private Long bookId;
|
private Long bookId;
|
||||||
|
|
||||||
|
@Schema(description = "评论内容", required = true)
|
||||||
@NotBlank(message="评论不能为空!")
|
@NotBlank(message="评论不能为空!")
|
||||||
@Length(min = 10,max = 512)
|
@Length(min = 10,max = 512)
|
||||||
private String commentContent;
|
private String commentContent;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.req;
|
package io.github.xxyopen.novel.dto.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.Max;
|
import jakarta.validation.constraints.Max;
|
||||||
import jakarta.validation.constraints.Min;
|
import jakarta.validation.constraints.Min;
|
||||||
import jakarta.validation.constraints.Pattern;
|
import jakarta.validation.constraints.Pattern;
|
||||||
@ -16,12 +17,15 @@ public class UserInfoUptReqDto {
|
|||||||
|
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "昵称")
|
||||||
@Length(min = 2,max = 10)
|
@Length(min = 2,max = 10)
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
|
@Schema(description = "头像地址")
|
||||||
@Pattern(regexp="^/[^\s]{10,}\\.(png|PNG|jpg|JPG|jpeg|JPEG|gif|GIF|bpm|BPM)$")
|
@Pattern(regexp="^/[^\s]{10,}\\.(png|PNG|jpg|JPG|jpeg|JPEG|gif|GIF|bpm|BPM)$")
|
||||||
private String userPhoto;
|
private String userPhoto;
|
||||||
|
|
||||||
|
@Schema(description = "性别")
|
||||||
@Min(value = 0)
|
@Min(value = 0)
|
||||||
@Max(value = 1)
|
@Max(value = 1)
|
||||||
private Integer userSex;
|
private Integer userSex;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.req;
|
package io.github.xxyopen.novel.dto.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Pattern;
|
import jakarta.validation.constraints.Pattern;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -13,10 +14,12 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class UserLoginReqDto {
|
public class UserLoginReqDto {
|
||||||
|
|
||||||
|
@Schema(description = "手机号", required = true)
|
||||||
@NotBlank(message="手机号不能为空!")
|
@NotBlank(message="手机号不能为空!")
|
||||||
@Pattern(regexp="^1[3|4|5|6|7|8|9][0-9]{9}$",message="手机号格式不正确!")
|
@Pattern(regexp="^1[3|4|5|6|7|8|9][0-9]{9}$",message="手机号格式不正确!")
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
@Schema(description = "密码", required = true)
|
||||||
@NotBlank(message="密码不能为空!")
|
@NotBlank(message="密码不能为空!")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.req;
|
package io.github.xxyopen.novel.dto.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Pattern;
|
import jakarta.validation.constraints.Pattern;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -14,13 +15,16 @@ import org.hibernate.validator.constraints.Length;
|
|||||||
@Data
|
@Data
|
||||||
public class UserRegisterReqDto {
|
public class UserRegisterReqDto {
|
||||||
|
|
||||||
|
@Schema(description = "手机号", required = true)
|
||||||
@NotBlank(message="手机号不能为空!")
|
@NotBlank(message="手机号不能为空!")
|
||||||
@Pattern(regexp="^1[3|4|5|6|7|8|9][0-9]{9}$",message="手机号格式不正确!")
|
@Pattern(regexp="^1[3|4|5|6|7|8|9][0-9]{9}$",message="手机号格式不正确!")
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
@Schema(description = "密码", required = true)
|
||||||
@NotBlank(message="密码不能为空!")
|
@NotBlank(message="密码不能为空!")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
@Schema(description = "验证码", required = true)
|
||||||
@NotBlank(message="验证码不能为空!")
|
@NotBlank(message="验证码不能为空!")
|
||||||
@Pattern(regexp="^\\d{4}$",message="验证码格式不正确!")
|
@Pattern(regexp="^\\d{4}$",message="验证码格式不正确!")
|
||||||
private String velCode;
|
private String velCode;
|
||||||
@ -28,6 +32,7 @@ public class UserRegisterReqDto {
|
|||||||
/**
|
/**
|
||||||
* 请求会话标识,用来标识图形验证码属于哪个会话
|
* 请求会话标识,用来标识图形验证码属于哪个会话
|
||||||
* */
|
* */
|
||||||
|
@Schema(description = "sessionId", required = true)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Length(min = 32,max = 32)
|
@Length(min = 32,max = 32)
|
||||||
private String sessionId;
|
private String sessionId;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -16,11 +17,13 @@ public class BookCategoryRespDto {
|
|||||||
/**
|
/**
|
||||||
* 类别ID
|
* 类别ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类别名
|
* 类别名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别名")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -18,11 +19,13 @@ public class BookChapterAboutRespDto {
|
|||||||
/**
|
/**
|
||||||
* 章节总数
|
* 章节总数
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "章节总数")
|
||||||
private Long chapterTotal;
|
private Long chapterTotal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内容概要(30字)
|
* 内容概要(30字)
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = " 内容概要(30字)")
|
||||||
private String contentSummary;
|
private String contentSummary;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -24,37 +25,44 @@ public class BookChapterRespDto implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 章节ID
|
* 章节ID
|
||||||
* */
|
* */
|
||||||
|
@Schema(description = "章节ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说ID
|
* 小说ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说ID")
|
||||||
private Long bookId;
|
private Long bookId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节号
|
* 章节号
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "章节号")
|
||||||
private Integer chapterNum;
|
private Integer chapterNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节名
|
* 章节名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "章节名")
|
||||||
private String chapterName;
|
private String chapterName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节字数
|
* 章节字数
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "章节字数")
|
||||||
private Integer chapterWordCount;
|
private Integer chapterWordCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节更新时间
|
* 章节更新时间
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "章节更新时间")
|
||||||
@JsonFormat(pattern = "yyyy/MM/dd HH:dd")
|
@JsonFormat(pattern = "yyyy/MM/dd HH:dd")
|
||||||
private LocalDateTime chapterUpdateTime;
|
private LocalDateTime chapterUpdateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否收费;1-收费 0-免费
|
* 是否收费;1-收费 0-免费
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "是否收费;1-收费 0-免费")
|
||||||
private Integer isVip;
|
private Integer isVip;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package io.github.xxyopen.novel.dto.resp;
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import io.github.xxyopen.novel.core.json.serializer.UsernameSerializer;
|
import io.github.xxyopen.novel.core.json.serializer.UsernameSerializer;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -18,25 +19,33 @@ import java.util.List;
|
|||||||
@Builder
|
@Builder
|
||||||
public class BookCommentRespDto {
|
public class BookCommentRespDto {
|
||||||
|
|
||||||
|
@Schema(description = "评论总数")
|
||||||
private Long commentTotal;
|
private Long commentTotal;
|
||||||
|
|
||||||
|
@Schema(description = "评论列表")
|
||||||
private List<CommentInfo> comments;
|
private List<CommentInfo> comments;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
public static class CommentInfo {
|
public static class CommentInfo {
|
||||||
|
|
||||||
|
@Schema(description = "评论ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "评论内容")
|
||||||
private String commentContent;
|
private String commentContent;
|
||||||
|
|
||||||
|
@Schema(description = "评论用户")
|
||||||
@JsonSerialize(using = UsernameSerializer.class)
|
@JsonSerialize(using = UsernameSerializer.class)
|
||||||
private String commentUser;
|
private String commentUser;
|
||||||
|
|
||||||
|
@Schema(description = "评论用户ID")
|
||||||
private Long commentUserId;
|
private Long commentUserId;
|
||||||
|
|
||||||
|
@Schema(description = "评论用户头像")
|
||||||
private String commentUserPhoto;
|
private String commentUserPhoto;
|
||||||
|
|
||||||
|
@Schema(description = "评论时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime commentTime;
|
private LocalDateTime commentTime;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -16,16 +17,19 @@ public class BookContentAboutRespDto {
|
|||||||
/**
|
/**
|
||||||
* 小说信息
|
* 小说信息
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说信息")
|
||||||
private BookInfoRespDto bookInfo;
|
private BookInfoRespDto bookInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节信息
|
* 章节信息
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "章节信息")
|
||||||
private BookChapterRespDto chapterInfo;
|
private BookChapterRespDto chapterInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 章节内容
|
* 章节内容
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "章节内容")
|
||||||
private String bookContent;
|
private String bookContent;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -20,81 +21,97 @@ public class BookInfoRespDto {
|
|||||||
/**
|
/**
|
||||||
* ID
|
* ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类别ID
|
* 类别ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别ID")
|
||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类别名
|
* 类别名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别名")
|
||||||
private String categoryName;
|
private String categoryName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说封面地址
|
* 小说封面地址
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说封面地址")
|
||||||
private String picUrl;
|
private String picUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说名
|
* 小说名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说名")
|
||||||
private String bookName;
|
private String bookName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作家id
|
* 作家id
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "作家id")
|
||||||
private Long authorId;
|
private Long authorId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作家名
|
* 作家名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "作家名")
|
||||||
private String authorName;
|
private String authorName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 书籍描述
|
* 书籍描述
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "书籍描述")
|
||||||
private String bookDesc;
|
private String bookDesc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 书籍状态;0-连载中 1-已完结
|
* 书籍状态;0-连载中 1-已完结
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "书籍状态;0-连载中 1-已完结")
|
||||||
private Integer bookStatus;
|
private Integer bookStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击量
|
* 点击量
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "点击量")
|
||||||
private Long visitCount;
|
private Long visitCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总字数
|
* 总字数
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "总字数")
|
||||||
private Integer wordCount;
|
private Integer wordCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 评论数
|
* 评论数
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "评论数")
|
||||||
private Integer commentCount;
|
private Integer commentCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首章节ID
|
* 首章节ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "首章节ID")
|
||||||
private Long firstChapterId;
|
private Long firstChapterId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最新章节ID
|
* 最新章节ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "最新章节ID")
|
||||||
private Long lastChapterId;
|
private Long lastChapterId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最新章节名
|
* 最新章节名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "最新章节名")
|
||||||
private String lastChapterName;
|
private String lastChapterName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最新章节更新时间
|
* 最新章节更新时间
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "最新章节更新时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -22,51 +23,61 @@ public class BookRankRespDto implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* ID
|
* ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类别ID
|
* 类别ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别ID")
|
||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类别名
|
* 类别名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别名")
|
||||||
private String categoryName;
|
private String categoryName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说封面地址
|
* 小说封面地址
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说封面地址")
|
||||||
private String picUrl;
|
private String picUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说名
|
* 小说名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说名")
|
||||||
private String bookName;
|
private String bookName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作家名
|
* 作家名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "作家名")
|
||||||
private String authorName;
|
private String authorName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 书籍描述
|
* 书籍描述
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "书籍描述")
|
||||||
private String bookDesc;
|
private String bookDesc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总字数
|
* 总字数
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "总字数")
|
||||||
private Integer wordCount;
|
private Integer wordCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最新章节名
|
* 最新章节名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "最新章节名")
|
||||||
private String lastChapterName;
|
private String lastChapterName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最新章节更新时间
|
* 最新章节更新时间
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "最新章节更新时间")
|
||||||
@JsonFormat(pattern = "MM/dd HH:mm")
|
@JsonFormat(pattern = "MM/dd HH:mm")
|
||||||
private LocalDateTime lastChapterUpdateTime;
|
private LocalDateTime lastChapterUpdateTime;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,31 +15,37 @@ public class HomeBookRespDto {
|
|||||||
/**
|
/**
|
||||||
* 类型;0-轮播图 1-顶部栏 2-本周强推 3-热门推荐 4-精品推荐
|
* 类型;0-轮播图 1-顶部栏 2-本周强推 3-热门推荐 4-精品推荐
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类型;0-轮播图 1-顶部栏 2-本周强推 3-热门推荐 4-精品推荐")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推荐小说ID
|
* 推荐小说ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说ID")
|
||||||
private Long bookId;
|
private Long bookId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说封面地址
|
* 小说封面地址
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说封面地址")
|
||||||
private String picUrl;
|
private String picUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说名
|
* 小说名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "小说名")
|
||||||
private String bookName;
|
private String bookName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作家名
|
* 作家名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "作家名")
|
||||||
private String authorName;
|
private String authorName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 书籍描述
|
* 书籍描述
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "书籍描述")
|
||||||
private String bookDesc;
|
private String bookDesc;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -20,10 +21,12 @@ public class HomeFriendLinkRespDto implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 链接名
|
* 链接名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "链接名")
|
||||||
private String linkName;
|
private String linkName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 链接url
|
* 链接url
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "链接url")
|
||||||
private String linkUrl;
|
private String linkUrl;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -15,11 +16,13 @@ public class ImgVerifyCodeRespDto {
|
|||||||
/**
|
/**
|
||||||
* 当前会话ID,用于标识改图形验证码属于哪个会话
|
* 当前会话ID,用于标识改图形验证码属于哪个会话
|
||||||
* */
|
* */
|
||||||
|
@Schema(description = "sessionId")
|
||||||
private String sessionId;
|
private String sessionId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base64 编码的验证码图片
|
* Base64 编码的验证码图片
|
||||||
* */
|
* */
|
||||||
|
@Schema(description = "Base64 编码的验证码图片")
|
||||||
private String img;
|
private String img;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -19,37 +20,44 @@ public class NewsInfoRespDto {
|
|||||||
/**
|
/**
|
||||||
* ID
|
* ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "新闻ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类别ID
|
* 类别ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别ID")
|
||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类别名
|
* 类别名
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "类别名")
|
||||||
private String categoryName;
|
private String categoryName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新闻来源
|
* 新闻来源
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "新闻来源")
|
||||||
private String sourceName;
|
private String sourceName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新闻标题
|
* 新闻标题
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "新闻标题")
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新时间
|
* 更新时间
|
||||||
*/
|
*/
|
||||||
|
@Schema(description = "更新时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新闻内容
|
* 新闻内容
|
||||||
* */
|
* */
|
||||||
|
@Schema(description = "新闻内容")
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -16,15 +17,18 @@ public class UserInfoRespDto {
|
|||||||
/**
|
/**
|
||||||
* 昵称
|
* 昵称
|
||||||
* */
|
* */
|
||||||
|
@Schema(description = "昵称")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户头像
|
* 用户头像
|
||||||
* */
|
* */
|
||||||
|
@Schema(description = "用户头像")
|
||||||
private String userPhoto;
|
private String userPhoto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户性别
|
* 用户性别
|
||||||
* */
|
* */
|
||||||
|
@Schema(description = "用户性别")
|
||||||
private Integer userSex;
|
private Integer userSex;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -12,9 +13,12 @@ import lombok.Data;
|
|||||||
@Builder
|
@Builder
|
||||||
public class UserLoginRespDto {
|
public class UserLoginRespDto {
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
private Long uid;
|
private Long uid;
|
||||||
|
|
||||||
|
@Schema(description = "用户昵称")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
|
@Schema(description = "用户token")
|
||||||
private String token;
|
private String token;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package io.github.xxyopen.novel.dto.resp;
|
package io.github.xxyopen.novel.dto.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -12,7 +13,9 @@ import lombok.Data;
|
|||||||
@Builder
|
@Builder
|
||||||
public class UserRegisterRespDto {
|
public class UserRegisterRespDto {
|
||||||
|
|
||||||
|
@Schema(description = "用户ID")
|
||||||
private Long uid;
|
private Long uid;
|
||||||
|
|
||||||
|
@Schema(description = "用户token")
|
||||||
private String token;
|
private String token;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user