mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
fix: prevent duplicate model names
This commit is contained in:
@@ -72,10 +72,13 @@ func (i *imlProviderModelService) CheckNameDuplicate(ctx context.Context, provid
|
||||
v, _ := i.store.First(ctx, map[string]interface{}{"provider": provider, "name": name})
|
||||
if v == nil {
|
||||
return false
|
||||
} else if excludeId != "" && v.UUID != excludeId {
|
||||
return true
|
||||
} else {
|
||||
if excludeId == "" {
|
||||
return true
|
||||
} else {
|
||||
return v.UUID != excludeId
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (i *imlProviderModelService) OnComplete() {
|
||||
|
||||
Reference in New Issue
Block a user