瀏覽代碼

新增电信城管相关配置

pull/106/head
xiaoying 1 年之前
父節點
當前提交
95b65f035d
共有 8 個檔案被更改,包括 56 行新增3 行删除
  1. +9
    -0
      src/main/java/com/tuoheng/gateway/commons/CommonsConfig.java
  2. +1
    -0
      src/main/java/com/tuoheng/gateway/config/WebSecurityConfig.java
  3. +6
    -0
      src/main/java/com/tuoheng/gateway/constants/AuthorityConstant.java
  4. +3
    -0
      src/main/java/com/tuoheng/gateway/constants/PermitPathConstant.java
  5. +8
    -0
      src/main/java/com/tuoheng/gateway/utils/GatewayUrlPathUtil.java
  6. +9
    -1
      src/main/resources/application-dev.yml
  7. +11
    -1
      src/main/resources/application-prod.yml
  8. +9
    -1
      src/main/resources/application-test.yml

+ 9
- 0
src/main/java/com/tuoheng/gateway/commons/CommonsConfig.java 查看文件

@@ -37,6 +37,10 @@ public class CommonsConfig {
* 大气权限接口地址
*/
public static String airmonitorPermissionUrl;
/**
* 电信城管权限接口地址
*/
public static String telecomumalePermissionUrl;


@Value("${tuoheng.hhz-admin-perUrl}")
@@ -64,4 +68,9 @@ public class CommonsConfig {
airmonitorPermissionUrl = url;
}

@Value("${tuoheng.telecomumale-admin-perUrl}")
public void setTelecomumalePermissionUrl(String url) {
telecomumalePermissionUrl = url;
}

}

+ 1
- 0
src/main/java/com/tuoheng/gateway/config/WebSecurityConfig.java 查看文件

