Documentation ¶
Index ¶
- Constants
- Variables
- type Check
- type CheckBiz
- func (c *CheckBiz) CreateCheck(ctx context.Context, check Check) error
- func (c *CheckBiz) DeleteCheck(ctx context.Context, checkID int64, userId int64) error
- func (c *CheckBiz) GetCheck(ctx context.Context, checkID int64) (Check, error)
- func (c *CheckBiz) ListChecks(ctx context.Context, pagination Pagination) ([]Check, error)
- func (c *CheckBiz) UpdateStatus(ctx context.Context, checkID int64, remark string, status uint8) error
- type CheckData
- type Pagination
Constants ¶
View Source
const ( UnderReview uint8 = iota Approved UnApproved )
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewCheckBiz)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct { ID int64 `gorm:"primaryKey;autoIncrement"` // 审核ID PostID int64 `gorm:"not null"` // 帖子ID Content string `gorm:"type:text;not null"` // 审核内容 Title string `gorm:"size:255;not null"` // 审核标签 UserID int64 `gorm:"column:user_id;index"` // 提交审核的用户ID Status uint8 `gorm:"default:0"` // 审核状态 Remark string `gorm:"type:text"` // 审核备注 CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"` // 创建时间 UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"` // 更新时间 DeletedAt sql.NullTime `gorm:"index"` // 删除时间 }
type CheckBiz ¶
type CheckBiz struct {
CheckData CheckData
}
func NewCheckBiz ¶
func (*CheckBiz) CreateCheck ¶
func (*CheckBiz) DeleteCheck ¶
func (*CheckBiz) ListChecks ¶
type CheckData ¶
type CheckData interface { Create(ctx context.Context, check Check) error // 创建审核记录 UpdateStatus(ctx context.Context, check Check) error // 更新审核状态 Delete(ctx context.Context, checkId int64, uid int64) error // 更新审核状态 ListChecks(ctx context.Context, pagination Pagination) ([]Check, error) // 获取审核列表 FindByID(ctx context.Context, checkId int64) (Check, error) // 通过ID获取审核记录 FindByPostId(ctx context.Context, postId uint) (Check, error) // 通过帖子ID获取审核记录 GetCheckCount(ctx context.Context) (int64, error) // 获取审核记录数量 }
Click to show internal directories.
Click to hide internal directories.