docs: 统一修正全项目“SN管理”相关术语为“序列号”

本次 commit 统一修正了全项目范围内关于 SN 管理的术语表述,将原“SN管理”、“序列号件”、“批次件”等表述调整为“序列号”、“序列号=是”、“序列号=否”,同时同步更新了相关文档、代码注释、前端提示文本、数据库 schema 注释、API 文档等,确保全链路术语统一,消除理解歧义。
This commit is contained in:
SunYF
2026-10-10 15:58:59 +08:00
parent b032f47fc7
commit 8be6e03a15
335 changed files with 5742 additions and 1616 deletions
+108
View File
@@ -40,6 +40,34 @@ func (_c *AlertCreate) SetType(v string) *AlertCreate {
return _c
}
// SetLevel sets the "level" field.
func (_c *AlertCreate) SetLevel(v string) *AlertCreate {
_c.mutation.SetLevel(v)
return _c
}
// SetNillableLevel sets the "level" field if the given value is not nil.
func (_c *AlertCreate) SetNillableLevel(v *string) *AlertCreate {
if v != nil {
_c.SetLevel(*v)
}
return _c
}
// SetTarget sets the "target" field.
func (_c *AlertCreate) SetTarget(v string) *AlertCreate {
_c.mutation.SetTarget(v)
return _c
}
// SetNillableTarget sets the "target" field if the given value is not nil.
func (_c *AlertCreate) SetNillableTarget(v *string) *AlertCreate {
if v != nil {
_c.SetTarget(*v)
}
return _c
}
// SetTitle sets the "title" field.
func (_c *AlertCreate) SetTitle(v string) *AlertCreate {
_c.mutation.SetTitle(v)
@@ -130,6 +158,34 @@ func (_c *AlertCreate) SetNillableReceiver(v *string) *AlertCreate {
return _c
}
// SetResolvedAt sets the "resolvedAt" field.
func (_c *AlertCreate) SetResolvedAt(v time.Time) *AlertCreate {
_c.mutation.SetResolvedAt(v)
return _c
}
// SetNillableResolvedAt sets the "resolvedAt" field if the given value is not nil.
func (_c *AlertCreate) SetNillableResolvedAt(v *time.Time) *AlertCreate {
if v != nil {
_c.SetResolvedAt(*v)
}
return _c
}
// SetResolvedBy sets the "resolvedBy" field.
func (_c *AlertCreate) SetResolvedBy(v string) *AlertCreate {
_c.mutation.SetResolvedBy(v)
return _c
}
// SetNillableResolvedBy sets the "resolvedBy" field if the given value is not nil.
func (_c *AlertCreate) SetNillableResolvedBy(v *string) *AlertCreate {
if v != nil {
_c.SetResolvedBy(*v)
}
return _c
}
// SetCreatedAt sets the "createdAt" field.
func (_c *AlertCreate) SetCreatedAt(v time.Time) *AlertCreate {
_c.mutation.SetCreatedAt(v)
@@ -189,6 +245,14 @@ func (_c *AlertCreate) defaults() {
v := alert.DefaultRuleId
_c.mutation.SetRuleId(v)
}
if _, ok := _c.mutation.Level(); !ok {
v := alert.DefaultLevel
_c.mutation.SetLevel(v)
}
if _, ok := _c.mutation.Target(); !ok {
v := alert.DefaultTarget
_c.mutation.SetTarget(v)
}
if _, ok := _c.mutation.Content(); !ok {
v := alert.DefaultContent
_c.mutation.SetContent(v)
@@ -213,6 +277,10 @@ func (_c *AlertCreate) defaults() {
v := alert.DefaultReceiver
_c.mutation.SetReceiver(v)
}
if _, ok := _c.mutation.ResolvedBy(); !ok {
v := alert.DefaultResolvedBy
_c.mutation.SetResolvedBy(v)
}
if _, ok := _c.mutation.CreatedAt(); !ok {
v := alert.DefaultCreatedAt()
_c.mutation.SetCreatedAt(v)
@@ -232,6 +300,22 @@ func (_c *AlertCreate) check() error {
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Alert.type": %w`, err)}
}
}
if _, ok := _c.mutation.Level(); !ok {
return &ValidationError{Name: "level", err: errors.New(`ent: missing required field "Alert.level"`)}
}
if v, ok := _c.mutation.Level(); ok {
if err := alert.LevelValidator(v); err != nil {
return &ValidationError{Name: "level", err: fmt.Errorf(`ent: validator failed for field "Alert.level": %w`, err)}
}
}
if _, ok := _c.mutation.Target(); !ok {
return &ValidationError{Name: "target", err: errors.New(`ent: missing required field "Alert.target"`)}
}
if v, ok := _c.mutation.Target(); ok {
if err := alert.TargetValidator(v); err != nil {
return &ValidationError{Name: "target", err: fmt.Errorf(`ent: validator failed for field "Alert.target": %w`, err)}
}
}
if _, ok := _c.mutation.Title(); !ok {
return &ValidationError{Name: "title", err: errors.New(`ent: missing required field "Alert.title"`)}
}
@@ -288,6 +372,14 @@ func (_c *AlertCreate) check() error {
return &ValidationError{Name: "receiver", err: fmt.Errorf(`ent: validator failed for field "Alert.receiver": %w`, err)}
}
}
if _, ok := _c.mutation.ResolvedBy(); !ok {
return &ValidationError{Name: "resolvedBy", err: errors.New(`ent: missing required field "Alert.resolvedBy"`)}
}
if v, ok := _c.mutation.ResolvedBy(); ok {
if err := alert.ResolvedByValidator(v); err != nil {
return &ValidationError{Name: "resolvedBy", err: fmt.Errorf(`ent: validator failed for field "Alert.resolvedBy": %w`, err)}
}
}
if _, ok := _c.mutation.CreatedAt(); !ok {
return &ValidationError{Name: "createdAt", err: errors.New(`ent: missing required field "Alert.createdAt"`)}
}
@@ -336,6 +428,14 @@ func (_c *AlertCreate) createSpec() (*Alert, *sqlgraph.CreateSpec) {
_spec.SetField(alert.FieldType, field.TypeString, value)
_node.Type = value
}
if value, ok := _c.mutation.Level(); ok {
_spec.SetField(alert.FieldLevel, field.TypeString, value)
_node.Level = value
}
if value, ok := _c.mutation.Target(); ok {
_spec.SetField(alert.FieldTarget, field.TypeString, value)
_node.Target = value
}
if value, ok := _c.mutation.Title(); ok {
_spec.SetField(alert.FieldTitle, field.TypeString, value)
_node.Title = value
@@ -364,6 +464,14 @@ func (_c *AlertCreate) createSpec() (*Alert, *sqlgraph.CreateSpec) {
_spec.SetField(alert.FieldReceiver, field.TypeString, value)
_node.Receiver = value
}
if value, ok := _c.mutation.ResolvedAt(); ok {
_spec.SetField(alert.FieldResolvedAt, field.TypeTime, value)
_node.ResolvedAt = value
}
if value, ok := _c.mutation.ResolvedBy(); ok {
_spec.SetField(alert.FieldResolvedBy, field.TypeString, value)
_node.ResolvedBy = value
}
if value, ok := _c.mutation.CreatedAt(); ok {
_spec.SetField(alert.FieldCreatedAt, field.TypeTime, value)
_node.CreatedAt = value