models

package
v0.0.0-...-d1a5c07 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MulanPSL-2.0 Imports: 4 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 {
	gorm.Model
	ArticleTitle   string         `json:"article_title" gorm:"column:article_title;type: varchar(255);comment: 文章标题"`
	TouristVolume  int64          `json:"tourist_volume" gorm:"column:tourist_volume;type: int(11);default: 0;comment: 文章浏览量"`
	ArticleInter   string         `json:"article_inter" gorm:"column:article_inter;type: varchar(255);comment: 文章简介"`
	ArticleContent string         `json:"article_content" gorm:"column:article_content;type: text;comment: 文章内容"`
	ArticleImg     datatypes.JSON `json:"article_img" gorm:"column:article_img;type: varchar(240);comment: 文章图片"`
}

func NewArticle

func NewArticle() *Article

func (*Article) ArticleInfo

func (ar *Article) ArticleInfo(ctx context.Context, a *Article) (*Article, error)

ArticleInfo 文章详情

func (*Article) ArticleList

func (ar *Article) ArticleList(ctx context.Context, a *Article) (article []*Article, err error)

ArticleList 文章列表

func (*Article) ArticleTouristVolumeUpdate

func (ar *Article) ArticleTouristVolumeUpdate(ctx context.Context, a *Article) error

ArticleTouristVolumeUpdate 文章游览量

type CountReview

type CountReview struct {
	Count    int64 `json:"count"`
	ObjectId int64 `json:"object_id"`
}

type Favorite

type Favorite struct {
	gorm.Model
	UserId       int64 `json:"user_id" gorm:"column:user_id;type: int(11);comment: 用户ID"`
	ObjectId     int64 `json:"object_id" gorm:"column:object_id;type: int(11);comment: 对端ID"`
	ObjectType   int64 `json:"object_type" gorm:"column:object_type;type: tinyint(1);comment: 对端类型:1.商品2.文章"`
	FavoriteType int64 `` /* 129-byte string literal not displayed */
}

func NewFavor

func NewFavor() *Favorite

func (*Favorite) CountFavorite

func (c *Favorite) CountFavorite(ctx context.Context, objectType int64, favoriteType []int64) (favor []FavoriteCount, err error)

CountFavorite 查看点赞、收藏计数

func (*Favorite) CreateFavorite

func (c *Favorite) CreateFavorite(ctx context.Context, f *Favorite) error

CreateFavorite 点赞、收藏添加

func (*Favorite) DeleteFavorite

func (c *Favorite) DeleteFavorite(ctx context.Context, f *Favorite) error

DeleteFavorite 点赞、收藏删除

func (*Favorite) FindFavorite

func (c *Favorite) FindFavorite(ctx context.Context, f *Favorite) (*Favorite, error)

FindFavorite 查看点赞、收藏详情

func (*Favorite) FindFavoriteList

func (c *Favorite) FindFavoriteList(ctx context.Context, userId int64, favoriteTypes []int64) (favor *[]Favorite, err error)

FindFavoriteList 查看点赞、收藏列表

func (*Favorite) UpdateFavorite

func (c *Favorite) UpdateFavorite(ctx context.Context, f *Favorite) (*Favorite, error)

UpdateFavorite 点赞、收藏修改

type FavoriteCount

type FavoriteCount struct {
	Count    int64 `json:"count"`
	ObjectId int64 `json:"object_id"`
}

type Review

type Review struct {
	gorm.Model
	UserId     int64          `json:"user_id" gorm:"column:user_id;type: int(11);default: 0;comment: 用户ID"`
	ReviewType int64          `json:"review_type" gorm:"column:review_type;type: tinyint(1);default: 0;comment: 评论类型"`
	ObjectId   int64          `json:"object_id" gorm:"column:object_id;type: int(11);default: 0;comment: 对端ID"`
	StarLevel  int64          `json:"star_level" gorm:"column:star_level;type: tinyint(1);default: 0;comment: 评论星级"`
	Content    string         `json:"content" gorm:"column:content;type: varchar(255);comment: 评论内容"`
	ReviewImg  datatypes.JSON `json:"review_img" gorm:"column:review_img;type: varchar(255);comment: 评论图片"`
}

func NewReviewModels

func NewReviewModels() *Review

func (*Review) CountReview

func (c *Review) CountReview(ctx context.Context, r *Review) (CountReview, error)

CountReview 评论统计

func (*Review) CreateReview

func (c *Review) CreateReview(ctx context.Context, r *Review) error

CreateReview 添加评论

func (*Review) ListReview

func (c *Review) ListReview(ctx context.Context, r *Review) (reviewUserList []ReviewUser, err error)

ListReview 评论列表(关联用户)

func (*Review) ReviewInfo

func (c *Review) ReviewInfo(ctx context.Context, r *Review) (*Review, error)

ReviewInfo 评论详情

type ReviewUser

type ReviewUser struct {
	Review
	Nickname string
	Avatar   string
}

Jump to

Keyboard shortcuts

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