Files
MonkeyCode/backend/db/aitask/aitask.go
2025-08-25 19:36:48 +08:00

107 lines
3.3 KiB
Go

// Code generated by ent, DO NOT EDIT.
package aitask
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the aitask type in the database.
Label = "ai_task"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldEmployeeID holds the string denoting the employee_id field in the database.
FieldEmployeeID = "employee_id"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldOutput holds the string denoting the output field in the database.
FieldOutput = "output"
// FieldLogs holds the string denoting the logs field in the database.
FieldLogs = "logs"
// FieldErrorMessage holds the string denoting the error_message field in the database.
FieldErrorMessage = "error_message"
// 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"
// Table holds the table name of the aitask in the database.
Table = "ai_tasks"
)
// Columns holds all SQL columns for aitask fields.
var Columns = []string{
FieldID,
FieldEmployeeID,
FieldStatus,
FieldOutput,
FieldLogs,
FieldErrorMessage,
FieldCreatedAt,
FieldUpdatedAt,
}
// 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 (
// DefaultStatus holds the default value on creation for the "status" field.
DefaultStatus string
// 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
)
// OrderOption defines the ordering options for the AITask 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()
}
// ByEmployeeID orders the results by the employee_id field.
func ByEmployeeID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmployeeID, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// ByOutput orders the results by the output field.
func ByOutput(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOutput, opts...).ToFunc()
}
// ByLogs orders the results by the logs field.
func ByLogs(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLogs, opts...).ToFunc()
}
// ByErrorMessage orders the results by the error_message field.
func ByErrorMessage(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldErrorMessage, 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()
}