mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-22 19:39:31 +08:00
318 lines
12 KiB
Go
318 lines
12 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package image
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the image type in the database.
|
|
Label = "image"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
|
|
FieldDeletedAt = "deleted_at"
|
|
// FieldUserID holds the string denoting the user_id field in the database.
|
|
FieldUserID = "user_id"
|
|
// FieldName holds the string denoting the name field in the database.
|
|
FieldName = "name"
|
|
// FieldRemark holds the string denoting the remark field in the database.
|
|
FieldRemark = "remark"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// EdgeUser holds the string denoting the user edge name in mutations.
|
|
EdgeUser = "user"
|
|
// EdgeTeams holds the string denoting the teams edge name in mutations.
|
|
EdgeTeams = "teams"
|
|
// EdgeGroups holds the string denoting the groups edge name in mutations.
|
|
EdgeGroups = "groups"
|
|
// EdgeProjectTasks holds the string denoting the project_tasks edge name in mutations.
|
|
EdgeProjectTasks = "project_tasks"
|
|
// EdgeProjects holds the string denoting the projects edge name in mutations.
|
|
EdgeProjects = "projects"
|
|
// EdgeTeamImages holds the string denoting the team_images edge name in mutations.
|
|
EdgeTeamImages = "team_images"
|
|
// EdgeTeamGroupImages holds the string denoting the team_group_images edge name in mutations.
|
|
EdgeTeamGroupImages = "team_group_images"
|
|
// Table holds the table name of the image in the database.
|
|
Table = "images"
|
|
// UserTable is the table that holds the user relation/edge.
|
|
UserTable = "images"
|
|
// UserInverseTable is the table name for the User entity.
|
|
// It exists in this package in order to avoid circular dependency with the "user" package.
|
|
UserInverseTable = "users"
|
|
// UserColumn is the table column denoting the user relation/edge.
|
|
UserColumn = "user_id"
|
|
// TeamsTable is the table that holds the teams relation/edge. The primary key declared below.
|
|
TeamsTable = "team_images"
|
|
// TeamsInverseTable is the table name for the Team entity.
|
|
// It exists in this package in order to avoid circular dependency with the "team" package.
|
|
TeamsInverseTable = "teams"
|
|
// GroupsTable is the table that holds the groups relation/edge. The primary key declared below.
|
|
GroupsTable = "team_group_images"
|
|
// GroupsInverseTable is the table name for the TeamGroup entity.
|
|
// It exists in this package in order to avoid circular dependency with the "teamgroup" package.
|
|
GroupsInverseTable = "team_groups"
|
|
// ProjectTasksTable is the table that holds the project_tasks relation/edge.
|
|
ProjectTasksTable = "project_tasks"
|
|
// ProjectTasksInverseTable is the table name for the ProjectTask entity.
|
|
// It exists in this package in order to avoid circular dependency with the "projecttask" package.
|
|
ProjectTasksInverseTable = "project_tasks"
|
|
// ProjectTasksColumn is the table column denoting the project_tasks relation/edge.
|
|
ProjectTasksColumn = "image_id"
|
|
// ProjectsTable is the table that holds the projects relation/edge.
|
|
ProjectsTable = "projects"
|
|
// ProjectsInverseTable is the table name for the Project entity.
|
|
// It exists in this package in order to avoid circular dependency with the "project" package.
|
|
ProjectsInverseTable = "projects"
|
|
// ProjectsColumn is the table column denoting the projects relation/edge.
|
|
ProjectsColumn = "image_id"
|
|
// TeamImagesTable is the table that holds the team_images relation/edge.
|
|
TeamImagesTable = "team_images"
|
|
// TeamImagesInverseTable is the table name for the TeamImage entity.
|
|
// It exists in this package in order to avoid circular dependency with the "teamimage" package.
|
|
TeamImagesInverseTable = "team_images"
|
|
// TeamImagesColumn is the table column denoting the team_images relation/edge.
|
|
TeamImagesColumn = "image_id"
|
|
// TeamGroupImagesTable is the table that holds the team_group_images relation/edge.
|
|
TeamGroupImagesTable = "team_group_images"
|
|
// TeamGroupImagesInverseTable is the table name for the TeamGroupImage entity.
|
|
// It exists in this package in order to avoid circular dependency with the "teamgroupimage" package.
|
|
TeamGroupImagesInverseTable = "team_group_images"
|
|
// TeamGroupImagesColumn is the table column denoting the team_group_images relation/edge.
|
|
TeamGroupImagesColumn = "image_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for image fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldDeletedAt,
|
|
FieldUserID,
|
|
FieldName,
|
|
FieldRemark,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
var (
|
|
// TeamsPrimaryKey and TeamsColumn2 are the table columns denoting the
|
|
// primary key for the teams relation (M2M).
|
|
TeamsPrimaryKey = []string{"team_id", "image_id"}
|
|
// GroupsPrimaryKey and GroupsColumn2 are the table columns denoting the
|
|
// primary key for the groups relation (M2M).
|
|
GroupsPrimaryKey = []string{"group_id", "image_id"}
|
|
)
|
|
|
|
// 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
|
|
}
|
|
|
|
// Note that the variables below are initialized by the runtime
|
|
// package on the initialization of the application. Therefore,
|
|
// it should be imported in the main as follows:
|
|
//
|
|
// import _ "github.com/chaitin/MonkeyCode/backend/db/runtime"
|
|
var (
|
|
Hooks [1]ent.Hook
|
|
Interceptors [1]ent.Interceptor
|
|
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
NameValidator func(string) error
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
|
UpdateDefaultUpdatedAt func() time.Time
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the Image 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()
|
|
}
|
|
|
|
// ByDeletedAt orders the results by the deleted_at field.
|
|
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUserID orders the results by the user_id field.
|
|
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByName orders the results by the name field.
|
|
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRemark orders the results by the remark field.
|
|
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRemark, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUserField orders the results by user field.
|
|
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
|
|
// ByTeamsCount orders the results by teams count.
|
|
func ByTeamsCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newTeamsStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByTeams orders the results by teams terms.
|
|
func ByTeams(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newTeamsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByGroupsCount orders the results by groups count.
|
|
func ByGroupsCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newGroupsStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByGroups orders the results by groups terms.
|
|
func ByGroups(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newGroupsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByProjectTasksCount orders the results by project_tasks count.
|
|
func ByProjectTasksCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newProjectTasksStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByProjectTasks orders the results by project_tasks terms.
|
|
func ByProjectTasks(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newProjectTasksStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByProjectsCount orders the results by projects count.
|
|
func ByProjectsCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newProjectsStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByProjects orders the results by projects terms.
|
|
func ByProjects(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newProjectsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByTeamImagesCount orders the results by team_images count.
|
|
func ByTeamImagesCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newTeamImagesStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByTeamImages orders the results by team_images terms.
|
|
func ByTeamImages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newTeamImagesStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByTeamGroupImagesCount orders the results by team_group_images count.
|
|
func ByTeamGroupImagesCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newTeamGroupImagesStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByTeamGroupImages orders the results by team_group_images terms.
|
|
func ByTeamGroupImages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newTeamGroupImagesStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
func newUserStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(UserInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
|
|
)
|
|
}
|
|
func newTeamsStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(TeamsInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2M, true, TeamsTable, TeamsPrimaryKey...),
|
|
)
|
|
}
|
|
func newGroupsStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(GroupsInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2M, true, GroupsTable, GroupsPrimaryKey...),
|
|
)
|
|
}
|
|
func newProjectTasksStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(ProjectTasksInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, ProjectTasksTable, ProjectTasksColumn),
|
|
)
|
|
}
|
|
func newProjectsStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(ProjectsInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, ProjectsTable, ProjectsColumn),
|
|
)
|
|
}
|
|
func newTeamImagesStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(TeamImagesInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, true, TeamImagesTable, TeamImagesColumn),
|
|
)
|
|
}
|
|
func newTeamGroupImagesStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(TeamGroupImagesInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, true, TeamGroupImagesTable, TeamGroupImagesColumn),
|
|
)
|
|
}
|