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; @@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
/**
* @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 {
/**
* 通过用户名查询用户信息

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

@ -16,7 +16,7 @@ mybatis: @@ -16,7 +16,7 @@ mybatis:
#配置SQL映射文件路径
mapper-locations: classpath:mapper/*.xml
# 搜索指定包别名
typeAliasesPackage: com.yisai.auth
typeAliasesPackage: com.ecell.internationalize.auth
#驼峰命名
configuration:
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 @@ @@ -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 @@ @@ -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: @@ -15,7 +15,7 @@ spring:
- id: ecell-internationalize-auth
uri: lb://ecell-internationalize-auth
predicates:
- Path=/auth/**
- Path=/ecell-internationalize-auth/**
filters:
# 验证码处理
- CacheRequestFilter
@ -30,10 +30,10 @@ spring: @@ -30,10 +30,10 @@ spring:
- StripPrefix=1
#易赛授权服务
- id: yisai-system-security
uri: lb://yisai-system-security
- id: ecell-internationalize-security
uri: lb://ecell-internationalize-security
predicates:
- Path=/yisai_security/**
- Path=/ecell-internationalize-security/**
filters:
- StripPrefix=1
#易赛APP服务
@ -59,8 +59,8 @@ security: @@ -59,8 +59,8 @@ security:
# 不校验白名单
ignore:
whites:
- /auth/logout
- /auth/login
- /ecell-internationalize-auth/auth/logout
- /ecell-internationalize-auth/auth/login
- /auth/register
- /*/v2/api-docs
- /csrf

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

@ -0,0 +1,23 @@ @@ -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; @@ -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.util.TreeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @author borui
*/
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
@Autowired
private SysMenuMapper sysMenuMapper;

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

@ -5,7 +5,7 @@ spring: @@ -5,7 +5,7 @@ spring:
encoding: UTF-8
datasource:
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
password: 123456
#数据源的其他配置
@ -35,7 +35,7 @@ mybatis: @@ -35,7 +35,7 @@ mybatis:
#配置SQL映射文件路径
mapper-locations: classpath:mapper/*.xml
# 搜索指定包别名
typeAliasesPackage: com.yisai.system.security
typeAliasesPackage: com.ecell.internationalize.system.security
#驼峰命名
configuration:
map-underscore-to-camel-case: true

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

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

Loading…
Cancel
Save