mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-04 10:13:53 +08:00
fix strategy bug
This commit is contained in:
@@ -119,6 +119,9 @@ func (m *imlServiceDiff) DiffForLatest(ctx context.Context, serviceId string, ba
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
if len(apis) < 1 {
|
||||
return nil, false, fmt.Errorf("api not found")
|
||||
}
|
||||
|
||||
apiIds := utils.SliceToSlice(apis, func(i *api.API) string {
|
||||
return i.UUID
|
||||
|
||||
@@ -27,7 +27,7 @@ func (i *imlAppFilter) Name() string {
|
||||
}
|
||||
|
||||
func (i *imlAppFilter) Title() string {
|
||||
return "消费者"
|
||||
return "consumer"
|
||||
}
|
||||
|
||||
func (i *imlAppFilter) Labels(values ...string) []string {
|
||||
@@ -36,7 +36,7 @@ func (i *imlAppFilter) Labels(values ...string) []string {
|
||||
}
|
||||
if values[0] == strategy_filter.ValuesALL {
|
||||
return []string{
|
||||
"全部消费者",
|
||||
"all consumer",
|
||||
}
|
||||
}
|
||||
apps, err := i.service.AppList(context.Background(), values...)
|
||||
|
||||
@@ -226,9 +226,6 @@ func (i *imlStrategyModule) Publish(ctx context.Context, driver string, scope st
|
||||
}
|
||||
}
|
||||
|
||||
if l.IsStop {
|
||||
continue
|
||||
}
|
||||
// TODO:同步到网关
|
||||
err = i.strategyService.CommitStrategy(txCtx, scope, target, l.Id, l)
|
||||
if err != nil {
|
||||
|
||||
@@ -21,6 +21,7 @@ func (p *plugin) strategyApis() []pm3.Api {
|
||||
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/strategy/service/:driver/list", []string{"context", "query:keyword", "query:service", "rest:driver", "query:page", "query:page_size", "query:order", "query:sort", "query:filters"}, []string{"list", "total"}, p.strategyController.ServiceStrategyList),
|
||||
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/strategy/service/:driver", []string{"context", "query:strategy"}, []string{"strategy"}, p.strategyController.GetStrategy),
|
||||
pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/strategy/service/:driver", []string{"context", "query:service", "rest:driver", "body"}, nil, p.strategyController.CreateServiceStrategy),
|
||||
pm3.CreateApiWidthDoc(http.MethodPut, "/api/v1/strategy/service/:driver", []string{"context", "query:strategy", "body"}, nil, p.strategyController.EditStrategy),
|
||||
pm3.CreateApiWidthDoc(http.MethodPatch, "/api/v1/strategy/service/:driver/enable", []string{"context", "query:strategy"}, nil, p.strategyController.EnableStrategy),
|
||||
pm3.CreateApiWidthDoc(http.MethodPatch, "/api/v1/strategy/service/:driver/disable", []string{"context", "query:strategy"}, nil, p.strategyController.DisableStrategy),
|
||||
pm3.CreateApiWidthDoc(http.MethodDelete, "/api/v1/strategy/service/:driver", []string{"context", "query:service", "query:strategy"}, nil, p.strategyController.DeleteServiceStrategy),
|
||||
|
||||
Reference in New Issue
Block a user