mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-24 21:29:00 +08:00
从内部项目迁移模型配置和镜像配置模块,包括个人用户设置和团队级管理, 涵盖完整 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
118 lines
3.7 KiB
Go
118 lines
3.7 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package teamimage
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the teamimage type in the database.
|
|
Label = "team_image"
|
|
// 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"
|
|
// FieldImageID holds the string denoting the image_id field in the database.
|
|
FieldImageID = "image_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"
|
|
// EdgeImage holds the string denoting the image edge name in mutations.
|
|
EdgeImage = "image"
|
|
// Table holds the table name of the teamimage in the database.
|
|
Table = "team_images"
|
|
// TeamTable is the table that holds the team relation/edge.
|
|
TeamTable = "team_images"
|
|
// 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"
|
|
// ImageTable is the table that holds the image relation/edge.
|
|
ImageTable = "team_images"
|
|
// ImageInverseTable is the table name for the Image entity.
|
|
// It exists in this package in order to avoid circular dependency with the "image" package.
|
|
ImageInverseTable = "images"
|
|
// ImageColumn is the table column denoting the image relation/edge.
|
|
ImageColumn = "image_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for teamimage fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldTeamID,
|
|
FieldImageID,
|
|
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 TeamImage 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()
|
|
}
|
|
|
|
// ByImageID orders the results by the image_id field.
|
|
func ByImageID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldImageID, 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...))
|
|
}
|
|
}
|
|
|
|
// ByImageField orders the results by image field.
|
|
func ByImageField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newImageStep(), 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 newImageStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(ImageInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, false, ImageTable, ImageColumn),
|
|
)
|
|
}
|