Documentation
¶
Index ¶
- func CantWriteNew(userId uint64, maxCount int64) bool
- func Create(entity *Entity) error
- func DecrementLike(entity Entity) int64
- func DecrementPostFast(topicId uint64, posters []Poster) error
- func Delete(entity *Entity) int64
- func GetMapByIds(ids []uint64) map[uint64]Entity
- func GetMaxId() uint64
- func GetPointerMapByIds(ids []uint64) map[uint64]*Entity
- func IncrementLike(entity Entity) int64
- func IncrementPostFast(topicId uint64, posters []Poster) error
- func IncrementViews(counts map[uint64]uint64) error
- func Page(q PageQuery) struct{ ... }
- func PageForAdmin(q AdminPageQuery) struct{ ... }
- func PageForModeration(q ModerationPageQuery) struct{ ... }
- func ReservePostSequence(topicId uint64) (uint64, error)
- func Save(entity *Entity) error
- func SaveNoUpdate(entity *Entity) error
- func SaveOrCreateById(entity *Entity) int64
- func UpdatePinWeight(id uint64, pinWeight int) error
- func UpdateProcessStatus(id uint64, processStatus int8) error
- type AdminPageQuery
- type Entity
- func Get(id uint64) (entity Entity)
- func GetDraftsByUserId(userId uint64, limit int) ([]*Entity, error)
- func GetLatestPublished(limit int) (entities []*Entity, err error)
- func GetLatestPublishedByUserId(userId uint64, limit int) ([]*Entity, error)
- func GetPublishedByUserBeforeId(userId uint64, beforeId uint64, limit int) ([]*Entity, error)
- func GetSimple(id any) (entity Entity)
- func QueryById(startId uint64, limit int) (entities []*Entity)
- type ModerationPageQuery
- type PageQuery
- type Poster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CantWriteNew ¶
func DecrementLike ¶
func DecrementPostFast ¶
func GetMapByIds ¶
func GetPointerMapByIds ¶
func IncrementLike ¶
func IncrementPostFast ¶
func IncrementViews ¶
func PageForAdmin ¶
func PageForAdmin(q AdminPageQuery) struct { Page int PageSize int HasNext bool Data []Entity }
func PageForModeration ¶
func ReservePostSequence ¶
func SaveNoUpdate ¶
func SaveOrCreateById ¶
func UpdatePinWeight ¶
func UpdateProcessStatus ¶
Types ¶
type AdminPageQuery ¶
type Entity ¶
type Entity struct {
Id uint64 `` /* 360-byte string literal not displayed */
Title string `gorm:"column:title;type:varchar(512);not null;default:'';" json:"title"`
CategoryIds []uint64 `gorm:"column:category_id;type:varchar(255);not null;default:'[]';serializer:json" json:"categoryIds"`
UserId uint64 `` /* 160-byte string literal not displayed */
Status int8 `` /* 263-byte string literal not displayed */
ProcessStatus int8 `` /* 278-byte string literal not displayed */
LikeCount uint64 `gorm:"column:like_count;type:bigint unsigned;not null;default:0;" json:"likeCount"`
ViewCount uint64 `` /* 133-byte string literal not displayed */
PostCount uint64 `gorm:"column:post_count;type:bigint unsigned;not null;default:0;" json:"postCount"`
ReplyCount uint64 `` /* 131-byte string literal not displayed */
PostSeq uint64 `gorm:"column:post_seq;type:bigint unsigned;not null;default:0;" json:"postSeq"`
FirstPostId uint64 `gorm:"column:first_post_id;type:bigint unsigned;not null;default:0;" json:"firstPostId"`
LastPostId uint64 `gorm:"column:last_post_id;type:bigint unsigned;not null;default:0;" json:"lastPostId"`
LastPostedAt *time.Time `gorm:"column:last_posted_at;index:idx_topics_last_posted,sort:desc;" json:"lastPostedAt"`
PinWeight int `` /* 224-byte string literal not displayed */
Excerpt string `gorm:"column:excerpt;type:varchar(255);not null;default:'';" json:"excerpt"`
FirstImageURL string `gorm:"column:first_image_url;type:varchar(512);not null;default:'';" json:"firstImageUrl"`
Posters []Poster `gorm:"column:posters;type:text;serializer:json" json:"posters"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime;<-:create;index:idx_topics_list_new,priority:3,sort:desc;" json:"createdAt"`
UpdatedAt time.Time `` /* 211-byte string literal not displayed */
DeletedAt gorm.DeletedAt `json:"-"`
}
func GetLatestPublished ¶
func (*Entity) GetPosters ¶
type ModerationPageQuery ¶
Click to show internal directories.
Click to hide internal directories.