feat: add book admin display fields
This commit is contained in:
@@ -131,7 +131,9 @@
|
||||
| bookAuthorRelation | object | 关系实体 |
|
||||
| bookAuthorRelation.id | uint | 关系 ID |
|
||||
| bookAuthorRelation.bookId | uint | 书籍 ID |
|
||||
| bookAuthorRelation.bookTitle | string | 书籍标题展示字段,来源于 `book.title AS book_title` |
|
||||
| bookAuthorRelation.authorId | uint | 作者 ID |
|
||||
| bookAuthorRelation.authorName | string | 作者名称展示字段,来源于 `book_author.name AS author_name` |
|
||||
| bookAuthorRelation.authorSort | int | 作者展示顺序 |
|
||||
| bookAuthorRelation.createdAt | string | 创建时间 |
|
||||
| bookAuthorRelation.updatedAt | string | 更新时间 |
|
||||
@@ -160,9 +162,10 @@
|
||||
| list | array | `bookRes.BookAuthorRelationListItem` 列表 |
|
||||
| list[].id | uint | 关系 ID |
|
||||
| list[].bookId | uint | 书籍 ID |
|
||||
| list[].bookTitle | string | 书籍标题展示字段,来源于 `book.title AS book_title` |
|
||||
| list[].authorId | uint | 作者 ID |
|
||||
| list[].authorSort | int | 作者展示顺序 |
|
||||
| list[].authorName | string | 作者名称展示字段 |
|
||||
| list[].authorName | string | 作者名称展示字段,来源于 `book_author.name AS author_name` |
|
||||
| total | int64 | 总数 |
|
||||
| page | int | 当前页 |
|
||||
| pageSize | int | 每页数量 |
|
||||
@@ -170,6 +173,7 @@
|
||||
#### 规则
|
||||
|
||||
- 列表默认排序:`bookId asc, authorSort asc, id desc`。
|
||||
- 列表通过 `book_author_relation` 联表 `book`、`book_author` 补充 `bookTitle/authorName` 展示字段;写接口仍只接收 `bookId/authorId/authorSort`。
|
||||
|
||||
## 规则
|
||||
|
||||
@@ -177,4 +181,5 @@
|
||||
- `bookId + authorId` 唯一,对应数据库唯一索引 `uk_book_author_relation_book_id_author_id`。
|
||||
- `authorSort` 必须大于 `0`。
|
||||
- 创建时 `authorSort` 未传或为 `0` 时默认 `1`。
|
||||
- `bookTitle/authorName` 为只读展示字段,禁止写入实体表结构,禁止作为创建或更新入参。
|
||||
- 删除策略为硬删。
|
||||
|
||||
Reference in New Issue
Block a user