|
@@ -1194,6 +1194,7 @@ type BatchMsgMutation struct {
|
|
|
fromwxid *string
|
|
|
msg *string
|
|
|
tag *string
|
|
|
+ tagids *string
|
|
|
total *int32
|
|
|
addtotal *int32
|
|
|
success *int32
|
|
@@ -1202,6 +1203,7 @@ type BatchMsgMutation struct {
|
|
|
addfail *int32
|
|
|
start_time *time.Time
|
|
|
stop_time *time.Time
|
|
|
+ send_time *time.Time
|
|
|
_type *int32
|
|
|
add_type *int32
|
|
|
organization_id *uint64
|
|
@@ -1752,6 +1754,55 @@ func (m *BatchMsgMutation) ResetTag() {
|
|
|
delete(m.clearedFields, batchmsg.FieldTag)
|
|
|
}
|
|
|
|
|
|
+// SetTagids sets the "tagids" field.
|
|
|
+func (m *BatchMsgMutation) SetTagids(s string) {
|
|
|
+ m.tagids = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Tagids returns the value of the "tagids" field in the mutation.
|
|
|
+func (m *BatchMsgMutation) Tagids() (r string, exists bool) {
|
|
|
+ v := m.tagids
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldTagids returns the old "tagids" 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) OldTagids(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldTagids is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldTagids requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldTagids: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Tagids, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearTagids clears the value of the "tagids" field.
|
|
|
+func (m *BatchMsgMutation) ClearTagids() {
|
|
|
+ m.tagids = nil
|
|
|
+ m.clearedFields[batchmsg.FieldTagids] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// TagidsCleared returns if the "tagids" field was cleared in this mutation.
|
|
|
+func (m *BatchMsgMutation) TagidsCleared() bool {
|
|
|
+ _, ok := m.clearedFields[batchmsg.FieldTagids]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetTagids resets all changes to the "tagids" field.
|
|
|
+func (m *BatchMsgMutation) ResetTagids() {
|
|
|
+ m.tagids = nil
|
|
|
+ delete(m.clearedFields, batchmsg.FieldTagids)
|
|
|
+}
|
|
|
+
|
|
|
// SetTotal sets the "total" field.
|
|
|
func (m *BatchMsgMutation) SetTotal(i int32) {
|
|
|
m.total = &i
|
|
@@ -2060,6 +2111,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)
|
|
|
+}
|
|
|
+
|
|
|
// SetType sets the "type" field.
|
|
|
func (m *BatchMsgMutation) SetType(i int32) {
|
|
|
m._type = &i
|
|
@@ -2220,7 +2320,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, 16)
|
|
|
+ fields := make([]string, 0, 18)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, batchmsg.FieldCreatedAt)
|
|
|
}
|
|
@@ -2248,6 +2348,9 @@ func (m *BatchMsgMutation) Fields() []string {
|
|
|
if m.tag != nil {
|
|
|
fields = append(fields, batchmsg.FieldTag)
|
|
|
}
|
|
|
+ if m.tagids != nil {
|
|
|
+ fields = append(fields, batchmsg.FieldTagids)
|
|
|
+ }
|
|
|
if m.total != nil {
|
|
|
fields = append(fields, batchmsg.FieldTotal)
|
|
|
}
|
|
@@ -2263,6 +2366,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)
|
|
|
+ }
|
|
|
if m._type != nil {
|
|
|
fields = append(fields, batchmsg.FieldType)
|
|
|
}
|
|
@@ -2295,6 +2401,8 @@ func (m *BatchMsgMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.Msg()
|
|
|
case batchmsg.FieldTag:
|
|
|
return m.Tag()
|
|
|
+ case batchmsg.FieldTagids:
|
|
|
+ return m.Tagids()
|
|
|
case batchmsg.FieldTotal:
|
|
|
return m.Total()
|
|
|
case batchmsg.FieldSuccess:
|
|
@@ -2305,6 +2413,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()
|
|
|
case batchmsg.FieldType:
|
|
|
return m.GetType()
|
|
|
case batchmsg.FieldOrganizationID:
|
|
@@ -2336,6 +2446,8 @@ func (m *BatchMsgMutation) OldField(ctx context.Context, name string) (ent.Value
|
|
|
return m.OldMsg(ctx)
|
|
|
case batchmsg.FieldTag:
|
|
|
return m.OldTag(ctx)
|
|
|
+ case batchmsg.FieldTagids:
|
|
|
+ return m.OldTagids(ctx)
|
|
|
case batchmsg.FieldTotal:
|
|
|
return m.OldTotal(ctx)
|
|
|
case batchmsg.FieldSuccess:
|
|
@@ -2346,6 +2458,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)
|
|
|
case batchmsg.FieldType:
|
|
|
return m.OldType(ctx)
|
|
|
case batchmsg.FieldOrganizationID:
|
|
@@ -2422,6 +2536,13 @@ func (m *BatchMsgMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetTag(v)
|
|
|
return nil
|
|
|
+ case batchmsg.FieldTagids:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetTagids(v)
|
|
|
+ return nil
|
|
|
case batchmsg.FieldTotal:
|
|
|
v, ok := value.(int32)
|
|
|
if !ok {
|
|
@@ -2457,6 +2578,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
|
|
|
case batchmsg.FieldType:
|
|
|
v, ok := value.(int32)
|
|
|
if !ok {
|
|
@@ -2597,6 +2725,9 @@ func (m *BatchMsgMutation) ClearedFields() []string {
|
|
|
if m.FieldCleared(batchmsg.FieldTag) {
|
|
|
fields = append(fields, batchmsg.FieldTag)
|
|
|
}
|
|
|
+ if m.FieldCleared(batchmsg.FieldTagids) {
|
|
|
+ fields = append(fields, batchmsg.FieldTagids)
|
|
|
+ }
|
|
|
if m.FieldCleared(batchmsg.FieldTotal) {
|
|
|
fields = append(fields, batchmsg.FieldTotal)
|
|
|
}
|
|
@@ -2612,6 +2743,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)
|
|
|
+ }
|
|
|
if m.FieldCleared(batchmsg.FieldType) {
|
|
|
fields = append(fields, batchmsg.FieldType)
|
|
|
}
|
|
@@ -2650,6 +2784,9 @@ func (m *BatchMsgMutation) ClearField(name string) error {
|
|
|
case batchmsg.FieldTag:
|
|
|
m.ClearTag()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldTagids:
|
|
|
+ m.ClearTagids()
|
|
|
+ return nil
|
|
|
case batchmsg.FieldTotal:
|
|
|
m.ClearTotal()
|
|
|
return nil
|
|
@@ -2665,6 +2802,9 @@ func (m *BatchMsgMutation) ClearField(name string) error {
|
|
|
case batchmsg.FieldStopTime:
|
|
|
m.ClearStopTime()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldSendTime:
|
|
|
+ m.ClearSendTime()
|
|
|
+ return nil
|
|
|
case batchmsg.FieldType:
|
|
|
m.ClearType()
|
|
|
return nil
|
|
@@ -2703,6 +2843,9 @@ func (m *BatchMsgMutation) ResetField(name string) error {
|
|
|
case batchmsg.FieldTag:
|
|
|
m.ResetTag()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldTagids:
|
|
|
+ m.ResetTagids()
|
|
|
+ return nil
|
|
|
case batchmsg.FieldTotal:
|
|
|
m.ResetTotal()
|
|
|
return nil
|
|
@@ -2718,6 +2861,9 @@ func (m *BatchMsgMutation) ResetField(name string) error {
|
|
|
case batchmsg.FieldStopTime:
|
|
|
m.ResetStopTime()
|
|
|
return nil
|
|
|
+ case batchmsg.FieldSendTime:
|
|
|
+ m.ResetSendTime()
|
|
|
+ return nil
|
|
|
case batchmsg.FieldType:
|
|
|
m.ResetType()
|
|
|
return nil
|
|
@@ -10034,7 +10180,6 @@ type MessageRecordsMutation struct {
|
|
|
updated_at *time.Time
|
|
|
status *uint8
|
|
|
addstatus *int8
|
|
|
- deleted_at *time.Time
|
|
|
bot_wxid *string
|
|
|
contact_type *int
|
|
|
addcontact_type *int
|
|
@@ -10307,55 +10452,6 @@ func (m *MessageRecordsMutation) ResetStatus() {
|
|
|
delete(m.clearedFields, messagerecords.FieldStatus)
|
|
|
}
|
|
|
|
|
|
-// SetDeletedAt sets the "deleted_at" field.
|
|
|
-func (m *MessageRecordsMutation) SetDeletedAt(t time.Time) {
|
|
|
- m.deleted_at = &t
|
|
|
-}
|
|
|
-
|
|
|
-// DeletedAt returns the value of the "deleted_at" field in the mutation.
|
|
|
-func (m *MessageRecordsMutation) DeletedAt() (r time.Time, exists bool) {
|
|
|
- v := m.deleted_at
|
|
|
- if v == nil {
|
|
|
- return
|
|
|
- }
|
|
|
- return *v, true
|
|
|
-}
|
|
|
-
|
|
|
-// OldDeletedAt returns the old "deleted_at" field's value of the MessageRecords entity.
|
|
|
-// If the MessageRecords 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 *MessageRecordsMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) {
|
|
|
- if !m.op.Is(OpUpdateOne) {
|
|
|
- return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations")
|
|
|
- }
|
|
|
- if m.id == nil || m.oldValue == nil {
|
|
|
- return v, errors.New("OldDeletedAt requires an ID field in the mutation")
|
|
|
- }
|
|
|
- oldValue, err := m.oldValue(ctx)
|
|
|
- if err != nil {
|
|
|
- return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err)
|
|
|
- }
|
|
|
- return oldValue.DeletedAt, nil
|
|
|
-}
|
|
|
-
|
|
|
-// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
-func (m *MessageRecordsMutation) ClearDeletedAt() {
|
|
|
- m.deleted_at = nil
|
|
|
- m.clearedFields[messagerecords.FieldDeletedAt] = struct{}{}
|
|
|
-}
|
|
|
-
|
|
|
-// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.
|
|
|
-func (m *MessageRecordsMutation) DeletedAtCleared() bool {
|
|
|
- _, ok := m.clearedFields[messagerecords.FieldDeletedAt]
|
|
|
- return ok
|
|
|
-}
|
|
|
-
|
|
|
-// ResetDeletedAt resets all changes to the "deleted_at" field.
|
|
|
-func (m *MessageRecordsMutation) ResetDeletedAt() {
|
|
|
- m.deleted_at = nil
|
|
|
- delete(m.clearedFields, messagerecords.FieldDeletedAt)
|
|
|
-}
|
|
|
-
|
|
|
// SetBotWxid sets the "bot_wxid" field.
|
|
|
func (m *MessageRecordsMutation) SetBotWxid(s string) {
|
|
|
m.bot_wxid = &s
|
|
@@ -11137,7 +11233,7 @@ func (m *MessageRecordsMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *MessageRecordsMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 17)
|
|
|
+ fields := make([]string, 0, 16)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, messagerecords.FieldCreatedAt)
|
|
|
}
|
|
@@ -11147,9 +11243,6 @@ func (m *MessageRecordsMutation) Fields() []string {
|
|
|
if m.status != nil {
|
|
|
fields = append(fields, messagerecords.FieldStatus)
|
|
|
}
|
|
|
- if m.deleted_at != nil {
|
|
|
- fields = append(fields, messagerecords.FieldDeletedAt)
|
|
|
- }
|
|
|
if m.bot_wxid != nil {
|
|
|
fields = append(fields, messagerecords.FieldBotWxid)
|
|
|
}
|
|
@@ -11203,8 +11296,6 @@ func (m *MessageRecordsMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.UpdatedAt()
|
|
|
case messagerecords.FieldStatus:
|
|
|
return m.Status()
|
|
|
- case messagerecords.FieldDeletedAt:
|
|
|
- return m.DeletedAt()
|
|
|
case messagerecords.FieldBotWxid:
|
|
|
return m.BotWxid()
|
|
|
case messagerecords.FieldContactID:
|
|
@@ -11246,8 +11337,6 @@ func (m *MessageRecordsMutation) OldField(ctx context.Context, name string) (ent
|
|
|
return m.OldUpdatedAt(ctx)
|
|
|
case messagerecords.FieldStatus:
|
|
|
return m.OldStatus(ctx)
|
|
|
- case messagerecords.FieldDeletedAt:
|
|
|
- return m.OldDeletedAt(ctx)
|
|
|
case messagerecords.FieldBotWxid:
|
|
|
return m.OldBotWxid(ctx)
|
|
|
case messagerecords.FieldContactID:
|
|
@@ -11304,13 +11393,6 @@ func (m *MessageRecordsMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetStatus(v)
|
|
|
return nil
|
|
|
- case messagerecords.FieldDeletedAt:
|
|
|
- v, ok := value.(time.Time)
|
|
|
- if !ok {
|
|
|
- return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
- }
|
|
|
- m.SetDeletedAt(v)
|
|
|
- return nil
|
|
|
case messagerecords.FieldBotWxid:
|
|
|
v, ok := value.(string)
|
|
|
if !ok {
|
|
@@ -11498,9 +11580,6 @@ func (m *MessageRecordsMutation) ClearedFields() []string {
|
|
|
if m.FieldCleared(messagerecords.FieldStatus) {
|
|
|
fields = append(fields, messagerecords.FieldStatus)
|
|
|
}
|
|
|
- if m.FieldCleared(messagerecords.FieldDeletedAt) {
|
|
|
- fields = append(fields, messagerecords.FieldDeletedAt)
|
|
|
- }
|
|
|
if m.FieldCleared(messagerecords.FieldContactID) {
|
|
|
fields = append(fields, messagerecords.FieldContactID)
|
|
|
}
|
|
@@ -11536,9 +11615,6 @@ func (m *MessageRecordsMutation) ClearField(name string) error {
|
|
|
case messagerecords.FieldStatus:
|
|
|
m.ClearStatus()
|
|
|
return nil
|
|
|
- case messagerecords.FieldDeletedAt:
|
|
|
- m.ClearDeletedAt()
|
|
|
- return nil
|
|
|
case messagerecords.FieldContactID:
|
|
|
m.ClearContactID()
|
|
|
return nil
|
|
@@ -11574,9 +11650,6 @@ func (m *MessageRecordsMutation) ResetField(name string) error {
|
|
|
case messagerecords.FieldStatus:
|
|
|
m.ResetStatus()
|
|
|
return nil
|
|
|
- case messagerecords.FieldDeletedAt:
|
|
|
- m.ResetDeletedAt()
|
|
|
- return nil
|
|
|
case messagerecords.FieldBotWxid:
|
|
|
m.ResetBotWxid()
|
|
|
return nil
|
|
@@ -20009,34 +20082,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 +20956,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 +21248,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 +21300,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 +21354,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 +21405,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 +21541,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 +21735,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)
|
|
|
}
|