entity

package
v0.0.0-...-7efc56f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListLimitDefault  = "100"     // 一覧取得上限
	ListOffsetDefault = "0"       // 一覧取得開始位置
	UnknownUserName   = "unknown" // 不明なユーザーの表示名
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	ID           int64       `json:"id"`           // 書籍ID
	Title        string      `json:"title"`        // タイトル
	TitleKana    string      `json:"titleKana"`    // タイトル(かな)
	Description  string      `json:"description"`  // 説明
	Isbn         string      `json:"isbn"`         // ISBN
	Publisher    string      `json:"publisher"`    // 出版社名
	PublishedOn  string      `json:"publishedOn"`  // 出版日
	ThumbnailURL string      `json:"thumbnailUrl"` // サムネイルURL
	RakutenURL   string      `json:"rakutenUrl"`   // 楽天ショップURL
	Size         string      `json:"size"`         // 楽天書籍サイズ
	Author       string      `json:"author"`       // 著者名一覧
	AuthorKana   string      `json:"authorKana"`   // 著者名一覧(かな)
	Reviews      BookReviews `json:"reviewsList"`  // レビュー一覧
	ReviewLimit  int64       `json:"reviewLimit"`  // レビュー取得上限
	ReviewOffset int64       `json:"reviewOffset"` // レビュー取得開始位置
	ReviewTotal  int64       `json:"reviewTotal"`  // レビュー検索一致件数
	CreatedAt    string      `json:"createdAt"`    // 登録日時
	UpdatedAt    string      `json:"updatedAt"`    // 更新日時
}

func NewBook

func NewBook(b *entity.Book, rs BookReviews) *Book

func (*Book) Fill

func (b *Book) Fill(limit, offset, total int64)

type BookOnBookshelf

type BookOnBookshelf struct {
	ID           int64       `json:"id"`                     // 書籍ID
	Title        string      `json:"title"`                  // タイトル
	TitleKana    string      `json:"titleKana"`              // タイトル(かな)
	Description  string      `json:"description"`            // 説明
	Isbn         string      `json:"isbn"`                   // ISBN
	Publisher    string      `json:"publisher"`              // 出版社名
	PublishedOn  string      `json:"publishedOn"`            // 出版日
	ThumbnailURL string      `json:"thumbnailUrl"`           // サムネイルURL
	RakutenURL   string      `json:"rakutenUrl"`             // 楽天ショップURL
	Size         string      `json:"size"`                   // 楽天書籍サイズ
	Author       string      `json:"author"`                 // 著者名一覧
	AuthorKana   string      `json:"author_kana"`            // 著者名一覧(かな)
	Bookshelf    *Bookshelf  `json:"bookshelf"`              // ユーザーの本棚情報
	Reviews      BookReviews `json:"reviewsList,omitempty"`  // レビュー一覧
	ReviewLimit  int64       `json:"reviewLimit,omitempty"`  // レビュー取得上限
	ReviewOffset int64       `json:"reviewOffset,omitempty"` // レビュー取得開始位置
	ReviewTotal  int64       `json:"reviewTotal,omitempty"`  // レビュー検索一致件
	CreatedAt    string      `json:"createdAt"`              // 登録日時
	UpdatedAt    string      `json:"updatedAt"`              // 更新日時
}

func NewBookOnBookshelf

func NewBookOnBookshelf(b *entity.Book, bs *entity.Bookshelf) *BookOnBookshelf

func (*BookOnBookshelf) Fill

func (b *BookOnBookshelf) Fill(rs BookReviews, limit, offset, total int64)

type BookReview

type BookReview struct {
	ID         int64           `json:"id"`         // レビューID
	Impression string          `json:"impression"` // 感想
	User       *BookReviewUser `json:"user"`       // 投稿者
	CreatedAt  string          `json:"createdAt"`  // 登録日時
	UpdatedAt  string          `json:"updatedAt"`  // 更新日時
}

func NewBookReview

func NewBookReview(r *entity.Review, u *entity.User) *BookReview

type BookReviewUser

type BookReviewUser struct {
	ID           string `json:"id"`           // ユーザーID
	Username     string `json:"username"`     // 表示名
	ThumbnailURL string `json:"thumbnailUrl"` // サムネイルURL
}

type BookReviews

type BookReviews []*BookReview

func NewBookReviews

func NewBookReviews(rs entity.Reviews, um map[string]*entity.User) BookReviews

type BooksOnBookshelf

type BooksOnBookshelf []*BookOnBookshelf

func NewBooksOnBookshelf

func NewBooksOnBookshelf(bm map[int64]*entity.Book, bss entity.Bookshelves) BooksOnBookshelf

type Bookshelf

type Bookshelf struct {
	Status    string `json:"status"`    // 読書ステータス
	ReadOn    string `json:"readOn"`    // 読み終えた日
	ReviewID  int64  `json:"reviewId"`  // レビューID
	CreatedAt string `json:"createdAt"` // 登録日時
	UpdatedAt string `json:"updatedAt"` // 更新日時
}

type UserReview

type UserReview struct {
	ID         int64           `json:"id"`         // レビューID
	Impression string          `json:"impression"` // 感想
	Book       *UserReviewBook `json:"book"`       // 書籍情報
	CreatedAt  string          `json:"createdAt"`  // 登録日時
	UpdatedAt  string          `json:"updatedAt"`  // 更新日時
}

func NewUserReview

func NewUserReview(r *entity.Review, b *entity.Book) *UserReview

type UserReviewBook

type UserReviewBook struct {
	ID           int64  `json:"id"`           // 書籍ID
	Title        string `json:"title"`        // タイトル
	ThumbnailURL string `json:"thumbnailUrl"` // サムネイルURL
}

type UserReviews

type UserReviews []*UserReview

func NewUserReviews

func NewUserReviews(rs entity.Reviews, bm map[int64]*entity.Book) UserReviews

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL