feat: add new API endpoint for owner ban checks

This commit is contained in:
2026-02-08 14:21:04 +08:00
parent 2eb4a57639
commit ae37a7165d

View File

@@ -382,6 +382,17 @@ func checkSingleOwnerBan(owner database.TeamOwner, proxy string) BanCheckResult
switch accountStatus.Status {
case "active":
// 检查是否为 free 账号(非 Team 账户),如果是则清理
if accountStatus.PlanType == "free" {
logger.Warning(fmt.Sprintf("母号 plan 为 free非 Team 账户,移除: %s", owner.Email), owner.Email, "ban-check")
database.Instance.MarkOwnerAsInvalid(owner.Email)
database.Instance.DeleteTeamOwnerByEmail(owner.Email)
logger.Info(fmt.Sprintf("free 母号已删除: %s", owner.Email), owner.Email, "ban-check")
result.Status = "banned"
result.Message = "账户 plan 为 free非 Team 账户"
return result
}
// 账户正常
logger.Info(fmt.Sprintf("母号有效: %s (plan: %s)", owner.Email, accountStatus.PlanType), owner.Email, "ban-check")
result.Status = "valid"