Documentation
¶
Index ¶
- func Create(entity *Entity) error
- func CreateWithDB(db *gorm.DB, entity *Entity) error
- func DeleteEntity(entity *Entity) int64
- func GetMapByIds(ids []uint64) map[uint64]*Entity
- func GetMaxId() uint64
- func GetMaxPostNoByTopicId(topicId uint64) uint64
- func Save(entity *Entity) error
- func SaveNoUpdate(entity *Entity) error
- func SaveOrCreateById(entity *Entity) int64
- func UpdateProcessStatus(id uint64, processStatus int8) error
- type Entity
- func Get(id uint64) (entity Entity)
- func GetByIds(ids []uint64) (entities []*Entity)
- func GetByTopicIdAfter(topicId uint64, id uint64, limit int) (entities []*Entity)
- func GetByTopicIdBefore(topicId uint64, id uint64, limit int) (entities []*Entity)
- func GetByTopicPostNoAfter(topicId uint64, postNo uint64, limit int) (entities []*Entity)
- func GetByTopicPostNoAsc(topicId uint64, limit int) (entities []*Entity)
- func GetByTopicPostNoAtOrAfter(topicId uint64, postNo uint64) (entity Entity, ok bool)
- func GetByTopicPostNoAtOrBefore(topicId uint64, postNo uint64) (entity Entity, ok bool)
- func GetByTopicPostNoBefore(topicId uint64, postNo uint64, limit int) (entities []*Entity)
- func GetByTopicPostNoDesc(topicId uint64, limit int) (entities []*Entity)
- func GetFirstPageByTopicId(topicId uint64) (entities []*Entity)
- func GetLastByTopicID(topicID uint64) (entity Entity, ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteEntity ¶
func GetMapByIds ¶
func GetMaxPostNoByTopicId ¶
func SaveNoUpdate ¶
func SaveOrCreateById ¶
func UpdateProcessStatus ¶
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 GetByTopicIdAfter ¶
func GetByTopicIdBefore ¶
func GetByTopicPostNoAfter ¶
func GetByTopicPostNoAsc ¶
func GetByTopicPostNoBefore ¶
func GetByTopicPostNoDesc ¶
func GetFirstPageByTopicId ¶
func GetLastByTopicID ¶ added in v0.2.51
Click to show internal directories.
Click to hide internal directories.