chore: apply stashed changes

This commit is contained in:
song
2026-02-02 22:20:08 +08:00
parent 0170d19fa7
commit 3ecadf4aad
33 changed files with 997 additions and 28 deletions

View File

@@ -334,6 +334,12 @@ func (_c *GroupCreate) SetNillableMcpXMLInject(v *bool) *GroupCreate {
return _c
}
// SetSupportedModelScopes sets the "supported_model_scopes" field.
func (_c *GroupCreate) SetSupportedModelScopes(v []string) *GroupCreate {
_c.mutation.SetSupportedModelScopes(v)
return _c
}
// AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
func (_c *GroupCreate) AddAPIKeyIDs(ids ...int64) *GroupCreate {
_c.mutation.AddAPIKeyIDs(ids...)
@@ -511,6 +517,10 @@ func (_c *GroupCreate) defaults() error {
v := group.DefaultMcpXMLInject
_c.mutation.SetMcpXMLInject(v)
}
if _, ok := _c.mutation.SupportedModelScopes(); !ok {
v := group.DefaultSupportedModelScopes
_c.mutation.SetSupportedModelScopes(v)
}
return nil
}
@@ -572,6 +582,9 @@ func (_c *GroupCreate) check() error {
if _, ok := _c.mutation.McpXMLInject(); !ok {
return &ValidationError{Name: "mcp_xml_inject", err: errors.New(`ent: missing required field "Group.mcp_xml_inject"`)}
}
if _, ok := _c.mutation.SupportedModelScopes(); !ok {
return &ValidationError{Name: "supported_model_scopes", err: errors.New(`ent: missing required field "Group.supported_model_scopes"`)}
}
return nil
}
@@ -691,6 +704,10 @@ func (_c *GroupCreate) createSpec() (*Group, *sqlgraph.CreateSpec) {
_spec.SetField(group.FieldMcpXMLInject, field.TypeBool, value)
_node.McpXMLInject = value
}
if value, ok := _c.mutation.SupportedModelScopes(); ok {
_spec.SetField(group.FieldSupportedModelScopes, field.TypeJSON, value)
_node.SupportedModelScopes = value
}
if nodes := _c.mutation.APIKeysIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
@@ -1237,6 +1254,18 @@ func (u *GroupUpsert) UpdateMcpXMLInject() *GroupUpsert {
return u
}
// SetSupportedModelScopes sets the "supported_model_scopes" field.
func (u *GroupUpsert) SetSupportedModelScopes(v []string) *GroupUpsert {
u.Set(group.FieldSupportedModelScopes, v)
return u
}
// UpdateSupportedModelScopes sets the "supported_model_scopes" field to the value that was provided on create.
func (u *GroupUpsert) UpdateSupportedModelScopes() *GroupUpsert {
u.SetExcluded(group.FieldSupportedModelScopes)
return u
}
// UpdateNewValues updates the mutable fields using the new values that were set on create.
// Using this option is equivalent to using:
//
@@ -1737,6 +1766,20 @@ func (u *GroupUpsertOne) UpdateMcpXMLInject() *GroupUpsertOne {
})
}
// SetSupportedModelScopes sets the "supported_model_scopes" field.
func (u *GroupUpsertOne) SetSupportedModelScopes(v []string) *GroupUpsertOne {
return u.Update(func(s *GroupUpsert) {
s.SetSupportedModelScopes(v)
})
}
// UpdateSupportedModelScopes sets the "supported_model_scopes" field to the value that was provided on create.
func (u *GroupUpsertOne) UpdateSupportedModelScopes() *GroupUpsertOne {
return u.Update(func(s *GroupUpsert) {
s.UpdateSupportedModelScopes()
})
}
// Exec executes the query.
func (u *GroupUpsertOne) Exec(ctx context.Context) error {
if len(u.create.conflict) == 0 {
@@ -2403,6 +2446,20 @@ func (u *GroupUpsertBulk) UpdateMcpXMLInject() *GroupUpsertBulk {
})
}
// SetSupportedModelScopes sets the "supported_model_scopes" field.
func (u *GroupUpsertBulk) SetSupportedModelScopes(v []string) *GroupUpsertBulk {
return u.Update(func(s *GroupUpsert) {
s.SetSupportedModelScopes(v)
})
}
// UpdateSupportedModelScopes sets the "supported_model_scopes" field to the value that was provided on create.
func (u *GroupUpsertBulk) UpdateSupportedModelScopes() *GroupUpsertBulk {
return u.Update(func(s *GroupUpsert) {
s.UpdateSupportedModelScopes()
})
}
// Exec executes the query.
func (u *GroupUpsertBulk) Exec(ctx context.Context) error {
if u.create.err != nil {