mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-08 03:00:26 +08:00
允许用户调用获取缓存策略信息API
This commit is contained in:
@@ -187,7 +187,7 @@ func (this *HTTPCachePolicyService) FindEnabledHTTPCachePolicyConfig(ctx context
|
|||||||
|
|
||||||
// FindEnabledHTTPCachePolicy 查找单个缓存策略信息
|
// FindEnabledHTTPCachePolicy 查找单个缓存策略信息
|
||||||
func (this *HTTPCachePolicyService) FindEnabledHTTPCachePolicy(ctx context.Context, req *pb.FindEnabledHTTPCachePolicyRequest) (*pb.FindEnabledHTTPCachePolicyResponse, error) {
|
func (this *HTTPCachePolicyService) FindEnabledHTTPCachePolicy(ctx context.Context, req *pb.FindEnabledHTTPCachePolicyRequest) (*pb.FindEnabledHTTPCachePolicyResponse, error) {
|
||||||
_, err := this.ValidateAdmin(ctx)
|
_, _, err := this.ValidateAdminAndUser(ctx, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -202,9 +202,10 @@ func (this *HTTPCachePolicyService) FindEnabledHTTPCachePolicy(ctx context.Conte
|
|||||||
return &pb.FindEnabledHTTPCachePolicyResponse{HttpCachePolicy: nil}, nil
|
return &pb.FindEnabledHTTPCachePolicyResponse{HttpCachePolicy: nil}, nil
|
||||||
}
|
}
|
||||||
return &pb.FindEnabledHTTPCachePolicyResponse{HttpCachePolicy: &pb.HTTPCachePolicy{
|
return &pb.FindEnabledHTTPCachePolicyResponse{HttpCachePolicy: &pb.HTTPCachePolicy{
|
||||||
Id: int64(policy.Id),
|
Id: int64(policy.Id),
|
||||||
Name: policy.Name,
|
Name: policy.Name,
|
||||||
IsOn: policy.IsOn,
|
IsOn: policy.IsOn,
|
||||||
|
MaxBytesJSON: policy.MaxSize,
|
||||||
}}, nil
|
}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user