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

@@ -12,28 +12,57 @@ type BookAuthorListItem struct {
book.BookAuthor `gorm:"embedded"`
AuthorName string `json:"authorName" gorm:"column:author_name"`
}
type BookAuthorRelationResponse struct {
BookAuthorRelation book.BookAuthorRelation `json:"bookAuthorRelation"`
}
type BookAuthorRelationListItem struct {
type BookAuthorRelationDisplay struct {
book.BookAuthorRelation `gorm:"embedded"`
BookTitle string `json:"bookTitle" gorm:"column:book_title"`
AuthorName string `json:"authorName" gorm:"column:author_name"`
}
type BookAuthorRelationResponse struct {
BookAuthorRelation BookAuthorRelationDisplay `json:"bookAuthorRelation"`
}
type BookAuthorRelationListItem = BookAuthorRelationDisplay
type BookChapterDisplay struct {
book.BookChapter `gorm:"embedded"`
BookTitle string `json:"bookTitle" gorm:"column:book_title"`
}
type BookChapterResponse struct {
BookChapter book.BookChapter `json:"bookChapter"`
BookChapter BookChapterDisplay `json:"bookChapter"`
}
type BookChapterListItem = BookChapterDisplay
type BookCommentDisplay struct {
book.BookComment `gorm:"embedded"`
BookTitle string `json:"bookTitle" gorm:"column:book_title"`
ChapterTitle string `json:"chapterTitle" gorm:"column:chapter_title"`
}
type BookCommentResponse struct {
BookComment book.BookComment `json:"bookComment"`
BookComment BookCommentDisplay `json:"bookComment"`
}
type BookCommentListItem = BookCommentDisplay
type BookCommentLikeRecordDisplay struct {
book.BookCommentLikeRecord `gorm:"embedded"`
BookTitle string `json:"bookTitle" gorm:"column:book_title"`
CommentContent string `json:"commentContent" gorm:"column:comment_content"`
}
type BookCommentLikeRecordResponse struct {
BookCommentLikeRecord book.BookCommentLikeRecord `json:"bookCommentLikeRecord"`
BookCommentLikeRecord BookCommentLikeRecordDisplay `json:"bookCommentLikeRecord"`
}
type BookCommentLikeRecordListItem = BookCommentLikeRecordDisplay
type BookFavoriteRecordDisplay struct {
book.BookFavoriteRecord `gorm:"embedded"`
BookTitle string `json:"bookTitle" gorm:"column:book_title"`
}
type BookFavoriteRecordResponse struct {
BookFavoriteRecord book.BookFavoriteRecord `json:"bookFavoriteRecord"`
BookFavoriteRecord BookFavoriteRecordDisplay `json:"bookFavoriteRecord"`
}
type BookFavoriteRecordListItem = BookFavoriteRecordDisplay
type BookReadRecordDisplay struct {
book.BookReadRecord `gorm:"embedded"`
ChapterTitle string `json:"chapterTitle" gorm:"column:chapter_title"`
}
type BookReadRecordResponse struct {
BookReadRecord book.BookReadRecord `json:"bookReadRecord"`
BookReadRecord BookReadRecordDisplay `json:"bookReadRecord"`
}
type BookReadRecordListItem = BookReadRecordDisplay
type BookSeriesResponse struct {
BookSeries book.BookSeries `json:"bookSeries"`
}