|
@@ -1083,6 +1083,8 @@ type BatchMsgMutation struct {
|
|
start_time *time.Time
|
|
start_time *time.Time
|
|
stop_time *time.Time
|
|
stop_time *time.Time
|
|
send_time *time.Time
|
|
send_time *time.Time
|
|
|
|
+ _type *int32
|
|
|
|
+ add_type *int32
|
|
clearedFields map[string]struct{}
|
|
clearedFields map[string]struct{}
|
|
done bool
|
|
done bool
|
|
oldValue func(context.Context) (*BatchMsg, error)
|
|
oldValue func(context.Context) (*BatchMsg, error)
|
|
@@ -1986,6 +1988,76 @@ func (m *BatchMsgMutation) ResetSendTime() {
|
|
delete(m.clearedFields, batchmsg.FieldSendTime)
|
|
delete(m.clearedFields, batchmsg.FieldSendTime)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// SetType sets the "type" field.
|
|
|
|
+func (m *BatchMsgMutation) SetType(i int32) {
|
|
|
|
+ m._type = &i
|
|
|
|
+ m.add_type = nil
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// GetType returns the value of the "type" field in the mutation.
|
|
|
|
+func (m *BatchMsgMutation) GetType() (r int32, exists bool) {
|
|
|
|
+ v := m._type
|
|
|
|
+ if v == nil {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ return *v, true
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// OldType returns the old "type" field's value of the BatchMsg entity.
|
|
|
|
+// If the BatchMsg object wasn't provided to the builder, the object is fetched from the database.
|
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
|
+func (m *BatchMsgMutation) OldType(ctx context.Context) (v int32, err error) {
|
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
|
+ return v, errors.New("OldType is only allowed on UpdateOne operations")
|
|
|
|
+ }
|
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
|
+ return v, errors.New("OldType requires an ID field in the mutation")
|
|
|
|
+ }
|
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return v, fmt.Errorf("querying old value for OldType: %w", err)
|
|
|
|
+ }
|
|
|
|
+ return oldValue.Type, nil
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// AddType adds i to the "type" field.
|
|
|
|
+func (m *BatchMsgMutation) AddType(i int32) {
|
|
|
|
+ if m.add_type != nil {
|
|
|
|
+ *m.add_type += i
|
|
|
|
+ } else {
|
|
|
|
+ m.add_type = &i
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// AddedType returns the value that was added to the "type" field in this mutation.
|
|
|
|
+func (m *BatchMsgMutation) AddedType() (r int32, exists bool) {
|
|
|
|
+ v := m.add_type
|
|
|
|
+ if v == nil {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ return *v, true
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// ClearType clears the value of the "type" field.
|
|
|
|
+func (m *BatchMsgMutation) ClearType() {
|
|
|
|
+ m._type = nil
|
|
|
|
+ m.add_type = nil
|
|
|
|
+ m.clearedFields[batchmsg.FieldType] = struct{}{}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// TypeCleared returns if the "type" field was cleared in this mutation.
|
|
|
|
+func (m *BatchMsgMutation) TypeCleared() bool {
|
|
|
|
+ _, ok := m.clearedFields[batchmsg.FieldType]
|
|
|
|
+ return ok
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// ResetType resets all changes to the "type" field.
|
|
|
|
+func (m *BatchMsgMutation) ResetType() {
|
|
|
|
+ m._type = nil
|
|
|
|
+ m.add_type = nil
|
|
|
|
+ delete(m.clearedFields, batchmsg.FieldType)
|
|
|
|
+}
|
|
|
|
+
|
|
// Where appends a list predicates to the BatchMsgMutation builder.
|
|
// Where appends a list predicates to the BatchMsgMutation builder.
|
|
func (m *BatchMsgMutation) Where(ps ...predicate.BatchMsg) {
|
|
func (m *BatchMsgMutation) Where(ps ...predicate.BatchMsg) {
|
|
m.predicates = append(m.predicates, ps...)
|
|
m.predicates = append(m.predicates, ps...)
|
|
@@ -2020,7 +2092,7 @@ func (m *BatchMsgMutation) Type() string {
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
// AddedFields().
|
|
// AddedFields().
|
|
func (m *BatchMsgMutation) Fields() []string {
|
|
func (m *BatchMsgMutation) Fields() []string {
|
|
- fields := make([]string, 0, 15)
|
|
|
|
|
|
+ fields := make([]string, 0, 16)
|
|
if m.created_at != nil {
|
|
if m.created_at != nil {
|
|
fields = append(fields, batchmsg.FieldCreatedAt)
|
|
fields = append(fields, batchmsg.FieldCreatedAt)
|
|
}
|
|
}
|
|
@@ -2066,6 +2138,9 @@ func (m *BatchMsgMutation) Fields() []string {
|
|
if m.send_time != nil {
|
|
if m.send_time != nil {
|
|
fields = append(fields, batchmsg.FieldSendTime)
|
|
fields = append(fields, batchmsg.FieldSendTime)
|
|
}
|
|
}
|
|
|
|
+ if m._type != nil {
|
|
|
|
+ fields = append(fields, batchmsg.FieldType)
|
|
|
|
+ }
|
|
return fields
|
|
return fields
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2104,6 +2179,8 @@ func (m *BatchMsgMutation) Field(name string) (ent.Value, bool) {
|
|
return m.StopTime()
|
|
return m.StopTime()
|
|
case batchmsg.FieldSendTime:
|
|
case batchmsg.FieldSendTime:
|
|
return m.SendTime()
|
|
return m.SendTime()
|
|
|
|
+ case batchmsg.FieldType:
|
|
|
|
+ return m.GetType()
|
|
}
|
|
}
|
|
return nil, false
|
|
return nil, false
|
|
}
|
|
}
|
|
@@ -2143,6 +2220,8 @@ func (m *BatchMsgMutation) OldField(ctx context.Context, name string) (ent.Value
|
|
return m.OldStopTime(ctx)
|
|
return m.OldStopTime(ctx)
|
|
case batchmsg.FieldSendTime:
|
|
case batchmsg.FieldSendTime:
|
|
return m.OldSendTime(ctx)
|
|
return m.OldSendTime(ctx)
|
|
|
|
+ case batchmsg.FieldType:
|
|
|
|
+ return m.OldType(ctx)
|
|
}
|
|
}
|
|
return nil, fmt.Errorf("unknown BatchMsg field %s", name)
|
|
return nil, fmt.Errorf("unknown BatchMsg field %s", name)
|
|
}
|
|
}
|
|
@@ -2257,6 +2336,13 @@ func (m *BatchMsgMutation) SetField(name string, value ent.Value) error {
|
|
}
|
|
}
|
|
m.SetSendTime(v)
|
|
m.SetSendTime(v)
|
|
return nil
|
|
return nil
|
|
|
|
+ case batchmsg.FieldType:
|
|
|
|
+ v, ok := value.(int32)
|
|
|
|
+ if !ok {
|
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
|
+ }
|
|
|
|
+ m.SetType(v)
|
|
|
|
+ return nil
|
|
}
|
|
}
|
|
return fmt.Errorf("unknown BatchMsg field %s", name)
|
|
return fmt.Errorf("unknown BatchMsg field %s", name)
|
|
}
|
|
}
|
|
@@ -2277,6 +2363,9 @@ func (m *BatchMsgMutation) AddedFields() []string {
|
|
if m.addfail != nil {
|
|
if m.addfail != nil {
|
|
fields = append(fields, batchmsg.FieldFail)
|
|
fields = append(fields, batchmsg.FieldFail)
|
|
}
|
|
}
|
|
|
|
+ if m.add_type != nil {
|
|
|
|
+ fields = append(fields, batchmsg.FieldType)
|
|
|
|
+ }
|
|
return fields
|
|
return fields
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2293,6 +2382,8 @@ func (m *BatchMsgMutation) AddedField(name string) (ent.Value, bool) {
|
|
return m.AddedSuccess()
|
|
return m.AddedSuccess()
|
|
case batchmsg.FieldFail:
|
|
case batchmsg.FieldFail:
|
|
return m.AddedFail()
|
|
return m.AddedFail()
|
|
|
|
+ case batchmsg.FieldType:
|
|
|
|
+ return m.AddedType()
|
|
}
|
|
}
|
|
return nil, false
|
|
return nil, false
|
|
}
|
|
}
|
|
@@ -2330,6 +2421,13 @@ func (m *BatchMsgMutation) AddField(name string, value ent.Value) error {
|
|
}
|
|
}
|
|
m.AddFail(v)
|
|
m.AddFail(v)
|
|
return nil
|
|
return nil
|
|
|
|
+ case batchmsg.FieldType:
|
|
|
|
+ v, ok := value.(int32)
|
|
|
|
+ if !ok {
|
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
|
+ }
|
|
|
|
+ m.AddType(v)
|
|
|
|
+ return nil
|
|
}
|
|
}
|
|
return fmt.Errorf("unknown BatchMsg numeric field %s", name)
|
|
return fmt.Errorf("unknown BatchMsg numeric field %s", name)
|
|
}
|
|
}
|
|
@@ -2377,6 +2475,9 @@ func (m *BatchMsgMutation) ClearedFields() []string {
|
|
if m.FieldCleared(batchmsg.FieldSendTime) {
|
|
if m.FieldCleared(batchmsg.FieldSendTime) {
|
|
fields = append(fields, batchmsg.FieldSendTime)
|
|
fields = append(fields, batchmsg.FieldSendTime)
|
|
}
|
|
}
|
|
|
|
+ if m.FieldCleared(batchmsg.FieldType) {
|
|
|
|
+ fields = append(fields, batchmsg.FieldType)
|
|
|
|
+ }
|
|
return fields
|
|
return fields
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2430,6 +2531,9 @@ func (m *BatchMsgMutation) ClearField(name string) error {
|
|
case batchmsg.FieldSendTime:
|
|
case batchmsg.FieldSendTime:
|
|
m.ClearSendTime()
|
|
m.ClearSendTime()
|
|
return nil
|
|
return nil
|
|
|
|
+ case batchmsg.FieldType:
|
|
|
|
+ m.ClearType()
|
|
|
|
+ return nil
|
|
}
|
|
}
|
|
return fmt.Errorf("unknown BatchMsg nullable field %s", name)
|
|
return fmt.Errorf("unknown BatchMsg nullable field %s", name)
|
|
}
|
|
}
|
|
@@ -2483,6 +2587,9 @@ func (m *BatchMsgMutation) ResetField(name string) error {
|
|
case batchmsg.FieldSendTime:
|
|
case batchmsg.FieldSendTime:
|
|
m.ResetSendTime()
|
|
m.ResetSendTime()
|
|
return nil
|
|
return nil
|
|
|
|
+ case batchmsg.FieldType:
|
|
|
|
+ m.ResetType()
|
|
|
|
+ return nil
|
|
}
|
|
}
|
|
return fmt.Errorf("unknown BatchMsg field %s", name)
|
|
return fmt.Errorf("unknown BatchMsg field %s", name)
|
|
}
|
|
}
|