|
@@ -147,6 +147,9 @@ type AgentMutation struct {
|
|
key_agent map[uint64]struct{}
|
|
key_agent map[uint64]struct{}
|
|
removedkey_agent map[uint64]struct{}
|
|
removedkey_agent map[uint64]struct{}
|
|
clearedkey_agent bool
|
|
clearedkey_agent bool
|
|
|
|
+ xjs_agent map[uint64]struct{}
|
|
|
|
+ removedxjs_agent map[uint64]struct{}
|
|
|
|
+ clearedxjs_agent bool
|
|
done bool
|
|
done bool
|
|
oldValue func(context.Context) (*Agent, error)
|
|
oldValue func(context.Context) (*Agent, error)
|
|
predicates []predicate.Agent
|
|
predicates []predicate.Agent
|
|
@@ -1015,6 +1018,60 @@ func (m *AgentMutation) ResetKeyAgent() {
|
|
m.removedkey_agent = nil
|
|
m.removedkey_agent = nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// AddXjsAgentIDs adds the "xjs_agent" edge to the XunjiService entity by ids.
|
|
|
|
+func (m *AgentMutation) AddXjsAgentIDs(ids ...uint64) {
|
|
|
|
+ if m.xjs_agent == nil {
|
|
|
|
+ m.xjs_agent = make(map[uint64]struct{})
|
|
|
|
+ }
|
|
|
|
+ for i := range ids {
|
|
|
|
+ m.xjs_agent[ids[i]] = struct{}{}
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// ClearXjsAgent clears the "xjs_agent" edge to the XunjiService entity.
|
|
|
|
+func (m *AgentMutation) ClearXjsAgent() {
|
|
|
|
+ m.clearedxjs_agent = true
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// XjsAgentCleared reports if the "xjs_agent" edge to the XunjiService entity was cleared.
|
|
|
|
+func (m *AgentMutation) XjsAgentCleared() bool {
|
|
|
|
+ return m.clearedxjs_agent
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// RemoveXjsAgentIDs removes the "xjs_agent" edge to the XunjiService entity by IDs.
|
|
|
|
+func (m *AgentMutation) RemoveXjsAgentIDs(ids ...uint64) {
|
|
|
|
+ if m.removedxjs_agent == nil {
|
|
|
|
+ m.removedxjs_agent = make(map[uint64]struct{})
|
|
|
|
+ }
|
|
|
|
+ for i := range ids {
|
|
|
|
+ delete(m.xjs_agent, ids[i])
|
|
|
|
+ m.removedxjs_agent[ids[i]] = struct{}{}
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// RemovedXjsAgent returns the removed IDs of the "xjs_agent" edge to the XunjiService entity.
|
|
|
|
+func (m *AgentMutation) RemovedXjsAgentIDs() (ids []uint64) {
|
|
|
|
+ for id := range m.removedxjs_agent {
|
|
|
|
+ ids = append(ids, id)
|
|
|
|
+ }
|
|
|
|
+ return
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// XjsAgentIDs returns the "xjs_agent" edge IDs in the mutation.
|
|
|
|
+func (m *AgentMutation) XjsAgentIDs() (ids []uint64) {
|
|
|
|
+ for id := range m.xjs_agent {
|
|
|
|
+ ids = append(ids, id)
|
|
|
|
+ }
|
|
|
|
+ return
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// ResetXjsAgent resets all changes to the "xjs_agent" edge.
|
|
|
|
+func (m *AgentMutation) ResetXjsAgent() {
|
|
|
|
+ m.xjs_agent = nil
|
|
|
|
+ m.clearedxjs_agent = false
|
|
|
|
+ m.removedxjs_agent = nil
|
|
|
|
+}
|
|
|
|
+
|
|
// Where appends a list predicates to the AgentMutation builder.
|
|
// Where appends a list predicates to the AgentMutation builder.
|
|
func (m *AgentMutation) Where(ps ...predicate.Agent) {
|
|
func (m *AgentMutation) Where(ps ...predicate.Agent) {
|
|
m.predicates = append(m.predicates, ps...)
|
|
m.predicates = append(m.predicates, ps...)
|
|
@@ -1388,6 +1445,9 @@ func (m *AgentMutation) AddedEdges() []string {
|
|
if m.key_agent != nil {
|
|
if m.key_agent != nil {
|
|
edges = append(edges, agent.EdgeKeyAgent)
|
|
edges = append(edges, agent.EdgeKeyAgent)
|
|
}
|
|
}
|
|
|
|
+ if m.xjs_agent != nil {
|
|
|
|
+ edges = append(edges, agent.EdgeXjsAgent)
|
|
|
|
+ }
|
|
return edges
|
|
return edges
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1425,6 +1485,12 @@ func (m *AgentMutation) AddedIDs(name string) []ent.Value {
|
|
ids = append(ids, id)
|
|
ids = append(ids, id)
|
|
}
|
|
}
|
|
return ids
|
|
return ids
|
|
|
|
+ case agent.EdgeXjsAgent:
|
|
|
|
+ ids := make([]ent.Value, 0, len(m.xjs_agent))
|
|
|
|
+ for id := range m.xjs_agent {
|
|
|
|
+ ids = append(ids, id)
|
|
|
|
+ }
|
|
|
|
+ return ids
|
|
}
|
|
}
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
@@ -1447,6 +1513,9 @@ func (m *AgentMutation) RemovedEdges() []string {
|
|
if m.removedkey_agent != nil {
|
|
if m.removedkey_agent != nil {
|
|
edges = append(edges, agent.EdgeKeyAgent)
|
|
edges = append(edges, agent.EdgeKeyAgent)
|
|
}
|
|
}
|
|
|
|
+ if m.removedxjs_agent != nil {
|
|
|
|
+ edges = append(edges, agent.EdgeXjsAgent)
|
|
|
|
+ }
|
|
return edges
|
|
return edges
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1484,6 +1553,12 @@ func (m *AgentMutation) RemovedIDs(name string) []ent.Value {
|
|
ids = append(ids, id)
|
|
ids = append(ids, id)
|
|
}
|
|
}
|
|
return ids
|
|
return ids
|
|
|
|
+ case agent.EdgeXjsAgent:
|
|
|
|
+ ids := make([]ent.Value, 0, len(m.removedxjs_agent))
|
|
|
|
+ for id := range m.removedxjs_agent {
|
|
|
|
+ ids = append(ids, id)
|
|
|
|
+ }
|
|
|
|
+ return ids
|
|
}
|
|
}
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
@@ -1506,6 +1581,9 @@ func (m *AgentMutation) ClearedEdges() []string {
|
|
if m.clearedkey_agent {
|
|
if m.clearedkey_agent {
|
|
edges = append(edges, agent.EdgeKeyAgent)
|
|
edges = append(edges, agent.EdgeKeyAgent)
|
|
}
|
|
}
|
|
|
|
+ if m.clearedxjs_agent {
|
|
|
|
+ edges = append(edges, agent.EdgeXjsAgent)
|
|
|
|
+ }
|
|
return edges
|
|
return edges
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1523,6 +1601,8 @@ func (m *AgentMutation) EdgeCleared(name string) bool {
|
|
return m.clearedxjs_agent
|
|
return m.clearedxjs_agent
|
|
case agent.EdgeKeyAgent:
|
|
case agent.EdgeKeyAgent:
|
|
return m.clearedkey_agent
|
|
return m.clearedkey_agent
|
|
|
|
+ case agent.EdgeXjsAgent:
|
|
|
|
+ return m.clearedxjs_agent
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
@@ -1554,6 +1634,9 @@ func (m *AgentMutation) ResetEdge(name string) error {
|
|
case agent.EdgeKeyAgent:
|
|
case agent.EdgeKeyAgent:
|
|
m.ResetKeyAgent()
|
|
m.ResetKeyAgent()
|
|
return nil
|
|
return nil
|
|
|
|
+ case agent.EdgeXjsAgent:
|
|
|
|
+ m.ResetXjsAgent()
|
|
|
|
+ return nil
|
|
}
|
|
}
|
|
return fmt.Errorf("unknown Agent edge %s", name)
|
|
return fmt.Errorf("unknown Agent edge %s", name)
|
|
}
|
|
}
|
|
@@ -50047,8 +50130,6 @@ type XunjiMutation struct {
|
|
app_secret *string
|
|
app_secret *string
|
|
token *string
|
|
token *string
|
|
encoding_key *string
|
|
encoding_key *string
|
|
- agent_id *uint64
|
|
|
|
- addagent_id *int64
|
|
|
|
organization_id *uint64
|
|
organization_id *uint64
|
|
addorganization_id *int64
|
|
addorganization_id *int64
|
|
clearedFields map[string]struct{}
|
|
clearedFields map[string]struct{}
|
|
@@ -50496,62 +50577,6 @@ func (m *XunjiMutation) ResetEncodingKey() {
|
|
m.encoding_key = nil
|
|
m.encoding_key = nil
|
|
}
|
|
}
|
|
|
|
|
|
-// SetAgentID sets the "agent_id" field.
|
|
|
|
-func (m *XunjiMutation) SetAgentID(u uint64) {
|
|
|
|
- m.agent_id = &u
|
|
|
|
- m.addagent_id = nil
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// AgentID returns the value of the "agent_id" field in the mutation.
|
|
|
|
-func (m *XunjiMutation) AgentID() (r uint64, exists bool) {
|
|
|
|
- v := m.agent_id
|
|
|
|
- if v == nil {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- return *v, true
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// OldAgentID returns the old "agent_id" field's value of the Xunji entity.
|
|
|
|
-// If the Xunji 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 *XunjiMutation) OldAgentID(ctx context.Context) (v uint64, err error) {
|
|
|
|
- if !m.op.Is(OpUpdateOne) {
|
|
|
|
- return v, errors.New("OldAgentID is only allowed on UpdateOne operations")
|
|
|
|
- }
|
|
|
|
- if m.id == nil || m.oldValue == nil {
|
|
|
|
- return v, errors.New("OldAgentID requires an ID field in the mutation")
|
|
|
|
- }
|
|
|
|
- oldValue, err := m.oldValue(ctx)
|
|
|
|
- if err != nil {
|
|
|
|
- return v, fmt.Errorf("querying old value for OldAgentID: %w", err)
|
|
|
|
- }
|
|
|
|
- return oldValue.AgentID, nil
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// AddAgentID adds u to the "agent_id" field.
|
|
|
|
-func (m *XunjiMutation) AddAgentID(u int64) {
|
|
|
|
- if m.addagent_id != nil {
|
|
|
|
- *m.addagent_id += u
|
|
|
|
- } else {
|
|
|
|
- m.addagent_id = &u
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// AddedAgentID returns the value that was added to the "agent_id" field in this mutation.
|
|
|
|
-func (m *XunjiMutation) AddedAgentID() (r int64, exists bool) {
|
|
|
|
- v := m.addagent_id
|
|
|
|
- if v == nil {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- return *v, true
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// ResetAgentID resets all changes to the "agent_id" field.
|
|
|
|
-func (m *XunjiMutation) ResetAgentID() {
|
|
|
|
- m.agent_id = nil
|
|
|
|
- m.addagent_id = nil
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
func (m *XunjiMutation) SetOrganizationID(u uint64) {
|
|
func (m *XunjiMutation) SetOrganizationID(u uint64) {
|
|
m.organization_id = &u
|
|
m.organization_id = &u
|
|
@@ -50642,7 +50667,7 @@ func (m *XunjiMutation) Type() string {
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
// AddedFields().
|
|
// AddedFields().
|
|
func (m *XunjiMutation) Fields() []string {
|
|
func (m *XunjiMutation) Fields() []string {
|
|
- fields := make([]string, 0, 10)
|
|
|
|
|
|
+ fields := make([]string, 0, 9)
|
|
if m.created_at != nil {
|
|
if m.created_at != nil {
|
|
fields = append(fields, xunji.FieldCreatedAt)
|
|
fields = append(fields, xunji.FieldCreatedAt)
|
|
}
|
|
}
|
|
@@ -50667,9 +50692,6 @@ func (m *XunjiMutation) Fields() []string {
|
|
if m.encoding_key != nil {
|
|
if m.encoding_key != nil {
|
|
fields = append(fields, xunji.FieldEncodingKey)
|
|
fields = append(fields, xunji.FieldEncodingKey)
|
|
}
|
|
}
|
|
- if m.agent_id != nil {
|
|
|
|
- fields = append(fields, xunji.FieldAgentID)
|
|
|
|
- }
|
|
|
|
if m.organization_id != nil {
|
|
if m.organization_id != nil {
|
|
fields = append(fields, xunji.FieldOrganizationID)
|
|
fields = append(fields, xunji.FieldOrganizationID)
|
|
}
|
|
}
|
|
@@ -50697,8 +50719,6 @@ func (m *XunjiMutation) Field(name string) (ent.Value, bool) {
|
|
return m.Token()
|
|
return m.Token()
|
|
case xunji.FieldEncodingKey:
|
|
case xunji.FieldEncodingKey:
|
|
return m.EncodingKey()
|
|
return m.EncodingKey()
|
|
- case xunji.FieldAgentID:
|
|
|
|
- return m.AgentID()
|
|
|
|
case xunji.FieldOrganizationID:
|
|
case xunji.FieldOrganizationID:
|
|
return m.OrganizationID()
|
|
return m.OrganizationID()
|
|
}
|
|
}
|
|
@@ -50726,8 +50746,6 @@ func (m *XunjiMutation) OldField(ctx context.Context, name string) (ent.Value, e
|
|
return m.OldToken(ctx)
|
|
return m.OldToken(ctx)
|
|
case xunji.FieldEncodingKey:
|
|
case xunji.FieldEncodingKey:
|
|
return m.OldEncodingKey(ctx)
|
|
return m.OldEncodingKey(ctx)
|
|
- case xunji.FieldAgentID:
|
|
|
|
- return m.OldAgentID(ctx)
|
|
|
|
case xunji.FieldOrganizationID:
|
|
case xunji.FieldOrganizationID:
|
|
return m.OldOrganizationID(ctx)
|
|
return m.OldOrganizationID(ctx)
|
|
}
|
|
}
|
|
@@ -50795,13 +50813,6 @@ func (m *XunjiMutation) SetField(name string, value ent.Value) error {
|
|
}
|
|
}
|
|
m.SetEncodingKey(v)
|
|
m.SetEncodingKey(v)
|
|
return nil
|
|
return nil
|
|
- case xunji.FieldAgentID:
|
|
|
|
- v, ok := value.(uint64)
|
|
|
|
- if !ok {
|
|
|
|
- return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
|
- }
|
|
|
|
- m.SetAgentID(v)
|
|
|
|
- return nil
|
|
|
|
case xunji.FieldOrganizationID:
|
|
case xunji.FieldOrganizationID:
|
|
v, ok := value.(uint64)
|
|
v, ok := value.(uint64)
|
|
if !ok {
|
|
if !ok {
|
|
@@ -50820,9 +50831,6 @@ func (m *XunjiMutation) AddedFields() []string {
|
|
if m.addstatus != nil {
|
|
if m.addstatus != nil {
|
|
fields = append(fields, xunji.FieldStatus)
|
|
fields = append(fields, xunji.FieldStatus)
|
|
}
|
|
}
|
|
- if m.addagent_id != nil {
|
|
|
|
- fields = append(fields, xunji.FieldAgentID)
|
|
|
|
- }
|
|
|
|
if m.addorganization_id != nil {
|
|
if m.addorganization_id != nil {
|
|
fields = append(fields, xunji.FieldOrganizationID)
|
|
fields = append(fields, xunji.FieldOrganizationID)
|
|
}
|
|
}
|
|
@@ -50836,8 +50844,6 @@ func (m *XunjiMutation) AddedField(name string) (ent.Value, bool) {
|
|
switch name {
|
|
switch name {
|
|
case xunji.FieldStatus:
|
|
case xunji.FieldStatus:
|
|
return m.AddedStatus()
|
|
return m.AddedStatus()
|
|
- case xunji.FieldAgentID:
|
|
|
|
- return m.AddedAgentID()
|
|
|
|
case xunji.FieldOrganizationID:
|
|
case xunji.FieldOrganizationID:
|
|
return m.AddedOrganizationID()
|
|
return m.AddedOrganizationID()
|
|
}
|
|
}
|
|
@@ -50856,13 +50862,6 @@ func (m *XunjiMutation) AddField(name string, value ent.Value) error {
|
|
}
|
|
}
|
|
m.AddStatus(v)
|
|
m.AddStatus(v)
|
|
return nil
|
|
return nil
|
|
- case xunji.FieldAgentID:
|
|
|
|
- v, ok := value.(int64)
|
|
|
|
- if !ok {
|
|
|
|
- return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
|
- }
|
|
|
|
- m.AddAgentID(v)
|
|
|
|
- return nil
|
|
|
|
case xunji.FieldOrganizationID:
|
|
case xunji.FieldOrganizationID:
|
|
v, ok := value.(int64)
|
|
v, ok := value.(int64)
|
|
if !ok {
|
|
if !ok {
|
|
@@ -50936,9 +50935,6 @@ func (m *XunjiMutation) ResetField(name string) error {
|
|
case xunji.FieldEncodingKey:
|
|
case xunji.FieldEncodingKey:
|
|
m.ResetEncodingKey()
|
|
m.ResetEncodingKey()
|
|
return nil
|
|
return nil
|
|
- case xunji.FieldAgentID:
|
|
|
|
- m.ResetAgentID()
|
|
|
|
- return nil
|
|
|
|
case xunji.FieldOrganizationID:
|
|
case xunji.FieldOrganizationID:
|
|
m.ResetOrganizationID()
|
|
m.ResetOrganizationID()
|
|
return nil
|
|
return nil
|