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

203 lines
7.6 KiB
Go

// Code generated by ent, DO NOT EDIT.
package alert
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the alert type in the database.
Label = "alert"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldRuleId holds the string denoting the ruleid field in the database.
FieldRuleId = "rule_id"
// FieldType holds the string denoting the type field in the database.
FieldType = "type"
// FieldLevel holds the string denoting the level field in the database.
FieldLevel = "level"
// FieldTarget holds the string denoting the target field in the database.
FieldTarget = "target"
// FieldTitle holds the string denoting the title field in the database.
FieldTitle = "title"
// FieldContent holds the string denoting the content field in the database.
FieldContent = "content"
// FieldRefType holds the string denoting the reftype field in the database.
FieldRefType = "ref_type"
// FieldRefId holds the string denoting the refid field in the database.
FieldRefId = "ref_id"
// FieldOrderNo holds the string denoting the orderno field in the database.
FieldOrderNo = "order_no"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldReceiver holds the string denoting the receiver field in the database.
FieldReceiver = "receiver"
// FieldResolvedAt holds the string denoting the resolvedat field in the database.
FieldResolvedAt = "resolved_at"
// FieldResolvedBy holds the string denoting the resolvedby field in the database.
FieldResolvedBy = "resolved_by"
// FieldCreatedAt holds the string denoting the createdat field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the alert in the database.
Table = "alert"
)
// Columns holds all SQL columns for alert fields.
var Columns = []string{
FieldID,
FieldRuleId,
FieldType,
FieldLevel,
FieldTarget,
FieldTitle,
FieldContent,
FieldRefType,
FieldRefId,
FieldOrderNo,
FieldStatus,
FieldReceiver,
FieldResolvedAt,
FieldResolvedBy,
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 (
// DefaultRuleId holds the default value on creation for the "ruleId" field.
DefaultRuleId int
// TypeValidator is a validator for the "type" field. It is called by the builders before save.
TypeValidator func(string) error
// DefaultLevel holds the default value on creation for the "level" field.
DefaultLevel string
// LevelValidator is a validator for the "level" field. It is called by the builders before save.
LevelValidator func(string) error
// DefaultTarget holds the default value on creation for the "target" field.
DefaultTarget string
// TargetValidator is a validator for the "target" field. It is called by the builders before save.
TargetValidator func(string) error
// TitleValidator is a validator for the "title" field. It is called by the builders before save.
TitleValidator func(string) error
// DefaultContent holds the default value on creation for the "content" field.
DefaultContent string
// ContentValidator is a validator for the "content" field. It is called by the builders before save.
ContentValidator func(string) error
// DefaultRefType holds the default value on creation for the "refType" field.
DefaultRefType string
// RefTypeValidator is a validator for the "refType" field. It is called by the builders before save.
RefTypeValidator func(string) error
// DefaultRefId holds the default value on creation for the "refId" field.
DefaultRefId string
// RefIdValidator is a validator for the "refId" field. It is called by the builders before save.
RefIdValidator func(string) error
// DefaultOrderNo holds the default value on creation for the "orderNo" field.
DefaultOrderNo string
// OrderNoValidator is a validator for the "orderNo" field. It is called by the builders before save.
OrderNoValidator func(string) error
// DefaultStatus holds the default value on creation for the "status" field.
DefaultStatus string
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
StatusValidator func(string) error
// 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
// DefaultResolvedBy holds the default value on creation for the "resolvedBy" field.
DefaultResolvedBy string
// ResolvedByValidator is a validator for the "resolvedBy" field. It is called by the builders before save.
ResolvedByValidator 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 Alert 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()
}
// ByRuleId orders the results by the ruleId field.
func ByRuleId(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRuleId, opts...).ToFunc()
}
// ByType orders the results by the type field.
func ByType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldType, opts...).ToFunc()
}
// ByLevel orders the results by the level field.
func ByLevel(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLevel, opts...).ToFunc()
}
// ByTarget orders the results by the target field.
func ByTarget(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTarget, opts...).ToFunc()
}
// ByTitle orders the results by the title field.
func ByTitle(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTitle, opts...).ToFunc()
}
// ByContent orders the results by the content field.
func ByContent(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldContent, opts...).ToFunc()
}
// ByRefType orders the results by the refType field.
func ByRefType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRefType, opts...).ToFunc()
}
// ByRefId orders the results by the refId field.
func ByRefId(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRefId, opts...).ToFunc()
}
// ByOrderNo orders the results by the orderNo field.
func ByOrderNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOrderNo, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// ByReceiver orders the results by the receiver field.
func ByReceiver(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldReceiver, opts...).ToFunc()
}
// ByResolvedAt orders the results by the resolvedAt field.
func ByResolvedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldResolvedAt, opts...).ToFunc()
}
// ByResolvedBy orders the results by the resolvedBy field.
func ByResolvedBy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldResolvedBy, opts...).ToFunc()
}
// ByCreatedAt orders the results by the createdAt field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}