This commit is contained in:
nkorange 2020-02-05 14:02:15 +08:00
parent fb3e176ccd
commit e0f9398e91

View File

@ -34,6 +34,7 @@ import com.alibaba.nacos.naming.pojo.ClusterInfo;
import com.alibaba.nacos.naming.pojo.IpAddressInfo;
import com.alibaba.nacos.naming.pojo.ServiceDetailInfo;
import com.alibaba.nacos.naming.pojo.ServiceView;
import com.alibaba.nacos.naming.web.NamingResourceParser;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -55,7 +56,7 @@ public class CatalogController {
@Autowired
protected ServiceManager serviceManager;
@Secured(action = ActionTypes.READ)
@Secured(parser = NamingResourceParser.class, action = ActionTypes.READ)
@GetMapping("/service")
public JSONObject serviceDetail(@RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId,
String serviceName) throws NacosException {
@ -96,7 +97,7 @@ public class CatalogController {
return detailView;
}
@Secured(action = ActionTypes.READ)
@Secured(parser = NamingResourceParser.class, action = ActionTypes.READ)
@RequestMapping(value = "/instances")
public JSONObject instanceList(@RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId,
@RequestParam String serviceName,
@ -138,7 +139,7 @@ public class CatalogController {
return result;
}
@Secured(resource = "naming/services", action = ActionTypes.READ)
@Secured(parser = NamingResourceParser.class, action = ActionTypes.READ)
@GetMapping("/services")
public Object listDetail(@RequestParam(required = false) boolean withInstances,
@RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId,