Forráskód Böngészése

Merge branch 'feature/0913-app' into develop

Eric 1 éve
szülő
commit
4f62dcc14d

+ 4 - 0
cooleshow-api/src/main/java/com/yonge/cooleshow/api/feign/properties/OpenFeignConfigProperties.java

@@ -18,6 +18,10 @@ import java.io.Serializable;
 @Data
 public class OpenFeignConfigProperties {
 
+    @ApiModelProperty("授权服务")
+    @NestedConfigurationProperty
+    private ServerConfig authServer;
+
     @ApiModelProperty("内容管理服务")
     @NestedConfigurationProperty
     private ServerConfig cmsServer;

+ 3 - 0
cooleshow-app/src/test/resources/application.yml

@@ -9,6 +9,9 @@ app-config:
     website: api-website
     tenant: api-tenant
   open-feign:
+    auth-server:
+      name: auth-server
+      url: https://test.colexiu.com/api-auth
     admin-server:
       name: admin-server
       url: https://test.colexiu.com/api-admin

+ 3 - 3
cooleshow-auth/auth-api/src/main/java/com/yonge/cooleshow/auth/api/client/AuthTaskFeignService.java

@@ -1,12 +1,12 @@
 package com.yonge.cooleshow.auth.api.client;
 
+import com.yonge.cooleshow.auth.api.client.fallback.AuthTaskFeignServiceFallback;
 import com.yonge.toolset.feign.config.FeignConfiguration;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 
-import com.yonge.cooleshow.auth.api.client.fallback.AuthTaskFeignServiceFallback;
-
-@FeignClient(contextId = "authTaskFeignService", name = "auth-server", configuration = { FeignConfiguration.class }, fallback = AuthTaskFeignServiceFallback.class)
+@FeignClient(contextId = "authTaskFeignService", name = "${app-config.open-feign.auth-server.name:auth-server}", url = "${app-config.open-feign.auth-server.url:}",
+		configuration = { FeignConfiguration.class }, fallback = AuthTaskFeignServiceFallback.class)
 public interface AuthTaskFeignService {
 
 	/**

+ 7 - 3
cooleshow-auth/auth-api/src/main/java/com/yonge/cooleshow/auth/api/client/SysUserFeignService.java

@@ -10,12 +10,16 @@ import com.yonge.toolset.utils.idcard.IdcardInfoExtractor;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
-import java.io.IOException;
 import java.util.List;
 
-@FeignClient(contextId = "sysUserFeignService", name = "auth-server", configuration = { FeignConfiguration.class }, fallback = SysUserFeignServiceFallback.class)
+@FeignClient(contextId = "sysUserFeignService", name = "${app-config.open-feign.auth-server.name:auth-server}", url = "${app-config.open-feign.auth-server.url:}",
+		configuration = { FeignConfiguration.class }, fallback = SysUserFeignServiceFallback.class)
 public interface SysUserFeignService {
 
 	@GetMapping(value = "user/queryUserById/{userId}")