feat: 锁定文章需填写锁定理由,编辑器显示锁定理由
- Post 模型新增 LockReason 字段,锁定必填理由,解锁清空 - PostLockRequest DTO:reason 必填,1-500字 - Admin JS:锁定操作弹出 prompt 要求填写理由 - 编辑器锁定横幅显示"锁定理由:XXX",理由为空时不显示该行
This commit is contained in:
@ -47,6 +47,11 @@ type PostRejectRequest struct {
|
||||
Reason string `json:"reason" binding:"required,min=1,max=500"`
|
||||
}
|
||||
|
||||
// PostLockRequest 锁定请求
|
||||
type PostLockRequest struct {
|
||||
Reason string `json:"reason" binding:"required,min=1,max=500"`
|
||||
}
|
||||
|
||||
// PostListQuery 列表查询参数
|
||||
type PostListQuery struct {
|
||||
Keyword string `form:"keyword"`
|
||||
|
||||
@ -15,6 +15,7 @@ type Post struct {
|
||||
UserID uint `gorm:"index;not null" json:"user_id"`
|
||||
Status string `gorm:"type:varchar(20);index;default:draft;not null" json:"status"`
|
||||
IsLocked bool `gorm:"default:false" json:"is_locked"`
|
||||
LockReason string `gorm:"type:varchar(500);default:''" json:"lock_reason,omitempty"`
|
||||
PendingTitle string `gorm:"type:varchar(200);default:''" json:"pending_title,omitempty"`
|
||||
PendingBody string `gorm:"type:text" json:"pending_body,omitempty"`
|
||||
RejectReason string `gorm:"type:varchar(500);default:''" json:"reject_reason,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user