posts

package
v0.2.63 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 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 CreateWithDB added in v0.2.61

func CreateWithDB(db *gorm.DB, entity *Entity) error

func DeleteEntity

func DeleteEntity(entity *Entity) int64

func GetMapByIds

func GetMapByIds(ids []uint64) map[uint64]*Entity

func GetMaxId

func GetMaxId() uint64

func GetMaxPostNoByTopicId

func GetMaxPostNoByTopicId(topicId uint64) uint64

func Save

func Save(entity *Entity) error

func SaveNoUpdate

func SaveNoUpdate(entity *Entity) error

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) int64

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_posts_topic_id,priority:2;" json:"id"`
	TopicId         uint64         `` /* 238-byte string literal not displayed */
	PostNo          uint64         `gorm:"column:post_no;type:bigint unsigned;not null;default:0;uniqueIndex:idx_posts_topic_no,priority:2;" json:"postNo"`
	UserId          uint64         `gorm:"column:user_id;type:bigint unsigned;not null;default:0;index;" json:"userId"`
	ReplyToPostId   uint64         `gorm:"column:reply_to_post_id;type:bigint unsigned;not null;default:0;" json:"replyToPostId"`
	Content         string         `gorm:"column:content;type:text;" json:"content"`
	RenderedHTML    string         `gorm:"column:rendered_html;type:text;" json:"renderedHTML"`
	RenderedVersion uint32         `gorm:"column:rendered_version;type:bigint unsigned;not null;default:0;" json:"renderedVersion"`
	ProcessStatus   int8           `gorm:"column:process_status;type:tinyint;not null;default:0;index:idx_posts_topic_process,priority:2;" json:"processStatus"`
	CreatedAt       time.Time      `gorm:"column:created_at;autoCreateTime;<-:create;index:idx_posts_topic_created,priority:2;" json:"createdAt"`
	UpdatedAt       time.Time      `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
	DeletedAt       gorm.DeletedAt `json:"-"`
}

func Get

func Get(id uint64) (entity Entity)

func GetByIds

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

func GetByTopicIdAfter

func GetByTopicIdAfter(topicId uint64, id uint64, limit int) (entities []*Entity)

func GetByTopicIdBefore

func GetByTopicIdBefore(topicId uint64, id uint64, limit int) (entities []*Entity)

func GetByTopicPostNoAfter

func GetByTopicPostNoAfter(topicId uint64, postNo uint64, limit int) (entities []*Entity)

func GetByTopicPostNoAsc

func GetByTopicPostNoAsc(topicId uint64, limit int) (entities []*Entity)

func GetByTopicPostNoAtOrAfter

func GetByTopicPostNoAtOrAfter(topicId uint64, postNo uint64) (entity Entity, ok bool)

func GetByTopicPostNoAtOrBefore

func GetByTopicPostNoAtOrBefore(topicId uint64, postNo uint64) (entity Entity, ok bool)

func GetByTopicPostNoBefore

func GetByTopicPostNoBefore(topicId uint64, postNo uint64, limit int) (entities []*Entity)

func GetByTopicPostNoDesc

func GetByTopicPostNoDesc(topicId uint64, limit int) (entities []*Entity)

func GetFirstPageByTopicId

func GetFirstPageByTopicId(topicId uint64) (entities []*Entity)

func GetLastByTopicID added in v0.2.51

func GetLastByTopicID(topicID uint64) (entity Entity, ok bool)

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