update 迁移vue5.x内容,调整bo,vo映射,迁移租户业务

This commit is contained in:
Yjoioooo
2023-04-24 16:24:17 +08:00
parent fbe8aa4f5f
commit a5129fdc25
207 changed files with 7301 additions and 2437 deletions

View File

@@ -30,6 +30,11 @@ public interface CacheNames {
*/
String SYS_DICT = "sys_dict";
/**
* 租户
*/
String SYS_TENANT = GlobalConstants.GLOBAL_REDIS_KEY + "sys_tenant#30d";
/**
* 用户账户
*/

View File

@@ -3,9 +3,10 @@ package org.dromara.common.core.constant;
/**
* 通用常量信息
*
* @author Lion Li
* @author ruoyi
*/
public interface Constants {
/**
* UTF-8 字符集
*/
@@ -32,24 +33,14 @@ public interface Constants {
String HTTPS = "https://";
/**
* 成功标
* 通用成功标
*/
Integer SUCCESS = 200;
String SUCCESS = "0";
/**
* 失败标
* 通用失败标
*/
Integer FAIL = 500;
/**
* 登录成功状态
*/
String LOGIN_SUCCESS_STATUS = "0";
/**
* 登录失败状态
*/
String LOGIN_FAIL_STATUS = "1";
String FAIL = "1";
/**
* 登录成功
@@ -74,13 +65,17 @@ public interface Constants {
/**
* 验证码有效期(分钟)
*/
long CAPTCHA_EXPIRATION = 2;
Integer CAPTCHA_EXPIRATION = 2;
/**
* 防重提交 redis key
* 令牌
*/
String REPEAT_SUBMIT_KEY = "repeat_submit:";
String TOKEN = "token";
String ACCESS_TOKEN = "access_token";
/**
* 顶级部门id
*/
Long TOP_PARENT_ID = 0L;
}

View File

@@ -1,9 +1,8 @@
package org.dromara.common.core.domain;
import org.dromara.common.core.constant.Constants;
import org.dromara.common.core.constant.HttpStatus;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dromara.common.core.constant.HttpStatus;
import java.io.Serializable;
@@ -20,12 +19,12 @@ public class R<T> implements Serializable {
/**
* 成功
*/
public static final int SUCCESS = Constants.SUCCESS;
public static final int SUCCESS = 200;
/**
* 失败
*/
public static final int FAIL = Constants.FAIL;
public static final int FAIL = 500;
/**
* 消息状态码

View File

@@ -0,0 +1,30 @@
package org.dromara.common.core.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 用户状态
*
* @author LionLi
*/
@Getter
@AllArgsConstructor
public enum TenantStatus {
/**
* 正常
*/
OK("0", "正常"),
/**
* 停用
*/
DISABLE("1", "停用"),
/**
* 删除
*/
DELETED("2", "删除");
private final String code;
private final String info;
}

View File

@@ -0,0 +1,92 @@
package org.dromara.common.core.utils;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import io.github.linpeilie.Converter;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Map;
/**
* Mapstruct 工具类
* <p>参考文档:<a href="https://mapstruct.plus/guide/quick-start">mapstruct-plus</a></p>
*
* @author Michelle.Chung
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class MapstructUtils {
private final static Converter CONVERTER = SpringUtils.getBean(Converter.class);
/**
* 将 T 类型对象,转换为 desc 类型的对象并返回
*
* @param source 数据来源实体
* @param desc 描述对象 转换后的对象
* @return desc
*/
public static <T, V> V convert(T source, Class<V> desc) {
if (ObjectUtil.isNull(source)) {
return null;
}
if (ObjectUtil.isNull(desc)) {
return null;
}
return CONVERTER.convert(source, desc);
}
/**
* 将 T 类型对象,按照配置的映射字段规则,给 desc 类型的对象赋值并返回 desc 对象
*
* @param source 数据来源实体
* @param desc 转换后的对象
* @return desc
*/
public static <T, V> V convert(T source, V desc) {
if (ObjectUtil.isNull(source)) {
return null;
}
if (ObjectUtil.isNull(desc)) {
return null;
}
return CONVERTER.convert(source, desc);
}
/**
* 将 T 类型的集合,转换为 desc 类型的集合并返回
*
* @param sourceList 数据来源实体列表
* @param desc 描述对象 转换后的对象
* @return desc
*/
public static <T, V> List<V> convert(List<T> sourceList, Class<V> desc) {
if (ObjectUtil.isNull(sourceList)) {
return null;
}
if (CollUtil.isEmpty(sourceList)) {
return CollUtil.newArrayList();
}
return CONVERTER.convert(sourceList, desc);
}
/**
* 将 Map 转换为 beanClass 类型的集合并返回
*
* @param map 数据来源
* @param beanClass bean类
* @return bean对象
*/
public static <T> T convert(Map<String, Object> map, Class<T> beanClass) {
if (MapUtil.isEmpty(map)) {
return null;
}
if (ObjectUtil.isNull(beanClass)) {
return null;
}
return CONVERTER.convert(map, beanClass);
}
}

View File

@@ -33,7 +33,7 @@ public class BaseEntity implements Serializable {
* 创建者
*/
@TableField(fill = FieldFill.INSERT)
private String createBy;
private Long createBy;
/**
* 创建时间
@@ -45,7 +45,7 @@ public class BaseEntity implements Serializable {
* 更新者
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private String updateBy;
private Long updateBy;
/**
* 更新时间