|
@@ -125,32 +125,38 @@ const (
|
|
|
// AddWechatFriendLogMutation represents an operation that mutates the AddWechatFriendLog nodes in the graph.
|
|
|
type AddWechatFriendLogMutation struct {
|
|
|
config
|
|
|
- op Op
|
|
|
- typ string
|
|
|
- id *int64
|
|
|
- owner_wx_id *string
|
|
|
- owner_wx_type *int
|
|
|
- addowner_wx_type *int
|
|
|
- find_content *string
|
|
|
- message *string
|
|
|
- find_request *map[string]interface{}
|
|
|
- find_result *map[string]interface{}
|
|
|
- is_can_add *int
|
|
|
- addis_can_add *int
|
|
|
- task_count *int
|
|
|
- addtask_count *int
|
|
|
- task_id *int64
|
|
|
- addtask_id *int64
|
|
|
- add_request *map[string]interface{}
|
|
|
- add_result *map[string]interface{}
|
|
|
- created_at *int64
|
|
|
- addcreated_at *int64
|
|
|
- updated_at *int64
|
|
|
- addupdated_at *int64
|
|
|
- clearedFields map[string]struct{}
|
|
|
- done bool
|
|
|
- oldValue func(context.Context) (*AddWechatFriendLog, error)
|
|
|
- predicates []predicate.AddWechatFriendLog
|
|
|
+ op Op
|
|
|
+ typ string
|
|
|
+ id *int64
|
|
|
+ owner_wx_id *string
|
|
|
+ owner_wx_type *int
|
|
|
+ addowner_wx_type *int
|
|
|
+ find_content *string
|
|
|
+ message *string
|
|
|
+ find_request *map[string]interface{}
|
|
|
+ find_result *map[string]interface{}
|
|
|
+ is_can_add *int
|
|
|
+ addis_can_add *int
|
|
|
+ task_count *int
|
|
|
+ addtask_count *int
|
|
|
+ task_id *int64
|
|
|
+ addtask_id *int64
|
|
|
+ add_request *map[string]interface{}
|
|
|
+ add_result *map[string]interface{}
|
|
|
+ created_at *int64
|
|
|
+ addcreated_at *int64
|
|
|
+ updated_at *int64
|
|
|
+ addupdated_at *int64
|
|
|
+ source *int
|
|
|
+ addsource *int
|
|
|
+ nick_name *string
|
|
|
+ avatar *string
|
|
|
+ organization_id *int64
|
|
|
+ addorganization_id *int64
|
|
|
+ clearedFields map[string]struct{}
|
|
|
+ done bool
|
|
|
+ oldValue func(context.Context) (*AddWechatFriendLog, error)
|
|
|
+ predicates []predicate.AddWechatFriendLog
|
|
|
}
|
|
|
|
|
|
var _ ent.Mutation = (*AddWechatFriendLogMutation)(nil)
|
|
@@ -897,6 +903,190 @@ func (m *AddWechatFriendLogMutation) ResetUpdatedAt() {
|
|
|
m.addupdated_at = nil
|
|
|
}
|
|
|
|
|
|
+// SetSource sets the "source" field.
|
|
|
+func (m *AddWechatFriendLogMutation) SetSource(i int) {
|
|
|
+ m.source = &i
|
|
|
+ m.addsource = nil
|
|
|
+}
|
|
|
+
|
|
|
+// Source returns the value of the "source" field in the mutation.
|
|
|
+func (m *AddWechatFriendLogMutation) Source() (r int, exists bool) {
|
|
|
+ v := m.source
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldSource returns the old "source" field's value of the AddWechatFriendLog entity.
|
|
|
+// If the AddWechatFriendLog 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 *AddWechatFriendLogMutation) OldSource(ctx context.Context) (v int, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldSource is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldSource requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldSource: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Source, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddSource adds i to the "source" field.
|
|
|
+func (m *AddWechatFriendLogMutation) AddSource(i int) {
|
|
|
+ if m.addsource != nil {
|
|
|
+ *m.addsource += i
|
|
|
+ } else {
|
|
|
+ m.addsource = &i
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedSource returns the value that was added to the "source" field in this mutation.
|
|
|
+func (m *AddWechatFriendLogMutation) AddedSource() (r int, exists bool) {
|
|
|
+ v := m.addsource
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetSource resets all changes to the "source" field.
|
|
|
+func (m *AddWechatFriendLogMutation) ResetSource() {
|
|
|
+ m.source = nil
|
|
|
+ m.addsource = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetNickName sets the "nick_name" field.
|
|
|
+func (m *AddWechatFriendLogMutation) SetNickName(s string) {
|
|
|
+ m.nick_name = &s
|
|
|
+}
|
|
|
+
|
|
|
+// NickName returns the value of the "nick_name" field in the mutation.
|
|
|
+func (m *AddWechatFriendLogMutation) NickName() (r string, exists bool) {
|
|
|
+ v := m.nick_name
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldNickName returns the old "nick_name" field's value of the AddWechatFriendLog entity.
|
|
|
+// If the AddWechatFriendLog 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 *AddWechatFriendLogMutation) OldNickName(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldNickName is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldNickName requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldNickName: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.NickName, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetNickName resets all changes to the "nick_name" field.
|
|
|
+func (m *AddWechatFriendLogMutation) ResetNickName() {
|
|
|
+ m.nick_name = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetAvatar sets the "avatar" field.
|
|
|
+func (m *AddWechatFriendLogMutation) SetAvatar(s string) {
|
|
|
+ m.avatar = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Avatar returns the value of the "avatar" field in the mutation.
|
|
|
+func (m *AddWechatFriendLogMutation) Avatar() (r string, exists bool) {
|
|
|
+ v := m.avatar
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldAvatar returns the old "avatar" field's value of the AddWechatFriendLog entity.
|
|
|
+// If the AddWechatFriendLog 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 *AddWechatFriendLogMutation) OldAvatar(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldAvatar is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldAvatar requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldAvatar: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Avatar, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetAvatar resets all changes to the "avatar" field.
|
|
|
+func (m *AddWechatFriendLogMutation) ResetAvatar() {
|
|
|
+ m.avatar = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetOrganizationID sets the "organization_id" field.
|
|
|
+func (m *AddWechatFriendLogMutation) SetOrganizationID(i int64) {
|
|
|
+ m.organization_id = &i
|
|
|
+ m.addorganization_id = nil
|
|
|
+}
|
|
|
+
|
|
|
+// OrganizationID returns the value of the "organization_id" field in the mutation.
|
|
|
+func (m *AddWechatFriendLogMutation) OrganizationID() (r int64, exists bool) {
|
|
|
+ v := m.organization_id
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldOrganizationID returns the old "organization_id" field's value of the AddWechatFriendLog entity.
|
|
|
+// If the AddWechatFriendLog 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 *AddWechatFriendLogMutation) OldOrganizationID(ctx context.Context) (v int64, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldOrganizationID requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.OrganizationID, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddOrganizationID adds i to the "organization_id" field.
|
|
|
+func (m *AddWechatFriendLogMutation) AddOrganizationID(i int64) {
|
|
|
+ if m.addorganization_id != nil {
|
|
|
+ *m.addorganization_id += i
|
|
|
+ } else {
|
|
|
+ m.addorganization_id = &i
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedOrganizationID returns the value that was added to the "organization_id" field in this mutation.
|
|
|
+func (m *AddWechatFriendLogMutation) AddedOrganizationID() (r int64, exists bool) {
|
|
|
+ v := m.addorganization_id
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetOrganizationID resets all changes to the "organization_id" field.
|
|
|
+func (m *AddWechatFriendLogMutation) ResetOrganizationID() {
|
|
|
+ m.organization_id = nil
|
|
|
+ m.addorganization_id = nil
|
|
|
+}
|
|
|
+
|
|
|
// Where appends a list predicates to the AddWechatFriendLogMutation builder.
|
|
|
func (m *AddWechatFriendLogMutation) Where(ps ...predicate.AddWechatFriendLog) {
|
|
|
m.predicates = append(m.predicates, ps...)
|
|
@@ -931,7 +1121,7 @@ func (m *AddWechatFriendLogMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *AddWechatFriendLogMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 13)
|
|
|
+ fields := make([]string, 0, 17)
|
|
|
if m.owner_wx_id != nil {
|
|
|
fields = append(fields, addwechatfriendlog.FieldOwnerWxID)
|
|
|
}
|
|
@@ -971,6 +1161,18 @@ func (m *AddWechatFriendLogMutation) Fields() []string {
|
|
|
if m.updated_at != nil {
|
|
|
fields = append(fields, addwechatfriendlog.FieldUpdatedAt)
|
|
|
}
|
|
|
+ if m.source != nil {
|
|
|
+ fields = append(fields, addwechatfriendlog.FieldSource)
|
|
|
+ }
|
|
|
+ if m.nick_name != nil {
|
|
|
+ fields = append(fields, addwechatfriendlog.FieldNickName)
|
|
|
+ }
|
|
|
+ if m.avatar != nil {
|
|
|
+ fields = append(fields, addwechatfriendlog.FieldAvatar)
|
|
|
+ }
|
|
|
+ if m.organization_id != nil {
|
|
|
+ fields = append(fields, addwechatfriendlog.FieldOrganizationID)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -1005,6 +1207,14 @@ func (m *AddWechatFriendLogMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.CreatedAt()
|
|
|
case addwechatfriendlog.FieldUpdatedAt:
|
|
|
return m.UpdatedAt()
|
|
|
+ case addwechatfriendlog.FieldSource:
|
|
|
+ return m.Source()
|
|
|
+ case addwechatfriendlog.FieldNickName:
|
|
|
+ return m.NickName()
|
|
|
+ case addwechatfriendlog.FieldAvatar:
|
|
|
+ return m.Avatar()
|
|
|
+ case addwechatfriendlog.FieldOrganizationID:
|
|
|
+ return m.OrganizationID()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -1040,6 +1250,14 @@ func (m *AddWechatFriendLogMutation) OldField(ctx context.Context, name string)
|
|
|
return m.OldCreatedAt(ctx)
|
|
|
case addwechatfriendlog.FieldUpdatedAt:
|
|
|
return m.OldUpdatedAt(ctx)
|
|
|
+ case addwechatfriendlog.FieldSource:
|
|
|
+ return m.OldSource(ctx)
|
|
|
+ case addwechatfriendlog.FieldNickName:
|
|
|
+ return m.OldNickName(ctx)
|
|
|
+ case addwechatfriendlog.FieldAvatar:
|
|
|
+ return m.OldAvatar(ctx)
|
|
|
+ case addwechatfriendlog.FieldOrganizationID:
|
|
|
+ return m.OldOrganizationID(ctx)
|
|
|
}
|
|
|
return nil, fmt.Errorf("unknown AddWechatFriendLog field %s", name)
|
|
|
}
|
|
@@ -1140,6 +1358,34 @@ func (m *AddWechatFriendLogMutation) SetField(name string, value ent.Value) erro
|
|
|
}
|
|
|
m.SetUpdatedAt(v)
|
|
|
return nil
|
|
|
+ case addwechatfriendlog.FieldSource:
|
|
|
+ v, ok := value.(int)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetSource(v)
|
|
|
+ return nil
|
|
|
+ case addwechatfriendlog.FieldNickName:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetNickName(v)
|
|
|
+ return nil
|
|
|
+ case addwechatfriendlog.FieldAvatar:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAvatar(v)
|
|
|
+ return nil
|
|
|
+ case addwechatfriendlog.FieldOrganizationID:
|
|
|
+ v, ok := value.(int64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetOrganizationID(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown AddWechatFriendLog field %s", name)
|
|
|
}
|
|
@@ -1166,6 +1412,12 @@ func (m *AddWechatFriendLogMutation) AddedFields() []string {
|
|
|
if m.addupdated_at != nil {
|
|
|
fields = append(fields, addwechatfriendlog.FieldUpdatedAt)
|
|
|
}
|
|
|
+ if m.addsource != nil {
|
|
|
+ fields = append(fields, addwechatfriendlog.FieldSource)
|
|
|
+ }
|
|
|
+ if m.addorganization_id != nil {
|
|
|
+ fields = append(fields, addwechatfriendlog.FieldOrganizationID)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -1186,6 +1438,10 @@ func (m *AddWechatFriendLogMutation) AddedField(name string) (ent.Value, bool) {
|
|
|
return m.AddedCreatedAt()
|
|
|
case addwechatfriendlog.FieldUpdatedAt:
|
|
|
return m.AddedUpdatedAt()
|
|
|
+ case addwechatfriendlog.FieldSource:
|
|
|
+ return m.AddedSource()
|
|
|
+ case addwechatfriendlog.FieldOrganizationID:
|
|
|
+ return m.AddedOrganizationID()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -1237,6 +1493,20 @@ func (m *AddWechatFriendLogMutation) AddField(name string, value ent.Value) erro
|
|
|
}
|
|
|
m.AddUpdatedAt(v)
|
|
|
return nil
|
|
|
+ case addwechatfriendlog.FieldSource:
|
|
|
+ v, ok := value.(int)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddSource(v)
|
|
|
+ return nil
|
|
|
+ case addwechatfriendlog.FieldOrganizationID:
|
|
|
+ v, ok := value.(int64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddOrganizationID(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown AddWechatFriendLog numeric field %s", name)
|
|
|
}
|
|
@@ -1330,6 +1600,18 @@ func (m *AddWechatFriendLogMutation) ResetField(name string) error {
|
|
|
case addwechatfriendlog.FieldUpdatedAt:
|
|
|
m.ResetUpdatedAt()
|
|
|
return nil
|
|
|
+ case addwechatfriendlog.FieldSource:
|
|
|
+ m.ResetSource()
|
|
|
+ return nil
|
|
|
+ case addwechatfriendlog.FieldNickName:
|
|
|
+ m.ResetNickName()
|
|
|
+ return nil
|
|
|
+ case addwechatfriendlog.FieldAvatar:
|
|
|
+ m.ResetAvatar()
|
|
|
+ return nil
|
|
|
+ case addwechatfriendlog.FieldOrganizationID:
|
|
|
+ m.ResetOrganizationID()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown AddWechatFriendLog field %s", name)
|
|
|
}
|