package admin

import (
	"metazone.cc/metalab/internal/model"
	"metazone.cc/metalab/internal/service"
)

// adminUseCase AdminController 对 AdminService 的最小依赖（ISP：4 个方法）
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)
}

// 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) error
	Unlock(postID uint) error
	Restore(postID uint) error
}
