Documentation ¶
Index ¶
- Constants
- type Model
- type Repo
- func (r *Repo) AddDisLike(ctx context.Context, id uint64) error
- func (r *Repo) AddDisLikeTx(ctx context.Context, tx sqlx.Session, id uint64) error
- func (r *Repo) AddLike(ctx context.Context, id uint64) error
- func (r *Repo) AddLikeTx(ctx context.Context, tx sqlx.Session, id uint64) error
- func (r *Repo) AddReport(ctx context.Context, id uint64) error
- func (r *Repo) AddReportTx(ctx context.Context, tx sqlx.Session, id uint64) error
- func (r *Repo) CountByOid(ctx context.Context, oid uint64) (uint64, error)
- func (r *Repo) CountGroupByOid(ctx context.Context) (map[uint64]uint64, error)
- func (r *Repo) CountGroupByOidLimit(ctx context.Context, offset, limit int64) (map[uint64]uint64, error)
- func (r *Repo) DeleteById(ctx context.Context, id uint64) error
- func (r *Repo) DeleteByIdTx(ctx context.Context, tx sqlx.Session, id uint64) error
- func (r *Repo) DeleteByRootTx(ctx context.Context, tx sqlx.Session, rootId uint64) error
- func (r *Repo) DoPin(ctx context.Context, oid, rid uint64) error
- func (r *Repo) FindById(ctx context.Context, id uint64) (*Model, error)
- func (r *Repo) FindByIdForUpdate(ctx context.Context, tx sqlx.Session, id uint64) (*Model, error)
- func (r *Repo) FindByOid(ctx context.Context, oid uint64) ([]*Model, error)
- func (r *Repo) FindByOidTx(ctx context.Context, tx sqlx.Session, oid uint64, lock bool) ([]*Model, error)
- func (r *Repo) FindByParentIdTx(ctx context.Context, tx sqlx.Session, rootId uint64, lock bool) ([]*Model, error)
- func (r *Repo) FindByRootId(ctx context.Context, rootId uint64) ([]*Model, error)
- func (r *Repo) FindRootParent(ctx context.Context, id uint64) (*RootParent, error)
- func (r *Repo) GetPinned(ctx context.Context, oid uint64) (*Model, error)
- func (r *Repo) GetRootReplies(ctx context.Context, oid, cursor uint64, want int) ([]*Model, error)
- func (r *Repo) GetSubReply(ctx context.Context, oid, root, cursor uint64, want int) ([]*Model, error)
- func (r *Repo) Insert(ctx context.Context, model *Model) (uint64, error)
- func (r *Repo) InsertTx(ctx context.Context, tx sqlx.Session, model *Model) (uint64, error)
- func (r *Repo) SetPin(ctx context.Context, id uint64) error
- func (r *Repo) SetPinTx(ctx context.Context, tx sqlx.Session, id uint64) error
- func (r *Repo) SetUnPin(ctx context.Context, id uint64) error
- func (r *Repo) SetUnPinTx(ctx context.Context, tx sqlx.Session, id uint64) error
- func (r *Repo) SubDisLike(ctx context.Context, id uint64) error
- func (r *Repo) SubDisLikeTx(ctx context.Context, tx sqlx.Session, id uint64) error
- func (r *Repo) SubLike(ctx context.Context, id uint64) error
- func (r *Repo) SubLikeTx(ctx context.Context, tx sqlx.Session, id uint64) error
- func (r *Repo) SubReport(ctx context.Context, id uint64) error
- func (r *Repo) SubReportTx(ctx context.Context, tx sqlx.Session, id uint64) error
- type RootParent
Constants ¶
View Source
const ( AlreadyPinned = 1 NotPinned = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { Id uint64 `json:"id" db:"id"` Oid uint64 `json:"oid" db:"oid"` CType int8 `json:"ctype" db:"ctype"` Content string `json:"content" db:"content"` Uid uint64 `json:"uid" db:"uid"` RootId uint64 `json:"root" db:"root"` ParentId uint64 `json:"parent" db:"parent"` ReplyUid uint64 `json:"ruid" db:"ruid"` State int8 `json:"state" db:"state"` Like int `json:"like" db:"like"` Dislike int `json:"dislike" db:"dislike"` Report int `json:"repot" db:"report"` IsPin int8 `json:"pin" db:"pin"` Ip int64 `json:"ip" db:"ip"` Ctime int64 `json:"ctime" db:"ctime"` Mtime int64 `json:"mtime" db:"mtime"` }
comment表
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) AddDisLikeTx ¶
func (*Repo) AddReportTx ¶
func (*Repo) CountByOid ¶
查出oid评论总量
func (*Repo) CountGroupByOid ¶
func (*Repo) CountGroupByOidLimit ¶
func (*Repo) DeleteByIdTx ¶
func (*Repo) DeleteByRootTx ¶
func (*Repo) FindByIdForUpdate ¶
func (*Repo) FindByOidTx ¶
func (*Repo) FindByParentIdTx ¶
func (*Repo) FindByRootId ¶
func (*Repo) FindRootParent ¶
func (*Repo) GetRootReplies ¶
获取主评论
func (*Repo) GetSubReply ¶
func (r *Repo) GetSubReply(ctx context.Context, oid, root, cursor uint64, want int) ([]*Model, error)
获取子评论
func (*Repo) SetUnPinTx ¶
func (*Repo) SubDisLikeTx ¶
Click to show internal directories.
Click to hide internal directories.