Browse Source

重构国际化,用户模块开发修改

master
caojianbin 8 months ago
parent
commit
00af391ce6
  1. 2
      ecell-internationalize/ecell-internationalize-auth/src/main/java/com/ecell/internationalize/auth/feign/SysUserFeignClient.java
  2. 2
      ecell-internationalize/ecell-internationalize-auth/src/main/resources/application-dev.yml
  3. 24
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-security/src/main/java/com/ecell/internationalize/common/security/annotation/EnableRyFeignClients.java
  4. 6
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-security/src/main/resources/META-INF/spring.factories
  5. 12
      ecell-internationalize/ecell-internationalize-gateway/src/main/resources/application-dev.yml
  6. 23
      ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/EcellSecurityApplication.java
  7. 2
      ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/service/impl/SysMenuServiceImpl.java
  8. 4
      ecell-internationalize/ecell-internationalize-system-security/src/main/resources/application-dev.yml
  9. 6
      ecell-internationalize/ecell-internationalize-system-security/src/main/resources/bootstrap.yml

2
ecell-internationalize/ecell-internationalize-auth/src/main/java/com/ecell/internationalize/auth/feign/SysUserFeignClient.java

@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
/** /**
* @author borui * @author borui
*/ */
@FeignClient(value = "yisai-system-security",fallback = SysUserFeignServiceFallBack.class,contextId ="yisai-system-security003") @FeignClient(value = "ecell-internationalize-security",fallback = SysUserFeignServiceFallBack.class,contextId ="ecell-internationalize-security003")
public interface SysUserFeignClient { public interface SysUserFeignClient {
/** /**
* 通过用户名查询用户信息 * 通过用户名查询用户信息

2
ecell-internationalize/ecell-internationalize-auth/src/main/resources/application-dev.yml

@ -16,7 +16,7 @@ mybatis:
#配置SQL映射文件路径 #配置SQL映射文件路径
mapper-locations: classpath:mapper/*.xml mapper-locations: classpath:mapper/*.xml
# 搜索指定包别名 # 搜索指定包别名
typeAliasesPackage: com.yisai.auth typeAliasesPackage: com.ecell.internationalize.auth
#驼峰命名 #驼峰命名
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true

24
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-security/src/main/java/com/ecell/internationalize/common/security/annotation/EnableRyFeignClients.java

@ -0,0 +1,24 @@
package com.ecell.internationalize.common.security.annotation;
import org.springframework.cloud.openfeign.EnableFeignClients;
import java.lang.annotation.*;
/**
* @author borui
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@EnableFeignClients
public @interface EnableRyFeignClients {
String[] value() default {};
String[] basePackages() default {"com.ecell.internationalize"};
Class<?>[] basePackageClasses() default {};
Class<?>[] defaultConfiguration() default {};
Class<?>[] clients() default {};
}

6
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-security/src/main/resources/META-INF/spring.factories

@ -0,0 +1,6 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.ecell.internationalize.common.security.config.WebMvcConfig,\
com.ecell.internationalize.common.security.service.TokenService,\
com.ecell.internationalize.common.security.aspect.PreAuthorizeAspect,\
com.ecell.internationalize.common.security.aspect.InnerAuthAspect,\
com.ecell.internationalize.common.security.handler.GlobalExceptionHandler

12
ecell-internationalize/ecell-internationalize-gateway/src/main/resources/application-dev.yml

@ -15,7 +15,7 @@ spring:
- id: ecell-internationalize-auth - id: ecell-internationalize-auth
uri: lb://ecell-internationalize-auth uri: lb://ecell-internationalize-auth
predicates: predicates:
- Path=/auth/** - Path=/ecell-internationalize-auth/**
filters: filters:
# 验证码处理 # 验证码处理
- CacheRequestFilter - CacheRequestFilter
@ -30,10 +30,10 @@ spring:
- StripPrefix=1 - StripPrefix=1
#易赛授权服务 #易赛授权服务
- id: yisai-system-security - id: ecell-internationalize-security
uri: lb://yisai-system-security uri: lb://ecell-internationalize-security
predicates: predicates:
- Path=/yisai_security/** - Path=/ecell-internationalize-security/**
filters: filters:
- StripPrefix=1 - StripPrefix=1
#易赛APP服务 #易赛APP服务
@ -59,8 +59,8 @@ security:
# 不校验白名单 # 不校验白名单
ignore: ignore:
whites: whites:
- /auth/logout - /ecell-internationalize-auth/auth/logout
- /auth/login - /ecell-internationalize-auth/auth/login
- /auth/register - /auth/register
- /*/v2/api-docs - /*/v2/api-docs
- /csrf - /csrf

23
ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/EcellSecurityApplication.java

@ -0,0 +1,23 @@
package com.ecell.internationalize.system.security;
import com.ecell.internationalize.common.security.annotation.EnableCustomConfig;
import com.ecell.internationalize.common.security.annotation.EnableRyFeignClients;
import com.ecell.internationalize.common.swagger.annotation.EnableCustomSwagger2;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author borui
*/
@EnableCustomConfig
@EnableCustomSwagger2
@EnableRyFeignClients
@MapperScan("com.**.mapper")
@SpringBootApplication(scanBasePackages = {"com.ecell.internationalize"})
public class EcellSecurityApplication {
public static void main(String[] args) {
SpringApplication.run(EcellSecurityApplication.class, args);
System.out.println("系统用户服务启动成功");
}
}

2
ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/service/impl/SysMenuServiceImpl.java

@ -10,12 +10,14 @@ import com.ecell.internationalize.system.security.mapper.SysMenuMapper;
import com.ecell.internationalize.system.security.service.SysMenuService; import com.ecell.internationalize.system.security.service.SysMenuService;
import com.ecell.internationalize.system.security.util.TreeUtil; import com.ecell.internationalize.system.security.util.TreeUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
/** /**
* @author borui * @author borui
*/ */
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService { public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
@Autowired @Autowired
private SysMenuMapper sysMenuMapper; private SysMenuMapper sysMenuMapper;

4
ecell-internationalize/ecell-internationalize-system-security/src/main/resources/application-dev.yml

@ -5,7 +5,7 @@ spring:
encoding: UTF-8 encoding: UTF-8
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.108:3306/ys-business?serverTimeZone=UTC url: jdbc:mysql://192.168.0.113:3306/ys-business?serverTimeZone=UTC
username: root username: root
password: 123456 password: 123456
#数据源的其他配置 #数据源的其他配置
@ -35,7 +35,7 @@ mybatis:
#配置SQL映射文件路径 #配置SQL映射文件路径
mapper-locations: classpath:mapper/*.xml mapper-locations: classpath:mapper/*.xml
# 搜索指定包别名 # 搜索指定包别名
typeAliasesPackage: com.yisai.system.security typeAliasesPackage: com.ecell.internationalize.system.security
#驼峰命名 #驼峰命名
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true

6
ecell-internationalize/ecell-internationalize-system-security/src/main/resources/bootstrap.yml

@ -6,7 +6,7 @@ server:
spring: spring:
application: application:
# 应用名称 # 应用名称
name: yisai-system-security name: ecell-internationalize-security
profiles: profiles:
# 环境配置 # 环境配置
active: dev active: dev
@ -14,10 +14,10 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: ecell-nacos:8848 server-addr: 127.0.0.1:8848
config: config:
# 配置中心地址 # 配置中心地址
server-addr: ecell-nacos:8848 server-addr: 127.0.0.1:8848
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

Loading…
Cancel
Save