finish data mask strategy

This commit is contained in:
Liujian
2024-11-26 23:44:00 +08:00
parent 651a1de601
commit cb63931f30
36 changed files with 1557 additions and 265 deletions
+24
View File
@@ -41,6 +41,30 @@ type imlAPIService struct {
universally.IServiceDelete
}
func (i *imlAPIService) ListForServices(ctx context.Context, serviceIds ...string) ([]*API, error) {
w := map[string]interface{}{}
if len(serviceIds) > 0 {
w["service"] = serviceIds
}
list, err := i.store.List(ctx, w)
if err != nil {
return nil, err
}
return utils.SliceToSlice(list, FromEntity), nil
}
func (i *imlAPIService) ListInfoForServices(ctx context.Context, serviceIds ...string) ([]*Info, error) {
w := map[string]interface{}{}
if len(serviceIds) > 0 {
w["service"] = serviceIds
}
list, err := i.apiInfoStore.List(ctx, w)
if err != nil {
return nil, err
}
return utils.SliceToSlice(list, FromEntityInfo), nil
}
func (i *imlAPIService) ListLatestCommitRequest(ctx context.Context, aid ...string) ([]*commit.Commit[Request], error) {
return i.requestCommitService.ListLatest(ctx, aid...)
}
+2
View File
@@ -17,9 +17,11 @@ type IAPIService interface {
CountMapByService(ctx context.Context, service ...string) (map[string]int64, error)
Exist(ctx context.Context, aid string, api *Exist) error
ListForService(ctx context.Context, serviceId string) ([]*API, error)
ListForServices(ctx context.Context, serviceIds ...string) ([]*API, error)
GetInfo(ctx context.Context, aid string) (*Info, error)
ListInfo(ctx context.Context, aids ...string) ([]*Info, error)
ListInfoForService(ctx context.Context, serviceId string) ([]*Info, error)
ListInfoForServices(ctx context.Context, serviceIds ...string) ([]*Info, error)
ListLatestCommitProxy(ctx context.Context, aid ...string) ([]*commit.Commit[Proxy], error)
LatestProxy(ctx context.Context, aid string) (*commit.Commit[Proxy], error)