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: 3 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 Auth

type Auth struct {
	ID               string        `json:"id"`               // ユーザーID
	Username         string        `json:"username"`         // ユーザー名
	Gender           entity.Gender `json:"gender"`           // 性別
	Email            string        `json:"email"`            // メールアドレス
	PhoneNumber      string        `json:"phoneNumber"`      // 電話番号
	ThumbnailURL     string        `json:"thumbnailUrl"`     // サムネイルURL
	SelfIntroduction string        `json:"selfIntroduction"` // 自己紹介
	LastName         string        `json:"lastName"`         // 姓
	FirstName        string        `json:"firstName"`        // 名
	LastNameKana     string        `json:"lastNameKana"`     // 姓(かな)
	FirstNameKana    string        `json:"firstNameKana"`    // 名(かな)
	PostalCode       string        `json:"postalCode"`       // 郵便番号
	Prefecture       string        `json:"prefecture"`       // 都道府県
	City             string        `json:"city"`             // 市区町村
	AddressLine1     string        `json:"addressLine1"`     // 町名,番地
	AddressLine2     string        `json:"addressLine2"`     // マンション・ビル名,号室
	CreatedAt        string        `json:"createdAt"`        // 作成日時
	UpdatedAt        string        `json:"updatedAt"`        // 更新日時
}

func NewAuth

func NewAuth(a *entity.Auth) *Auth

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:"published_on"`        // 出版日
	ThumbnailURL string     `json:"thumbnailUrl"`        // サムネイルURL
	RakutenURL   string     `json:"rakutenUrl"`          // 楽天ショップURL
	Size         string     `json:"size"`                // 楽天書籍サイズ
	Author       string     `json:"author"`              // 著者名一覧
	AuthorKana   string     `json:"authorKana"`          // 著者名一覧(かな)
	Bookshelf    *Bookshelf `json:"bookshelf,omitempty"` // ユーザーの本棚情報
	CreatedAt    string     `json:"createdAt"`           // 登録日時
	UpdatedAt    string     `json:"updatedAt"`           // 更新日時
}

func NewBook

func NewBook(b *entity.Book, bs *entity.Bookshelf) *Book

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 Books

type Books []*Book

func NewBooks

func NewBooks(bm map[int64]*entity.Book, bss entity.Bookshelves) Books

type Bookshelf

type Bookshelf struct {
	ID         int64  `json:"id"`                   // 本棚ID
	Status     string `json:"status"`               // 読書ステータス
	ReadOn     string `json:"readOn"`               // 読み終えた日
	Impression string `json:"impression,omitempty"` // 感想
	CreatedAt  string `json:"createdAt"`            // 登録日時
	UpdatedAt  string `json:"updatedAt"`            // 更新日時
}

func NewBookshelf

func NewBookshelf(bs *entity.Bookshelf) *Bookshelf

type ChatMessage

type ChatMessage struct {
	Text      string    `json:"text"`      // テキストメッセージ
	Image     string    `json:"image"`     // 添付画像URL
	UserID    string    `json:"userId"`    // ユーザーID
	User      *ChatUser `json:"user"`      // 送信者
	CreatedAt string    `json:"createdAt"` // 送信日時
}

func NewChatMessage

func NewChatMessage(m *entity.ChatMessage, u *entity.User) *ChatMessage

type ChatRoom

type ChatRoom struct {
	ID            string       `json:"id"`            // チャットルームID
	Users         ChatUsers    `json:"usersList"`     // 参加者一覧
	LatestMessage *ChatMessage `json:"latestMessage"` // 最新のメッセージ
	CreatedAt     string       `json:"createdAt"`     // 作成日時
	UpdatedAt     string       `json:"updatedAt"`     // 更新日時
}

func NewChatRoom

func NewChatRoom(r *entity.ChatRoom, um map[string]*entity.User) *ChatRoom

type ChatRooms

type ChatRooms []*ChatRoom

func NewChatRooms

func NewChatRooms(rs entity.ChatRooms, um map[string]*entity.User) ChatRooms

type ChatUser

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

type ChatUsers

type ChatUsers []*ChatUser

type Follow

type Follow struct {
	ID               string `json:"id"`               // ユーザーID
	Username         string `json:"username"`         // 表示名
	ThumbnailURL     string `json:"thumbnailUrl"`     // サムネイルURL
	SelfIntroduction string `json:"selfIntroduction"` // 自己紹介
	IsFollow         bool   `json:"isFollow"`         // 自分がフォローしているか
}

func NewFollow

func NewFollow(f *entity.Follow) *Follow

type Follower

type Follower struct {
	ID               string `json:"id"`               // ユーザーID
	Username         string `json:"username"`         // 表示名
	ThumbnailURL     string `json:"thumbnailUrl"`     // サムネイルURL
	SelfIntroduction string `json:"selfIntroduction"` // 自己紹介
	IsFollow         bool   `json:"isFollow"`         // 自分がフォローしているか
}

func NewFollower

func NewFollower(f *entity.Follower) *Follower

type Followers

type Followers []*Follower

func NewFollowers

func NewFollowers(fs entity.Followers) Followers

type Follows

type Follows []*Follow

func NewFollows

func NewFollows(fs entity.Follows) Follows

type MonthlyResult

type MonthlyResult struct {
	Year      int32 `json:"year"`      // 年
	Month     int32 `json:"month"`     // 月
	ReadTotal int64 `json:"readTotal"` // 読んだ本の合計
}

func NewMonthlyResult

func NewMonthlyResult(r *entity.MonthlyResult, date time.Time) *MonthlyResult

type MonthlyResults

type MonthlyResults []*MonthlyResult

func NewMonthlyResults

func NewMonthlyResults(rm map[string]*entity.MonthlyResult, now time.Time) MonthlyResults

type UserProfile

type UserProfile struct {
	ID               string                `json:"id"`               // ユーザーID
	Username         string                `json:"username"`         // 表示名
	ThumbnailURL     string                `json:"thumbnailUrl"`     // サムネイルURL
	SelfIntroduction string                `json:"selfIntroduction"` // 自己紹介
	IsFollow         bool                  `json:"isFollow"`         // 自分がフォローしているか
	IsFollower       bool                  `json:"isFollower"`       // 自分がフォローされているか
	FollowCount      int64                 `json:"followCount"`      // フォロー数
	FollowerCount    int64                 `json:"followerCount"`    // フォロワー数
	Rating           int32                 `json:"rating"`           // ユーザーからの平均評価
	ReviewCount      int64                 `json:"reviewCount"`      // ユーザーからのレビュー数
	Products         []*UserProfileProduct `json:"productsList"`     // 出品商品一覧
}

func NewUserProfile

func NewUserProfile(p *entity.UserProfile) *UserProfile

type UserProfileProduct

type UserProfileProduct struct {
	ID           int64    `json:"id"`           // 商品ID
	Name         string   `json:"name"`         // 商品名
	ThumbnailURL string   `json:"thumbnailUrl"` // サムネイルURL
	Authors      []string `json:"authorsList"`  // 著者名一覧
}

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