correction des pb de space : le spaceId est maintenant dans l'url uniquement
This commit is contained in:
1 parent
c52460bac0
commit
0bb8d1cb46
41 files changed
+1463
-121
No files matched your search
@@ -3,6 +3,7 @@ package provider
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"trankilou.fr/lassistanoque/backend/internal/domain"
|
||||
)
|
||||
@@ -33,6 +34,28 @@ func (s *Service) ListProviders(userID string, teamID string) ([]*domain.Provide
|
||||
return s.repo.ListProviders(userID, teamID)
|
||||
}
|
||||
|
||||
func (s *Service) ListProvidersModels(userID string, teamID string) ([]*domain.ComplexItem, error) {
|
||||
|
||||
items := make([]*domain.ComplexItem, 0)
|
||||
|
||||
providers, err := s.repo.ListProviders(userID, teamID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, provider := range providers {
|
||||
models := strings.Split(provider.Models, "|")
|
||||
for _, m := range models {
|
||||
items = append(items, &domain.ComplexItem{
|
||||
Group: provider.Name,
|
||||
Value: provider.ID + "|" + m,
|
||||
Label: m,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return items, nil
|
||||
}
|
||||
|
||||
func (s *Service) GetProvider(userID string, teamID string, id string) (*domain.Provider, error) {
|
||||
return s.repo.GetProvider(userID, teamID, id)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user