初始化项目框架,完成部分接口开发
This commit is contained in:
64
internal/model/book.go
Normal file
64
internal/model/book.go
Normal file
@ -0,0 +1,64 @@
|
||||
package model
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type Book struct {
|
||||
g.Meta `orm:"table:books"`
|
||||
Id int64 `json:"id"`
|
||||
AuthorId int64 `json:"authorId"`
|
||||
CategoryId int64 `json:"categoryId"`
|
||||
Title string `json:"title"`
|
||||
CoverUrl string `json:"coverUrl"`
|
||||
Description string `json:"description"`
|
||||
Status int `json:"status"`
|
||||
WordsCount int `json:"wordsCount"`
|
||||
ChaptersCount int `json:"chaptersCount"`
|
||||
LatestChapterId int64 `json:"latestChapterId"`
|
||||
Rating float64 `json:"rating"`
|
||||
ReadCount int64 `json:"readCount"`
|
||||
Tags string `json:"tags"`
|
||||
IsRecommended int `json:"isRecommended"`
|
||||
}
|
||||
|
||||
type BookListIn struct {
|
||||
Page int
|
||||
Size int
|
||||
Title string
|
||||
CategoryId int64
|
||||
AuthorId int64
|
||||
Status int
|
||||
IsRecommended int
|
||||
}
|
||||
type BookListOut struct {
|
||||
Total int
|
||||
List []Book
|
||||
}
|
||||
|
||||
type BookAddIn struct {
|
||||
AuthorId int64
|
||||
CategoryId int64
|
||||
Title string
|
||||
CoverUrl string
|
||||
Description string
|
||||
Status int
|
||||
Tags string
|
||||
IsRecommended int
|
||||
}
|
||||
type BookEditIn struct {
|
||||
Id int64
|
||||
AuthorId int64
|
||||
CategoryId int64
|
||||
Title string
|
||||
CoverUrl string
|
||||
Description string
|
||||
Status int
|
||||
Tags string
|
||||
IsRecommended int
|
||||
}
|
||||
type BookDelIn struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type BookCRUDOut struct {
|
||||
Success bool
|
||||
}
|
||||
Reference in New Issue
Block a user