fix(仓储): 修复查询关闭错误并迁移集成测试
修复 rows.Close 失败时的错误返回逻辑 迁移网关路由集成测试到 ent 事务基建 补齐仓储接口变更对应的测试桩方法 新增 backend/Makefile 统一测试命令 测试: GOTOOLCHAIN=go1.24.11 go test ./... 测试: golangci-lint run ./... --timeout=5m 测试: make test-integration
This commit is contained in:
@@ -175,16 +175,16 @@ func (Account) Edges() []ent.Edge {
|
||||
// 每个索引对应一个常用的查询条件。
|
||||
func (Account) Indexes() []ent.Index {
|
||||
return []ent.Index{
|
||||
index.Fields("platform"), // 按平台筛选
|
||||
index.Fields("type"), // 按认证类型筛选
|
||||
index.Fields("status"), // 按状态筛选
|
||||
index.Fields("proxy_id"), // 按代理筛选
|
||||
index.Fields("priority"), // 按优先级排序
|
||||
index.Fields("last_used_at"), // 按最后使用时间排序
|
||||
index.Fields("schedulable"), // 筛选可调度账户
|
||||
index.Fields("rate_limited_at"), // 筛选速率限制账户
|
||||
index.Fields("platform"), // 按平台筛选
|
||||
index.Fields("type"), // 按认证类型筛选
|
||||
index.Fields("status"), // 按状态筛选
|
||||
index.Fields("proxy_id"), // 按代理筛选
|
||||
index.Fields("priority"), // 按优先级排序
|
||||
index.Fields("last_used_at"), // 按最后使用时间排序
|
||||
index.Fields("schedulable"), // 筛选可调度账户
|
||||
index.Fields("rate_limited_at"), // 筛选速率限制账户
|
||||
index.Fields("rate_limit_reset_at"), // 筛选速率限制解除时间
|
||||
index.Fields("overload_until"), // 筛选过载账户
|
||||
index.Fields("deleted_at"), // 软删除查询优化
|
||||
index.Fields("overload_until"), // 筛选过载账户
|
||||
index.Fields("deleted_at"), // 软删除查询优化
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Wei-Shaw/sub2api/ent/intercept"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/schema/field"
|
||||
"entgo.io/ent/schema/mixin"
|
||||
"github.com/Wei-Shaw/sub2api/ent/intercept"
|
||||
)
|
||||
|
||||
// SoftDeleteMixin 实现基于 deleted_at 时间戳的软删除功能。
|
||||
|
||||
@@ -110,4 +110,3 @@ func (UserSubscription) Indexes() []ent.Index {
|
||||
index.Fields("user_id", "group_id").Unique(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user