Files
bj_power/bj_power_mes/ent/eventlog/eventlog.go
T
2026-08-28 15:06:01 +08:00

128 lines
4.7 KiB
Go

// Code generated by ent, DO NOT EDIT.
package eventlog
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the eventlog type in the database.
Label = "event_log"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldEventType holds the string denoting the eventtype field in the database.
FieldEventType = "event_type"
// FieldWorkOrderNo holds the string denoting the workorderno field in the database.
FieldWorkOrderNo = "work_order_no"
// FieldOperator holds the string denoting the operator field in the database.
FieldOperator = "operator"
// FieldEntityType holds the string denoting the entitytype field in the database.
FieldEntityType = "entity_type"
// FieldEntityId holds the string denoting the entityid field in the database.
FieldEntityId = "entity_id"
// FieldDescription holds the string denoting the description field in the database.
FieldDescription = "description"
// FieldPayload holds the string denoting the payload field in the database.
FieldPayload = "payload"
// FieldCreatedAt holds the string denoting the createdat field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the eventlog in the database.
Table = "event_log"
)
// Columns holds all SQL columns for eventlog fields.
var Columns = []string{
FieldID,
FieldEventType,
FieldWorkOrderNo,
FieldOperator,
FieldEntityType,
FieldEntityId,
FieldDescription,
FieldPayload,
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 (
// EventTypeValidator is a validator for the "eventType" field. It is called by the builders before save.
EventTypeValidator func(string) error
// DefaultWorkOrderNo holds the default value on creation for the "workOrderNo" field.
DefaultWorkOrderNo string
// WorkOrderNoValidator is a validator for the "workOrderNo" field. It is called by the builders before save.
WorkOrderNoValidator func(string) error
// DefaultOperator holds the default value on creation for the "operator" field.
DefaultOperator string
// OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
OperatorValidator func(string) error
// DefaultEntityType holds the default value on creation for the "entityType" field.
DefaultEntityType string
// EntityTypeValidator is a validator for the "entityType" field. It is called by the builders before save.
EntityTypeValidator func(string) error
// DefaultEntityId holds the default value on creation for the "entityId" field.
DefaultEntityId string
// EntityIdValidator is a validator for the "entityId" field. It is called by the builders before save.
EntityIdValidator func(string) error
// DefaultDescription holds the default value on creation for the "description" field.
DefaultDescription string
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
DefaultCreatedAt func() time.Time
// IDValidator is a validator for the "id" field. It is called by the builders before save.
IDValidator func(int) error
)
// OrderOption defines the ordering options for the EventLog 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()
}
// ByEventType orders the results by the eventType field.
func ByEventType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEventType, opts...).ToFunc()
}
// ByWorkOrderNo orders the results by the workOrderNo field.
func ByWorkOrderNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldWorkOrderNo, opts...).ToFunc()
}
// ByOperator orders the results by the operator field.
func ByOperator(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOperator, opts...).ToFunc()
}
// ByEntityType orders the results by the entityType field.
func ByEntityType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEntityType, opts...).ToFunc()
}
// ByEntityId orders the results by the entityId field.
func ByEntityId(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEntityId, opts...).ToFunc()
}
// ByDescription orders the results by the description field.
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDescription, opts...).ToFunc()
}
// ByCreatedAt orders the results by the createdAt field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}