reply

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 4 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 GetCount

func GetCount() int64

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;" json:"id"`                                                      //
	ArticleId uint64    `gorm:"column:article_id;type:bigint unsigned;not null;default:0;index:idx_reply_article_created;" json:"articleId"` //
	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 GetByArticleId added in v0.0.3

func GetByArticleId(articleId 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