reply

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountByArticleId added in v0.2.2

func CountByArticleId(articleId uint64) int64

func Create

func Create(entity *Entity) error

func DeleteEntity

func DeleteEntity(entity *Entity) int64

func GetCount

func GetCount() int64

func GetCountGroupByDay added in v0.1.1

func GetCountGroupByDay() ([]map[string]any, error)

GetCountGroupByDay 按天统计回复数

func GetMaxId

func GetMaxId() uint64

func GetUserCount added in v0.0.3

func GetUserCount(userId uint64) int64

Types

type Entity

type Entity struct {
	Id        uint64 `gorm:"primaryKey;column:id;autoIncrement;not null;index:idx_reply_article_id,priority:2;" json:"id"` //
	ArticleId uint64 ``                                                                                                    //
	/* 152-byte string literal not displayed */
	UserId    uint64    `gorm:"column:user_id;type:bigint unsigned;not null;default:0;index;" json:"userId"` //
	TargetId  uint64    `gorm:"column:target_id;type:bigint unsigned;not null;default:0;" json:"targetId"`   // 目标id
	Content   string    `gorm:"column:content;type:text;" json:"content"`                                    //
	ReplyId   uint64    `gorm:"column:reply_id;type:bigint;not null;default:0;" json:"replyId"`
	CreatedAt time.Time `gorm:"column:created_at;index;autoCreateTime;<-:create;index:idx_reply_article_created;" json:"createdAt"` //
	UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
	gorm.DeletedAt
}

func Get

func Get(id any) (entity Entity)

func GetAll added in v0.1.1

func GetAll(offset, limit int) ([]*Entity, error)

GetAll 用于全量导出/修复数据,支持分页查询

func GetAllByArticleId added in v0.1.1

func GetAllByArticleId(articleId uint64) (entities []*Entity)

func GetByArticleId added in v0.0.3

func GetByArticleId(articleId uint64) (entities []*Entity)

func GetByArticleIdAfter added in v0.2.2

func GetByArticleIdAfter(articleId uint64, id uint64, limit int) (entities []*Entity)

func GetByArticleIdAsc added in v0.2.2

func GetByArticleIdAsc(articleId uint64, limit int) (entities []*Entity)

func GetByArticleIdBefore added in v0.2.2

func GetByArticleIdBefore(articleId uint64, id uint64, limit int) (entities []*Entity)

func GetByIds added in v0.2.2

func GetByIds(ids []uint64) (entities []*Entity)

func GetByMaxIdPage

func GetByMaxIdPage(articleId uint64, id uint64, pageSize int) (entities []Entity)

func (*Entity) TableName

func (itself *Entity) TableName() string

Jump to

Keyboard shortcuts

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