123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- // Code generated by ent, DO NOT EDIT.
- package task
- import (
- "time"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
- // Label holds the string label denoting the task type in the database.
- Label = "task"
- // FieldID holds the string denoting the id field in the database.
- FieldID = "id"
- // 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"
- // FieldStatus holds the string denoting the status field in the database.
- FieldStatus = "status"
- // FieldName holds the string denoting the name field in the database.
- FieldName = "name"
- // FieldTaskGroup holds the string denoting the task_group field in the database.
- FieldTaskGroup = "task_group"
- // FieldCronExpression holds the string denoting the cron_expression field in the database.
- FieldCronExpression = "cron_expression"
- // FieldPattern holds the string denoting the pattern field in the database.
- FieldPattern = "pattern"
- // FieldPayload holds the string denoting the payload field in the database.
- FieldPayload = "payload"
- // EdgeTaskLogs holds the string denoting the task_logs edge name in mutations.
- EdgeTaskLogs = "task_logs"
- // Table holds the table name of the task in the database.
- Table = "sys_tasks"
- // TaskLogsTable is the table that holds the task_logs relation/edge.
- TaskLogsTable = "sys_task_logs"
- // TaskLogsInverseTable is the table name for the TaskLog entity.
- // It exists in this package in order to avoid circular dependency with the "tasklog" package.
- TaskLogsInverseTable = "sys_task_logs"
- // TaskLogsColumn is the table column denoting the task_logs relation/edge.
- TaskLogsColumn = "task_task_logs"
- )
- // Columns holds all SQL columns for task fields.
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldStatus,
- FieldName,
- FieldTaskGroup,
- FieldCronExpression,
- FieldPattern,
- FieldPayload,
- }
- // 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
- // 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
- // DefaultStatus holds the default value on creation for the "status" field.
- DefaultStatus uint8
- )
- // OrderOption defines the ordering options for the Task 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()
- }
- // 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()
- }
- // ByStatus orders the results by the status field.
- func ByStatus(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStatus, opts...).ToFunc()
- }
- // ByName orders the results by the name field.
- func ByName(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldName, opts...).ToFunc()
- }
- // ByTaskGroup orders the results by the task_group field.
- func ByTaskGroup(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTaskGroup, opts...).ToFunc()
- }
- // ByCronExpression orders the results by the cron_expression field.
- func ByCronExpression(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCronExpression, opts...).ToFunc()
- }
- // ByPattern orders the results by the pattern field.
- func ByPattern(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldPattern, opts...).ToFunc()
- }
- // ByPayload orders the results by the payload field.
- func ByPayload(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldPayload, opts...).ToFunc()
- }
- // ByTaskLogsCount orders the results by task_logs count.
- func ByTaskLogsCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newTaskLogsStep(), opts...)
- }
- }
- // ByTaskLogs orders the results by task_logs terms.
- func ByTaskLogs(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newTaskLogsStep(), append([]sql.OrderTerm{term}, terms...)...)
- }
- }
- func newTaskLogsStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(TaskLogsInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, TaskLogsTable, TaskLogsColumn),
- )
- }
|