github.com/s7techlab/cckit@v0.10.5/state/testdata/schema/book.go (about)

     1  package schema
     2  
     3  const BookEntity = `BOOK`
     4  
     5  type Book struct {
     6  	Id       string
     7  	Title    string
     8  	Chapters []BookChapter
     9  }
    10  
    11  func (b Book) Key() ([]string, error) {
    12  	return []string{BookEntity, b.Id}, nil
    13  }
    14  
    15  type BookChapter struct {
    16  	Pos   int
    17  	Title string
    18  }
    19  
    20  const PrivateBookEntity = `PRIVATE_BOOK`
    21  
    22  type PrivateBook struct {
    23  	Id       string
    24  	Title    string
    25  	Chapters []BookChapter
    26  }
    27  
    28  func (pb PrivateBook) Key() ([]string, error) {
    29  	return []string{PrivateBookEntity, pb.Id}, nil
    30  }
    31  
    32  type BookListRequest struct {
    33  	PageSize int32
    34  	Bookmark string
    35  }
    36  
    37  type BookList struct {
    38  	Items []*Book
    39  	Next  string
    40  }