- 评论图片上传(LV4+,经验≥1500),JPEG/PNG 自动转 WebP,二进制搜索质量优化 - 后台评论管理页面,支持关键词搜索、分页、删除,侧边栏新增入口 - 通知跳转高亮:评论通知 RelatedID 改为 postID,消息页链接到 #comments,前端自动滚动 - 新增 adminCommentUseCase/commentStore 接口(遵循 ISP),AdminCommentRow 移至 model 层 - 前端 @mention 联想/图片上传光标插入/评论展开收起/内联回复交互完善
55 lines
2.1 KiB
Go
55 lines
2.1 KiB
Go
package admin
|
||
|
||
import (
|
||
"metazone.cc/metalab/internal/model"
|
||
"metazone.cc/metalab/internal/service"
|
||
"metazone.cc/metalab/internal/session"
|
||
)
|
||
|
||
// adminUseCase AdminController 对 AdminService 的最小依赖(ISP:6 个方法)
|
||
type adminUseCase interface {
|
||
ListUsers(params service.ListUsersParams) (*service.ListUsersResult, error)
|
||
UpdateUserStatus(operatorUID, targetUID uint, newStatus string) error
|
||
ResetUserToken(operatorUID, targetUID uint) error
|
||
CountUsers() (int64, error)
|
||
GetPostStats() (*service.PostStats, error)
|
||
GetStoreMetrics() session.StoreMetrics
|
||
}
|
||
|
||
// auditUseCase AuditController 对 AuditService 的最小依赖(ISP:3 个方法)
|
||
type auditUseCase interface {
|
||
List(auditType, status string, page, pageSize int) (*service.AuditListResult, error)
|
||
Approve(reviewerID uint, submissionID uint) error
|
||
Reject(reviewerID uint, submissionID uint, reason string) error
|
||
}
|
||
|
||
// siteSettingUseCase SiteSettingController 对 SiteSettingService 的最小依赖(ISP:4 个方法)
|
||
type siteSettingUseCase interface {
|
||
GetSettings() map[string]string
|
||
UpdateSetting(key, value string) error
|
||
UpdateBoolSetting(key string, value bool) error
|
||
GetAuditSettings(defaults *service.AuditDefaults) *service.AuditSettings
|
||
}
|
||
|
||
// auditStatusProvider 审核控制器所需的用户信息查询(ISP)
|
||
type auditStatusProvider interface {
|
||
FindByID(id uint) (*model.User, error)
|
||
}
|
||
|
||
// adminPostUseCase AdminPostController 对 PostService 的最小依赖(ISP:7 个方法)
|
||
type adminPostUseCase interface {
|
||
ListAdmin(keyword, status string, page, pageSize int) ([]model.Post, int64, error)
|
||
ListPendingRevisions(keyword string, page, pageSize int) ([]model.Post, int64, error)
|
||
Approve(postID uint) error
|
||
Reject(postID uint, reason string) error
|
||
Lock(postID uint, reason string) error
|
||
Unlock(postID uint) error
|
||
Restore(postID uint) error
|
||
}
|
||
|
||
// adminCommentUseCase AdminCommentController 对 CommentService 的最小依赖(ISP:2 个方法)
|
||
type adminCommentUseCase interface {
|
||
ListAllComments(keyword string, showDeleted bool, page, pageSize int) ([]model.AdminCommentRow, int64, error)
|
||
Delete(commentID uint) error
|
||
}
|