Documentation ¶
Index ¶
Constants ¶
View Source
const ( OperationBorrow = iota OperationReturn )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct { base.DefaultModel Isbn string `gorm:"size:32;NOT NULL;comment:isbn"` Name string `gorm:"size:100;NOT NULL;comment:书名"` Desc string `gorm:"size:1000;NOT NULL;comment:简介"` Cover string `gorm:"size:200;NOT NULL;comment:封面"` Author pq.StringArray `gorm:"type:varchar(100)[];comment:作者"` Translator pq.StringArray `gorm:"type:varchar(100)[];comment:译者"` PublishingHouse string `gorm:"size:100;NOT NULL;comment:出版社"` Edition string `gorm:"size:32;NOT NULL;comment:版次"` PrintedTimes string `gorm:"size:32;NOT NULL;comment:印次"` PrintedSheets string `gorm:"size:32;NOT NULL;comment:印张"` Format string `gorm:"size:32;NOT NULL;comment:开本"` WordCount float32 `gorm:"NOT NULL;comment:字数"` Pricing float32 `gorm:"NOT NULL;comment:定价"` PurchasePrice float32 `gorm:"NOT NULL;comment:购买价"` Packing string `gorm:"size:32;NOT NULL;comment:包装"` PageSize int `gorm:"comment:页数;NOT NULL;"` PurchaseTime time.Time `gorm:"comment:购买时间"` PurchaseSource string `gorm:"size:100;NOT NULL;comment:购买途径"` BookBorrowUID uint `gorm:"comment:借书人uid"` }
Book 书
func NewBookFromPB ¶
func NewBookFromPB(in *pb.CreateBookRequest) *Book
func (*Book) ToBookIndexPBs ¶
ToBookIndexPBs ..
type BookBorrowReturn ¶
type BookBorrowReturn struct { base.Model ID uint `gorm:"primarykey"` BookID uint `gorm:"comment:书id"` Book Book `gorm:"ForeignKey:BookID"` UID uint `gorm:"comment:用户id"` Operation int8 `gorm:"comment:操作类型"` //0:借,1:还 CreatedAt time.Time }
BookBorrowReturn 书籍位置
func NewBookBorrowReturn ¶
func NewBookBorrowReturn() *BookBorrowReturn
func (*BookBorrowReturn) ToBookBorrowReturnPBs ¶
func (m *BookBorrowReturn) ToBookBorrowReturnPBs(data []*BookBorrowReturn) []*pb.BookBorrowReturn
ToBookBorrowReturnPBs ..
type BookPosition ¶
type BookPosition struct { base.DefaultModel BookID uint `gorm:"uniqueIndex:book_position_uix;comment:书id"` BookshelfID uint `gorm:"comment:书架id"` Book Book `gorm:"ForeignKey:BookID"` Bookshelf Bookshelf `gorm:"ForeignKey:BookshelfID"` Layer int8 `gorm:"comment:层"` Partition int8 `gorm:"comment:分区"` PrevID uint `gorm:"comment:左侧位置id"` }
BookPosition 书籍位置
func NewBookPosition ¶
func NewBookPosition() *BookPosition
func (*BookPosition) DeleteByID ¶
func (m *BookPosition) DeleteByID(id int64) error
DeleteByID 获取某个书架某行某分区的最后一本书id
func (*BookPosition) GetLastBookPositionID ¶
func (m *BookPosition) GetLastBookPositionID(bookshelfID, layer, partiton int) error
GetLastBookPosition 获取某个书架某行某分区的最后一本书id
func (*BookPosition) ToBookPositionPBs ¶
func (m *BookPosition) ToBookPositionPBs(data []*BookPosition) []*pb.BookPosition
ToBookPositionPBs ..
type Bookshelf ¶
type Bookshelf struct { base.DefaultModel Name string `gorm:"size:100;NOT NULL;comment:书架名"` Cover string `gorm:"size:200;NOT NULL;comment:图片"` LayerNum int8 `gorm:"comment:层数"` PartitionNum int8 `gorm:"comment:分区数"` }
Bookshelf 书架
func NewBookshelfFromPB ¶
func NewBookshelfFromPB(in *pb.CreateBookshelfRequest) *Bookshelf
Click to show internal directories.
Click to hide internal directories.