model

package
v0.0.0-...-2c8b9bc Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	ID          domain.ID `bson:"id"`
	AuthorID    domain.ID `bson:"author_id"`
	Title       string    `bson:"title"`
	Slug        string    `bson:"slug"`
	Description string    `bson:"description"`
	Body        string    `bson:"body"`
	CreatedAt   time.Time `bson:"created_at"`
	UpdatedAt   time.Time `bson:"updated_at"`
}

func AsArticle

func AsArticle(arg domain.Article) Article

func (Article) ToDomain

func (data Article) ToDomain() domain.Article

type ArticleFavorite

type ArticleFavorite struct {
	ArticleID domain.ID `bson:"article_id"`
	UserID    domain.ID `bson:"user_id"`
}

func AsArticleFavorite

func AsArticleFavorite(arg domain.ArticleFavorite) ArticleFavorite

func (ArticleFavorite) ToDomain

func (data ArticleFavorite) ToDomain() domain.ArticleFavorite

type ArticleFavoriteCount

type ArticleFavoriteCount struct {
	ArticleID domain.ID `bson:"article_id"`
	Count     int       `bson:"favorite_count"`
}

func (ArticleFavoriteCount) ToDomain

type ArticleTag

type ArticleTag struct {
	ArticleID domain.ID `bson:"article_id"`
	TagID     domain.ID `bson:"tag_id"`
}

func AsArticleTag

func AsArticleTag(arg domain.ArticleTag) ArticleTag

func (ArticleTag) ToDomain

func (data ArticleTag) ToDomain() domain.ArticleTag

type Comment

type Comment struct {
	ID        domain.ID `bson:"id"`
	ArticleID domain.ID `bson:"article_id"`
	AuthorID  domain.ID `bson:"author_id"`
	Body      string    `bson:"body"`
	CreatedAt time.Time `bson:"created_at"`
	UpdatedAt time.Time `bson:"updated_at"`
}

func AsComment

func AsComment(arg domain.Comment) Comment

func (Comment) ToDomain

func (data Comment) ToDomain() domain.Comment

type Tag

type Tag struct {
	ID   domain.ID `bson:"id"`
	Name string    `bson:"name"`
}

func AsTag

func AsTag(arg domain.Tag) Tag

func (Tag) ToDomain

func (data Tag) ToDomain() domain.Tag

type User

type User struct {
	ID        domain.ID `bson:"id"`
	Email     string    `bson:"email"`
	Username  string    `bson:"username"`
	Password  string    `bson:"password"`
	Image     string    `bson:"image"`
	Bio       string    `bson:"bio"`
	CreatedAt time.Time `bson:"created_at"`
	UpdatedAt time.Time `bson:"updated_at"`
}

func AsUser

func AsUser(arg domain.User) User

func (User) ToDomain

func (data User) ToDomain() domain.User

type UserFollow

type UserFollow struct {
	FollowerID domain.ID `bson:"follower_id"`
	FolloweeID domain.ID `bson:"followee_id"`
}

func AsUserFollow

func AsUserFollow(arg domain.UserFollow) UserFollow

func (UserFollow) ToDomain

func (data UserFollow) ToDomain() domain.UserFollow

Jump to

Keyboard shortcuts

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