chore: 更新依赖、配置和代码生成
主要更新: - 更新 go.mod/go.sum 依赖 - 重新生成 Ent ORM 代码 - 更新 Wire 依赖注入配置 - 添加 docker-compose.override.yml 到 .gitignore - 更新 README 文档(Simple Mode 说明和已知问题) - 清理调试日志 - 其他代码优化和格式修复
This commit is contained in:
@@ -9,18 +9,6 @@ import (
|
||||
"github.com/Wei-Shaw/sub2api/ent"
|
||||
)
|
||||
|
||||
// The APIKeyFunc type is an adapter to allow the use of ordinary
|
||||
// function as APIKey mutator.
|
||||
type APIKeyFunc func(context.Context, *ent.APIKeyMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f APIKeyFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.APIKeyMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.APIKeyMutation", m)
|
||||
}
|
||||
|
||||
// The AccountFunc type is an adapter to allow the use of ordinary
|
||||
// function as Account mutator.
|
||||
type AccountFunc func(context.Context, *ent.AccountMutation) (ent.Value, error)
|
||||
@@ -45,6 +33,18 @@ func (f AccountGroupFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.AccountGroupMutation", m)
|
||||
}
|
||||
|
||||
// The ApiKeyFunc type is an adapter to allow the use of ordinary
|
||||
// function as ApiKey mutator.
|
||||
type ApiKeyFunc func(context.Context, *ent.ApiKeyMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f ApiKeyFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.ApiKeyMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.ApiKeyMutation", m)
|
||||
}
|
||||
|
||||
// The GroupFunc type is an adapter to allow the use of ordinary
|
||||
// function as Group mutator.
|
||||
type GroupFunc func(context.Context, *ent.GroupMutation) (ent.Value, error)
|
||||
|
||||
Reference in New Issue
Block a user