Files
bj_power/bj_power_mes/ent/alertrule/alertrule.go
T
SunYF 5c3b747a20 feat: 新增预警与附件模块,优化工位派工功能
1. 新增预警规则、预警消息、业务附件数据库表与CRUD逻辑
2. 为拧紧记录添加审核人、审核时间字段及审核留痕功能
3. 优化产线点位类型与编号描述,更新工位组合下发菜单名称为工艺路线派工
4. 新增上传文件获取原文件名与大小的工具方法
5. 在系统管理菜单新增预警中心与附件中心入口
2026-09-14 16:31:08 +08:00

121 lines
4.1 KiB
Go

// Code generated by ent, DO NOT EDIT.
package alertrule
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the alertrule type in the database.
Label = "alert_rule"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldType holds the string denoting the type field in the database.
FieldType = "type"
// FieldThreshold holds the string denoting the threshold field in the database.
FieldThreshold = "threshold"
// FieldReceiver holds the string denoting the receiver field in the database.
FieldReceiver = "receiver"
// FieldEnabled holds the string denoting the enabled field in the database.
FieldEnabled = "enabled"
// FieldCreatedBy holds the string denoting the createdby field in the database.
FieldCreatedBy = "created_by"
// FieldCreatedAt holds the string denoting the createdat field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the alertrule in the database.
Table = "alert_rule"
)
// Columns holds all SQL columns for alertrule fields.
var Columns = []string{
FieldID,
FieldName,
FieldType,
FieldThreshold,
FieldReceiver,
FieldEnabled,
FieldCreatedBy,
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 (
// NameValidator is a validator for the "name" field. It is called by the builders before save.
NameValidator func(string) error
// TypeValidator is a validator for the "type" field. It is called by the builders before save.
TypeValidator func(string) error
// DefaultThreshold holds the default value on creation for the "threshold" field.
DefaultThreshold float64
// DefaultReceiver holds the default value on creation for the "receiver" field.
DefaultReceiver string
// ReceiverValidator is a validator for the "receiver" field. It is called by the builders before save.
ReceiverValidator func(string) error
// DefaultEnabled holds the default value on creation for the "enabled" field.
DefaultEnabled bool
// DefaultCreatedBy holds the default value on creation for the "createdBy" field.
DefaultCreatedBy string
// CreatedByValidator is a validator for the "createdBy" field. It is called by the builders before save.
CreatedByValidator func(string) error
// 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 AlertRule 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()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByType orders the results by the type field.
func ByType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldType, opts...).ToFunc()
}
// ByThreshold orders the results by the threshold field.
func ByThreshold(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldThreshold, opts...).ToFunc()
}
// ByReceiver orders the results by the receiver field.
func ByReceiver(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldReceiver, opts...).ToFunc()
}
// ByEnabled orders the results by the enabled field.
func ByEnabled(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEnabled, opts...).ToFunc()
}
// ByCreatedBy orders the results by the createdBy field.
func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedBy, opts...).ToFunc()
}
// ByCreatedAt orders the results by the createdAt field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}