add seven
This commit is contained in:
@@ -5,6 +5,7 @@ package ent
|
||||
import (
|
||||
"api/ent/card"
|
||||
"api/ent/ma"
|
||||
"api/ent/sev"
|
||||
"api/ent/ue"
|
||||
"api/ent/user"
|
||||
"context"
|
||||
@@ -752,6 +753,21 @@ func (uc *UserCreate) AddMa(m ...*Ma) *UserCreate {
|
||||
return uc.AddMaIDs(ids...)
|
||||
}
|
||||
|
||||
// AddSevIDs adds the "sev" edge to the Sev entity by IDs.
|
||||
func (uc *UserCreate) AddSevIDs(ids ...int) *UserCreate {
|
||||
uc.mutation.AddSevIDs(ids...)
|
||||
return uc
|
||||
}
|
||||
|
||||
// AddSev adds the "sev" edges to the Sev entity.
|
||||
func (uc *UserCreate) AddSev(s ...*Sev) *UserCreate {
|
||||
ids := make([]int, len(s))
|
||||
for i := range s {
|
||||
ids[i] = s[i].ID
|
||||
}
|
||||
return uc.AddSevIDs(ids...)
|
||||
}
|
||||
|
||||
// Mutation returns the UserMutation object of the builder.
|
||||
func (uc *UserCreate) Mutation() *UserMutation {
|
||||
return uc.mutation
|
||||
@@ -1177,6 +1193,22 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
|
||||
}
|
||||
_spec.Edges = append(_spec.Edges, edge)
|
||||
}
|
||||
if nodes := uc.mutation.SevIDs(); len(nodes) > 0 {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.O2M,
|
||||
Inverse: false,
|
||||
Table: user.SevTable,
|
||||
Columns: []string{user.SevColumn},
|
||||
Bidi: false,
|
||||
Target: &sqlgraph.EdgeTarget{
|
||||
IDSpec: sqlgraph.NewFieldSpec(sev.FieldID, field.TypeInt),
|
||||
},
|
||||
}
|
||||
for _, k := range nodes {
|
||||
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
||||
}
|
||||
_spec.Edges = append(_spec.Edges, edge)
|
||||
}
|
||||
return _node, _spec
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user