Files
yokowu d4aecca9db feat: 添加模型和镜像管理模块(Phase 2 迁移)
从内部项目迁移模型配置和镜像配置模块,包括个人用户设置和团队级管理,
涵盖完整 CRUD、健康检查、供应商模型列表、所有权模型和 Swagger 注释。

- Ent schema: model, image, team_model, team_image, team_group_model, team_group_image
- Domain 层: 接口、请求/响应类型、From 转换器
- Setting 模块: 个人模型/镜像 repo、usecase(代理重试、健康检查)、handler
- Team 模块: 团队模型/镜像 repo、usecase、handler(TeamAuth + 审计中间件)
- SQL 迁移: 000002_model_image up/down
2026-03-16 21:11:42 +08:00

118 lines
3.8 KiB
Go

// Code generated by ent, DO NOT EDIT.
package teamgroupmodel
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the teamgroupmodel type in the database.
Label = "team_group_model"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldGroupID holds the string denoting the group_id field in the database.
FieldGroupID = "group_id"
// FieldModelID holds the string denoting the model_id field in the database.
FieldModelID = "model_id"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// EdgeGroup holds the string denoting the group edge name in mutations.
EdgeGroup = "group"
// EdgeModel holds the string denoting the model edge name in mutations.
EdgeModel = "model"
// Table holds the table name of the teamgroupmodel in the database.
Table = "team_group_models"
// GroupTable is the table that holds the group relation/edge.
GroupTable = "team_group_models"
// GroupInverseTable is the table name for the TeamGroup entity.
// It exists in this package in order to avoid circular dependency with the "teamgroup" package.
GroupInverseTable = "team_groups"
// GroupColumn is the table column denoting the group relation/edge.
GroupColumn = "group_id"
// ModelTable is the table that holds the model relation/edge.
ModelTable = "team_group_models"
// ModelInverseTable is the table name for the Model entity.
// It exists in this package in order to avoid circular dependency with the "model" package.
ModelInverseTable = "models"
// ModelColumn is the table column denoting the model relation/edge.
ModelColumn = "model_id"
)
// Columns holds all SQL columns for teamgroupmodel fields.
var Columns = []string{
FieldID,
FieldGroupID,
FieldModelID,
FieldCreatedAt,
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
return false
}
var (
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
)
// OrderOption defines the ordering options for the TeamGroupModel queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByGroupID orders the results by the group_id field.
func ByGroupID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGroupID, opts...).ToFunc()
}
// ByModelID orders the results by the model_id field.
func ByModelID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldModelID, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByGroupField orders the results by group field.
func ByGroupField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newGroupStep(), sql.OrderByField(field, opts...))
}
}
// ByModelField orders the results by model field.
func ByModelField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newModelStep(), sql.OrderByField(field, opts...))
}
}
func newGroupStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(GroupInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, GroupTable, GroupColumn),
)
}
func newModelStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ModelInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, ModelTable, ModelColumn),
)
}