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.7 KiB
Go

// Code generated by ent, DO NOT EDIT.
package teammodel
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the teammodel type in the database.
Label = "team_model"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldTeamID holds the string denoting the team_id field in the database.
FieldTeamID = "team_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"
// EdgeTeam holds the string denoting the team edge name in mutations.
EdgeTeam = "team"
// EdgeModel holds the string denoting the model edge name in mutations.
EdgeModel = "model"
// Table holds the table name of the teammodel in the database.
Table = "team_models"
// TeamTable is the table that holds the team relation/edge.
TeamTable = "team_models"
// TeamInverseTable is the table name for the Team entity.
// It exists in this package in order to avoid circular dependency with the "team" package.
TeamInverseTable = "teams"
// TeamColumn is the table column denoting the team relation/edge.
TeamColumn = "team_id"
// ModelTable is the table that holds the model relation/edge.
ModelTable = "team_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 teammodel fields.
var Columns = []string{
FieldID,
FieldTeamID,
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 TeamModel 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()
}
// ByTeamID orders the results by the team_id field.
func ByTeamID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTeamID, 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()
}
// ByTeamField orders the results by team field.
func ByTeamField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newTeamStep(), 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 newTeamStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(TeamInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, TeamTable, TeamColumn),
)
}
func newModelStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ModelInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, ModelTable, ModelColumn),
)
}