后台增加撤销用户实名功能
实名姓名与收款账户不一致会导致收款码登记失败,新增后台撤销实名能力: - 新增 user:revoke_realname 权限,授予超级管理员与运营角色 - 撤销时重置用户实名状态为未认证并删除实名记录,使其可重新认证,写入审计日志 - 用户管理页新增实名状态列与"撤销实名"操作(含原因弹窗) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8192344027
commit
4d54f1b03a
@@ -8,6 +8,7 @@ import (
|
||||
var (
|
||||
ErrDependencyUnavailable = errors.New("dependency unavailable")
|
||||
ErrInvalidUser = errors.New("invalid user")
|
||||
ErrRealnameNotRevocable = errors.New("realname not revocable")
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
@@ -54,3 +55,13 @@ func (s *Service) SetDepositFreeQuota(ctx context.Context, adminID uint64, userI
|
||||
}
|
||||
return s.repo.SetDepositFreeQuota(ctx, adminID, userID, req, meta)
|
||||
}
|
||||
|
||||
func (s *Service) RevokeRealname(ctx context.Context, adminID uint64, userID uint64, req RevokeRealnameRequest, meta AuditMeta) (*UserDTO, error) {
|
||||
if s.repo == nil {
|
||||
return nil, ErrDependencyUnavailable
|
||||
}
|
||||
if userID == 0 {
|
||||
return nil, ErrInvalidUser
|
||||
}
|
||||
return s.repo.RevokeRealname(ctx, adminID, userID, req, meta)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user