feat: add book admin display fields

This commit is contained in:
2026-04-27 13:53:37 +08:00
parent 67c33d06be
commit 2fa15625b0
20 changed files with 472 additions and 70 deletions

View File

@@ -11,7 +11,7 @@
- 实体模型:`book.BookChapter`
- 搜索入参:`bookReq.BookChapterSearch`
- 详情响应:`bookRes.BookChapterResponse`
- 列表项:`book.BookChapter`
- 列表项:`bookRes.BookChapterListItem`
- 返回:写操作 `response.Response{msg}`;详情 `response.Response{data}`;列表 `response.PageResult`
- 删除策略:硬删
@@ -143,6 +143,7 @@
| bookChapter.createdAt | string | 创建时间 |
| bookChapter.updatedAt | string | 更新时间 |
| bookChapter.bookId | uint | 所属书籍 ID |
| bookChapter.bookTitle | string | 书籍标题展示字段,来源于 `book.title AS book_title` |
| bookChapter.title | string | 章节标题 |
| bookChapter.chapterNo | int | 同书内章节顺序编号 |
| bookChapter.isReadable | bool | 是否对 app 端开放阅读 |
@@ -173,11 +174,12 @@
| 字段 | 类型 | 说明 |
|:---|:---|:---|
| list | array | `book.BookChapter` 列表 |
| list | array | `bookRes.BookChapterListItem` 列表 |
| list[].id | uint | 章节 ID |
| list[].createdAt | string | 创建时间 |
| list[].updatedAt | string | 更新时间 |
| list[].bookId | uint | 所属书籍 ID |
| list[].bookTitle | string | 书籍标题展示字段,来源于 `book.title AS book_title` |
| list[].title | string | 章节标题 |
| list[].chapterNo | int | 同书内章节顺序编号 |
| list[].isReadable | bool | 是否对 app 端开放阅读 |
@@ -191,6 +193,7 @@
#### 规则
- 列表默认排序:`book_id asc, chapter_no asc`
- 列表通过 `book_chapter` 联表 `book` 补充 `bookTitle` 展示字段;写接口仍只接收 `bookId`
## 规则
@@ -199,3 +202,4 @@
- `chapterNo` 必须大于 `0`
- `totalLines` 不能小于 `0``isReadable=true``totalLines` 必须大于 `0`
- 创建、更新复用实体 `book.BookChapter`;列表查询复用 `bookReq.BookChapterSearch`;详情返回 `bookRes.BookChapterResponse`
- `bookTitle` 为只读展示字段,禁止写入实体表结构,禁止作为创建或更新入参。