feat: add new API endpoint for owner ban checks
This commit is contained in:
@@ -382,6 +382,17 @@ func checkSingleOwnerBan(owner database.TeamOwner, proxy string) BanCheckResult
|
|||||||
|
|
||||||
switch accountStatus.Status {
|
switch accountStatus.Status {
|
||||||
case "active":
|
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")
|
logger.Info(fmt.Sprintf("母号有效: %s (plan: %s)", owner.Email, accountStatus.PlanType), owner.Email, "ban-check")
|
||||||
result.Status = "valid"
|
result.Status = "valid"
|
||||||
|
|||||||
Reference in New Issue
Block a user