Browse Source

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

master
caojianbin 8 months ago
parent
commit
b13c66a7db
  1. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/constant/ExceptionResultConstant.java
  2. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/constant/FieldConstant.java
  3. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/ChatOssDto.java
  4. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/CheckVersionUpload.java
  5. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/DeviceOwnerInfoApp.java
  6. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/HeartTemperatureConfig.java
  7. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/HeartTemperatureRecord.java
  8. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/ImeiFamilyInfo.java
  9. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/ImeiSosInfo.java
  10. 2
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/utlis/AesUtil.java
  11. 8
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/utlis/HttpUtil.java
  12. 8
      ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/utlis/HttpUtil.java
  13. 27
      ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/config/ExceptionAdviceConfig.java
  14. 24
      ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/entity/FirmManageVO.java
  15. 37
      ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/entity/MenuTree.java
  16. 34
      ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/fallback/FirmManageFeignServiceFallBack.java
  17. 38
      ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/feign/FirmManageFeignClient.java
  18. 68
      ecell-internationalize/ecell-internationalize-system-security/src/main/resources/application-dev.yml
  19. 25
      ecell-internationalize/ecell-internationalize-system-security/src/main/resources/bootstrap.yml

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/constant/ExceptionResultConstant.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/constant/ExceptionResultConstant.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.constant;
package com.ecell.internationalize.common.system.constant;
import java.util.HashMap;
import java.util.Map;

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/constant/FieldConstant.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/constant/FieldConstant.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.constant;
package com.ecell.internationalize.common.system.constant;
import java.util.HashMap;
import java.util.Map;

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/entity/ChatOssDto.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/ChatOssDto.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.entity;
package com.ecell.internationalize.common.system.entity;
import lombok.Data;

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/entity/CheckVersionUpload.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/CheckVersionUpload.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.entity;
package com.ecell.internationalize.common.system.entity;
import lombok.Data;

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/entity/DeviceOwnerInfoApp.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/DeviceOwnerInfoApp.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.entity;
package com.ecell.internationalize.common.system.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/entity/HeartTemperatureConfig.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/HeartTemperatureConfig.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.entity;
package com.ecell.internationalize.common.system.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/entity/HeartTemperatureRecord.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/HeartTemperatureRecord.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.entity;
package com.ecell.internationalize.common.system.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/entity/ImeiFamilyInfo.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/ImeiFamilyInfo.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.entity;
package com.ecell.internationalize.common.system.entity;
import com.ecell.internationalize.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/entity/ImeiSosInfo.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/entity/ImeiSosInfo.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.entity;
package com.ecell.internationalize.common.system.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;

2
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/utlis/AesUtil.java → ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/utlis/AesUtil.java

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package com.ecell.internationalize.common.sysytem.utlis;
package com.ecell.internationalize.common.system.utlis;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.slf4j.Logger;

8
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/system/utlis/HttpUtil.java

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
package com.ecell.internationalize.common.system.utlis;
/**
* @author borui
*/
public class HttpUtil {
}

8
ecell-internationalize/ecell-internationalize-common/ecell-internationalize-common-system/src/main/java/com/ecell/internationalize/common/sysytem/utlis/HttpUtil.java

@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
package com.ecell.internationalize.common.sysytem.utlis;
/**
* @author borui
*/
public class HttpUtil {
}

27
ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/config/ExceptionAdviceConfig.java

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
package com.ecell.internationalize.system.security.config;
import com.ecell.internationalize.common.core.utils.locale.LocaleUtil;
import com.ecell.internationalize.common.core.web.domain.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
* @author borui
*/
@RestControllerAdvice
public class ExceptionAdviceConfig {
private static final Logger logger = LoggerFactory.getLogger(ExceptionAdviceConfig.class);
/**
* 全局异常处理,配置国际化
* @Author: liy
* @Date: 2022/7/8 13:53
*/
@ExceptionHandler(Exception.class)
public AjaxResult exceptionHandler(Exception e) {
e.printStackTrace();
logger.error("异常错误信息:{}",e.getCause().getMessage());
return AjaxResult.error(LocaleUtil.getMessage("messages.error"));
}
}

24
ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/entity/FirmManageVO.java

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
package com.ecell.internationalize.system.security.entity;
import lombok.Data;
/**
* @author borui
*/
@Data
public class FirmManageVO {
private static final long serialVersionUID = 1L;
/**
* 厂商Id
*/
private String firmId;
/**
* 厂商名称
*/
private String firmName;
/**
* 账号状态 0:禁用 1启用
*/
private String status;
}

