Files
bj_power/bj_power_mes/ent/alertrule/alertrule.go
T
SunYF 8be6e03a15 docs: 统一修正全项目“SN管理”相关术语为“序列号”
本次 commit 统一修正了全项目范围内关于 SN 管理的术语表述,将原“SN管理”、“序列号件”、“批次件”等表述调整为“序列号”、“序列号=是”、“序列号=否”,同时同步更新了相关文档、代码注释、前端提示文本、数据库 schema 注释、API 文档等,确保全链路术语统一,消除理解歧义。
2026-10-10 15:58:59 +08:00

121 lines
4.2 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"
// FieldEnabled holds the string denoting the enabled field in the database.
FieldEnabled = "enabled"
// FieldNotifyChannels holds the string denoting the notifychannels field in the database.
FieldNotifyChannels = "notify_channels"
// 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,
FieldEnabled,
FieldNotifyChannels,
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
// DefaultEnabled holds the default value on creation for the "enabled" field.
DefaultEnabled bool
// DefaultNotifyChannels holds the default value on creation for the "notifyChannels" field.
DefaultNotifyChannels string
// NotifyChannelsValidator is a validator for the "notifyChannels" field. It is called by the builders before save.
NotifyChannelsValidator func(string) error
// 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()
}
// ByEnabled orders the results by the enabled field.
func ByEnabled(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEnabled, opts...).ToFunc()
}
// ByNotifyChannels orders the results by the notifyChannels field.
func ByNotifyChannels(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldNotifyChannels, 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()
}