Documentation
¶
Index ¶
- func CountByArticleId(articleId uint64) int64
- func Create(entity *Entity) error
- func DeleteEntity(entity *Entity) int64
- func GetCount() int64
- func GetCountGroupByDay() ([]map[string]any, error)
- func GetMaxId() uint64
- func GetUserCount(userId uint64) int64
- func SaveNoUpdate(entity *Entity) error
- type Entity
- func Get(id any) (entity Entity)
- func GetAll(offset, limit int) ([]*Entity, error)
- func GetAllByArticleId(articleId uint64) (entities []*Entity)
- func GetByArticleId(articleId uint64) (entities []*Entity)
- func GetByArticleIdAfter(articleId uint64, id uint64, limit int) (entities []*Entity)
- func GetByArticleIdAsc(articleId uint64, limit int) (entities []*Entity)
- func GetByArticleIdBefore(articleId uint64, id uint64, limit int) (entities []*Entity)
- func GetByIds(ids []uint64) (entities []*Entity)
- func GetByMaxIdPage(articleId uint64, id uint64, pageSize int) (entities []Entity)
- func QueryById(startId uint64, limit int) (entities []*Entity)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountByArticleId ¶ added in v0.2.2
func DeleteEntity ¶
func GetCountGroupByDay ¶ added in v0.1.1
GetCountGroupByDay 按天统计回复数
func GetUserCount ¶ added in v0.0.3
func SaveNoUpdate ¶ added in v0.2.6
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"` //
RenderedHTML string `gorm:"column:rendered_html;type:text;" json:"renderedHTML"` // md 渲染后数据
RenderedVersion uint32 `gorm:"column:rendered_version;type:bigint unsigned;not null;default:0;" json:"renderedVersion"` // md 的渲染器版本
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 GetAllByArticleId ¶ added in v0.1.1
func GetByArticleId ¶ added in v0.0.3
func GetByArticleIdAfter ¶ added in v0.2.2
func GetByArticleIdAsc ¶ added in v0.2.2
func GetByArticleIdBefore ¶ added in v0.2.2
func GetByMaxIdPage ¶
Click to show internal directories.
Click to hide internal directories.