Documentation
¶
Index ¶
- type Article
- type CountReview
- type Favorite
- func (c *Favorite) CountFavorite(ctx context.Context, objectType int64, favoriteType []int64) (favor []FavoriteCount, err error)
- func (c *Favorite) CreateFavorite(ctx context.Context, f *Favorite) error
- func (c *Favorite) DeleteFavorite(ctx context.Context, f *Favorite) error
- func (c *Favorite) FindFavorite(ctx context.Context, f *Favorite) (*Favorite, error)
- func (c *Favorite) FindFavoriteList(ctx context.Context, userId int64, favoriteTypes []int64) (favor *[]Favorite, err error)
- func (c *Favorite) UpdateFavorite(ctx context.Context, f *Favorite) (*Favorite, error)
- type FavoriteCount
- type Review
- func (c *Review) CountReview(ctx context.Context, r *Review) (CountReview, error)
- func (c *Review) CreateReview(ctx context.Context, r *Review) error
- func (c *Review) ListReview(ctx context.Context, r *Review) (reviewUserList []ReviewUser, err error)
- func (c *Review) ReviewInfo(ctx context.Context, r *Review) (*Review, error)
- type ReviewUser
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 ¶
ArticleInfo 文章详情
func (*Article) ArticleList ¶
ArticleList 文章列表
type CountReview ¶
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 (*Favorite) CountFavorite ¶
func (c *Favorite) CountFavorite(ctx context.Context, objectType int64, favoriteType []int64) (favor []FavoriteCount, err error)
CountFavorite 查看点赞、收藏计数
func (*Favorite) CreateFavorite ¶
CreateFavorite 点赞、收藏添加
func (*Favorite) DeleteFavorite ¶
DeleteFavorite 点赞、收藏删除
func (*Favorite) FindFavorite ¶
FindFavorite 查看点赞、收藏详情
type FavoriteCount ¶
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 ¶
CountReview 评论统计
func (*Review) CreateReview ¶
CreateReview 添加评论
func (*Review) ListReview ¶
func (c *Review) ListReview(ctx context.Context, r *Review) (reviewUserList []ReviewUser, err error)
ListReview 评论列表(关联用户)
type ReviewUser ¶
Click to show internal directories.
Click to hide internal directories.