|
@@ -4375,6 +4375,8 @@ type BatchMsgMutation struct {
|
|
|
addorganization_id *int64
|
|
|
ctype *uint64
|
|
|
addctype *int64
|
|
|
+ cc *string
|
|
|
+ phone *string
|
|
|
clearedFields map[string]struct{}
|
|
|
done bool
|
|
|
oldValue func(context.Context) (*BatchMsg, error)
|
|
@@ -5509,6 +5511,104 @@ func (m *BatchMsgMutation) ResetCtype() {
|
|
|
m.addctype = nil
|
|
|
}
|
|
|
|
|
|
+// SetCc sets the "cc" field.
|
|
|
+func (m *BatchMsgMutation) SetCc(s string) {
|
|
|
+ m.cc = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Cc returns the value of the "cc" field in the mutation.
|
|
|
+func (m *BatchMsgMutation) Cc() (r string, exists bool) {
|
|
|
+ v := m.cc
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldCc returns the old "cc" 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) OldCc(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldCc is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldCc requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldCc: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Cc, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearCc clears the value of the "cc" field.
|
|
|
+func (m *BatchMsgMutation) ClearCc() {
|
|
|
+ m.cc = nil
|
|
|
+ m.clearedFields[batchmsg.FieldCc] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// CcCleared returns if the "cc" field was cleared in this mutation.
|
|
|
+func (m *BatchMsgMutation) CcCleared() bool {
|
|
|
+ _, ok := m.clearedFields[batchmsg.FieldCc]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetCc resets all changes to the "cc" field.
|
|
|
+func (m *BatchMsgMutation) ResetCc() {
|
|
|
+ m.cc = nil
|
|
|
+ delete(m.clearedFields, batchmsg.FieldCc)
|
|
|
+}
|
|
|
+
|
|
|
+// SetPhone sets the "phone" field.
|
|
|
+func (m *BatchMsgMutation) SetPhone(s string) {
|
|
|
+ m.phone = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Phone returns the value of the "phone" field in the mutation.
|
|
|
+func (m *BatchMsgMutation) Phone() (r string, exists bool) {
|
|
|
+ v := m.phone
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldPhone returns the old "phone" 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) OldPhone(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldPhone is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldPhone requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldPhone: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Phone, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearPhone clears the value of the "phone" field.
|
|
|
+func (m *BatchMsgMutation) ClearPhone() {
|
|
|
+ m.phone = nil
|
|
|
+ m.clearedFields[batchmsg.FieldPhone] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// PhoneCleared returns if the "phone" field was cleared in this mutation.
|
|
|
+func (m *BatchMsgMutation) PhoneCleared() bool {
|
|
|
+ _, ok := m.clearedFields[batchmsg.FieldPhone]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetPhone resets all changes to the "phone" field.
|
|
|
+func (m *BatchMsgMutation) ResetPhone() {
|
|
|
+ m.phone = nil
|
|
|
+ delete(m.clearedFields, batchmsg.FieldPhone)
|
|
|
+}
|
|
|
+
|
|
|
// Where appends a list predicates to the BatchMsgMutation builder.
|
|
|
func (m *BatchMsgMutation) Where(ps ...predicate.BatchMsg) {
|
|
|
m.predicates = append(m.predicates, ps...)
|
|
@@ -5543,7 +5643,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, 19)
|
|
|
+ fields := make([]string, 0, 21)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, batchmsg.FieldCreatedAt)
|
|
|
}
|
|
@@ -5601,6 +5701,12 @@ func (m *BatchMsgMutation) Fields() []string {
|
|
|
if m.ctype != nil {
|
|
|
fields = append(fields, batchmsg.FieldCtype)
|
|
|
}
|
|
|
+ if m.cc != nil {
|
|
|
+ fields = append(fields, batchmsg.FieldCc)
|
|
|
+ }
|
|
|
+ if m.phone != nil {
|
|
|
+ fields = append(fields, batchmsg.FieldPhone)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -5647,6 +5753,10 @@ func (m *BatchMsgMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.OrganizationID()
|
|
|
case batchmsg.FieldCtype:
|
|
|
return m.Ctype()
|
|
|
+ case batchmsg.FieldCc:
|
|
|
+ return m.Cc()
|
|
|
+ case batchmsg.FieldPhone:
|
|
|
+ return m.Phone()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -5694,6 +5804,10 @@ func (m *BatchMsgMutation) OldField(ctx context.Context, name string) (ent.Value
|
|
|
return m.OldOrganizationID(ctx)
|
|
|
case batchmsg.FieldCtype:
|
|
|
return m.OldCtype(ctx)
|
|
|
+ case batchmsg.FieldCc:
|
|
|
+ return m.OldCc(ctx)
|
|
|
+ case batchmsg.FieldPhone:
|
|
|
+ return m.OldPhone(ctx)
|
|
|
}
|
|
|
return nil, fmt.Errorf("unknown BatchMsg field %s", name)
|
|
|
}
|
|
@@ -5836,6 +5950,20 @@ func (m *BatchMsgMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetCtype(v)
|
|
|
return nil
|
|
|
+ case batchmsg.FieldCc:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetCc(v)
|
|
|
+ return nil
|
|
|
+ case batchmsg.FieldPhone:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetPhone(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown BatchMsg field %s", name)
|
|
|
}
|
|
@@ -5998,6 +6126,12 @@ func (m *BatchMsgMutation) ClearedFields() []string {
|
|
|
if m.FieldCleared(batchmsg.FieldType) {
|
|
|
fields = append(fields, batchmsg.FieldType)
|
|
|
}
|
|
|
+ if m.FieldCleared(batchmsg.FieldCc) {
|
|
|
+ fields = append(fields, batchmsg.FieldCc)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(batchmsg.FieldPhone) {
|
|
|
+ fields = append(fields, batchmsg.FieldPhone)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -6057,6 +6191,12 @@ func (m *BatchMsgMutation) ClearField(name string) error {
|
|
|
case batchmsg.FieldType:
|
|
|
m.ClearType()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldCc:
|
|
|
+ m.ClearCc()
|
|
|
+ return nil
|
|
|
+ case batchmsg.FieldPhone:
|
|
|
+ m.ClearPhone()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown BatchMsg nullable field %s", name)
|
|
|
}
|
|
@@ -6122,6 +6262,12 @@ func (m *BatchMsgMutation) ResetField(name string) error {
|
|
|
case batchmsg.FieldCtype:
|
|
|
m.ResetCtype()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldCc:
|
|
|
+ m.ResetCc()
|
|
|
+ return nil
|
|
|
+ case batchmsg.FieldPhone:
|
|
|
+ m.ResetPhone()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown BatchMsg field %s", name)
|
|
|
}
|
|
@@ -20951,6 +21097,10 @@ type MsgMutation struct {
|
|
|
addmsgtype *int32
|
|
|
msg *string
|
|
|
batch_no *string
|
|
|
+ ctype *uint64
|
|
|
+ addctype *int64
|
|
|
+ cc *string
|
|
|
+ phone *string
|
|
|
clearedFields map[string]struct{}
|
|
|
done bool
|
|
|
oldValue func(context.Context) (*Msg, error)
|
|
@@ -21518,6 +21668,134 @@ func (m *MsgMutation) ResetBatchNo() {
|
|
|
delete(m.clearedFields, msg.FieldBatchNo)
|
|
|
}
|
|
|
|
|
|
+// SetCtype sets the "ctype" field.
|
|
|
+func (m *MsgMutation) SetCtype(u uint64) {
|
|
|
+ m.ctype = &u
|
|
|
+ m.addctype = nil
|
|
|
+}
|
|
|
+
|
|
|
+// Ctype returns the value of the "ctype" field in the mutation.
|
|
|
+func (m *MsgMutation) Ctype() (r uint64, exists bool) {
|
|
|
+ v := m.ctype
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldCtype returns the old "ctype" field's value of the Msg entity.
|
|
|
+// If the Msg 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 *MsgMutation) OldCtype(ctx context.Context) (v uint64, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldCtype is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldCtype requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldCtype: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Ctype, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddCtype adds u to the "ctype" field.
|
|
|
+func (m *MsgMutation) AddCtype(u int64) {
|
|
|
+ if m.addctype != nil {
|
|
|
+ *m.addctype += u
|
|
|
+ } else {
|
|
|
+ m.addctype = &u
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedCtype returns the value that was added to the "ctype" field in this mutation.
|
|
|
+func (m *MsgMutation) AddedCtype() (r int64, exists bool) {
|
|
|
+ v := m.addctype
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetCtype resets all changes to the "ctype" field.
|
|
|
+func (m *MsgMutation) ResetCtype() {
|
|
|
+ m.ctype = nil
|
|
|
+ m.addctype = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetCc sets the "cc" field.
|
|
|
+func (m *MsgMutation) SetCc(s string) {
|
|
|
+ m.cc = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Cc returns the value of the "cc" field in the mutation.
|
|
|
+func (m *MsgMutation) Cc() (r string, exists bool) {
|
|
|
+ v := m.cc
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldCc returns the old "cc" field's value of the Msg entity.
|
|
|
+// If the Msg 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 *MsgMutation) OldCc(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldCc is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldCc requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldCc: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Cc, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetCc resets all changes to the "cc" field.
|
|
|
+func (m *MsgMutation) ResetCc() {
|
|
|
+ m.cc = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetPhone sets the "phone" field.
|
|
|
+func (m *MsgMutation) SetPhone(s string) {
|
|
|
+ m.phone = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Phone returns the value of the "phone" field in the mutation.
|
|
|
+func (m *MsgMutation) Phone() (r string, exists bool) {
|
|
|
+ v := m.phone
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldPhone returns the old "phone" field's value of the Msg entity.
|
|
|
+// If the Msg 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 *MsgMutation) OldPhone(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldPhone is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldPhone requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldPhone: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Phone, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetPhone resets all changes to the "phone" field.
|
|
|
+func (m *MsgMutation) ResetPhone() {
|
|
|
+ m.phone = nil
|
|
|
+}
|
|
|
+
|
|
|
// Where appends a list predicates to the MsgMutation builder.
|
|
|
func (m *MsgMutation) Where(ps ...predicate.Msg) {
|
|
|
m.predicates = append(m.predicates, ps...)
|
|
@@ -21552,7 +21830,7 @@ func (m *MsgMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *MsgMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 9)
|
|
|
+ fields := make([]string, 0, 12)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, msg.FieldCreatedAt)
|
|
|
}
|
|
@@ -21580,6 +21858,15 @@ func (m *MsgMutation) Fields() []string {
|
|
|
if m.batch_no != nil {
|
|
|
fields = append(fields, msg.FieldBatchNo)
|
|
|
}
|
|
|
+ if m.ctype != nil {
|
|
|
+ fields = append(fields, msg.FieldCtype)
|
|
|
+ }
|
|
|
+ if m.cc != nil {
|
|
|
+ fields = append(fields, msg.FieldCc)
|
|
|
+ }
|
|
|
+ if m.phone != nil {
|
|
|
+ fields = append(fields, msg.FieldPhone)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -21606,6 +21893,12 @@ func (m *MsgMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.Msg()
|
|
|
case msg.FieldBatchNo:
|
|
|
return m.BatchNo()
|
|
|
+ case msg.FieldCtype:
|
|
|
+ return m.Ctype()
|
|
|
+ case msg.FieldCc:
|
|
|
+ return m.Cc()
|
|
|
+ case msg.FieldPhone:
|
|
|
+ return m.Phone()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -21633,6 +21926,12 @@ func (m *MsgMutation) OldField(ctx context.Context, name string) (ent.Value, err
|
|
|
return m.OldMsg(ctx)
|
|
|
case msg.FieldBatchNo:
|
|
|
return m.OldBatchNo(ctx)
|
|
|
+ case msg.FieldCtype:
|
|
|
+ return m.OldCtype(ctx)
|
|
|
+ case msg.FieldCc:
|
|
|
+ return m.OldCc(ctx)
|
|
|
+ case msg.FieldPhone:
|
|
|
+ return m.OldPhone(ctx)
|
|
|
}
|
|
|
return nil, fmt.Errorf("unknown Msg field %s", name)
|
|
|
}
|
|
@@ -21705,6 +22004,27 @@ func (m *MsgMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetBatchNo(v)
|
|
|
return nil
|
|
|
+ case msg.FieldCtype:
|
|
|
+ v, ok := value.(uint64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetCtype(v)
|
|
|
+ return nil
|
|
|
+ case msg.FieldCc:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetCc(v)
|
|
|
+ return nil
|
|
|
+ case msg.FieldPhone:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetPhone(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Msg field %s", name)
|
|
|
}
|
|
@@ -21719,6 +22039,9 @@ func (m *MsgMutation) AddedFields() []string {
|
|
|
if m.addmsgtype != nil {
|
|
|
fields = append(fields, msg.FieldMsgtype)
|
|
|
}
|
|
|
+ if m.addctype != nil {
|
|
|
+ fields = append(fields, msg.FieldCtype)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -21731,6 +22054,8 @@ func (m *MsgMutation) AddedField(name string) (ent.Value, bool) {
|
|
|
return m.AddedStatus()
|
|
|
case msg.FieldMsgtype:
|
|
|
return m.AddedMsgtype()
|
|
|
+ case msg.FieldCtype:
|
|
|
+ return m.AddedCtype()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -21754,6 +22079,13 @@ func (m *MsgMutation) AddField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.AddMsgtype(v)
|
|
|
return nil
|
|
|
+ case msg.FieldCtype:
|
|
|
+ v, ok := value.(int64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddCtype(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Msg numeric field %s", name)
|
|
|
}
|
|
@@ -21853,6 +22185,15 @@ func (m *MsgMutation) ResetField(name string) error {
|
|
|
case msg.FieldBatchNo:
|
|
|
m.ResetBatchNo()
|
|
|
return nil
|
|
|
+ case msg.FieldCtype:
|
|
|
+ m.ResetCtype()
|
|
|
+ return nil
|
|
|
+ case msg.FieldCc:
|
|
|
+ m.ResetCc()
|
|
|
+ return nil
|
|
|
+ case msg.FieldPhone:
|
|
|
+ m.ResetPhone()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Msg field %s", name)
|
|
|
}
|