Compare commits

..

5 Commits

Author SHA1 Message Date
Dot.L 9c4590db07 Merge pull request #297 from APIParkLab/feature/1.7-liujian
Fix: Apikey getting md5 when calling MCP Server at service level
2025-04-22 18:08:51 +08:00
Liujian 7ba8a57793 Fix: Apikey getting md5 when calling MCP Server at service level 2025-04-22 18:08:24 +08:00
Dot.L 2dc16f4bb8 Merge pull request #295 from APIParkLab/feature/1.7-liujian
Fix: Issue where API portal's service list fails to retrieve when Influxdb is not initialized
2025-04-17 16:20:42 +08:00
Liujian b68496a82a Fix: Issue where API portal's service list fails to retrieve when Influxdb is not initialized 2025-04-17 16:20:17 +08:00
Liujian c7c3e8033b Merge remote-tracking branch 'github-pro/main' into feature/1.7-liujian 2025-04-16 15:38:08 +08:00
5 changed files with 18 additions and 4 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ func (t *Tool) RegisterMCP(s *server.MCPServer) {
}
apikey := utils.Label(ctx, "apikey")
if apikey != "" {
req.Header.Set("Authorization", utils.Md5(apikey))
req.Header.Set("Authorization", apikey)
}
resp, err := client.Do(req)
+2 -1
View File
@@ -718,7 +718,8 @@ func (i *imlProviderModule) getAiProviders(ctx context.Context) ([]*gateway.Dyna
}
model, has := driver.GetModel(l.DefaultLLM)
if !has {
return nil, fmt.Errorf("model not found: %s", l.DefaultLLM)
continue
//return nil, fmt.Errorf("model not found: %s", l.DefaultLLM)
}
cfg := make(map[string]interface{})
cfg["provider"] = l.Id
+3 -1
View File
@@ -200,11 +200,13 @@ func (i *imlAuthorizationModule) initGateway(ctx context.Context, partitionId st
}
func (i *imlAuthorizationModule) online(ctx context.Context, s *service.Service) error {
clusters, err := i.clusterService.List(ctx)
if err != nil {
return err
}
if len(clusters) < 1 {
return nil
}
authorizations, err := i.authorizationService.ListByApp(ctx, s.Id)
if err != nil {
return err
+9 -1
View File
@@ -181,8 +181,16 @@ func (i *imlCatalogueModule) genCommonWheres(ctx context.Context, clusterIds ...
}
func (i *imlCatalogueModule) ProviderStatistics(ctx context.Context, start, end time.Time, serviceIds ...string) (map[string]int64, error) {
// 判断是否配置influxdb
clusterId := cluster.DefaultClusterID
_, err := i.clusterService.Get(ctx, clusterId)
_, err := i.monitorService.Get(ctx, clusterId)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return make(map[string]int64), nil
}
return nil, err
}
_, err = i.clusterService.Get(ctx, clusterId)
if err != nil {
return nil, err
}
+3
View File
@@ -8,6 +8,7 @@ import (
"io"
"net/http"
"net/url"
"strconv"
"strings"
"time"
@@ -268,6 +269,8 @@ func (i *imlMcpModule) Invoke(ctx context.Context, req mcp.CallToolRequest) (*mc
for _, value := range v {
queryParam.Add(k, value)
}
case float64:
queryParam.Add(k, strconv.FormatFloat(v, 'f', -1, 64))
default:
return nil, fmt.Errorf("invalid query param type: %T", v)
}