add seven
This commit is contained in:
@ -44,6 +44,18 @@ func (f MaFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.MaMutation", m)
|
||||
}
|
||||
|
||||
// The SevFunc type is an adapter to allow the use of ordinary
|
||||
// function as Sev mutator.
|
||||
type SevFunc func(context.Context, *ent.SevMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f SevFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.SevMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.SevMutation", m)
|
||||
}
|
||||
|
||||
// The UeFunc type is an adapter to allow the use of ordinary
|
||||
// function as Ue mutator.
|
||||
type UeFunc func(context.Context, *ent.UeMutation) (ent.Value, error)
|
||||
|
Reference in New Issue
Block a user