|
@@ -278,21 +278,6 @@ func (au *AgentUpdate) AddKeyAgent(a ...*ApiKey) *AgentUpdate {
|
|
|
return au.AddKeyAgentIDs(ids...)
|
|
|
}
|
|
|
|
|
|
-// AddXjsAgentIDs adds the "xjs_agent" edge to the XunjiService entity by IDs.
|
|
|
-func (au *AgentUpdate) AddXjsAgentIDs(ids ...uint64) *AgentUpdate {
|
|
|
- au.mutation.AddXjsAgentIDs(ids...)
|
|
|
- return au
|
|
|
-}
|
|
|
-
|
|
|
-// AddXjsAgent adds the "xjs_agent" edges to the XunjiService entity.
|
|
|
-func (au *AgentUpdate) AddXjsAgent(x ...*XunjiService) *AgentUpdate {
|
|
|
- ids := make([]uint64, len(x))
|
|
|
- for i := range x {
|
|
|
- ids[i] = x[i].ID
|
|
|
- }
|
|
|
- return au.AddXjsAgentIDs(ids...)
|
|
|
-}
|
|
|
-
|
|
|
// Mutation returns the AgentMutation object of the builder.
|
|
|
func (au *AgentUpdate) Mutation() *AgentMutation {
|
|
|
return au.mutation
|
|
@@ -403,27 +388,6 @@ func (au *AgentUpdate) RemoveKeyAgent(a ...*ApiKey) *AgentUpdate {
|
|
|
return au.RemoveKeyAgentIDs(ids...)
|
|
|
}
|
|
|
|
|
|
-// ClearXjsAgent clears all "xjs_agent" edges to the XunjiService entity.
|
|
|
-func (au *AgentUpdate) ClearXjsAgent() *AgentUpdate {
|
|
|
- au.mutation.ClearXjsAgent()
|
|
|
- return au
|
|
|
-}
|
|
|
-
|
|
|
-// RemoveXjsAgentIDs removes the "xjs_agent" edge to XunjiService entities by IDs.
|
|
|
-func (au *AgentUpdate) RemoveXjsAgentIDs(ids ...uint64) *AgentUpdate {
|
|
|
- au.mutation.RemoveXjsAgentIDs(ids...)
|
|
|
- return au
|
|
|
-}
|
|
|
-
|
|
|
-// RemoveXjsAgent removes "xjs_agent" edges to XunjiService entities.
|
|
|
-func (au *AgentUpdate) RemoveXjsAgent(x ...*XunjiService) *AgentUpdate {
|
|
|
- ids := make([]uint64, len(x))
|
|
|
- for i := range x {
|
|
|
- ids[i] = x[i].ID
|
|
|
- }
|
|
|
- return au.RemoveXjsAgentIDs(ids...)
|
|
|
-}
|
|
|
-
|
|
|
// Save executes the query and returns the number of nodes affected by the update operation.
|
|
|
func (au *AgentUpdate) Save(ctx context.Context) (int, error) {
|
|
|
if err := au.defaults(); err != nil {
|
|
@@ -781,51 +745,6 @@ func (au *AgentUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|
|
}
|
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
|
}
|
|
|
- if au.mutation.XjsAgentCleared() {
|
|
|
- edge := &sqlgraph.EdgeSpec{
|
|
|
- Rel: sqlgraph.O2M,
|
|
|
- Inverse: false,
|
|
|
- Table: agent.XjsAgentTable,
|
|
|
- Columns: []string{agent.XjsAgentColumn},
|
|
|
- Bidi: false,
|
|
|
- Target: &sqlgraph.EdgeTarget{
|
|
|
- IDSpec: sqlgraph.NewFieldSpec(xunjiservice.FieldID, field.TypeUint64),
|
|
|
- },
|
|
|
- }
|
|
|
- _spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
|
- }
|
|
|
- if nodes := au.mutation.RemovedXjsAgentIDs(); len(nodes) > 0 && !au.mutation.XjsAgentCleared() {
|
|
|
- edge := &sqlgraph.EdgeSpec{
|
|
|
- Rel: sqlgraph.O2M,
|
|
|
- Inverse: false,
|
|
|
- Table: agent.XjsAgentTable,
|
|
|
- Columns: []string{agent.XjsAgentColumn},
|
|
|
- Bidi: false,
|
|
|
- Target: &sqlgraph.EdgeTarget{
|
|
|
- IDSpec: sqlgraph.NewFieldSpec(xunjiservice.FieldID, field.TypeUint64),
|
|
|
- },
|
|
|
- }
|
|
|
- for _, k := range nodes {
|
|
|
- edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
|
- }
|
|
|
- _spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
|
- }
|
|
|
- if nodes := au.mutation.XjsAgentIDs(); len(nodes) > 0 {
|
|
|
- edge := &sqlgraph.EdgeSpec{
|
|
|
- Rel: sqlgraph.O2M,
|
|
|
- Inverse: false,
|
|
|
- Table: agent.XjsAgentTable,
|
|
|
- Columns: []string{agent.XjsAgentColumn},
|
|
|
- Bidi: false,
|
|
|
- Target: &sqlgraph.EdgeTarget{
|
|
|
- IDSpec: sqlgraph.NewFieldSpec(xunjiservice.FieldID, field.TypeUint64),
|
|
|
- },
|
|
|
- }
|
|
|
- for _, k := range nodes {
|
|
|
- edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
|
- }
|
|
|
- _spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
|
- }
|
|
|
if n, err = sqlgraph.UpdateNodes(ctx, au.driver, _spec); err != nil {
|
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
|
err = &NotFoundError{agent.Label}
|
|
@@ -1091,21 +1010,6 @@ func (auo *AgentUpdateOne) AddKeyAgent(a ...*ApiKey) *AgentUpdateOne {
|
|
|
return auo.AddKeyAgentIDs(ids...)
|
|
|
}
|
|
|
|
|
|
-// AddXjsAgentIDs adds the "xjs_agent" edge to the XunjiService entity by IDs.
|
|
|
-func (auo *AgentUpdateOne) AddXjsAgentIDs(ids ...uint64) *AgentUpdateOne {
|
|
|
- auo.mutation.AddXjsAgentIDs(ids...)
|
|
|
- return auo
|
|
|
-}
|
|
|
-
|
|
|
-// AddXjsAgent adds the "xjs_agent" edges to the XunjiService entity.
|
|
|
-func (auo *AgentUpdateOne) AddXjsAgent(x ...*XunjiService) *AgentUpdateOne {
|
|
|
- ids := make([]uint64, len(x))
|
|
|
- for i := range x {
|
|
|
- ids[i] = x[i].ID
|
|
|
- }
|
|
|
- return auo.AddXjsAgentIDs(ids...)
|
|
|
-}
|
|
|
-
|
|
|
// Mutation returns the AgentMutation object of the builder.
|
|
|
func (auo *AgentUpdateOne) Mutation() *AgentMutation {
|
|
|
return auo.mutation
|
|
@@ -1216,27 +1120,6 @@ func (auo *AgentUpdateOne) RemoveKeyAgent(a ...*ApiKey) *AgentUpdateOne {
|
|
|
return auo.RemoveKeyAgentIDs(ids...)
|
|
|
}
|
|
|
|
|
|
-// ClearXjsAgent clears all "xjs_agent" edges to the XunjiService entity.
|
|
|
-func (auo *AgentUpdateOne) ClearXjsAgent() *AgentUpdateOne {
|
|
|
- auo.mutation.ClearXjsAgent()
|
|
|
- return auo
|
|
|
-}
|
|
|
-
|
|
|
-// RemoveXjsAgentIDs removes the "xjs_agent" edge to XunjiService entities by IDs.
|
|
|
-func (auo *AgentUpdateOne) RemoveXjsAgentIDs(ids ...uint64) *AgentUpdateOne {
|
|
|
- auo.mutation.RemoveXjsAgentIDs(ids...)
|
|
|
- return auo
|
|
|
-}
|
|
|
-
|
|
|
-// RemoveXjsAgent removes "xjs_agent" edges to XunjiService entities.
|
|
|
-func (auo *AgentUpdateOne) RemoveXjsAgent(x ...*XunjiService) *AgentUpdateOne {
|
|
|
- ids := make([]uint64, len(x))
|
|
|
- for i := range x {
|
|
|
- ids[i] = x[i].ID
|
|
|
- }
|
|
|
- return auo.RemoveXjsAgentIDs(ids...)
|
|
|
-}
|
|
|
-
|
|
|
// Where appends a list predicates to the AgentUpdate builder.
|
|
|
func (auo *AgentUpdateOne) Where(ps ...predicate.Agent) *AgentUpdateOne {
|
|
|
auo.mutation.Where(ps...)
|
|
@@ -1624,51 +1507,6 @@ func (auo *AgentUpdateOne) sqlSave(ctx context.Context) (_node *Agent, err error
|
|
|
}
|
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
|
}
|
|
|
- if auo.mutation.XjsAgentCleared() {
|
|
|
- edge := &sqlgraph.EdgeSpec{
|
|
|
- Rel: sqlgraph.O2M,
|
|
|
- Inverse: false,
|
|
|
- Table: agent.XjsAgentTable,
|
|
|
- Columns: []string{agent.XjsAgentColumn},
|
|
|
- Bidi: false,
|
|
|
- Target: &sqlgraph.EdgeTarget{
|
|
|
- IDSpec: sqlgraph.NewFieldSpec(xunjiservice.FieldID, field.TypeUint64),
|
|
|
- },
|
|
|
- }
|
|
|
- _spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
|
- }
|
|
|
- if nodes := auo.mutation.RemovedXjsAgentIDs(); len(nodes) > 0 && !auo.mutation.XjsAgentCleared() {
|
|
|
- edge := &sqlgraph.EdgeSpec{
|
|
|
- Rel: sqlgraph.O2M,
|
|
|
- Inverse: false,
|
|
|
- Table: agent.XjsAgentTable,
|
|
|
- Columns: []string{agent.XjsAgentColumn},
|
|
|
- Bidi: false,
|
|
|
- Target: &sqlgraph.EdgeTarget{
|
|
|
- IDSpec: sqlgraph.NewFieldSpec(xunjiservice.FieldID, field.TypeUint64),
|
|
|
- },
|
|
|
- }
|
|
|
- for _, k := range nodes {
|
|
|
- edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
|
- }
|
|
|
- _spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
|
- }
|
|
|
- if nodes := auo.mutation.XjsAgentIDs(); len(nodes) > 0 {
|
|
|
- edge := &sqlgraph.EdgeSpec{
|
|
|
- Rel: sqlgraph.O2M,
|
|
|
- Inverse: false,
|
|
|
- Table: agent.XjsAgentTable,
|
|
|
- Columns: []string{agent.XjsAgentColumn},
|
|
|
- Bidi: false,
|
|
|
- Target: &sqlgraph.EdgeTarget{
|
|
|
- IDSpec: sqlgraph.NewFieldSpec(xunjiservice.FieldID, field.TypeUint64),
|
|
|
- },
|
|
|
- }
|
|
|
- for _, k := range nodes {
|
|
|
- edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
|
- }
|
|
|
- _spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
|
- }
|
|
|
_node = &Agent{config: auo.config}
|
|
|
_spec.Assign = _node.assignValues
|
|
|
_spec.ScanValues = _node.scanValues
|