MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / CheckNameDuplicate

Method CheckNameDuplicate

service/ai-model/iml.go:71–82  ·  view source on GitHub ↗
(ctx context.Context, provider string, name string, excludeId string)

Source from the content-addressed store, hash-verified

69}
70
71func (i *imlProviderModelService) CheckNameDuplicate(ctx context.Context, provider string, name string, excludeId string) bool {
72 v, _ := i.store.First(ctx, map[string]interface{}{"provider": provider, "name": name})
73 if v == nil {
74 return false
75 } else {
76 if excludeId == "" {
77 return true
78 } else {
79 return v.UUID != excludeId
80 }
81 }
82}
83
84func (i *imlProviderModelService) OnComplete() {
85 i.IServiceGet = universally.NewGet[ProviderModel, ai.ProviderModel](i.store, FromEntity)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected