|
@@ -1070,6 +1070,7 @@ type BatchMsgMutation struct {
|
|
|
status *uint8
|
|
|
addstatus *int8
|
|
|
batch_no *string
|
|
|
+ task_name *string
|
|
|
fromwxid *string
|
|
|
msg *string
|
|
|
tag *string
|
|
@@ -1081,6 +1082,7 @@ type BatchMsgMutation struct {
|
|
|
addfail *int32
|
|
|
start_time *time.Time
|
|
|
stop_time *time.Time
|
|
|
+ send_time *time.Time
|
|
|
clearedFields map[string]struct{}
|
|
|
done bool
|
|
|
oldValue func(context.Context) (*BatchMsg, error)
|
|
@@ -1431,6 +1433,55 @@ func (m *BatchMsgMutation) ResetBatchNo() {
|
|
|
delete(m.clearedFields, batchmsg.FieldBatchNo)
|
|
|
}
|
|
|
|
|
|
+// SetTaskName sets the "task_name" field.
|
|
|
+func (m *BatchMsgMutation) SetTaskName(s string) {
|
|
|
+ m.task_name = &s
|
|
|
+}
|
|
|
+
|
|
|
+// TaskName returns the value of the "task_name" field in the mutation.
|
|
|
+func (m *BatchMsgMutation) TaskName() (r string, exists bool) {
|
|
|
+ v := m.task_name
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldTaskName returns the old "task_name" 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) OldTaskName(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldTaskName is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldTaskName requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldTaskName: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.TaskName, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearTaskName clears the value of the "task_name" field.
|
|
|
+func (m *BatchMsgMutation) ClearTaskName() {
|
|
|
+ m.task_name = nil
|
|
|
+ m.clearedFields[batchmsg.FieldTaskName] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// TaskNameCleared returns if the "task_name" field was cleared in this mutation.
|
|
|
+func (m *BatchMsgMutation) TaskNameCleared() bool {
|
|
|
+ _, ok := m.clearedFields[batchmsg.FieldTaskName]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetTaskName resets all changes to the "task_name" field.
|
|
|
+func (m *BatchMsgMutation) ResetTaskName() {
|
|
|
+ m.task_name = nil
|
|
|
+ delete(m.clearedFields, batchmsg.FieldTaskName)
|
|
|
+}
|
|
|
+
|
|
|
// SetFromwxid sets the "fromwxid" field.
|
|
|
func (m *BatchMsgMutation) SetFromwxid(s string) {
|
|
|
m.fromwxid = &s
|
|
@@ -1886,6 +1937,55 @@ func (m *BatchMsgMutation) ResetStopTime() {
|
|
|
delete(m.clearedFields, batchmsg.FieldStopTime)
|
|
|
}
|
|
|
|
|
|
+// SetSendTime sets the "send_time" field.
|
|
|
+func (m *BatchMsgMutation) SetSendTime(t time.Time) {
|
|
|
+ m.send_time = &t
|
|
|
+}
|
|
|
+
|
|
|
+// SendTime returns the value of the "send_time" field in the mutation.
|
|
|
+func (m *BatchMsgMutation) SendTime() (r time.Time, exists bool) {
|
|
|
+ v := m.send_time
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldSendTime returns the old "send_time" 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) OldSendTime(ctx context.Context) (v time.Time, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldSendTime is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldSendTime requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldSendTime: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.SendTime, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearSendTime clears the value of the "send_time" field.
|
|
|
+func (m *BatchMsgMutation) ClearSendTime() {
|
|
|
+ m.send_time = nil
|
|
|
+ m.clearedFields[batchmsg.FieldSendTime] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// SendTimeCleared returns if the "send_time" field was cleared in this mutation.
|
|
|
+func (m *BatchMsgMutation) SendTimeCleared() bool {
|
|
|
+ _, ok := m.clearedFields[batchmsg.FieldSendTime]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetSendTime resets all changes to the "send_time" field.
|
|
|
+func (m *BatchMsgMutation) ResetSendTime() {
|
|
|
+ m.send_time = nil
|
|
|
+ delete(m.clearedFields, batchmsg.FieldSendTime)
|
|
|
+}
|
|
|
+
|
|
|
// Where appends a list predicates to the BatchMsgMutation builder.
|
|
|
func (m *BatchMsgMutation) Where(ps ...predicate.BatchMsg) {
|
|
|
m.predicates = append(m.predicates, ps...)
|
|
@@ -1920,7 +2020,7 @@ func (m *BatchMsgMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *BatchMsgMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 13)
|
|
|
+ fields := make([]string, 0, 15)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, batchmsg.FieldCreatedAt)
|
|
|
}
|
|
@@ -1936,6 +2036,9 @@ func (m *BatchMsgMutation) Fields() []string {
|
|
|
if m.batch_no != nil {
|
|
|
fields = append(fields, batchmsg.FieldBatchNo)
|
|
|
}
|
|
|
+ if m.task_name != nil {
|
|
|
+ fields = append(fields, batchmsg.FieldTaskName)
|
|
|
+ }
|
|
|
if m.fromwxid != nil {
|
|
|
fields = append(fields, batchmsg.FieldFromwxid)
|
|
|
}
|
|
@@ -1960,6 +2063,9 @@ func (m *BatchMsgMutation) Fields() []string {
|
|
|
if m.stop_time != nil {
|
|
|
fields = append(fields, batchmsg.FieldStopTime)
|
|
|
}
|
|
|
+ if m.send_time != nil {
|
|
|
+ fields = append(fields, batchmsg.FieldSendTime)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -1978,6 +2084,8 @@ func (m *BatchMsgMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.Status()
|
|
|
case batchmsg.FieldBatchNo:
|
|
|
return m.BatchNo()
|
|
|
+ case batchmsg.FieldTaskName:
|
|
|
+ return m.TaskName()
|
|
|
case batchmsg.FieldFromwxid:
|
|
|
return m.Fromwxid()
|
|
|
case batchmsg.FieldMsg:
|
|
@@ -1994,6 +2102,8 @@ func (m *BatchMsgMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.StartTime()
|
|
|
case batchmsg.FieldStopTime:
|
|
|
return m.StopTime()
|
|
|
+ case batchmsg.FieldSendTime:
|
|
|
+ return m.SendTime()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -2013,6 +2123,8 @@ func (m *BatchMsgMutation) OldField(ctx context.Context, name string) (ent.Value
|
|
|
return m.OldStatus(ctx)
|
|
|
case batchmsg.FieldBatchNo:
|
|
|
return m.OldBatchNo(ctx)
|
|
|
+ case batchmsg.FieldTaskName:
|
|
|
+ return m.OldTaskName(ctx)
|
|
|
case batchmsg.FieldFromwxid:
|
|
|
return m.OldFromwxid(ctx)
|
|
|
case batchmsg.FieldMsg:
|
|
@@ -2029,6 +2141,8 @@ func (m *BatchMsgMutation) OldField(ctx context.Context, name string) (ent.Value
|
|
|
return m.OldStartTime(ctx)
|
|
|
case batchmsg.FieldStopTime:
|
|
|
return m.OldStopTime(ctx)
|
|
|
+ case batchmsg.FieldSendTime:
|
|
|
+ return m.OldSendTime(ctx)
|
|
|
}
|
|
|
return nil, fmt.Errorf("unknown BatchMsg field %s", name)
|
|
|
}
|
|
@@ -2073,6 +2187,13 @@ func (m *BatchMsgMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetBatchNo(v)
|
|
|
return nil
|
|
|
+ case batchmsg.FieldTaskName:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetTaskName(v)
|
|
|
+ return nil
|
|
|
case batchmsg.FieldFromwxid:
|
|
|
v, ok := value.(string)
|
|
|
if !ok {
|
|
@@ -2129,6 +2250,13 @@ func (m *BatchMsgMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetStopTime(v)
|
|
|
return nil
|
|
|
+ case batchmsg.FieldSendTime:
|
|
|
+ v, ok := value.(time.Time)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetSendTime(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown BatchMsg field %s", name)
|
|
|
}
|
|
@@ -2219,6 +2347,9 @@ func (m *BatchMsgMutation) ClearedFields() []string {
|
|
|
if m.FieldCleared(batchmsg.FieldBatchNo) {
|
|
|
fields = append(fields, batchmsg.FieldBatchNo)
|
|
|
}
|
|
|
+ if m.FieldCleared(batchmsg.FieldTaskName) {
|
|
|
+ fields = append(fields, batchmsg.FieldTaskName)
|
|
|
+ }
|
|
|
if m.FieldCleared(batchmsg.FieldFromwxid) {
|
|
|
fields = append(fields, batchmsg.FieldFromwxid)
|
|
|
}
|
|
@@ -2243,6 +2374,9 @@ func (m *BatchMsgMutation) ClearedFields() []string {
|
|
|
if m.FieldCleared(batchmsg.FieldStopTime) {
|
|
|
fields = append(fields, batchmsg.FieldStopTime)
|
|
|
}
|
|
|
+ if m.FieldCleared(batchmsg.FieldSendTime) {
|
|
|
+ fields = append(fields, batchmsg.FieldSendTime)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -2266,6 +2400,9 @@ func (m *BatchMsgMutation) ClearField(name string) error {
|
|
|
case batchmsg.FieldBatchNo:
|
|
|
m.ClearBatchNo()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldTaskName:
|
|
|
+ m.ClearTaskName()
|
|
|
+ return nil
|
|
|
case batchmsg.FieldFromwxid:
|
|
|
m.ClearFromwxid()
|
|
|
return nil
|
|
@@ -2290,6 +2427,9 @@ func (m *BatchMsgMutation) ClearField(name string) error {
|
|
|
case batchmsg.FieldStopTime:
|
|
|
m.ClearStopTime()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldSendTime:
|
|
|
+ m.ClearSendTime()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown BatchMsg nullable field %s", name)
|
|
|
}
|
|
@@ -2313,6 +2453,9 @@ func (m *BatchMsgMutation) ResetField(name string) error {
|
|
|
case batchmsg.FieldBatchNo:
|
|
|
m.ResetBatchNo()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldTaskName:
|
|
|
+ m.ResetTaskName()
|
|
|
+ return nil
|
|
|
case batchmsg.FieldFromwxid:
|
|
|
m.ResetFromwxid()
|
|
|
return nil
|
|
@@ -2337,6 +2480,9 @@ func (m *BatchMsgMutation) ResetField(name string) error {
|
|
|
case batchmsg.FieldStopTime:
|
|
|
m.ResetStopTime()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldSendTime:
|
|
|
+ m.ResetSendTime()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown BatchMsg field %s", name)
|
|
|
}
|