reply

package
v0.2.51 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(entity *Entity) error

func DeleteEntity

func DeleteEntity(entity *Entity) int64

func GetMaxId

func GetMaxId() uint64

func GetMaxReplyNoByArticleId

func GetMaxReplyNoByArticleId(articleId uint64) uint64

func Save

func Save(entity *Entity) error

func SaveNoUpdate

func SaveNoUpdate(entity *Entity) error

func UpdateProcessStatus

func UpdateProcessStatus(id uint64, processStatus int8) error

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 ``                                                                                                    //
	/* 190-byte string literal not displayed */
	ReplyNo         uint64    `gorm:"column:reply_no;type:bigint unsigned;not null;default:0;index:idx_reply_article_no,priority:2;" json:"replyNo"`          // 文章内稳定回复序号
	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 的渲染器版本
	ProcessStatus   int8      `gorm:"column:process_status;type:tinyint;not null;default:0;index:idx_reply_article_process,priority:2;" json:"processStatus"` // 管理状态:0 正常 1 封禁
	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 GetByArticleIdAfter

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

func GetByArticleIdBefore

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

func GetByArticleReplyNoAfter

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

func GetByArticleReplyNoAsc

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

func GetByArticleReplyNoAtOrAfter

func GetByArticleReplyNoAtOrAfter(articleId uint64, replyNo uint64) (entity Entity, ok bool)

func GetByArticleReplyNoAtOrBefore

func GetByArticleReplyNoAtOrBefore(articleId uint64, replyNo uint64) (entity Entity, ok bool)

func GetByArticleReplyNoBefore

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

func GetByArticleReplyNoDesc

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

func GetByIds

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

func GetFirstPageByArticleId

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

func QueryById

func QueryById(startId uint64, limit 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