xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.customer
customer
0.0.1-SNAPSHOT
jar
customer
customer project for Spring Boot
org.springframework.boot
spring-boot-starter-parent
1.5.6.RELEASE
UTF-8
UTF-8
1.8
Camden.SR6
com.server
beans
1.0-SNAPSHOT
org.springframework.cloud
spring-cloud-starter-config
org.springframework.boot
spring-boot-starter-security
org.springframework.cloud
spring-cloud-starter-eureka
org.springframework.boot
spring-boot-starter-websocket
org.springframework.boot
spring-boot-devtools
true
org.springframework.cloud
spring-cloud-starter-feign
org.springframework.boot
spring-boot-starter-actuator
org.springframework.cloud
spring-cloud-starter-eureka-server
org.springframework.boot
spring-boot-starter-test
test
mysql
mysql-connector-java
8.0.11
org.springframework.boot
spring-boot-starter-data-jpa
org.springframework.cloud
spring-cloud-dependencies
${spring-cloud.version}
pom
import
org.springframework.boot
spring-boot-maven-plugin
启动类
@SpringBootApplication
@EnableEurekaClient
@EnableDiscoveryClient
@EnableFeignClients
public class CustomerApplication {
public static void main(String[] args) {
SpringApplication.run(CustomerApplication.class, args);
}
}
使用权限管理系统服务类
@FeignClient(value = "AUS")
public interface AuthorityServer {
@RequestMapping(value = "/auth/login",method = RequestMethod.POST)
String loginAuthentication(@RequestBody UserEntity user);
@RequestMapping(value = "/auth/token",method = RequestMethod.GET)
String getResourceAuthentication(@RequestParam(value = ParameterNames.ACCESS_TOKEN) String token);
@RequestMapping(value = "/auth/sign",method = RequestMethod.POST)
String userSignIn(@RequestBody UserEntity user);
@RequestMapping(value = "/auth/update",method = RequestMethod.POST)
String userUpdate(@RequestBody UserEntity user);
@RequestMapping(value = "/api/verify",method = RequestMethod.GET)
String getResourcePermissions(@RequestParam(value = ParameterNames.ACCESS_TOKEN)String token,@RequestParam(ParameterNames.CODE) String app,@RequestParam(ParameterNames.PATH) String path);
}
》》例子:
"使用该类直接调方法传参就可以了"
@Autowired
private AuthorityServer authorityServer;
authorityServer.loginAuthentication(bean);