这里使用 FeignClient
@FeignClient(name ="nacos" ,url = "nacos.eos-ts.h3c.com:80") public interface NacosClient { @PostMapping(value = "nacos/v1/auth/users/login", consumes = {"application/x-www-form-urlencoded"}) String login(@RequestParam String username, @RequestParam String password); @GetMapping(value = "nacos/v1/cs/configs", consumes = {"application/x-www-form-urlencoded; charset=utf-8"}) String showConfig(@RequestParam String dataId, @RequestParam String namespaceId, @RequestParam String tenant, @RequestParam String accessToken, @RequestParam String group, @RequestParam String show); @PostMapping(value = "nacos/v1/auth/users", consumes = {"application/x-www-form-urlencoded; charset=utf-8"}) String createUser(@RequestParam String username, @RequestParam String password, @RequestParam String accessToken); @PostMapping(value = "nacos/v1/auth/roles", consumes = {"application/x-www-form-urlencoded; charset=utf-8"}) String createRole(@RequestParam String role, @RequestParam String username, @RequestParam String accessToken); @PostMapping(value = "nacos/v1/auth/permissions", consumes = {"application/x-www-form-urlencoded; charset=utf-8"}) String createSource(@RequestParam String role, @RequestParam String resource, @RequestParam String action, @RequestParam String accessToken); @PostMapping(value = "nacos/v1/console/namespaces", consumes = {"application/x-www-form-urlencoded; charset=utf-8"}) String createNamespace(@RequestParam String customNamespaceId, @RequestParam String namespaceName, @RequestParam String namespaceDesc,
@RequestParam String namespaceId,@RequestParam String accessToken); @PostMapping(value = "nacos/v1/cs/configs", consumes = {"application/json; charset=utf-8"}) String copeNamespace(@RequestParam Boolean clone, @RequestParam String policy, @RequestParam String tenant, @RequestParam String namespaceId, @RequestBody JSONArray list,
@RequestParam String accessToken); @PostMapping(value = "nacos/v1/cs/configs", consumes = {"application/x-www-form-urlencoded; charset=utf-8"}) Boolean createGroupText(@RequestParam String dataId, @RequestParam String group, @RequestParam String content, @RequestParam(value = "config_tags") String configTags,@RequestParam String desc, @RequestParam String type, @RequestParam String appName,@RequestParam String tenant,
@RequestParam String namespaceId,@RequestParam String accessToken); }
业务调用时先登录获取 token 在调用其他接口