update 优化整体代码 适配jdk17
parent
55c3e7687b
commit
8ad97f6e69
|
|
@ -2,6 +2,7 @@ package org.dromara.resource.api.domain;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -12,6 +13,7 @@ import java.io.Serializable;
|
|||
@Data
|
||||
public class RemoteFile implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.dromara.resource.api.domain;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -12,6 +13,7 @@ import java.io.Serializable;
|
|||
@Data
|
||||
public class RemoteSms implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ public interface RemoteLogService {
|
|||
* 保存系统日志
|
||||
*
|
||||
* @param sysOperLog 日志实体
|
||||
* @return 结果
|
||||
*/
|
||||
void saveLog(RemoteOperLogBo sysOperLog);
|
||||
|
||||
|
|
@ -22,7 +21,6 @@ public interface RemoteLogService {
|
|||
* 保存访问记录
|
||||
*
|
||||
* @param sysLogininfor 访问实体
|
||||
* @return 结果
|
||||
*/
|
||||
void saveLogininfor(RemoteLogininforBo sysLogininfor);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.dromara.system.api.domain;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -15,6 +16,9 @@ import java.io.Serializable;
|
|||
@NoArgsConstructor
|
||||
public class SysUserOnline implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 会话编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.dromara.system.api.domain.bo;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -17,6 +18,10 @@ import java.util.Map;
|
|||
@Data
|
||||
@NoArgsConstructor
|
||||
public class RemoteLogininforBo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 访问ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.dromara.system.api.domain.bo;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -17,6 +18,10 @@ import java.util.Map;
|
|||
@Data
|
||||
@NoArgsConstructor
|
||||
public class RemoteOperLogBo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 日志主键
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import org.dromara.common.core.xss.Xss;
|
|||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -22,6 +24,9 @@ import java.util.Date;
|
|||
@NoArgsConstructor
|
||||
public class RemoteUserBo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.dromara.system.api.domain.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ import java.util.Date;
|
|||
@Data
|
||||
public class RemoteDictDataVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.dromara.system.api.domain.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ import java.util.Date;
|
|||
@Data
|
||||
public class RemoteTenantVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import org.dromara.common.core.constant.CacheConstants;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
@ -17,6 +18,8 @@ import java.util.Set;
|
|||
@Data
|
||||
@NoArgsConstructor
|
||||
public class LoginUser implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.dromara.system.api.model;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -15,6 +16,9 @@ import java.io.Serializable;
|
|||
@NoArgsConstructor
|
||||
public class RoleDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 小程序登录用户身份权限
|
||||
*
|
||||
|
|
@ -14,6 +16,7 @@ import lombok.NoArgsConstructor;
|
|||
@NoArgsConstructor
|
||||
public class XcxLoginUser extends LoginUser {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package org.dromara.auth.controller;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.auth.domain.convert.TenantVoConvert;
|
||||
import org.dromara.auth.domain.vo.LoginTenantVo;
|
||||
import org.dromara.auth.domain.vo.LoginVo;
|
||||
import org.dromara.auth.domain.vo.TenantListVo;
|
||||
|
|
@ -13,6 +12,7 @@ import org.dromara.auth.form.RegisterBody;
|
|||
import org.dromara.auth.form.SmsLoginBody;
|
||||
import org.dromara.auth.service.SysLoginService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.tenant.helper.TenantHelper;
|
||||
|
|
@ -51,10 +51,7 @@ public class TokenController {
|
|||
public R<LoginVo> login(@Validated @RequestBody LoginBody body) {
|
||||
LoginVo loginVo = new LoginVo();
|
||||
// 生成令牌
|
||||
String token = sysLoginService.login(
|
||||
body.getTenantId(),
|
||||
body.getUsername(),
|
||||
body.getPassword());
|
||||
String token = sysLoginService.login(body.getTenantId(), body.getUsername(), body.getPassword());
|
||||
loginVo.setToken(token);
|
||||
return R.ok(loginVo);
|
||||
}
|
||||
|
|
@ -131,7 +128,7 @@ public class TokenController {
|
|||
@GetMapping("/tenant/list")
|
||||
public R<LoginTenantVo> tenantList(HttpServletRequest request) throws Exception {
|
||||
List<RemoteTenantVo> tenantList = remoteTenantService.queryList();
|
||||
List<TenantListVo> voList = TenantVoConvert.INSTANCE.convertList(tenantList);
|
||||
List<TenantListVo> voList = MapstructUtils.convert(tenantList, TenantListVo.class);
|
||||
// 获取域名
|
||||
String host = new URL(request.getRequestURL().toString()).getHost();
|
||||
// 根据域名进行筛选
|
||||
|
|
|
|||
|
|
@ -1,35 +1,16 @@
|
|||
package org.dromara.auth.domain.convert;
|
||||
|
||||
import io.github.linpeilie.BaseMapper;
|
||||
import org.dromara.auth.domain.vo.TenantListVo;
|
||||
import org.dromara.system.api.domain.vo.RemoteTenantVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
import org.mapstruct.MappingConstants;
|
||||
|
||||
/**
|
||||
* 租户vo转换器
|
||||
* @author zhujie
|
||||
*/
|
||||
@Mapper
|
||||
public interface TenantVoConvert {
|
||||
|
||||
TenantVoConvert INSTANCE = Mappers.getMapper(TenantVoConvert.class);
|
||||
|
||||
/**
|
||||
* RemoteTenantVoToTenantListVo
|
||||
* @param remoteTenantVo 待转换对象
|
||||
* @return 转换后对象
|
||||
*/
|
||||
TenantListVo convert(RemoteTenantVo remoteTenantVo);
|
||||
|
||||
/**
|
||||
* RemoteTenantVoToTenantListVo
|
||||
* @param remoteTenantVo 待转换对象
|
||||
* @return 转换后对象
|
||||
*/
|
||||
List<TenantListVo> convertList(List<RemoteTenantVo> remoteTenantVo);
|
||||
|
||||
|
||||
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
|
||||
public interface TenantVoConvert extends BaseMapper<RemoteTenantVo, TenantListVo> {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.common.core.config;
|
||||
|
||||
import jakarta.validation.Validator;
|
||||
import org.hibernate.validator.HibernateValidator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
|
|
@ -7,7 +8,6 @@ import org.springframework.context.MessageSource;
|
|||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
|
||||
|
||||
import jakarta.validation.Validator;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
|
|
@ -26,18 +26,19 @@ public class ValidatorConfig {
|
|||
*/
|
||||
@Bean
|
||||
public Validator validator() {
|
||||
LocalValidatorFactoryBean factoryBean = new LocalValidatorFactoryBean();
|
||||
// 国际化
|
||||
factoryBean.setValidationMessageSource(messageSource);
|
||||
// 设置使用 HibernateValidator 校验器
|
||||
factoryBean.setProviderClass(HibernateValidator.class);
|
||||
Properties properties = new Properties();
|
||||
// 设置 快速异常返回
|
||||
properties.setProperty("hibernate.validator.fail_fast", "true");
|
||||
factoryBean.setValidationProperties(properties);
|
||||
// 加载配置
|
||||
factoryBean.afterPropertiesSet();
|
||||
return factoryBean.getValidator();
|
||||
try (LocalValidatorFactoryBean factoryBean = new LocalValidatorFactoryBean()) {
|
||||
// 国际化
|
||||
factoryBean.setValidationMessageSource(messageSource);
|
||||
// 设置使用 HibernateValidator 校验器
|
||||
factoryBean.setProviderClass(HibernateValidator.class);
|
||||
Properties properties = new Properties();
|
||||
// 设置 快速异常返回
|
||||
properties.setProperty("hibernate.validator.fail_fast", "true");
|
||||
factoryBean.setValidationProperties(properties);
|
||||
// 加载配置
|
||||
factoryBean.afterPropertiesSet();
|
||||
return factoryBean.getValidator();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -14,6 +15,8 @@ import java.io.Serializable;
|
|||
@Data
|
||||
@NoArgsConstructor
|
||||
public class R<T> implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,12 +2,15 @@ package org.dromara.common.core.exception;
|
|||
|
||||
import org.dromara.common.core.exception.user.UserException;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 验证码错误异常类
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public class CaptchaException extends UserException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CaptchaException() {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package org.dromara.common.core.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 检查异常
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class CheckedException extends RuntimeException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CheckedException(String message) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package org.dromara.common.core.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 演示模式异常
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class DemoModeException extends RuntimeException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public DemoModeException() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package org.dromara.common.core.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 全局异常
|
||||
*
|
||||
|
|
@ -7,6 +9,7 @@ package org.dromara.common.core.exception;
|
|||
*/
|
||||
public class GlobalException extends RuntimeException {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package org.dromara.common.core.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 业务异常
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public final class ServiceException extends RuntimeException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package org.dromara.common.core.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 工具类异常
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class UtilException extends RuntimeException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 8247610319171014183L;
|
||||
|
||||
public UtilException(Throwable e) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import org.dromara.common.core.utils.StringUtils;
|
|||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 基础异常
|
||||
*
|
||||
|
|
@ -13,6 +15,7 @@ import lombok.Getter;
|
|||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class BaseException extends RuntimeException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,12 +2,15 @@ package org.dromara.common.core.exception.file;
|
|||
|
||||
import org.dromara.common.core.exception.base.BaseException;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 文件信息异常类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileException extends BaseException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FileException(String code, Object[] args) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package org.dromara.common.core.exception.file;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 文件名称超长限制异常类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileNameLengthLimitExceededException extends FileException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FileNameLengthLimitExceededException(int defaultFileNameLength) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package org.dromara.common.core.exception.file;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 文件名大小限制异常类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileSizeLimitExceededException extends FileException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FileSizeLimitExceededException(long defaultMaxSize) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package org.dromara.common.core.exception.user;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 验证码失效异常类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class CaptchaExpireException extends UserException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CaptchaExpireException() {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,15 @@ package org.dromara.common.core.exception.user;
|
|||
|
||||
import org.dromara.common.core.exception.base.BaseException;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户信息异常类
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public class UserException extends BaseException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public UserException(String code, Object... args) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package org.dromara.common.core.exception.user;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户密码不正确或不符合规范异常类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class UserPasswordNotMatchException extends UserException {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public UserPasswordNotMatchException() {
|
||||
|
|
|
|||
|
|
@ -1,200 +0,0 @@
|
|||
package org.dromara.common.core.utils;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.SimpleCache;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.cglib.beans.BeanCopier;
|
||||
import org.springframework.cglib.beans.BeanMap;
|
||||
import org.springframework.cglib.core.Converter;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* bean拷贝工具(基于 cglib 性能优异)
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class BeanCopyUtils {
|
||||
|
||||
/**
|
||||
* 单对象基于class创建拷贝
|
||||
*
|
||||
* @param source 数据来源实体
|
||||
* @param desc 描述对象 转换后的对象
|
||||
* @return desc
|
||||
*/
|
||||
public static <T, V> V copy(T source, Class<V> desc) {
|
||||
if (ObjectUtil.isNull(source)) {
|
||||
return null;
|
||||
}
|
||||
if (ObjectUtil.isNull(desc)) {
|
||||
return null;
|
||||
}
|
||||
final V target = ReflectUtil.newInstanceIfPossible(desc);
|
||||
return copy(source, target);
|
||||
}
|
||||
|
||||
/**
|
||||
* 单对象基于对象创建拷贝
|
||||
*
|
||||
* @param source 数据来源实体
|
||||
* @param desc 转换后的对象
|
||||
* @return desc
|
||||
*/
|
||||
public static <T, V> V copy(T source, V desc) {
|
||||
if (ObjectUtil.isNull(source)) {
|
||||
return null;
|
||||
}
|
||||
if (ObjectUtil.isNull(desc)) {
|
||||
return null;
|
||||
}
|
||||
BeanCopier beanCopier = BeanCopierCache.INSTANCE.get(source.getClass(), desc.getClass(), null);
|
||||
beanCopier.copy(source, desc, null);
|
||||
return desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表对象基于class创建拷贝
|
||||
*
|
||||
* @param sourceList 数据来源实体列表
|
||||
* @param desc 描述对象 转换后的对象
|
||||
* @return desc
|
||||
*/
|
||||
public static <T, V> List<V> copyList(List<T> sourceList, Class<V> desc) {
|
||||
if (ObjectUtil.isNull(sourceList)) {
|
||||
return null;
|
||||
}
|
||||
if (CollUtil.isEmpty(sourceList)) {
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
return StreamUtils.toList(sourceList, source -> {
|
||||
V target = ReflectUtil.newInstanceIfPossible(desc);
|
||||
copy(source, target);
|
||||
return target;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* bean拷贝到map
|
||||
*
|
||||
* @param bean 数据来源实体
|
||||
* @return map对象
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> Map<String, Object> copyToMap(T bean) {
|
||||
if (ObjectUtil.isNull(bean)) {
|
||||
return null;
|
||||
}
|
||||
return BeanMap.create(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* map拷贝到bean
|
||||
*
|
||||
* @param map 数据来源
|
||||
* @param beanClass bean类
|
||||
* @return bean对象
|
||||
*/
|
||||
public static <T> T mapToBean(Map<String, Object> map, Class<T> beanClass) {
|
||||
if (MapUtil.isEmpty(map)) {
|
||||
return null;
|
||||
}
|
||||
if (ObjectUtil.isNull(beanClass)) {
|
||||
return null;
|
||||
}
|
||||
T bean = ReflectUtil.newInstanceIfPossible(beanClass);
|
||||
return mapToBean(map, bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* map拷贝到bean
|
||||
*
|
||||
* @param map 数据来源
|
||||
* @param bean bean对象
|
||||
* @return bean对象
|
||||
*/
|
||||
public static <T> T mapToBean(Map<String, Object> map, T bean) {
|
||||
if (MapUtil.isEmpty(map)) {
|
||||
return null;
|
||||
}
|
||||
if (ObjectUtil.isNull(bean)) {
|
||||
return null;
|
||||
}
|
||||
BeanMap.create(bean).putAll(map);
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* map拷贝到map
|
||||
*
|
||||
* @param map 数据来源
|
||||
* @param clazz 返回的对象类型
|
||||
* @return map对象
|
||||
*/
|
||||
public static <T, V> Map<String, V> mapToMap(Map<String, T> map, Class<V> clazz) {
|
||||
if (MapUtil.isEmpty(map)) {
|
||||
return null;
|
||||
}
|
||||
if (ObjectUtil.isNull(clazz)) {
|
||||
return null;
|
||||
}
|
||||
Map<String, V> copyMap = new LinkedHashMap<>(map.size());
|
||||
map.forEach((k, v) -> copyMap.put(k, copy(v, clazz)));
|
||||
return copyMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* BeanCopier属性缓存<br>
|
||||
* 缓存用于防止多次反射造成的性能问题
|
||||
*
|
||||
* @author Looly
|
||||
* @since 5.4.1
|
||||
*/
|
||||
public enum BeanCopierCache {
|
||||
/**
|
||||
* BeanCopier属性缓存单例
|
||||
*/
|
||||
INSTANCE;
|
||||
|
||||
private final SimpleCache<String, BeanCopier> cache = new SimpleCache<>();
|
||||
|
||||
/**
|
||||
* 获得类与转换器生成的key在{@link BeanCopier}的Map中对应的元素
|
||||
*
|
||||
* @param srcClass 源Bean的类
|
||||
* @param targetClass 目标Bean的类
|
||||
* @param converter 转换器
|
||||
* @return Map中对应的BeanCopier
|
||||
*/
|
||||
public BeanCopier get(Class<?> srcClass, Class<?> targetClass, Converter converter) {
|
||||
final String key = genKey(srcClass, targetClass, converter);
|
||||
return cache.get(key, () -> BeanCopier.create(srcClass, targetClass, converter != null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得类与转换器生成的key
|
||||
*
|
||||
* @param srcClass 源Bean的类
|
||||
* @param targetClass 目标Bean的类
|
||||
* @param converter 转换器
|
||||
* @return 属性名和Map映射的key
|
||||
*/
|
||||
private String genKey(Class<?> srcClass, Class<?> targetClass, Converter converter) {
|
||||
final StringBuilder key = StrUtil.builder()
|
||||
.append(srcClass.getName()).append('#').append(targetClass.getName());
|
||||
if(null != converter){
|
||||
key.append('#').append(converter.getClass().getName());
|
||||
}
|
||||
return key.toString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,9 +2,11 @@ package org.dromara.common.core.utils;
|
|||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.extra.servlet.JakartaServletUtil;
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import org.dromara.common.core.constant.Constants;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.http.MediaType;
|
||||
|
|
@ -13,12 +15,7 @@ import org.springframework.web.context.request.RequestAttributes;
|
|||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
|
@ -215,11 +212,7 @@ public class ServletUtils extends JakartaServletUtil {
|
|||
* @return 编码后的内容
|
||||
*/
|
||||
public static String urlEncode(String str) {
|
||||
try {
|
||||
return URLEncoder.encode(str, Constants.UTF8);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
return URLEncoder.encode(str, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -229,11 +222,7 @@ public class ServletUtils extends JakartaServletUtil {
|
|||
* @return 解码后的内容
|
||||
*/
|
||||
public static String urlDecode(String str) {
|
||||
try {
|
||||
return URLDecoder.decode(str, Constants.UTF8);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
return URLDecoder.decode(str, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -256,17 +256,13 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||
if (s != null) {
|
||||
final int len = s.length();
|
||||
if (s.length() <= size) {
|
||||
for (int i = size - len; i > 0; i--) {
|
||||
sb.append(c);
|
||||
}
|
||||
sb.append(String.valueOf(c).repeat(size - len));
|
||||
sb.append(s);
|
||||
} else {
|
||||
return s.substring(len - size, len);
|
||||
}
|
||||
} else {
|
||||
for (int i = size; i > 0; i--) {
|
||||
sb.append(c);
|
||||
}
|
||||
sb.append(String.valueOf(c).repeat(Math.max(0, size)));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ public class FileUtils extends FileUtil {
|
|||
* @param s 需要百分号编码的字符串
|
||||
* @return 百分号编码后的字符串
|
||||
*/
|
||||
public static String percentEncode(String s) throws UnsupportedEncodingException {
|
||||
String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
|
||||
public static String percentEncode(String s) {
|
||||
String encode = URLEncoder.encode(s, StandardCharsets.UTF_8);
|
||||
return encode.replaceAll("\\+", "%20");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,21 +56,20 @@ public class MybatisDecryptInterceptor implements Interceptor {
|
|||
if (ObjectUtil.isNull(sourceObject)) {
|
||||
return;
|
||||
}
|
||||
if (sourceObject instanceof Map<?, ?>) {
|
||||
new HashSet<>(((Map<?, ?>) sourceObject).values()).forEach(this::decryptHandler);
|
||||
if (sourceObject instanceof Map<?, ?> map) {
|
||||
new HashSet<>(map.values()).forEach(this::decryptHandler);
|
||||
return;
|
||||
}
|
||||
if (sourceObject instanceof List<?>) {
|
||||
List<?> sourceList = (List<?>) sourceObject;
|
||||
if(CollUtil.isEmpty(sourceList)) {
|
||||
if (sourceObject instanceof List<?> list) {
|
||||
if(CollUtil.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
// 判断第一个元素是否含有注解。如果没有直接返回,提高效率
|
||||
Object firstItem = sourceList.get(0);
|
||||
Object firstItem = list.get(0);
|
||||
if (ObjectUtil.isNull(firstItem) || CollUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) {
|
||||
return;
|
||||
}
|
||||
((List<?>) sourceObject).forEach(this::decryptHandler);
|
||||
list.forEach(this::decryptHandler);
|
||||
return;
|
||||
}
|
||||
Set<Field> fields = encryptorManager.getFieldCache(sourceObject.getClass());
|
||||
|
|
|
|||
|
|
@ -46,9 +46,8 @@ public class MybatisEncryptInterceptor implements Interceptor {
|
|||
|
||||
@Override
|
||||
public Object plugin(Object target) {
|
||||
if (target instanceof ParameterHandler) {
|
||||
if (target instanceof ParameterHandler parameterHandler) {
|
||||
// 进行加密操作
|
||||
ParameterHandler parameterHandler = (ParameterHandler) target;
|
||||
Object parameterObject = parameterHandler.getParameterObject();
|
||||
if (ObjectUtil.isNotNull(parameterObject) && !(parameterObject instanceof String)) {
|
||||
this.encryptHandler(parameterObject);
|
||||
|
|
@ -66,21 +65,20 @@ public class MybatisEncryptInterceptor implements Interceptor {
|
|||
if (ObjectUtil.isNull(sourceObject)) {
|
||||
return;
|
||||
}
|
||||
if (sourceObject instanceof Map<?, ?>) {
|
||||
new HashSet<>(((Map<?, ?>) sourceObject).values()).forEach(this::encryptHandler);
|
||||
if (sourceObject instanceof Map<?, ?> map) {
|
||||
new HashSet<>(map.values()).forEach(this::encryptHandler);
|
||||
return;
|
||||
}
|
||||
if (sourceObject instanceof List<?>) {
|
||||
List<?> sourceList = (List<?>) sourceObject;
|
||||
if(CollUtil.isEmpty(sourceList)) {
|
||||
if (sourceObject instanceof List<?> list) {
|
||||
if(CollUtil.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
// 判断第一个元素是否含有注解。如果没有直接返回,提高效率
|
||||
Object firstItem = sourceList.get(0);
|
||||
Object firstItem = list.get(0);
|
||||
if (ObjectUtil.isNull(firstItem) || CollUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) {
|
||||
return;
|
||||
}
|
||||
((List<?>) sourceObject).forEach(this::encryptHandler);
|
||||
list.forEach(this::encryptHandler);
|
||||
return;
|
||||
}
|
||||
Set<Field> fields = encryptorManager.getFieldCache(sourceObject.getClass());
|
||||
|
|
|
|||
|
|
@ -28,20 +28,19 @@ import java.util.Map;
|
|||
@Slf4j
|
||||
public class CellMergeStrategy extends AbstractMergeStrategy {
|
||||
|
||||
private final List<?> list;
|
||||
private final List<CellRangeAddress> cellList;
|
||||
private final boolean hasTitle;
|
||||
private int rowIndex;
|
||||
|
||||
public CellMergeStrategy(List<?> list, boolean hasTitle) {
|
||||
this.list = list;
|
||||
this.hasTitle = hasTitle;
|
||||
// 行合并开始下标
|
||||
this.rowIndex = hasTitle ? 1 : 0;
|
||||
this.cellList = handle(list, hasTitle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) {
|
||||
List<CellRangeAddress> cellList = handle(list, hasTitle);
|
||||
// judge the list is not null
|
||||
if (CollUtil.isNotEmpty(cellList)) {
|
||||
// the judge is necessary
|
||||
|
|
|
|||
|
|
@ -55,9 +55,8 @@ public class DefaultExcelListener<T> extends AnalysisEventListener<T> implements
|
|||
@Override
|
||||
public void onException(Exception exception, AnalysisContext context) throws Exception {
|
||||
String errMsg = null;
|
||||
if (exception instanceof ExcelDataConvertException) {
|
||||
if (exception instanceof ExcelDataConvertException excelDataConvertException) {
|
||||
// 如果是某一个单元格的转换异常 能获取到具体行号
|
||||
ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException) exception;
|
||||
Integer rowIndex = excelDataConvertException.getRowIndex();
|
||||
Integer columnIndex = excelDataConvertException.getColumnIndex();
|
||||
errMsg = StrUtil.format("第{}行-第{}列-表头{}: 解析异常<br/>",
|
||||
|
|
@ -66,8 +65,7 @@ public class DefaultExcelListener<T> extends AnalysisEventListener<T> implements
|
|||
log.error(errMsg);
|
||||
}
|
||||
}
|
||||
if (exception instanceof ConstraintViolationException) {
|
||||
ConstraintViolationException constraintViolationException = (ConstraintViolationException) exception;
|
||||
if (exception instanceof ConstraintViolationException constraintViolationException) {
|
||||
Set<ConstraintViolation<?>> constraintViolations = constraintViolationException.getConstraintViolations();
|
||||
String constraintViolationsMsg = StreamUtils.join(constraintViolations, ConstraintViolation::getMessage, ", ");
|
||||
errMsg = StrUtil.format("第{}行数据校验异常: {}", context.readRowHolder().getRowIndex() + 1, constraintViolationsMsg);
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ public class ExcelUtil {
|
|||
if (StringUtils.containsAny(propertyValue, separator)) {
|
||||
for (String value : propertyValue.split(separator)) {
|
||||
if (itemArray[0].equals(value)) {
|
||||
propertyString.append(itemArray[1] + separator);
|
||||
propertyString.append(itemArray[1]).append(separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -305,7 +305,7 @@ public class ExcelUtil {
|
|||
if (StringUtils.containsAny(propertyValue, separator)) {
|
||||
for (String value : propertyValue.split(separator)) {
|
||||
if (itemArray[1].equals(value)) {
|
||||
propertyString.append(itemArray[0] + separator);
|
||||
propertyString.append(itemArray[0]).append(separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,9 +76,8 @@ public class RepeatSubmitAspect {
|
|||
*/
|
||||
@AfterReturning(pointcut = "@annotation(repeatSubmit)", returning = "jsonResult")
|
||||
public void doAfterReturning(JoinPoint joinPoint, RepeatSubmit repeatSubmit, Object jsonResult) {
|
||||
if (jsonResult instanceof R) {
|
||||
if (jsonResult instanceof R<?> r) {
|
||||
try {
|
||||
R<?> r = (R<?>) jsonResult;
|
||||
// 成功则不删除redis数据 保证在有效时间内无法重复提交
|
||||
if (r.getCode() == R.SUCCESS) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
package org.dromara.common.log.domain.convert;
|
||||
|
||||
import org.dromara.common.log.event.OperLogEvent;
|
||||
import org.dromara.system.api.domain.bo.RemoteOperLogBo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 操作日志转换器
|
||||
* @author zhujie
|
||||
*/
|
||||
@Mapper
|
||||
public interface OperLogEventConvert {
|
||||
|
||||
OperLogEventConvert INSTANCE = Mappers.getMapper(OperLogEventConvert.class);
|
||||
|
||||
/**
|
||||
* OperLogEventToRemoteOperLogBo
|
||||
* @param operLogEvent 待转换对象
|
||||
* @return 转换后对象
|
||||
*/
|
||||
@Mapping(target = "params", ignore = true)
|
||||
RemoteOperLogBo convert(OperLogEvent operLogEvent);
|
||||
}
|
||||
|
|
@ -1,14 +1,15 @@
|
|||
package org.dromara.common.log.event;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.http.useragent.UserAgent;
|
||||
import cn.hutool.http.useragent.UserAgentUtil;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.constant.Constants;
|
||||
import org.dromara.common.core.utils.ServletUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.core.utils.ip.AddressUtils;
|
||||
import org.dromara.common.log.domain.convert.OperLogEventConvert;
|
||||
import org.dromara.system.api.RemoteLogService;
|
||||
import org.dromara.system.api.domain.bo.RemoteLogininforBo;
|
||||
import org.dromara.system.api.domain.bo.RemoteOperLogBo;
|
||||
|
|
@ -16,8 +17,6 @@ import org.springframework.context.event.EventListener;
|
|||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 异步调用日志服务
|
||||
*
|
||||
|
|
@ -36,7 +35,7 @@ public class LogEventListener {
|
|||
@Async
|
||||
@EventListener
|
||||
public void saveLog(OperLogEvent operLogEvent) {
|
||||
RemoteOperLogBo sysOperLog = OperLogEventConvert.INSTANCE.convert(operLogEvent);
|
||||
RemoteOperLogBo sysOperLog = BeanUtil.toBean(operLogEvent, RemoteOperLogBo.class);
|
||||
remoteLogService.saveLog(sysOperLog);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package org.dromara.common.log.event;
|
|||
import lombok.Data;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -14,6 +16,7 @@ import java.io.Serializable;
|
|||
@Data
|
||||
public class LogininforEvent implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.dromara.common.log.event;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ import java.util.Date;
|
|||
@Data
|
||||
public class OperLogEvent implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import org.dromara.common.core.utils.StringUtils;
|
|||
import org.dromara.common.core.utils.sql.SqlUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -22,6 +23,7 @@ import java.util.List;
|
|||
@Data
|
||||
public class PageQuery implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -17,6 +18,7 @@ import java.util.List;
|
|||
@Data
|
||||
@NoArgsConstructor
|
||||
public class TableDataInfo<T> implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
|
|||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
try {
|
||||
if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity) {
|
||||
BaseEntity baseEntity = (BaseEntity) metaObject.getOriginalObject();
|
||||
if (ObjectUtil.isNotNull(metaObject)
|
||||
&& metaObject.getOriginalObject() instanceof BaseEntity baseEntity) {
|
||||
Date current = ObjectUtil.isNotNull(baseEntity.getCreateTime())
|
||||
? baseEntity.getCreateTime() : new Date();
|
||||
baseEntity.setCreateTime(current);
|
||||
|
|
@ -47,8 +47,8 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
|
|||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
try {
|
||||
if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity) {
|
||||
BaseEntity baseEntity = (BaseEntity) metaObject.getOriginalObject();
|
||||
if (ObjectUtil.isNotNull(metaObject)
|
||||
&& metaObject.getOriginalObject() instanceof BaseEntity baseEntity) {
|
||||
Date current = new Date();
|
||||
// 更新时间填充(不管为不为空)
|
||||
baseEntity.setUpdateTime(current);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,12 @@ import cn.hutool.core.collection.ConcurrentHashSet;
|
|||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ClassUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.jsqlparser.JSQLParserException;
|
||||
import net.sf.jsqlparser.expression.Expression;
|
||||
import net.sf.jsqlparser.expression.Parenthesis;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
|
||||
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
|
|
@ -17,12 +23,6 @@ import org.dromara.common.mybatis.helper.DataPermissionHelper;
|
|||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.system.api.model.LoginUser;
|
||||
import org.dromara.system.api.model.RoleDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.jsqlparser.JSQLParserException;
|
||||
import net.sf.jsqlparser.expression.Expression;
|
||||
import net.sf.jsqlparser.expression.Parenthesis;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
|
||||
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
|
||||
import org.springframework.context.expression.BeanFactoryResolver;
|
||||
import org.springframework.expression.BeanResolver;
|
||||
import org.springframework.expression.ExpressionParser;
|
||||
|
|
@ -35,7 +35,6 @@ import java.lang.reflect.Method;
|
|||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 数据权限过滤
|
||||
|
|
@ -163,7 +162,7 @@ public class PlusDataPermissionHandler {
|
|||
String methodName = sb.substring(index + 1, sb.length());
|
||||
Class<?> clazz = ClassUtil.loadClass(clazzName);
|
||||
List<Method> methods = Arrays.stream(ClassUtil.getDeclaredMethods(clazz))
|
||||
.filter(method -> method.getName().equals(methodName)).collect(Collectors.toList());
|
||||
.filter(method -> method.getName().equals(methodName)).toList();
|
||||
DataPermission dataPermission;
|
||||
// 获取方法注解
|
||||
for (Method method : methods) {
|
||||
|
|
|
|||
|
|
@ -58,15 +58,15 @@ public class DataBaseHelper {
|
|||
String var = Convert.toStr(var1);
|
||||
if (dataBasyType == DataBaseType.SQL_SERVER) {
|
||||
// charindex(',100,' , ',0,100,101,') <> 0
|
||||
return "charindex('," + var + ",' , ','+" + var2 + "+',') <> 0";
|
||||
return "charindex(',%s,' , ','+%s+',') <> 0".formatted(var, var2);
|
||||
} else if (dataBasyType == DataBaseType.POSTGRE_SQL) {
|
||||
// (select position(',100,' in ',0,100,101,')) <> 0
|
||||
return "(select position('," + var + ",' in ','||" + var2 + "||',')) <> 0";
|
||||
return "(select position(',%s,' in ','||%s||',')) <> 0".formatted(var, var2);
|
||||
} else if (dataBasyType == DataBaseType.ORACLE) {
|
||||
// instr(',0,100,101,' , ',100,') <> 0
|
||||
return "instr(','||" + var2 + "||',' , '," + var + ",') <> 0";
|
||||
return "instr(','||%s||',' , ',%s,') <> 0".formatted(var2, var);
|
||||
}
|
||||
// find_in_set('100' , '0,100,101')
|
||||
return "find_in_set('" + var + "' , " + var2 + ") <> 0";
|
||||
return "find_in_set('%s' , %s) <> 0".formatted(var, var2);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,8 +68,7 @@ public class PlusDataPermissionInterceptor extends JsqlParserSupport implements
|
|||
SelectBody selectBody = select.getSelectBody();
|
||||
if (selectBody instanceof PlainSelect) {
|
||||
this.setWhere((PlainSelect) selectBody, (String) obj);
|
||||
} else if (selectBody instanceof SetOperationList) {
|
||||
SetOperationList setOperationList = (SetOperationList) selectBody;
|
||||
} else if (selectBody instanceof SetOperationList setOperationList) {
|
||||
List<SelectBody> selectBodyList = setOperationList.getSelects();
|
||||
selectBodyList.forEach(s -> this.setWhere((PlainSelect) s, (String) obj));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,12 +218,11 @@ public class OssClient {
|
|||
private static String getPolicy(String bucketName, PolicyType policyType) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("{\n\"Statement\": [\n{\n\"Action\": [\n");
|
||||
if (policyType == PolicyType.WRITE) {
|
||||
builder.append("\"s3:GetBucketLocation\",\n\"s3:ListBucketMultipartUploads\"\n");
|
||||
} else if (policyType == PolicyType.READ_WRITE) {
|
||||
builder.append("\"s3:GetBucketLocation\",\n\"s3:ListBucket\",\n\"s3:ListBucketMultipartUploads\"\n");
|
||||
} else {
|
||||
builder.append("\"s3:GetBucketLocation\"\n");
|
||||
switch (policyType) {
|
||||
case WRITE -> builder.append("\"s3:GetBucketLocation\",\n\"s3:ListBucketMultipartUploads\"\n");
|
||||
case READ_WRITE ->
|
||||
builder.append("\"s3:GetBucketLocation\",\n\"s3:ListBucket\",\n\"s3:ListBucketMultipartUploads\"\n");
|
||||
default -> builder.append("\"s3:GetBucketLocation\"\n");
|
||||
}
|
||||
builder.append("],\n\"Effect\": \"Allow\",\n\"Principal\": \"*\",\n\"Resource\": \"arn:aws:s3:::");
|
||||
builder.append(bucketName);
|
||||
|
|
@ -235,15 +234,11 @@ public class OssClient {
|
|||
}
|
||||
builder.append("{\n\"Action\": ");
|
||||
switch (policyType) {
|
||||
case WRITE:
|
||||
case WRITE ->
|
||||
builder.append("[\n\"s3:AbortMultipartUpload\",\n\"s3:DeleteObject\",\n\"s3:ListMultipartUploadParts\",\n\"s3:PutObject\"\n],\n");
|
||||
break;
|
||||
case READ_WRITE:
|
||||
case READ_WRITE ->
|
||||
builder.append("[\n\"s3:AbortMultipartUpload\",\n\"s3:DeleteObject\",\n\"s3:GetObject\",\n\"s3:ListMultipartUploadParts\",\n\"s3:PutObject\"\n],\n");
|
||||
break;
|
||||
default:
|
||||
builder.append("\"s3:GetObject\",\n");
|
||||
break;
|
||||
default -> builder.append("\"s3:GetObject\",\n");
|
||||
}
|
||||
builder.append("\"Effect\": \"Allow\",\n\"Principal\": \"*\",\n\"Resource\": \"arn:aws:s3:::");
|
||||
builder.append(bucketName);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package org.dromara.common.oss.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* OSS异常类
|
||||
*
|
||||
|
|
@ -7,6 +9,7 @@ package org.dromara.common.oss.exception;
|
|||
*/
|
||||
public class OssException extends RuntimeException {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public OssException(String msg) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package org.dromara.common.sms.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* Sms异常类
|
||||
*
|
||||
|
|
@ -7,6 +9,7 @@ package org.dromara.common.sms.exception;
|
|||
*/
|
||||
public class SmsException extends RuntimeException {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public SmsException(String msg) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package org.dromara.common.tenant.exception;
|
|||
|
||||
import org.dromara.common.core.exception.base.BaseException;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 租户异常类
|
||||
*
|
||||
|
|
@ -10,6 +12,7 @@ import org.dromara.common.core.exception.base.BaseException;
|
|||
*/
|
||||
public class TenantException extends BaseException {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TenantException(String code, Object... args) {
|
||||
|
|
|
|||
|
|
@ -33,13 +33,13 @@ public class RedisLockController {
|
|||
@Lock4j(keys = {"#key"})
|
||||
@GetMapping("/testLock4j")
|
||||
public R<String> testLock4j(String key, String value) {
|
||||
System.out.println("start:" + key + ",time:" + LocalTime.now().toString());
|
||||
System.out.println("start:" + key + ",time:" + LocalTime.now());
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("end :" + key + ",time:" + LocalTime.now().toString());
|
||||
System.out.println("end :" + key + ",time:" + LocalTime.now());
|
||||
return R.ok("操作成功", value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import org.dromara.common.mybatis.core.domain.BaseEntity;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 测试单表对象 test_demo
|
||||
*
|
||||
|
|
@ -16,6 +18,7 @@ import lombok.EqualsAndHashCode;
|
|||
@TableName("test_demo")
|
||||
public class TestDemo extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 测试树表对象 test_tree
|
||||
*
|
||||
|
|
@ -19,6 +21,7 @@ import org.dromara.common.mybatis.core.domain.BaseEntity;
|
|||
@TableName("test_tree")
|
||||
public class TestTree extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
package org.dromara.demo.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.demo.domain.TestDemo;
|
||||
|
||||
/**
|
||||
* 测试单表业务对象 test_demo
|
||||
|
|
@ -18,6 +19,7 @@ import jakarta.validation.constraints.NotNull;
|
|||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = TestDemo.class, reverseConvertGenerate = false)
|
||||
public class TestDemoBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
package org.dromara.demo.domain.bo;
|
||||
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.demo.domain.TestTree;
|
||||
|
||||
/**
|
||||
* 测试树表业务对象 test_tree
|
||||
|
|
@ -18,6 +19,7 @@ import jakarta.validation.constraints.NotNull;
|
|||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = TestTree.class, reverseConvertGenerate = false)
|
||||
public class TestTreeBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ package org.dromara.demo.domain.vo;
|
|||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.demo.domain.TestDemo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -15,6 +17,7 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TestDemo.class)
|
||||
public class TestDemoVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ package org.dromara.demo.domain.vo;
|
|||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.demo.domain.TestTree;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -15,6 +17,7 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = TestTree.class)
|
||||
public class TestTreeVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import cn.hutool.core.util.CharUtil;
|
|||
import cn.hutool.core.util.RandomUtil;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 无符号计算生成器
|
||||
*
|
||||
|
|
@ -13,6 +15,7 @@ import org.dromara.common.core.utils.StringUtils;
|
|||
*/
|
||||
public class UnsignedMathGenerator implements CodeGenerator {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5514819971774091076L;
|
||||
|
||||
private static final String OPERATORS = "+-*";
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ public class GatewayExceptionHandler implements ErrorWebExceptionHandler {
|
|||
|
||||
if (ex instanceof NotFoundException) {
|
||||
msg = "服务未找到";
|
||||
} else if (ex instanceof ResponseStatusException) {
|
||||
ResponseStatusException responseStatusException = (ResponseStatusException) ex;
|
||||
} else if (ex instanceof ResponseStatusException responseStatusException) {
|
||||
msg = responseStatusException.getMessage();
|
||||
} else {
|
||||
msg = "内部服务器错误";
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class GenController extends BaseController {
|
|||
GenTable table = genTableService.selectGenTableById(tableId);
|
||||
List<GenTable> tables = genTableService.selectGenTableAll();
|
||||
List<GenTableColumn> list = genTableService.selectGenTableColumnListByTableId(tableId);
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("info", table);
|
||||
map.put("rows", list);
|
||||
map.put("tables", tables);
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ public class VelocityUtils {
|
|||
* @return 模板列表
|
||||
*/
|
||||
public static List<String> getTemplateList(String tplCategory) {
|
||||
List<String> templates = new ArrayList<String>();
|
||||
List<String> templates = new ArrayList<>();
|
||||
templates.add("vm/java/domain.java.vm");
|
||||
templates.add("vm/java/bo.java.vm");
|
||||
templates.add("vm/java/vo.java.vm");
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ import io.github.linpeilie.annotations.AutoMapper;
|
|||
import lombok.Data;
|
||||
import org.dromara.resource.domain.SysOssConfig;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 对象存储配置视图对象 sys_oss_config
|
||||
|
|
@ -14,8 +17,9 @@ import org.dromara.resource.domain.SysOssConfig;
|
|||
*/
|
||||
@Data
|
||||
@AutoMapper(target = SysOssConfig.class)
|
||||
public class SysOssConfigVo {
|
||||
public class SysOssConfigVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,13 +2,19 @@ package org.dromara.resource.domain.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 上传对象信息
|
||||
*
|
||||
* @author Michelle.Chung
|
||||
*/
|
||||
@Data
|
||||
public class SysOssUploadVo {
|
||||
public class SysOssUploadVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* URL地址
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import io.github.linpeilie.annotations.AutoMapper;
|
|||
import lombok.Data;
|
||||
import org.dromara.resource.domain.SysOss;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -13,8 +15,9 @@ import java.util.Date;
|
|||
*/
|
||||
@Data
|
||||
@AutoMapper(target = SysOss.class)
|
||||
public class SysOssVo {
|
||||
public class SysOssVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,32 +1,16 @@
|
|||
package org.dromara.system.domain.convert;
|
||||
|
||||
import io.github.linpeilie.BaseMapper;
|
||||
import org.dromara.system.api.domain.vo.RemoteDictDataVo;
|
||||
import org.dromara.system.domain.vo.SysDictDataVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
import org.mapstruct.MappingConstants;
|
||||
|
||||
/**
|
||||
* 字典数据转换器
|
||||
* @author zhujie
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysDictDataVoConvert {
|
||||
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
|
||||
public interface SysDictDataVoConvert extends BaseMapper<SysDictDataVo, RemoteDictDataVo> {
|
||||
|
||||
SysDictDataVoConvert INSTANCE = Mappers.getMapper(SysDictDataVoConvert.class);
|
||||
|
||||
/**
|
||||
* SysDictDataVoToRemoteDictDataVo
|
||||
* @param sysDictDataVo 待转换对象
|
||||
* @return 转换后对象
|
||||
*/
|
||||
RemoteDictDataVo convert(SysDictDataVo sysDictDataVo);
|
||||
|
||||
/**
|
||||
* SysDictDataVoListToRemoteDictDataVoList
|
||||
* @param sysDictDataVos 待转换对象
|
||||
* @return 转换后对象
|
||||
*/
|
||||
List<RemoteDictDataVo> convertList(List<SysDictDataVo> sysDictDataVos);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,16 @@
|
|||
package org.dromara.system.domain.convert;
|
||||
|
||||
import io.github.linpeilie.BaseMapper;
|
||||
import org.dromara.system.api.domain.bo.RemoteLogininforBo;
|
||||
import org.dromara.system.domain.bo.SysLogininforBo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.mapstruct.MappingConstants;
|
||||
|
||||
/**
|
||||
* 登录日志转换器
|
||||
* @author zhujie
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysLogininforBoConvert {
|
||||
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
|
||||
public interface SysLogininforBoConvert extends BaseMapper<RemoteLogininforBo, SysLogininforBo> {
|
||||
|
||||
SysLogininforBoConvert INSTANCE = Mappers.getMapper(SysLogininforBoConvert.class);
|
||||
|
||||
/**
|
||||
* RemoteLogininforBoToSysLogininforBo
|
||||
* @param remoteLogininforBo 待转换对象
|
||||
* @return 转换后对象
|
||||
*/
|
||||
SysLogininforBo convert(RemoteLogininforBo remoteLogininforBo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
package org.dromara.system.domain.convert;
|
||||
|
||||
import io.github.linpeilie.BaseMapper;
|
||||
import org.dromara.system.api.domain.bo.RemoteOperLogBo;
|
||||
import org.dromara.system.domain.bo.SysOperLogBo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.mapstruct.MappingConstants;
|
||||
|
||||
/**
|
||||
* 操作日志转换器
|
||||
* @author zhujie
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysOperLogBoConvert {
|
||||
|
||||
SysOperLogBoConvert INSTANCE = Mappers.getMapper(SysOperLogBoConvert.class);
|
||||
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
|
||||
public interface SysOperLogBoConvert extends BaseMapper<RemoteOperLogBo, SysOperLogBo> {
|
||||
|
||||
/**
|
||||
* RemoteOperLogBoToSysOperLogBo
|
||||
|
|
|
|||
|
|
@ -1,32 +1,16 @@
|
|||
package org.dromara.system.domain.convert;
|
||||
|
||||
import io.github.linpeilie.BaseMapper;
|
||||
import org.dromara.system.api.domain.vo.RemoteTenantVo;
|
||||
import org.dromara.system.domain.vo.SysTenantVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
import org.mapstruct.MappingConstants;
|
||||
|
||||
/**
|
||||
* 租户转换器
|
||||
* @author zhujie
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysTenantVoConvert {
|
||||
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
|
||||
public interface SysTenantVoConvert extends BaseMapper<SysTenantVo, RemoteTenantVo> {
|
||||
|
||||
SysTenantVoConvert INSTANCE = Mappers.getMapper(SysTenantVoConvert.class);
|
||||
|
||||
/**
|
||||
* SysTenantVoToRemoteTenantVo
|
||||
* @param sysTenantVo 待转换对象
|
||||
* @return 转换后对象
|
||||
*/
|
||||
RemoteTenantVo convert(SysTenantVo sysTenantVo);
|
||||
|
||||
/**
|
||||
* SysTenantVoListToRemoteTenantVoList
|
||||
* @param sysTenantVos 待转换对象
|
||||
* @return 转换后对象
|
||||
*/
|
||||
List<RemoteTenantVo> convertList(List<SysTenantVo> sysTenantVos);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,21 @@
|
|||
package org.dromara.system.domain.convert;
|
||||
|
||||
import io.github.linpeilie.BaseMapper;
|
||||
import org.dromara.system.api.domain.bo.RemoteOperLogBo;
|
||||
import org.dromara.system.api.domain.bo.RemoteUserBo;
|
||||
import org.dromara.system.domain.bo.SysOperLogBo;
|
||||
import org.dromara.system.domain.bo.SysUserBo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.MappingConstants;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 用户信息转换器
|
||||
* @author zhujie
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserBoConvert {
|
||||
|
||||
SysUserBoConvert INSTANCE = Mappers.getMapper(SysUserBoConvert.class);
|
||||
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
|
||||
public interface SysUserBoConvert extends BaseMapper<RemoteUserBo, SysUserBo> {
|
||||
|
||||
/**
|
||||
* RemoteUserBoToSysUserBo
|
||||
|
|
|
|||
|
|
@ -2,13 +2,19 @@ package org.dromara.system.domain.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户头像信息
|
||||
*
|
||||
* @author Michelle.Chung
|
||||
*/
|
||||
@Data
|
||||
public class AvatarVo {
|
||||
public class AvatarVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package org.dromara.system.domain.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
|
@ -12,7 +14,10 @@ import java.util.Properties;
|
|||
* @author Michelle.Chung
|
||||
*/
|
||||
@Data
|
||||
public class CacheListInfoVo {
|
||||
public class CacheListInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Properties info;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package org.dromara.system.domain.vo;
|
|||
import cn.hutool.core.lang.tree.Tree;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -11,7 +13,10 @@ import java.util.List;
|
|||
* @author Michelle.Chung
|
||||
*/
|
||||
@Data
|
||||
public class DeptTreeSelectVo {
|
||||
public class DeptTreeSelectVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 选中部门列表
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package org.dromara.system.domain.vo;
|
|||
import cn.hutool.core.lang.tree.Tree;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -11,7 +13,10 @@ import java.util.List;
|
|||
* @author Michelle.Chung
|
||||
*/
|
||||
@Data
|
||||
public class MenuTreeSelectVo {
|
||||
public class MenuTreeSelectVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 选中菜单列表
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ package org.dromara.system.domain.vo;
|
|||
import lombok.Data;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 路由显示信息
|
||||
*
|
||||
|
|
@ -10,7 +13,10 @@ import org.dromara.common.core.utils.StringUtils;
|
|||
*/
|
||||
|
||||
@Data
|
||||
public class MetaVo {
|
||||
public class MetaVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 设置该路由在侧边栏和面包屑中展示的名字
|
||||
|
|
|
|||
|
|
@ -2,13 +2,19 @@ package org.dromara.system.domain.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户个人信息
|
||||
*
|
||||
* @author Michelle.Chung
|
||||
*/
|
||||
@Data
|
||||
public class ProfileVo {
|
||||
public class ProfileVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package org.dromara.system.domain.vo;
|
|||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -12,7 +14,10 @@ import java.util.List;
|
|||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
public class RouterVo {
|
||||
public class RouterVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 路由名字
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.system.domain.SysConfig;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysConfig.class)
|
||||
public class SysConfigVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.system.domain.SysDept;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -21,6 +22,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysDept.class)
|
||||
public class SysDeptVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.system.domain.SysDictData;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysDictData.class)
|
||||
public class SysDictDataVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.system.domain.SysDictType;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysDictType.class)
|
||||
public class SysDictTypeVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.system.domain.SysLogininfor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -24,6 +25,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysLogininfor.class)
|
||||
public class SysLogininforVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import io.github.linpeilie.annotations.AutoMapper;
|
|||
import lombok.Data;
|
||||
import org.dromara.system.domain.SysMenu;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
|
@ -19,6 +20,7 @@ import java.util.List;
|
|||
@AutoMapper(target = SysMenu.class)
|
||||
public class SysMenuVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import org.dromara.common.translation.annotation.Translation;
|
|||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.system.domain.SysNotice;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysNotice.class)
|
||||
public class SysNoticeVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.system.domain.SysOperLog;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -23,6 +24,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysOperLog.class)
|
||||
public class SysOperLogVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.system.domain.SysPost;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -23,6 +24,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysPost.class)
|
||||
public class SysPostVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.system.domain.SysRole;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysRole.class)
|
||||
public class SysRoleVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.system.domain.SysTenantPackage;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
|
@ -21,6 +22,7 @@ import java.io.Serializable;
|
|||
@AutoMapper(target = SysTenantPackage.class)
|
||||
public class SysTenantPackageVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
|
|||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ import java.util.Date;
|
|||
@AutoMapper(target = SysUserVo.class, convertGenerate = false)
|
||||
public class SysUserExportVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
|
|||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ import java.io.Serializable;
|
|||
// @Accessors(chain = true) // 导入不允许使用 会找不到set方法
|
||||
public class SysUserImportVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package org.dromara.system.domain.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -10,7 +12,10 @@ import java.util.List;
|
|||
* @author Michelle.Chung
|
||||
*/
|
||||
@Data
|
||||
public class SysUserInfoVo {
|
||||
public class SysUserInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import org.dromara.common.translation.annotation.Translation;
|
|||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -24,6 +25,7 @@ import java.util.List;
|
|||
@AutoMapper(target = SysUser.class)
|
||||
public class SysUserVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package org.dromara.system.domain.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
|
|
@ -10,7 +12,10 @@ import java.util.Set;
|
|||
* @author Michelle.Chung
|
||||
*/
|
||||
@Data
|
||||
public class UserInfoVo {
|
||||
public class UserInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户基本信息
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ package org.dromara.system.dubbo;
|
|||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.system.api.RemoteDictService;
|
||||
import org.dromara.system.api.domain.vo.RemoteDictDataVo;
|
||||
import org.dromara.system.domain.convert.SysDictDataVoConvert;
|
||||
import org.dromara.system.domain.vo.SysDictDataVo;
|
||||
import org.dromara.system.service.ISysDictTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -26,8 +26,8 @@ public class RemoteDictServiceImpl implements RemoteDictService {
|
|||
|
||||
@Override
|
||||
public List<RemoteDictDataVo> selectDictDataByType(String dictType) {
|
||||
List<SysDictDataVo> sysDictDataVos = sysDictTypeService.selectDictDataByType(dictType);
|
||||
return SysDictDataVoConvert.INSTANCE.convertList(sysDictDataVos);
|
||||
List<SysDictDataVo> list = sysDictTypeService.selectDictDataByType(dictType);
|
||||
return MapstructUtils.convert(list, RemoteDictDataVo.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@ package org.dromara.system.dubbo;
|
|||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.system.api.RemoteLogService;
|
||||
import org.dromara.system.api.domain.bo.RemoteLogininforBo;
|
||||
import org.dromara.system.api.domain.bo.RemoteOperLogBo;
|
||||
import org.dromara.system.domain.bo.SysLogininforBo;
|
||||
import org.dromara.system.domain.bo.SysOperLogBo;
|
||||
import org.dromara.system.domain.convert.SysLogininforBoConvert;
|
||||
import org.dromara.system.domain.convert.SysOperLogBoConvert;
|
||||
import org.dromara.system.service.ISysLogininforService;
|
||||
import org.dromara.system.service.ISysOperLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -28,13 +27,13 @@ public class RemoteLogServiceImpl implements RemoteLogService {
|
|||
|
||||
@Override
|
||||
public void saveLog(RemoteOperLogBo remoteOperLogBo) {
|
||||
SysOperLogBo sysOperLogBo = SysOperLogBoConvert.INSTANCE.convert(remoteOperLogBo);
|
||||
SysOperLogBo sysOperLogBo = MapstructUtils.convert(remoteOperLogBo, SysOperLogBo.class);
|
||||
operLogService.insertOperlog(sysOperLogBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveLogininfor(RemoteLogininforBo remoteLogininforBo) {
|
||||
SysLogininforBo sysLogininforBo = SysLogininforBoConvert.INSTANCE.convert(remoteLogininforBo);
|
||||
SysLogininforBo sysLogininforBo = MapstructUtils.convert(remoteLogininforBo, SysLogininforBo.class);
|
||||
logininforService.insertLogininfor(sysLogininforBo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ package org.dromara.system.dubbo;
|
|||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.system.api.RemoteTenantService;
|
||||
import org.dromara.system.api.domain.vo.RemoteTenantVo;
|
||||
import org.dromara.system.domain.bo.SysTenantBo;
|
||||
import org.dromara.system.domain.convert.SysTenantVoConvert;
|
||||
import org.dromara.system.domain.vo.SysTenantVo;
|
||||
import org.dromara.system.service.ISysTenantService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -27,8 +27,8 @@ public class RemoteTenantServiceImpl implements RemoteTenantService {
|
|||
*/
|
||||
@Override
|
||||
public RemoteTenantVo queryByTenantId(String tenantId) {
|
||||
SysTenantVo sysTenantVo = tenantService.queryByTenantId(tenantId);
|
||||
return SysTenantVoConvert.INSTANCE.convert(sysTenantVo);
|
||||
SysTenantVo vo = tenantService.queryByTenantId(tenantId);
|
||||
return MapstructUtils.convert(vo, RemoteTenantVo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -36,8 +36,8 @@ public class RemoteTenantServiceImpl implements RemoteTenantService {
|
|||
*/
|
||||
@Override
|
||||
public List<RemoteTenantVo> queryList() {
|
||||
List<SysTenantVo> sysTenantVos = tenantService.queryList(new SysTenantBo());
|
||||
return SysTenantVoConvert.INSTANCE.convertList(sysTenantVos);
|
||||
List<SysTenantVo> list = tenantService.queryList(new SysTenantBo());
|
||||
return MapstructUtils.convert(list, RemoteTenantVo.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.apache.dubbo.config.annotation.DubboService;
|
|||
import org.dromara.common.core.enums.UserStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.exception.user.UserException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.dromara.system.api.domain.bo.RemoteUserBo;
|
||||
import org.dromara.system.api.model.LoginUser;
|
||||
|
|
@ -15,7 +16,6 @@ import org.dromara.system.api.model.RoleDTO;
|
|||
import org.dromara.system.api.model.XcxLoginUser;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
import org.dromara.system.domain.bo.SysUserBo;
|
||||
import org.dromara.system.domain.convert.SysUserBoConvert;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.mapper.SysUserMapper;
|
||||
import org.dromara.system.service.ISysConfigService;
|
||||
|
|
@ -110,7 +110,7 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|||
|
||||
@Override
|
||||
public Boolean registerUserInfo(RemoteUserBo remoteUserBo) {
|
||||
SysUserBo sysUserBo = SysUserBoConvert.INSTANCE.convert(remoteUserBo);
|
||||
SysUserBo sysUserBo = MapstructUtils.convert(remoteUserBo, SysUserBo.class);
|
||||
String username = sysUserBo.getUserName();
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
||||
throw new ServiceException("当前系统没有开启注册功能");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class WebSecurityConfigurer {
|
|||
|
||||
return httpSecurity
|
||||
.headers().frameOptions().disable()
|
||||
.and().authorizeRequests()
|
||||
.and().authorizeHttpRequests()
|
||||
.requestMatchers(adminContextPath + "/assets/**"
|
||||
, adminContextPath + "/login"
|
||||
, adminContextPath + "/actuator/**"
|
||||
|
|
|
|||
Loading…
Reference in New Issue