|
@@ -20009,34 +20009,42 @@ func (m *WorkExperienceMutation) ResetEdge(name string) error {
|
|
|
// WxMutation represents an operation that mutates the Wx nodes in the graph.
|
|
|
type WxMutation struct {
|
|
|
config
|
|
|
- op Op
|
|
|
- typ string
|
|
|
- id *uint64
|
|
|
- created_at *time.Time
|
|
|
- updated_at *time.Time
|
|
|
- status *uint8
|
|
|
- addstatus *int8
|
|
|
- deleted_at *time.Time
|
|
|
- port *string
|
|
|
- process_id *string
|
|
|
- callback *string
|
|
|
- wxid *string
|
|
|
- account *string
|
|
|
- nickname *string
|
|
|
- tel *string
|
|
|
- head_big *string
|
|
|
- organization_id *uint64
|
|
|
- addorganization_id *int64
|
|
|
- api_base *string
|
|
|
- api_key *string
|
|
|
- clearedFields map[string]struct{}
|
|
|
- server *uint64
|
|
|
- clearedserver bool
|
|
|
- agent *uint64
|
|
|
- clearedagent bool
|
|
|
- done bool
|
|
|
- oldValue func(context.Context) (*Wx, error)
|
|
|
- predicates []predicate.Wx
|
|
|
+ op Op
|
|
|
+ typ string
|
|
|
+ id *uint64
|
|
|
+ created_at *time.Time
|
|
|
+ updated_at *time.Time
|
|
|
+ status *uint8
|
|
|
+ addstatus *int8
|
|
|
+ deleted_at *time.Time
|
|
|
+ port *string
|
|
|
+ process_id *string
|
|
|
+ callback *string
|
|
|
+ wxid *string
|
|
|
+ account *string
|
|
|
+ nickname *string
|
|
|
+ tel *string
|
|
|
+ head_big *string
|
|
|
+ organization_id *uint64
|
|
|
+ addorganization_id *int64
|
|
|
+ api_base *string
|
|
|
+ api_key *string
|
|
|
+ allow_list *[]string
|
|
|
+ appendallow_list []string
|
|
|
+ group_allow_list *[]string
|
|
|
+ appendgroup_allow_list []string
|
|
|
+ block_list *[]string
|
|
|
+ appendblock_list []string
|
|
|
+ group_block_list *[]string
|
|
|
+ appendgroup_block_list []string
|
|
|
+ clearedFields map[string]struct{}
|
|
|
+ server *uint64
|
|
|
+ clearedserver bool
|
|
|
+ agent *uint64
|
|
|
+ clearedagent bool
|
|
|
+ done bool
|
|
|
+ oldValue func(context.Context) (*Wx, error)
|
|
|
+ predicates []predicate.Wx
|
|
|
}
|
|
|
|
|
|
var _ ent.Mutation = (*WxMutation)(nil)
|
|
@@ -20875,6 +20883,210 @@ func (m *WxMutation) ResetAPIKey() {
|
|
|
delete(m.clearedFields, wx.FieldAPIKey)
|
|
|
}
|
|
|
|
|
|
+// SetAllowList sets the "allow_list" field.
|
|
|
+func (m *WxMutation) SetAllowList(s []string) {
|
|
|
+ m.allow_list = &s
|
|
|
+ m.appendallow_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// AllowList returns the value of the "allow_list" field in the mutation.
|
|
|
+func (m *WxMutation) AllowList() (r []string, exists bool) {
|
|
|
+ v := m.allow_list
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldAllowList returns the old "allow_list" field's value of the Wx entity.
|
|
|
+// If the Wx 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 *WxMutation) OldAllowList(ctx context.Context) (v []string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldAllowList is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldAllowList requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldAllowList: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.AllowList, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendAllowList adds s to the "allow_list" field.
|
|
|
+func (m *WxMutation) AppendAllowList(s []string) {
|
|
|
+ m.appendallow_list = append(m.appendallow_list, s...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedAllowList returns the list of values that were appended to the "allow_list" field in this mutation.
|
|
|
+func (m *WxMutation) AppendedAllowList() ([]string, bool) {
|
|
|
+ if len(m.appendallow_list) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendallow_list, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetAllowList resets all changes to the "allow_list" field.
|
|
|
+func (m *WxMutation) ResetAllowList() {
|
|
|
+ m.allow_list = nil
|
|
|
+ m.appendallow_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetGroupAllowList sets the "group_allow_list" field.
|
|
|
+func (m *WxMutation) SetGroupAllowList(s []string) {
|
|
|
+ m.group_allow_list = &s
|
|
|
+ m.appendgroup_allow_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// GroupAllowList returns the value of the "group_allow_list" field in the mutation.
|
|
|
+func (m *WxMutation) GroupAllowList() (r []string, exists bool) {
|
|
|
+ v := m.group_allow_list
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldGroupAllowList returns the old "group_allow_list" field's value of the Wx entity.
|
|
|
+// If the Wx 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 *WxMutation) OldGroupAllowList(ctx context.Context) (v []string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldGroupAllowList is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldGroupAllowList requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldGroupAllowList: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.GroupAllowList, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendGroupAllowList adds s to the "group_allow_list" field.
|
|
|
+func (m *WxMutation) AppendGroupAllowList(s []string) {
|
|
|
+ m.appendgroup_allow_list = append(m.appendgroup_allow_list, s...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedGroupAllowList returns the list of values that were appended to the "group_allow_list" field in this mutation.
|
|
|
+func (m *WxMutation) AppendedGroupAllowList() ([]string, bool) {
|
|
|
+ if len(m.appendgroup_allow_list) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendgroup_allow_list, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetGroupAllowList resets all changes to the "group_allow_list" field.
|
|
|
+func (m *WxMutation) ResetGroupAllowList() {
|
|
|
+ m.group_allow_list = nil
|
|
|
+ m.appendgroup_allow_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetBlockList sets the "block_list" field.
|
|
|
+func (m *WxMutation) SetBlockList(s []string) {
|
|
|
+ m.block_list = &s
|
|
|
+ m.appendblock_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// BlockList returns the value of the "block_list" field in the mutation.
|
|
|
+func (m *WxMutation) BlockList() (r []string, exists bool) {
|
|
|
+ v := m.block_list
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldBlockList returns the old "block_list" field's value of the Wx entity.
|
|
|
+// If the Wx 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 *WxMutation) OldBlockList(ctx context.Context) (v []string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldBlockList is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldBlockList requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldBlockList: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.BlockList, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendBlockList adds s to the "block_list" field.
|
|
|
+func (m *WxMutation) AppendBlockList(s []string) {
|
|
|
+ m.appendblock_list = append(m.appendblock_list, s...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedBlockList returns the list of values that were appended to the "block_list" field in this mutation.
|
|
|
+func (m *WxMutation) AppendedBlockList() ([]string, bool) {
|
|
|
+ if len(m.appendblock_list) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendblock_list, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetBlockList resets all changes to the "block_list" field.
|
|
|
+func (m *WxMutation) ResetBlockList() {
|
|
|
+ m.block_list = nil
|
|
|
+ m.appendblock_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetGroupBlockList sets the "group_block_list" field.
|
|
|
+func (m *WxMutation) SetGroupBlockList(s []string) {
|
|
|
+ m.group_block_list = &s
|
|
|
+ m.appendgroup_block_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// GroupBlockList returns the value of the "group_block_list" field in the mutation.
|
|
|
+func (m *WxMutation) GroupBlockList() (r []string, exists bool) {
|
|
|
+ v := m.group_block_list
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldGroupBlockList returns the old "group_block_list" field's value of the Wx entity.
|
|
|
+// If the Wx 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 *WxMutation) OldGroupBlockList(ctx context.Context) (v []string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldGroupBlockList is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldGroupBlockList requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldGroupBlockList: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.GroupBlockList, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendGroupBlockList adds s to the "group_block_list" field.
|
|
|
+func (m *WxMutation) AppendGroupBlockList(s []string) {
|
|
|
+ m.appendgroup_block_list = append(m.appendgroup_block_list, s...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedGroupBlockList returns the list of values that were appended to the "group_block_list" field in this mutation.
|
|
|
+func (m *WxMutation) AppendedGroupBlockList() ([]string, bool) {
|
|
|
+ if len(m.appendgroup_block_list) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendgroup_block_list, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetGroupBlockList resets all changes to the "group_block_list" field.
|
|
|
+func (m *WxMutation) ResetGroupBlockList() {
|
|
|
+ m.group_block_list = nil
|
|
|
+ m.appendgroup_block_list = nil
|
|
|
+}
|
|
|
+
|
|
|
// ClearServer clears the "server" edge to the Server entity.
|
|
|
func (m *WxMutation) ClearServer() {
|
|
|
m.clearedserver = true
|
|
@@ -20963,7 +21175,7 @@ func (m *WxMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *WxMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 17)
|
|
|
+ fields := make([]string, 0, 21)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, wx.FieldCreatedAt)
|
|
|
}
|
|
@@ -21015,6 +21227,18 @@ func (m *WxMutation) Fields() []string {
|
|
|
if m.api_key != nil {
|
|
|
fields = append(fields, wx.FieldAPIKey)
|
|
|
}
|
|
|
+ if m.allow_list != nil {
|
|
|
+ fields = append(fields, wx.FieldAllowList)
|
|
|
+ }
|
|
|
+ if m.group_allow_list != nil {
|
|
|
+ fields = append(fields, wx.FieldGroupAllowList)
|
|
|
+ }
|
|
|
+ if m.block_list != nil {
|
|
|
+ fields = append(fields, wx.FieldBlockList)
|
|
|
+ }
|
|
|
+ if m.group_block_list != nil {
|
|
|
+ fields = append(fields, wx.FieldGroupBlockList)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -21057,6 +21281,14 @@ func (m *WxMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.APIBase()
|
|
|
case wx.FieldAPIKey:
|
|
|
return m.APIKey()
|
|
|
+ case wx.FieldAllowList:
|
|
|
+ return m.AllowList()
|
|
|
+ case wx.FieldGroupAllowList:
|
|
|
+ return m.GroupAllowList()
|
|
|
+ case wx.FieldBlockList:
|
|
|
+ return m.BlockList()
|
|
|
+ case wx.FieldGroupBlockList:
|
|
|
+ return m.GroupBlockList()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -21100,6 +21332,14 @@ func (m *WxMutation) OldField(ctx context.Context, name string) (ent.Value, erro
|
|
|
return m.OldAPIBase(ctx)
|
|
|
case wx.FieldAPIKey:
|
|
|
return m.OldAPIKey(ctx)
|
|
|
+ case wx.FieldAllowList:
|
|
|
+ return m.OldAllowList(ctx)
|
|
|
+ case wx.FieldGroupAllowList:
|
|
|
+ return m.OldGroupAllowList(ctx)
|
|
|
+ case wx.FieldBlockList:
|
|
|
+ return m.OldBlockList(ctx)
|
|
|
+ case wx.FieldGroupBlockList:
|
|
|
+ return m.OldGroupBlockList(ctx)
|
|
|
}
|
|
|
return nil, fmt.Errorf("unknown Wx field %s", name)
|
|
|
}
|
|
@@ -21228,6 +21468,34 @@ func (m *WxMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetAPIKey(v)
|
|
|
return nil
|
|
|
+ case wx.FieldAllowList:
|
|
|
+ v, ok := value.([]string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAllowList(v)
|
|
|
+ return nil
|
|
|
+ case wx.FieldGroupAllowList:
|
|
|
+ v, ok := value.([]string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetGroupAllowList(v)
|
|
|
+ return nil
|
|
|
+ case wx.FieldBlockList:
|
|
|
+ v, ok := value.([]string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetBlockList(v)
|
|
|
+ return nil
|
|
|
+ case wx.FieldGroupBlockList:
|
|
|
+ v, ok := value.([]string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetGroupBlockList(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Wx field %s", name)
|
|
|
}
|
|
@@ -21394,6 +21662,18 @@ func (m *WxMutation) ResetField(name string) error {
|
|
|
case wx.FieldAPIKey:
|
|
|
m.ResetAPIKey()
|
|
|
return nil
|
|
|
+ case wx.FieldAllowList:
|
|
|
+ m.ResetAllowList()
|
|
|
+ return nil
|
|
|
+ case wx.FieldGroupAllowList:
|
|
|
+ m.ResetGroupAllowList()
|
|
|
+ return nil
|
|
|
+ case wx.FieldBlockList:
|
|
|
+ m.ResetBlockList()
|
|
|
+ return nil
|
|
|
+ case wx.FieldGroupBlockList:
|
|
|
+ m.ResetGroupBlockList()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Wx field %s", name)
|
|
|
}
|