@@ -82,6 +82,7 @@ public class WebSecurityConfig {
.pathMatchers("/oidc/admin/tenant/**", "/oidc/admin/client/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_OIDC_ADMIN)
.pathMatchers("/waterway/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_WATERWAY_ADMIN)
.pathMatchers("/waterway/miniprogram/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_WATERWAY_MP)
.pathMatchers("/telecomumale/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_TELECOMUMALE_ADMIN)
.pathMatchers("/weptsp/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_WEPTSP_ADMIN)
.pathMatchers("/airmonitor/admin/**").hasAnyAuthority(AuthorityConstant.SCOPE_ADMIN, AuthorityConstant.SCOPE_TUOHNEG_AIRMONITOR_ADMIN)
.pathMatchers("/oidc/admin/user/**").authenticated()

+ 6
- 0
src/main/java/com/tuoheng/gateway/constants/AuthorityConstant.java 查看文件

@@ -58,4 +58,10 @@ public class AuthorityConstant {
*/
public static final String SCOPE_TUOHNEG_AIRMONITOR_ADMIN = "SCOPE_tuoheng-airmonitor-admin";
//public static final String SCOPE_TUOHNEG_AIRPORT_MP= "SCOPE_tuoheng-weptsp-mp";

/**
* Telecomumale 用户权限
*/
public static final String SCOPE_TUOHNEG_TELECOMUMALE_ADMIN = "SCOPE_tuoheng-telecomumale-admin";
//public static final String SCOPE_TUOHNEG_AIRPORT_MP= "SCOPE_tuoheng-weptsp-mp";
}

+ 3
- 0
src/main/java/com/tuoheng/gateway/constants/PermitPathConstant.java 查看文件

@@ -69,6 +69,9 @@ public class PermitPathConstant {

public static String weptspPermitUrlStr[] = {
"/weptsp/admin/download/workStreamExcel/**",
"/weptsp/admin/inspection/uploadFlightUrl/**",
"/weptsp/admin/inspection/updateTaskByCode/**",
"/weptsp/admin/dsp/callback/**"
};

public static String airmonitorPermitUrlStr[] = {

+ 8
- 0
src/main/java/com/tuoheng/gateway/utils/GatewayUrlPathUtil.java 查看文件

@@ -40,6 +40,8 @@ public class GatewayUrlPathUtil {

private static final String AIRMONITOR_ADMIN = "tuoheng-airmonitor-admin";

private static final String TELECOMUMALE_ADMIN = "tuoheng-telecomumale-admin";

/**
* 获取 gateway 路由前缀,匹配url
*
@@ -73,6 +75,9 @@ public class GatewayUrlPathUtil {
case AIRMONITOR_ADMIN:
apiPath = "/airmonitor/admin";
break;
case TELECOMUMALE_ADMIN:
apiPath = "/telecomumale/admin";
break;
default:
break;
}
@@ -103,6 +108,9 @@ public class GatewayUrlPathUtil {
if (clientId.equals(AIRMONITOR_ADMIN)) {
url = CommonsConfig.airmonitorPermissionUrl;
}
if (clientId.equals(TELECOMUMALE_ADMIN)) {
url = CommonsConfig.telecomumalePermissionUrl;
}
log.info("getRoleIdByApiUrlPermission -url:{},token:{}", url, token);
if (StringUtils.isNotBlank(url)) {
HttpHeaders resultRequestHeader = new HttpHeaders();

+ 9
- 1
src/main/resources/application-dev.yml 查看文件

@@ -231,6 +231,13 @@ spring:
- Path=/airport/admin/**
filters:
- StripPrefix=2
# 电信城管admin服务
- id: tuoheng-telecomumale-admin
uri: lb://tuoheng-telecomumale-admin
predicates:
- Path=/telecomumale/admin/**
filters:
- StripPrefix=2
# Redis数据源
redis:
# 缓存库默认索引0
@@ -263,4 +270,5 @@ tuoheng:
freeway-admin-perUrl: http://192.168.11.11:9117/permission/getRoleIdList
waterway-admin-perUrl: http://192.168.11.11:9120/permission/getRoleIdList
weptsp-admin-perUrl: http://192.168.11.11:9140/permission/getRoleIdList
airmonitor-admin-perUrl: http://192.168.11.11:9130/permission/getRoleIdList
airmonitor-admin-perUrl: http://192.168.11.11:9130/permission/getRoleIdList
telecomumale-admin-perUrl: http://192.168.11.11:9150/permission/getRoleIdList

+ 11
- 1
src/main/resources/application-prod.yml 查看文件

@@ -209,6 +209,13 @@ spring:
- Path=/airport/admin/**
filters:
- StripPrefix=2
# 电信城管admin服务
- id: tuoheng-telecomumale-admin
uri: lb://tuoheng-telecomumale-admin
predicates:
- Path=/telecomumale/admin/**
filters:
- StripPrefix=2
# Redis数据源
redis:
# 缓存库默认索引0
@@ -239,4 +246,7 @@ security:
tuoheng:
hhz-admin-perUrl: https://hhz.t-aaron.com/permission/getRoleIdList
freeway-admin-perUrl: https://freeway.t-aaron.com/permission/getRoleIdList
waterway-admin-perUrl: https://waterway.t-aaron.com/permission/getRoleIdList
waterway-admin-perUrl: https://waterway.t-aaron.com/permission/getRoleIdList
airmonitor-admin-perUrl: https://airmonitor.t-aaron.com/permission/getRoleIdList
weptsp-admin-perUrl: https://weptsp.t-aaron.com/permission/getRoleIdList
telecomumale-admin-perUrl: https://telecomumale.t-aaron.com/permission/getRoleIdList

+ 9
- 1
src/main/resources/application-test.yml 查看文件

@@ -224,6 +224,13 @@ spring:
- Path=/airport/admin/**
filters:
- StripPrefix=2
# 电信城管admin服务
- id: tuoheng-telecomumale-admin
uri: lb://tuoheng-telecomumale-admin
predicates:
- Path=/telecomumale/admin/**
filters:
- StripPrefix=2
# Redis数据源
redis:
# 缓存库默认索引0
@@ -256,4 +263,5 @@ tuoheng:
freeway-admin-perUrl: https://freeway-test.t-aaron.com/permission/getRoleIdList
waterway-admin-perUrl: https://waterway-test.t-aaron.com/permission/getRoleIdList
weptsp-admin-perUrl: https://weptsp-test.t-aaron.com/permission/getRoleIdList
airmonitor-admin-perUrl: https://airmonitor-test.t-aaron.com/permission/getRoleIdList
airmonitor-admin-perUrl: https://airmonitor-test.t-aaron.com/permission/getRoleIdList
telecomumale-admin-perUrl: https://telecomumale-test.t-aaron.com/permission/getRoleIdList

Loading…
取消
儲存