chore: 更新依赖、配置和代码生成
主要更新: - 更新 go.mod/go.sum 依赖 - 重新生成 Ent ORM 代码 - 更新 Wire 依赖注入配置 - 添加 docker-compose.override.yml 到 .gitignore - 更新 README 文档(Simple Mode 说明和已知问题) - 清理调试日志 - 其他代码优化和格式修复
This commit is contained in:
@@ -31,7 +31,7 @@ type GroupQuery struct {
|
||||
order []group.OrderOption
|
||||
inters []Interceptor
|
||||
predicates []predicate.Group
|
||||
withAPIKeys *APIKeyQuery
|
||||
withAPIKeys *ApiKeyQuery
|
||||
withRedeemCodes *RedeemCodeQuery
|
||||
withSubscriptions *UserSubscriptionQuery
|
||||
withUsageLogs *UsageLogQuery
|
||||
@@ -76,8 +76,8 @@ func (_q *GroupQuery) Order(o ...group.OrderOption) *GroupQuery {
|
||||
}
|
||||
|
||||
// QueryAPIKeys chains the current query on the "api_keys" edge.
|
||||
func (_q *GroupQuery) QueryAPIKeys() *APIKeyQuery {
|
||||
query := (&APIKeyClient{config: _q.config}).Query()
|
||||
func (_q *GroupQuery) QueryAPIKeys() *ApiKeyQuery {
|
||||
query := (&ApiKeyClient{config: _q.config}).Query()
|
||||
query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
|
||||
if err := _q.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
@@ -459,8 +459,8 @@ func (_q *GroupQuery) Clone() *GroupQuery {
|
||||
|
||||
// WithAPIKeys tells the query-builder to eager-load the nodes that are connected to
|
||||
// the "api_keys" edge. The optional arguments are used to configure the query builder of the edge.
|
||||
func (_q *GroupQuery) WithAPIKeys(opts ...func(*APIKeyQuery)) *GroupQuery {
|
||||
query := (&APIKeyClient{config: _q.config}).Query()
|
||||
func (_q *GroupQuery) WithAPIKeys(opts ...func(*ApiKeyQuery)) *GroupQuery {
|
||||
query := (&ApiKeyClient{config: _q.config}).Query()
|
||||
for _, opt := range opts {
|
||||
opt(query)
|
||||
}
|
||||
@@ -654,8 +654,8 @@ func (_q *GroupQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Group,
|
||||
}
|
||||
if query := _q.withAPIKeys; query != nil {
|
||||
if err := _q.loadAPIKeys(ctx, query, nodes,
|
||||
func(n *Group) { n.Edges.APIKeys = []*APIKey{} },
|
||||
func(n *Group, e *APIKey) { n.Edges.APIKeys = append(n.Edges.APIKeys, e) }); err != nil {
|
||||
func(n *Group) { n.Edges.APIKeys = []*ApiKey{} },
|
||||
func(n *Group, e *ApiKey) { n.Edges.APIKeys = append(n.Edges.APIKeys, e) }); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@@ -711,7 +711,7 @@ func (_q *GroupQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Group,
|
||||
return nodes, nil
|
||||
}
|
||||
|
||||
func (_q *GroupQuery) loadAPIKeys(ctx context.Context, query *APIKeyQuery, nodes []*Group, init func(*Group), assign func(*Group, *APIKey)) error {
|
||||
func (_q *GroupQuery) loadAPIKeys(ctx context.Context, query *ApiKeyQuery, nodes []*Group, init func(*Group), assign func(*Group, *ApiKey)) error {
|
||||
fks := make([]driver.Value, 0, len(nodes))
|
||||
nodeids := make(map[int64]*Group)
|
||||
for i := range nodes {
|
||||
@@ -724,7 +724,7 @@ func (_q *GroupQuery) loadAPIKeys(ctx context.Context, query *APIKeyQuery, nodes
|
||||
if len(query.ctx.Fields) > 0 {
|
||||
query.ctx.AppendFieldOnce(apikey.FieldGroupID)
|
||||
}
|
||||
query.Where(predicate.APIKey(func(s *sql.Selector) {
|
||||
query.Where(predicate.ApiKey(func(s *sql.Selector) {
|
||||
s.Where(sql.InValues(s.C(group.APIKeysColumn), fks...))
|
||||
}))
|
||||
neighbors, err := query.All(ctx)
|
||||
|
||||
Reference in New Issue
Block a user