37
ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/entity/MenuTree.java

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
package com.ecell.internationalize.system.security.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* @author borui
*/
@Data
@ApiModel(value = "权限树")
@EqualsAndHashCode(callSuper = true)
public class MenuTree extends TreeNode implements Serializable {
/**
* 菜单名称
*/
@ApiModelProperty(value = "菜单名称")
private String menuName;
/**
* 路由
*/
@ApiModelProperty(value = "路由")
private String path;
public MenuTree() {
}
public MenuTree(MenuVO menuVO) {
this.menuId = menuVO.getMenuId();
this.parentId = menuVO.getParentId();
this.menuName = menuVO.getMenuName();
this.path=menuVO.getPath();
}
}

34
ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/fallback/FirmManageFeignServiceFallBack.java

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
package com.ecell.internationalize.system.security.fallback;
import com.ecell.internationalize.common.core.exception.ServiceException;
import com.ecell.internationalize.common.core.utils.locale.LocaleUtil;
import com.ecell.internationalize.common.core.web.domain.AjaxResult;
import com.ecell.internationalize.common.system.constant.FieldConstant;
import com.ecell.internationalize.system.security.entity.FirmManageVO;
import com.ecell.internationalize.system.security.feign.FirmManageFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 服务熔断降级
* @Title: FirmManageFeignClient
* @Author: liy
* @Date: 2022/7/18 15:09
*/
@Component
public class FirmManageFeignServiceFallBack implements FirmManageFeignClient {
@Override
public AjaxResult queryAll() {
throw new ServiceException(LocaleUtil.getMessage(FieldConstant.MESSAGES_FALLBACK_INFO));
}
@Override
public AjaxResult findById(String firmId) {
throw new ServiceException(LocaleUtil.getMessage(FieldConstant.MESSAGES_FALLBACK_INFO));
}
@Override
public List<FirmManageVO> getAgent() {
throw new ServiceException(LocaleUtil.getMessage(FieldConstant.MESSAGES_FALLBACK_INFO));
}
}

38
ecell-internationalize/ecell-internationalize-system-security/src/main/java/com/ecell/internationalize/system/security/feign/FirmManageFeignClient.java

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
package com.ecell.internationalize.system.security.feign;
import com.ecell.internationalize.common.core.web.domain.AjaxResult;
import com.ecell.internationalize.system.security.entity.FirmManageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 厂商Feign
* @Title: FirmManageFeignClient
* @Author: liy
* @Date: 2022/7/25 17:33
*/
@FeignClient(value = "yisai-system",contextId ="yisai-system001")
public interface FirmManageFeignClient {
/**
* 查询所有厂商信息
* @return List
*/
@GetMapping("firm_manage/firm/queryAll")
AjaxResult queryAll();
/**
* 根据ID查询厂商信息
* @param firmId 实体对象
* @return List
*/
@GetMapping("firm_manage/firm/queryById")
AjaxResult findById(@RequestParam("firmId") String firmId);
/**
* 查询所有厂商代理商信息
* @return List
*/
@GetMapping("firm_manage/firm/queryAllData")
List<FirmManageVO> getAgent();
}

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

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
spring:
# 配置国际化资源文件路径
messages:
basename: i18n/messages
encoding: UTF-8
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.108:3306/ys-business?serverTimeZone=UTC
username: root
password: 123456
#数据源的其他配置
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
redis:
host: 120.77.209.176
port: 6379
database: 2
password: Ecell...20201001
#设置静态资源路径,多个以逗号分隔
web:
resources:
static-locations: classpath:static/
mybatis:
#配置SQL映射文件路径
mapper-locations: classpath:mapper/*.xml
# 搜索指定包别名
typeAliasesPackage: com.yisai.system.security
#驼峰命名
configuration:
map-underscore-to-camel-case: true
# feign 配置
feign:
sentinel:
enabled: true
okhttp:
enabled: true
httpclient:
enabled: false
client:
config:
default:
connectTimeout: 10000
readTimeout: 60000
compression:
request:
enabled: true
response:
enabled: true
# 暴露监控端点
management:
endpoints:
web:
exposure:
include: '*'
logging:
level:
com.yisai.system.security.mapper: debug

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

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
# Tomcat
server:
port: 9299
# Spring
spring:
application:
# 应用名称
name: yisai-system-security
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ecell-nacos:8848
config:
# 配置中心地址
server-addr: ecell-nacos:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
Loading…
Cancel
Save