系统配置修改

This commit is contained in:
2025-12-09 18:07:44 +08:00
parent e242ff172c
commit b59babed0a
33 changed files with 1177 additions and 128 deletions

View File

@@ -2,48 +2,77 @@ CREATE SCHEMA IF NOT EXISTS file;
DROP TABLE IF EXISTS file.tb_sys_file CASCADE;
CREATE TABLE file.tb_sys_file (
optsn VARCHAR(50) NOT NULL, -- 流水号
file_id VARCHAR(50) NOT NULL, -- 文件ID
name VARCHAR(255) NOT NULL, -- 文件名
path VARCHAR(255) NOT NULL, -- 文件路径
size BIGINT NOT NULL, -- 文件大小
type VARCHAR(50) NOT NULL, -- 文件类型
storage_type VARCHAR(50) NOT NULL, -- 存储类型
mime_type VARCHAR(255) NOT NULL, -- 文件MIME类型
url VARCHAR(255) NOT NULL, -- 文件URL
status VARCHAR(50) NOT NULL, -- 文件状态
service_type VARCHAR(50), -- 服务类型bidding/customer_service/internal等
dept_path VARCHAR(255) NOT NULL, -- 当前部门路径
creator VARCHAR(50) DEFAULT NULL, -- 创建者
updater VARCHAR(50) DEFAULT NULL, -- 更新者
-- BaseDTO 继承字段
optsn VARCHAR(50) NOT NULL, -- 操作流水号
creator VARCHAR(50) DEFAULT NULL, -- 创建人
updater VARCHAR(50) DEFAULT NULL, -- 更新人
dept_path VARCHAR(255) DEFAULT NULL, -- 部门路径
remark TEXT DEFAULT NULL, -- 备注
create_time TIMESTAMPTZ NOT NULL DEFAULT now(), -- 创建时间
update_time TIMESTAMPTZ DEFAULT NULL, -- 更新时间(由触发器维护)
update_time TIMESTAMPTZ DEFAULT NULL, -- 更新时间
delete_time TIMESTAMPTZ DEFAULT NULL, -- 删除时间
deleted BOOLEAN NOT NULL DEFAULT false, -- 是否删除
deleted INTEGER NOT NULL DEFAULT 0, -- 是否删除0-未删除1-已删除)
-- TbSysFileDTO 特有字段
file_id VARCHAR(50) NOT NULL, -- 文件ID (主键)
name VARCHAR(255) NOT NULL, -- 文件名
path VARCHAR(500) NOT NULL, -- 文件路径
size BIGINT NOT NULL, -- 文件大小(字节)
type VARCHAR(50) DEFAULT NULL, -- 文件类型
storage_type VARCHAR(50) DEFAULT NULL, -- 存储类型
mime_type VARCHAR(255) DEFAULT NULL, -- MIME 类型
url VARCHAR(500) DEFAULT NULL, -- 文件访问 URL
status VARCHAR(50) DEFAULT NULL, -- 文件状态
module VARCHAR(100) DEFAULT NULL, -- 所属模块
business_id VARCHAR(50) DEFAULT NULL, -- 业务ID
uploader VARCHAR(50) DEFAULT NULL, -- 上传者用户ID
object_name VARCHAR(500) DEFAULT NULL, -- MinIO对象名称
bucket_name VARCHAR(100) DEFAULT NULL, -- MinIO存储桶名称
md5_hash VARCHAR(32) DEFAULT NULL, -- 文件MD5值
extension VARCHAR(20) DEFAULT NULL, -- 文件扩展名
PRIMARY KEY (file_id),
UNIQUE (optsn)
);
CREATE INDEX idx_file_service ON file.tb_sys_file(service_type) WHERE deleted = false;
COMMENT ON TABLE file.tb_sys_file IS '文件表';
COMMENT ON COLUMN file.tb_sys_file.service_type IS '服务类型(用于服务间数据隔离)';
COMMENT ON COLUMN file.tb_sys_file.optsn IS '流水号';
COMMENT ON COLUMN file.tb_sys_file.file_id IS '文件ID';
COMMENT ON COLUMN file.tb_sys_file.name IS '文件名';
COMMENT ON COLUMN file.tb_sys_file.path IS '文件路径';
COMMENT ON COLUMN file.tb_sys_file.size IS '文件大小';
COMMENT ON COLUMN file.tb_sys_file.type IS '文件类型';
COMMENT ON COLUMN file.tb_sys_file.storage_type IS '存储类型';
COMMENT ON COLUMN file.tb_sys_file.mime_type IS '文件MIME类型';
COMMENT ON COLUMN file.tb_sys_file.url IS '文件URL';
COMMENT ON COLUMN file.tb_sys_file.status IS '文件状态';
COMMENT ON COLUMN file.tb_sys_file.dept_path IS '当前部门路径';
COMMENT ON COLUMN file.tb_sys_file.creator IS '创建者';
COMMENT ON COLUMN file.tb_sys_file.updater IS '更新者';
COMMENT ON TABLE file.tb_sys_file IS '系统文件表';
-- BaseDTO 继承字段注释
COMMENT ON COLUMN file.tb_sys_file.optsn IS '操作流水号';
COMMENT ON COLUMN file.tb_sys_file.creator IS '创建人';
COMMENT ON COLUMN file.tb_sys_file.updater IS '更新人';
COMMENT ON COLUMN file.tb_sys_file.dept_path IS '部门路径';
COMMENT ON COLUMN file.tb_sys_file.remark IS '备注';
COMMENT ON COLUMN file.tb_sys_file.create_time IS '创建时间';
COMMENT ON COLUMN file.tb_sys_file.update_time IS '更新时间';
COMMENT ON COLUMN file.tb_sys_file.delete_time IS '删除时间';
COMMENT ON COLUMN file.tb_sys_file.deleted IS '是否删除';
COMMENT ON COLUMN file.tb_sys_file.deleted IS '是否删除0-未删除1-已删除)';
-- TbSysFileDTO 特有字段注释
COMMENT ON COLUMN file.tb_sys_file.file_id IS '文件ID (主键)';
COMMENT ON COLUMN file.tb_sys_file.name IS '文件名';
COMMENT ON COLUMN file.tb_sys_file.path IS '文件路径';
COMMENT ON COLUMN file.tb_sys_file.size IS '文件大小(字节)';
COMMENT ON COLUMN file.tb_sys_file.type IS '文件类型';
COMMENT ON COLUMN file.tb_sys_file.storage_type IS '存储类型';
COMMENT ON COLUMN file.tb_sys_file.mime_type IS 'MIME 类型';
COMMENT ON COLUMN file.tb_sys_file.url IS '文件访问 URL';
COMMENT ON COLUMN file.tb_sys_file.status IS '文件状态';
COMMENT ON COLUMN file.tb_sys_file.module IS '所属模块';
COMMENT ON COLUMN file.tb_sys_file.business_id IS '业务ID';
COMMENT ON COLUMN file.tb_sys_file.uploader IS '上传者用户ID';
COMMENT ON COLUMN file.tb_sys_file.object_name IS 'MinIO对象名称';
COMMENT ON COLUMN file.tb_sys_file.bucket_name IS 'MinIO存储桶名称';
COMMENT ON COLUMN file.tb_sys_file.md5_hash IS '文件MD5值';
COMMENT ON COLUMN file.tb_sys_file.extension IS '文件扩展名';
-- 文件表索引
CREATE INDEX idx_file_module_business ON file.tb_sys_file(module, business_id) WHERE deleted = 0;
CREATE INDEX idx_file_uploader ON file.tb_sys_file(uploader) WHERE deleted = 0;
CREATE INDEX idx_file_bucket ON file.tb_sys_file(bucket_name) WHERE deleted = 0;
CREATE INDEX idx_file_status ON file.tb_sys_file(status) WHERE deleted = 0;
CREATE INDEX idx_file_create_time ON file.tb_sys_file(create_time) WHERE deleted = 0;
CREATE INDEX idx_file_md5 ON file.tb_sys_file(md5_hash) WHERE deleted = 0;
-- =============================
-- 文件关联表
@@ -85,6 +114,7 @@ COMMENT ON COLUMN file.tb_file_relation.update_time IS '更新时间';
COMMENT ON COLUMN file.tb_file_relation.delete_time IS '删除时间';
COMMENT ON COLUMN file.tb_file_relation.deleted IS '是否删除';
-- 文件关联表索引
CREATE INDEX idx_file_relation_object ON file.tb_file_relation(object_type, object_id) WHERE deleted = false;
CREATE INDEX idx_file_relation_file ON file.tb_file_relation(file_id) WHERE deleted = false;
CREATE INDEX idx_file_relation_service ON file.tb_file_relation(service_type) WHERE deleted = false;

View File

@@ -24,9 +24,25 @@ INSERT INTO config.tb_sys_config (
-- 存储与上传
('CFG-0301', 'cfg_upload_max', 'upload.maxSizeMB', '最大上传大小', '50', 'INTEGER', 'input', '单文件最大上传(MB)', NULL, NULL, 'storage', 'mod_file', 10, 0, '前后端需一致校验', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0302', 'cfg_storage_backend', 'storage.backend', '存储后端', 'local', 'String', 'select', '存储后端类型', NULL, '["local", "minio", "s3"]'::json, 'storage', 'mod_file', 20, 0, '本地/MinIO/S3等', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0302', 'cfg_storage_backend', 'storage.backend', '存储后端', 'minio', 'String', 'select', '存储后端类型', NULL, '["local", "minio", "s3"]'::json, 'storage', 'mod_file', 20, 0, '本地/MinIO/S3等当前默认MinIO', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0303', 'cfg_storage_base', 'storage.basePath', '存储路径', '/data/urban-lifeline', 'String', 'input', '本地存储基路径', NULL, NULL, 'storage', 'mod_file', 30, 0, '当 backend=local', 'system', NULL, NULL, now(), NULL, NULL, false),
-- MinIO 对象存储配置
('CFG-0310', 'cfg_minio_endpoint', 'minio.endpoint', 'MinIO服务端点', 'http://localhost:9000', 'String', 'input', 'MinIO服务器地址', NULL, NULL, 'storage', 'mod_file', 40, 0, 'MinIO API服务地址如 http://localhost:9000', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0311', 'cfg_minio_accesskey', 'minio.accessKey', 'MinIO访问密钥', 'minioadmin', 'String', 'input', 'MinIO AccessKey', NULL, NULL, 'storage', 'mod_file', 50, 0, 'MinIO认证的AccessKey', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0312', 'cfg_minio_secretkey', 'minio.secretKey', 'MinIO私钥', 'minioadmin123', 'String', 'password', 'MinIO SecretKey', NULL, NULL, 'storage', 'mod_file', 60, 0, 'MinIO认证的SecretKey', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0313', 'cfg_minio_bucket', 'minio.bucketName', 'MinIO存储桶', 'urban-lifeline', 'String', 'input', 'MinIO默认存储桶名称', NULL, NULL, 'storage', 'mod_file', 70, 0, '用于存储文件的默认bucket', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0314', 'cfg_minio_publicurl', 'minio.publicUrl', 'MinIO公网地址', 'http://localhost:9000', 'String', 'input', 'MinIO公网访问地址', NULL, NULL, 'storage', 'mod_file', 80, 0, '用于生成文件访问URL可与endpoint不同', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0315', 'cfg_minio_ssl', 'minio.ssl.enabled', '启用SSL', 'false', 'BOOLEAN', 'switch', '是否启用SSL连接', NULL, NULL, 'storage', 'mod_file', 90, 0, 'HTTPS连接MinIO服务', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0316', 'cfg_minio_region', 'minio.region', 'MinIO区域', 'us-east-1', 'String', 'input', 'MinIO存储区域', NULL, NULL, 'storage', 'mod_file', 100, 0, 'AWS S3兼容的区域配置', 'system', NULL, NULL, now(), NULL, NULL, false),
-- 文件管理配置
('CFG-0320', 'cfg_file_allowed_exts','file.allowedExtensions', '允许的文件扩展名', 'jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,ppt,pptx,txt,zip,rar', 'String', 'textarea', '允许上传的文件扩展名', NULL, NULL, 'storage', 'mod_file', 110, 0, '逗号分隔,如 jpg,png,pdf', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0321', 'cfg_file_forbidden_exts','file.forbiddenExtensions','禁止的文件扩展名', 'exe,bat,sh,php,jsp,asp', 'String', 'textarea', '禁止上传的文件扩展名', NULL, NULL, 'storage', 'mod_file', 120, 0, '逗号分隔,安全考虑', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0322', 'cfg_file_cleanup_days', 'file.tempCleanupDays', '临时文件清理天数', '7', 'INTEGER', 'input', '临时文件自动清理天数', NULL, NULL, 'storage', 'mod_file', 130, 0, '超过天数的临时文件将被清理', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0323', 'cfg_file_duplicate_check','file.duplicateCheck.enabled','启用文件去重', 'true', 'BOOLEAN', 'switch', '是否启用MD5去重检查', NULL, NULL, 'storage', 'mod_file', 140, 0, '基于MD5值检查重复文件', 'system', NULL, NULL, now(), NULL, NULL, false),
('CFG-0324', 'cfg_file_virus_scan', 'file.virusScan.enabled', '启用病毒扫描', 'false', 'BOOLEAN', 'switch', '是否启用文件病毒扫描', NULL, NULL, 'storage', 'mod_file', 150, 0, '需要集成防病毒引擎', 'system', NULL, NULL, now(), NULL, NULL, false),
-- 通知(邮件/SMS
-- 邮件配置
('CFG-0401', 'cfg_mail_host', 'email.host', 'SMTP服务器地址', 'smtp.qq.com', 'String', 'input', 'SMTP服务器地址', NULL, NULL, 'notify', 'mod_message', 10, 1, '邮件发送服务器地址', 'system', NULL, NULL, now(), NULL, NULL, false),

View File

@@ -60,3 +60,38 @@ services:
# Linux 需要添加 extra_hosts 来访问主机服务
extra_hosts:
- "host.docker.internal:host-gateway"
minio:
image: minio/minio:latest
container_name: urban-lifeline-minio
restart: unless-stopped
networks:
- urban-lifeline
ports:
- "9000:9000" # MinIO API 端口
- "9001:9001" # MinIO Console (Web UI) 端口
environment:
# 管理员账户配置
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin123
# Console 地址配置
MINIO_CONSOLE_ADDRESS: ":9001"
MINIO_ADDRESS: ":9000"
# 时区设置
TZ: Asia/Shanghai
volumes:
# 数据持久化到主机目录
- ../../.data/docker/minio/data:/data
- ../../.data/docker/minio/config:/root/.minio
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
start_period: 30s

View File

@@ -144,14 +144,14 @@
"Gateway (8180)",
"Auth (8181)",
"System (8182)",
"Log (8183)",
// "Log (8183)",
"File (8184)",
"Message (8185)",
"Bidding (8186)",
"Platform (8187)",
"Workcase (8188)",
"Crontab (8189)",
"Agent (8190)"
// "Message (8185)",
// "Bidding (8186)",
// "Platform (8187)",
// "Workcase (8188)",
// "Crontab (8189)",
// "Agent (8190)"
],
"stopAll": true,
"presentation": {

View File

@@ -0,0 +1,6 @@
---
trigger: manual
---
1. 有BaseDTO基类,DTO\VO在api模块下面
2. 用Dubbo注册和引用服务

View File

@@ -46,4 +46,25 @@ public class TbSysFileDTO extends BaseDTO {
@Schema(description = "文件状态")
private String status;
@Schema(description = "所属模块")
private String module;
@Schema(description = "业务ID")
private String businessId;
@Schema(description = "上传者用户ID")
private String uploader;
@Schema(description = "MinIO对象名称")
private String objectName;
@Schema(description = "MinIO存储桶名称")
private String bucketName;
@Schema(description = "文件MD5值")
private String md5Hash;
@Schema(description = "文件扩展名")
private String extension;
}

View File

@@ -0,0 +1,58 @@
package org.xyzh.common.utils.json;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedTypes;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* @description FastJSON2 JSONObject 类型处理器
* @filename FastJson2TypeHandler.java
* @author yslg
* @copyright yslg
* @since 2025-12-09
*/
@MappedTypes({JSONObject.class})
public class FastJson2TypeHandler extends BaseTypeHandler<JSONObject> {
@Override
public void setNonNullParameter(PreparedStatement ps, int i, JSONObject parameter, JdbcType jdbcType) throws SQLException {
ps.setString(i, parameter.toJSONString());
}
@Override
public JSONObject getNullableResult(ResultSet rs, String columnName) throws SQLException {
String jsonString = rs.getString(columnName);
return parseToJSONObject(jsonString);
}
@Override
public JSONObject getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
String jsonString = rs.getString(columnIndex);
return parseToJSONObject(jsonString);
}
@Override
public JSONObject getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String jsonString = cs.getString(columnIndex);
return parseToJSONObject(jsonString);
}
private JSONObject parseToJSONObject(String jsonString) {
if (jsonString == null || jsonString.trim().isEmpty()) {
return null;
}
try {
return JSON.parseObject(jsonString);
} catch (Exception e) {
// 如果解析失败返回一个空的JSONObject
return new JSONObject();
}
}
}

View File

@@ -29,6 +29,10 @@
<groupId>org.xyzh.apis</groupId>
<artifactId>api-file</artifactId>
</dependency>
<dependency>
<groupId>org.xyzh.apis</groupId>
<artifactId>api-system</artifactId>
</dependency>
<!-- Spring Boot Web -->
<dependency>

View File

@@ -0,0 +1,145 @@
package org.xyzh.file.config;
import io.minio.MinioClient;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.xyzh.api.system.service.SysConfigService;
import org.apache.dubbo.config.annotation.DubboReference;
import jakarta.annotation.PostConstruct;
/**
* @description MinIO 配置类,从数据库读取配置信息
* @filename MinioConfig.java
* @author yslg
* @copyright yslg
* @since 2025-12-09
*/
@Data
@Component
public class MinioConfig {
private static final Logger logger = LoggerFactory.getLogger(MinioConfig.class);
@DubboReference(version = "1.0.0", group = "system", timeout = 3000, retries = 0)
private SysConfigService sysConfigService;
// MinIO 配置项的键名
private static final String MINIO_ENDPOINT_KEY = "minio.endpoint";
private static final String MINIO_ACCESS_KEY = "minio.accessKey";
private static final String MINIO_SECRET_KEY = "minio.secretKey";
private static final String MINIO_BUCKET_NAME_KEY = "minio.bucketName";
private static final String MINIO_PUBLIC_URL_KEY = "minio.publicUrl";
// 默认值
private static final String DEFAULT_ENDPOINT = "http://localhost:9000";
private static final String DEFAULT_ACCESS_KEY = "minioadmin";
private static final String DEFAULT_SECRET_KEY = "minioadmin123";
private static final String DEFAULT_BUCKET_NAME = "urban-lifeline";
private static final String DEFAULT_PUBLIC_URL = "http://localhost:9000";
// 配置属性
private String endpoint;
private String accessKey;
private String secretKey;
private String bucketName;
private String publicUrl;
private MinioClient minioClient;
@PostConstruct
public void init() {
loadConfig();
initClient();
}
/**
* 从数据库加载MinIO配置
*/
private void loadConfig() {
try {
endpoint = sysConfigService.getStringConfig(MINIO_ENDPOINT_KEY);
accessKey = sysConfigService.getStringConfig(MINIO_ACCESS_KEY);
secretKey = sysConfigService.getStringConfig(MINIO_SECRET_KEY);
bucketName = sysConfigService.getStringConfig(MINIO_BUCKET_NAME_KEY);
publicUrl = sysConfigService.getStringConfig(MINIO_PUBLIC_URL_KEY);
// 使用默认值如果配置不存在
if (endpoint == null || endpoint.trim().isEmpty()) {
endpoint = DEFAULT_ENDPOINT;
logger.warn("未找到MinIO endpoint配置使用默认值: {}", DEFAULT_ENDPOINT);
}
if (accessKey == null || accessKey.trim().isEmpty()) {
accessKey = DEFAULT_ACCESS_KEY;
logger.warn("未找到MinIO accessKey配置使用默认值");
}
if (secretKey == null || secretKey.trim().isEmpty()) {
secretKey = DEFAULT_SECRET_KEY;
logger.warn("未找到MinIO secretKey配置使用默认值");
}
if (bucketName == null || bucketName.trim().isEmpty()) {
bucketName = DEFAULT_BUCKET_NAME;
logger.warn("未找到MinIO bucketName配置使用默认值: {}", DEFAULT_BUCKET_NAME);
}
if (publicUrl == null || publicUrl.trim().isEmpty()) {
publicUrl = endpoint; // 默认使用endpoint作为公网访问地址
logger.warn("未找到MinIO publicUrl配置使用endpoint作为默认值: {}", endpoint);
}
logger.info("MinIO配置加载完成 - endpoint: {}, bucketName: {}", endpoint, bucketName);
} catch (Exception e) {
logger.error("加载MinIO配置失败使用默认配置", e);
endpoint = DEFAULT_ENDPOINT;
accessKey = DEFAULT_ACCESS_KEY;
secretKey = DEFAULT_SECRET_KEY;
bucketName = DEFAULT_BUCKET_NAME;
publicUrl = DEFAULT_PUBLIC_URL;
}
}
/**
* 初始化MinIO客户端
*/
private void initClient() {
try {
minioClient = MinioClient.builder()
.endpoint(endpoint)
.credentials(accessKey, secretKey)
.build();
logger.info("MinIO客户端初始化成功");
} catch (Exception e) {
logger.error("MinIO客户端初始化失败", e);
throw new RuntimeException("MinIO客户端初始化失败", e);
}
}
/**
* 重新加载配置
*/
public void reloadConfig() {
logger.info("重新加载MinIO配置");
loadConfig();
initClient();
}
/**
* 获取MinIO客户端
*/
public MinioClient getMinioClient() {
return minioClient;
}
/**
* 构建文件的公网访问URL
* @param objectName 对象名称
* @return 完整的文件访问URL
*/
public String buildFileUrl(String objectName) {
return publicUrl + "/" + bucketName + "/" + objectName;
}
}

View File

@@ -0,0 +1,87 @@
package org.xyzh.file.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.xyzh.api.file.dto.TbSysFileDTO;
/**
* @description 文件Mapper接口
* @filename FileMapper.java
* @author yslg
* @copyright yslg
* @since 2025-12-09
*/
@Mapper
public interface FileMapper extends BaseMapper<TbSysFileDTO> {
/**
* 根据文件ID查询文件信息自定义方法替代selectById
* @param fileId 文件ID
* @return 文件信息
*/
@Select("SELECT * FROM file.tb_sys_file WHERE file_id = #{fileId} AND deleted = 0")
TbSysFileDTO selectByFileId(@Param("fileId") String fileId);
/**
* 插入文件记录(自定义方法)
* @param fileDTO 文件DTO
* @return 影响行数
*/
int insertFile(TbSysFileDTO fileDTO);
/**
* 根据文件ID更新文件信息自定义方法替代updateById
* @param fileDTO 文件DTO
* @return 影响行数
*/
int updateByFileId(TbSysFileDTO fileDTO);
/**
* 根据文件ID逻辑删除文件自定义方法
* @param fileId 文件ID
* @param updater 更新者
* @return 影响行数
*/
@Update("UPDATE file.tb_sys_file SET deleted = 1, delete_time = CURRENT_TIMESTAMP, updater = #{updater} WHERE file_id = #{fileId}")
int deleteByFileId(@Param("fileId") String fileId, @Param("updater") String updater);
/**
* 根据模块和业务ID查询文件列表
* @param module 模块
* @param businessId 业务ID
* @return 文件列表
*/
@Select("SELECT * FROM file.tb_sys_file WHERE module = #{module} AND business_id = #{businessId} AND deleted = 0 ORDER BY create_time DESC")
List<TbSysFileDTO> selectByModuleAndBusinessId(@Param("module") String module, @Param("businessId") String businessId);
/**
* 根据上传者查询文件列表
* @param uploader 上传者用户ID
* @return 文件列表
*/
@Select("SELECT * FROM file.tb_sys_file WHERE uploader = #{uploader} AND deleted = 0 ORDER BY create_time DESC")
List<TbSysFileDTO> selectByUploader(@Param("uploader") String uploader);
/**
* 根据MD5查询文件用于防重复上传
* @param md5Hash MD5哈希值
* @return 文件信息
*/
@Select("SELECT * FROM file.tb_sys_file WHERE md5_hash = #{md5Hash} AND deleted = 0 LIMIT 1")
TbSysFileDTO selectByMd5Hash(@Param("md5Hash") String md5Hash);
/**
* 根据MinIO对象名称查询文件
* @param bucketName 存储桶名称
* @param objectName 对象名称
* @return 文件信息
*/
@Select("SELECT * FROM file.tb_sys_file WHERE bucket_name = #{bucketName} AND object_name = #{objectName} AND deleted = 0")
TbSysFileDTO selectByMinioObject(@Param("bucketName") String bucketName, @Param("objectName") String objectName);
}

View File

@@ -0,0 +1,307 @@
package org.xyzh.file.service.impl;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.beans.BeanUtils; // 不再需要BeanUtils
import org.springframework.util.DigestUtils;
import org.springframework.web.multipart.MultipartFile;
import org.xyzh.api.file.dto.TbSysFileDTO;
import org.xyzh.api.file.service.FileService;
import org.xyzh.common.core.domain.ResultDomain;
import org.xyzh.file.config.MinioConfig;
import org.xyzh.file.mapper.FileMapper;
import org.xyzh.file.util.MinioUtil;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* @description 文件服务实现类
* @filename FileServiceImpl.java
* @author yslg
* @copyright yslg
* @since 2025-12-09
*/
@DubboService(
version = "1.0.0",
group = "file",
timeout = 3000,
retries = 0
)
public class FileServiceImpl implements FileService {
private static final Logger logger = LoggerFactory.getLogger(FileServiceImpl.class);
@Autowired
private MinioConfig minioConfig;
@Autowired
private MinioUtil minioUtil;
@Autowired
private FileMapper fileMapper;
@Override
public ResultDomain<TbSysFileDTO> uploadFile(MultipartFile file, String module, String businessId) {
try {
if (file == null || file.isEmpty()) {
return ResultDomain.failure("文件不能为空");
}
// 生成文件信息
String originalFilename = file.getOriginalFilename();
String extension = getFileExtension(originalFilename);
String contentType = file.getContentType();
long size = file.getSize();
// 生成唯一的对象名称
String objectName = generateObjectName(originalFilename, module);
// 计算文件MD5
String md5Hash = calculateMD5(file.getBytes());
// 上传到MinIO
String bucketName = minioConfig.getBucketName();
boolean uploadSuccess = minioUtil.uploadFile(
bucketName,
objectName,
file.getInputStream(),
size,
contentType
);
if (!uploadSuccess) {
return ResultDomain.failure("文件上传到MinIO失败");
}
// 构建文件访问URL
String fileUrl = minioConfig.buildFileUrl(objectName);
// 保存到数据库
TbSysFileDTO fileDTO = new TbSysFileDTO();
fileDTO.setOptsn(UUID.randomUUID().toString());
fileDTO.setFileId(UUID.randomUUID().toString());
fileDTO.setName(originalFilename);
fileDTO.setPath(objectName);
fileDTO.setSize(size);
fileDTO.setType(extension);
fileDTO.setStorageType("MINIO");
fileDTO.setMimeType(contentType);
fileDTO.setUrl(fileUrl);
fileDTO.setStatus("NORMAL");
fileDTO.setModule(module);
fileDTO.setBusinessId(businessId);
fileDTO.setObjectName(objectName);
fileDTO.setBucketName(bucketName);
fileDTO.setMd5Hash(md5Hash);
fileDTO.setExtension(extension);
fileDTO.setCreateTime(new java.util.Date());
int result = fileMapper.insertFile(fileDTO);
if (result <= 0) {
// 如果数据库保存失败删除MinIO中的文件
minioUtil.deleteFile(bucketName, objectName);
return ResultDomain.failure("文件信息保存失败");
}
logger.info("文件上传成功: {}, 大小: {} bytes", originalFilename, size);
return ResultDomain.success("文件上传成功", fileDTO);
} catch (Exception e) {
logger.error("文件上传失败", e);
return ResultDomain.failure("文件上传失败: " + e.getMessage());
}
}
@Override
public ResultDomain<TbSysFileDTO> batchUploadFiles(MultipartFile[] files, String module, String businessId, String uploader) {
try {
if (files == null || files.length == 0) {
return ResultDomain.failure("文件列表不能为空");
}
List<TbSysFileDTO> uploadedFiles = new ArrayList<>();
for (MultipartFile file : files) {
ResultDomain<TbSysFileDTO> result = uploadFile(file, module, businessId);
if (result.getSuccess()) {
TbSysFileDTO fileDTO = result.getData();
fileDTO.setUploader(uploader);
uploadedFiles.add(fileDTO);
} else {
// 如果有文件上传失败,记录日志但继续处理其他文件
logger.warn("文件上传失败: {}, 原因: {}", file.getOriginalFilename(), result.getMessage());
}
}
if (uploadedFiles.isEmpty()) {
return ResultDomain.failure("所有文件上传失败");
}
// 返回上传成功的文件列表(这里简化处理,实际可能需要返回详细结果)
TbSysFileDTO resultDTO = new TbSysFileDTO();
// 可以在这里设置批量上传的汇总信息
logger.info("批量文件上传完成,成功: {}, 总数: {}", uploadedFiles.size(), files.length);
return ResultDomain.success("批量文件上传成功", resultDTO);
} catch (Exception e) {
logger.error("批量文件上传失败", e);
return ResultDomain.failure("批量文件上传失败: " + e.getMessage());
}
}
@Override
public ResultDomain<Boolean> deleteFile(String fileId) {
try {
// 从数据库获取文件信息
TbSysFileDTO sysFile = fileMapper.selectByFileId(fileId);
if (sysFile == null) {
return ResultDomain.failure("文件不存在");
}
// 删除MinIO中的文件
minioUtil.deleteFile(sysFile.getBucketName(), sysFile.getObjectName());
// 逻辑删除数据库记录
int result = fileMapper.deleteByFileId(fileId, "system");
if (result > 0) {
logger.info("文件删除成功: {}", fileId);
return ResultDomain.success("文件删除成功", true);
} else {
return ResultDomain.failure("文件删除失败");
}
} catch (Exception e) {
logger.error("文件删除失败: {}", fileId, e);
return ResultDomain.failure("文件删除失败: " + e.getMessage());
}
}
@Override
public ResultDomain<TbSysFileDTO> batchDeleteFiles(String[] fileIds) {
try {
if (fileIds == null || fileIds.length == 0) {
return ResultDomain.failure("文件ID列表不能为空");
}
int successCount = 0;
for (String fileId : fileIds) {
ResultDomain<Boolean> result = deleteFile(fileId);
if (result.getSuccess()) {
successCount++;
}
}
TbSysFileDTO resultDTO = new TbSysFileDTO();
// 可以在这里设置批量删除的结果统计
logger.info("批量文件删除完成,成功: {}, 总数: {}", successCount, fileIds.length);
return ResultDomain.success("批量文件删除完成", resultDTO);
} catch (Exception e) {
logger.error("批量文件删除失败", e);
return ResultDomain.failure("批量文件删除失败: " + e.getMessage());
}
}
@Override
public ResultDomain<byte[]> downloadFile(String fileId) {
try {
// 从数据库获取文件信息
TbSysFileDTO sysFile = fileMapper.selectByFileId(fileId);
if (sysFile == null) {
return ResultDomain.failure("文件不存在");
}
// 从MinIO下载文件
InputStream inputStream = minioUtil.downloadFile(sysFile.getBucketName(), sysFile.getObjectName());
if (inputStream == null) {
return ResultDomain.failure("文件下载失败");
}
// 将输入流转换为字节数组
byte[] data = inputStream.readAllBytes();
inputStream.close();
logger.info("文件下载成功: {}", fileId);
return ResultDomain.success("文件下载成功", data);
} catch (Exception e) {
logger.error("文件下载失败: {}", fileId, e);
return ResultDomain.failure("文件下载失败: " + e.getMessage());
}
}
@Override
public ResultDomain<TbSysFileDTO> getFileById(String fileId) {
try {
TbSysFileDTO sysFile = fileMapper.selectByFileId(fileId);
if (sysFile == null) {
return ResultDomain.failure("文件不存在");
}
return ResultDomain.success("获取文件信息成功", sysFile);
} catch (Exception e) {
logger.error("查询文件失败: {}", fileId, e);
return ResultDomain.failure("查询文件失败: " + e.getMessage());
}
}
@Override
public ResultDomain<TbSysFileDTO> saveTempFile(MultipartFile file, String module, String businessId) {
try {
// 临时文件上传逻辑与普通上传相同,但可以添加特殊标识
ResultDomain<TbSysFileDTO> result = uploadFile(file, module, businessId);
if (result.getSuccess()) {
TbSysFileDTO fileDTO = result.getData();
fileDTO.setStatus("TEMP"); // 标记为临时文件
// 更新数据库中的状态
fileMapper.updateByFileId(fileDTO);
}
return result;
} catch (Exception e) {
logger.error("临时文件保存失败", e);
return ResultDomain.failure("临时文件保存失败: " + e.getMessage());
}
}
/**
* 生成唯一的对象名称
*/
private String generateObjectName(String originalFilename, String module) {
String extension = getFileExtension(originalFilename);
String date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd"));
String uuid = UUID.randomUUID().toString().replace("-", "");
return String.format("%s/%s/%s%s", module, date, uuid, extension);
}
/**
* 获取文件扩展名
*/
private String getFileExtension(String filename) {
if (filename == null || !filename.contains(".")) {
return "";
}
return filename.substring(filename.lastIndexOf("."));
}
/**
* 计算文件MD5值
*/
private String calculateMD5(byte[] data) {
return DigestUtils.md5DigestAsHex(data);
}
}

View File

@@ -0,0 +1,222 @@
package org.xyzh.file.util;
import io.minio.*;
import io.minio.http.Method;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.xyzh.file.config.MinioConfig;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.TimeUnit;
/**
* @description MinIO 工具类
* @filename MinioUtil.java
* @author yslg
* @copyright yslg
* @since 2025-12-09
*/
@Component
public class MinioUtil {
private static final Logger logger = LoggerFactory.getLogger(MinioUtil.class);
@Autowired
private MinioConfig minioConfig;
/**
* 检查存储桶是否存在,如果不存在则创建
* @param bucketName 存储桶名称
* @return true 成功false 失败
*/
public boolean createBucketIfNotExists(String bucketName) {
try {
MinioClient minioClient = minioConfig.getMinioClient();
// 检查存储桶是否存在
boolean exists = minioClient.bucketExists(BucketExistsArgs.builder()
.bucket(bucketName)
.build());
if (!exists) {
// 创建存储桶
minioClient.makeBucket(MakeBucketArgs.builder()
.bucket(bucketName)
.build());
logger.info("成功创建存储桶: {}", bucketName);
}
return true;
} catch (Exception e) {
logger.error("创建存储桶失败: {}", bucketName, e);
return false;
}
}
/**
* 上传文件到MinIO
* @param bucketName 存储桶名称
* @param objectName 对象名称
* @param inputStream 文件输入流
* @param size 文件大小
* @param contentType 文件类型
* @return true 成功false 失败
*/
public boolean uploadFile(String bucketName, String objectName, InputStream inputStream, long size, String contentType) {
try {
MinioClient minioClient = minioConfig.getMinioClient();
// 确保存储桶存在
if (!createBucketIfNotExists(bucketName)) {
return false;
}
// 上传文件
minioClient.putObject(PutObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.stream(inputStream, size, -1)
.contentType(contentType)
.build());
logger.info("文件上传成功: {}/{}", bucketName, objectName);
return true;
} catch (Exception e) {
logger.error("文件上传失败: {}/{}", bucketName, objectName, e);
return false;
}
}
/**
* 上传字节数组到MinIO
* @param bucketName 存储桶名称
* @param objectName 对象名称
* @param data 字节数组
* @param contentType 文件类型
* @return true 成功false 失败
*/
public boolean uploadFile(String bucketName, String objectName, byte[] data, String contentType) {
try (ByteArrayInputStream inputStream = new ByteArrayInputStream(data)) {
return uploadFile(bucketName, objectName, inputStream, data.length, contentType);
} catch (IOException e) {
logger.error("创建字节数组输入流失败", e);
return false;
}
}
/**
* 下载文件
* @param bucketName 存储桶名称
* @param objectName 对象名称
* @return 文件输入流失败返回null
*/
public InputStream downloadFile(String bucketName, String objectName) {
try {
MinioClient minioClient = minioConfig.getMinioClient();
return minioClient.getObject(GetObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.build());
} catch (Exception e) {
logger.error("文件下载失败: {}/{}", bucketName, objectName, e);
return null;
}
}
/**
* 删除文件
* @param bucketName 存储桶名称
* @param objectName 对象名称
* @return true 成功false 失败
*/
public boolean deleteFile(String bucketName, String objectName) {
try {
MinioClient minioClient = minioConfig.getMinioClient();
minioClient.removeObject(RemoveObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.build());
logger.info("文件删除成功: {}/{}", bucketName, objectName);
return true;
} catch (Exception e) {
logger.error("文件删除失败: {}/{}", bucketName, objectName, e);
return false;
}
}
/**
* 获取文件的预签名URL用于临时访问
* @param bucketName 存储桶名称
* @param objectName 对象名称
* @param expiry 过期时间(秒)
* @return 预签名URL失败返回null
*/
public String getPresignedUrl(String bucketName, String objectName, int expiry) {
try {
MinioClient minioClient = minioConfig.getMinioClient();
return minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder()
.method(Method.GET)
.bucket(bucketName)
.object(objectName)
.expiry(expiry, TimeUnit.SECONDS)
.build());
} catch (Exception e) {
logger.error("生成预签名URL失败: {}/{}", bucketName, objectName, e);
return null;
}
}
/**
* 检查文件是否存在
* @param bucketName 存储桶名称
* @param objectName 对象名称
* @return true 存在false 不存在
*/
public boolean fileExists(String bucketName, String objectName) {
try {
MinioClient minioClient = minioConfig.getMinioClient();
minioClient.statObject(StatObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.build());
return true;
} catch (Exception e) {
return false;
}
}
/**
* 获取文件信息
* @param bucketName 存储桶名称
* @param objectName 对象名称
* @return 文件信息失败返回null
*/
public StatObjectResponse getFileInfo(String bucketName, String objectName) {
try {
MinioClient minioClient = minioConfig.getMinioClient();
return minioClient.statObject(StatObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.build());
} catch (Exception e) {
logger.error("获取文件信息失败: {}/{}", bucketName, objectName, e);
return null;
}
}
}

View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.xyzh.file.mapper.FileMapper">
<!-- 文件信息结果映射 -->
<resultMap id="fileResultMap" type="org.xyzh.api.file.dto.TbSysFileDTO">
<!-- 主键字段必须在最前面 -->
<id column="file_id" property="fileId"/>
<!-- BaseDTO 字段 -->
<result column="optsn" property="optsn"/>
<result column="creator" property="creator"/>
<result column="updater" property="updater"/>
<result column="dept_path" property="deptPath"/>
<result column="remark" property="remark"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="deleted" property="deleted"/>
<!-- TbSysFileDTO 特有字段 -->
<result column="name" property="name"/>
<result column="path" property="path"/>
<result column="size" property="size"/>
<result column="type" property="type"/>
<result column="storage_type" property="storageType"/>
<result column="mime_type" property="mimeType"/>
<result column="url" property="url"/>
<result column="status" property="status"/>
<result column="module" property="module"/>
<result column="business_id" property="businessId"/>
<result column="uploader" property="uploader"/>
<result column="object_name" property="objectName"/>
<result column="bucket_name" property="bucketName"/>
<result column="md5_hash" property="md5Hash"/>
<result column="extension" property="extension"/>
</resultMap>
<!-- 插入文件记录 -->
<insert id="insertFile" parameterType="org.xyzh.api.file.dto.TbSysFileDTO">
INSERT INTO file.tb_sys_file (
<!-- 必填字段无默认值的NOT NULL字段 -->
optsn, file_id, name, path, size
<!-- 可选字段(包括有默认值的字段) -->
<if test="creator != null">, creator</if>
<if test="updater != null">, updater</if>
<if test="deptPath != null">, dept_path</if>
<if test="remark != null">, remark</if>
<if test="createTime != null">, create_time</if>
<if test="updateTime != null">, update_time</if>
<if test="deleteTime != null">, delete_time</if>
<if test="deleted != null">, deleted</if>
<if test="type != null">, type</if>
<if test="storageType != null">, storage_type</if>
<if test="mimeType != null">, mime_type</if>
<if test="url != null">, url</if>
<if test="status != null">, status</if>
<if test="module != null">, module</if>
<if test="businessId != null">, business_id</if>
<if test="uploader != null">, uploader</if>
<if test="objectName != null">, object_name</if>
<if test="bucketName != null">, bucket_name</if>
<if test="md5Hash != null">, md5_hash</if>
<if test="extension != null">, extension</if>
) VALUES (
<!-- 必填字段值 -->
#{optsn}, #{fileId}, #{name}, #{path}, #{size}
<!-- 可选字段值 -->
<if test="creator != null">, #{creator}</if>
<if test="updater != null">, #{updater}</if>
<if test="deptPath != null">, #{deptPath}</if>
<if test="remark != null">, #{remark}</if>
<if test="createTime != null">, #{createTime}</if>
<if test="updateTime != null">, #{updateTime}</if>
<if test="deleteTime != null">, #{deleteTime}</if>
<if test="deleted != null">, #{deleted}</if>
<if test="type != null">, #{type}</if>
<if test="storageType != null">, #{storageType}</if>
<if test="mimeType != null">, #{mimeType}</if>
<if test="url != null">, #{url}</if>
<if test="status != null">, #{status}</if>
<if test="module != null">, #{module}</if>
<if test="businessId != null">, #{businessId}</if>
<if test="uploader != null">, #{uploader}</if>
<if test="objectName != null">, #{objectName}</if>
<if test="bucketName != null">, #{bucketName}</if>
<if test="md5Hash != null">, #{md5Hash}</if>
<if test="extension != null">, #{extension}</if>
)
</insert>
<!-- 根据文件ID更新文件信息 -->
<update id="updateByFileId" parameterType="org.xyzh.api.file.dto.TbSysFileDTO">
UPDATE file.tb_sys_file
<set>
<if test="updater != null">updater = #{updater},</if>
<if test="deptPath != null">dept_path = #{deptPath},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = CURRENT_TIMESTAMP,
<if test="name != null">name = #{name},</if>
<if test="path != null">path = #{path},</if>
<if test="size != null">size = #{size},</if>
<if test="type != null">type = #{type},</if>
<if test="storageType != null">storage_type = #{storageType},</if>
<if test="mimeType != null">mime_type = #{mimeType},</if>
<if test="url != null">url = #{url},</if>
<if test="status != null">status = #{status},</if>
<if test="module != null">module = #{module},</if>
<if test="businessId != null">business_id = #{businessId},</if>
<if test="uploader != null">uploader = #{uploader},</if>
<if test="objectName != null">object_name = #{objectName},</if>
<if test="bucketName != null">bucket_name = #{bucketName},</if>
<if test="md5Hash != null">md5_hash = #{md5Hash},</if>
<if test="extension != null">extension = #{extension}</if>
</set>
WHERE file_id = #{fileId} AND ( deleted IS NULL OR deleted = false)
</update>
</mapper>

View File

@@ -1,5 +1,6 @@
package org.xyzh.system.controller;
import org.apache.dubbo.config.annotation.DubboReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -25,7 +26,7 @@ public class DeptRoleController {
private static final Logger logger = LoggerFactory.getLogger(DeptRoleController.class);
@Autowired
@DubboReference(version = "1.0.0", group = "system", timeout = 3000, retries = 0)
private DeptRoleService deptRoleService;
// ================= 部门角色相关接口 =================

View File

@@ -1,5 +1,6 @@
package org.xyzh.system.controller;
import org.apache.dubbo.config.annotation.DubboReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,7 +25,7 @@ public class PermissionController {
private static final Logger logger = LoggerFactory.getLogger(PermissionController.class);
@Autowired
@DubboReference(version = "1.0.0", group = "system", timeout = 3000, retries = 0)
private ModulePermissionService modulePermissionService;
// ================= 模块相关接口 =================

View File

@@ -1,5 +1,6 @@
package org.xyzh.system.controller;
import org.apache.dubbo.config.annotation.DubboReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -23,7 +24,7 @@ public class SysConfigController {
private static final Logger logger = LoggerFactory.getLogger(SysConfigController.class);
@Autowired
@DubboReference(version = "1.0.0", group = "system", timeout = 3000, retries = 0)
private SysConfigService sysConfigService;
// ================= 系统配置相关接口 =================

View File

@@ -1,5 +1,6 @@
package org.xyzh.system.controller;
import org.apache.dubbo.config.annotation.DubboReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -25,7 +26,7 @@ public class UserController {
private static final Logger logger = LoggerFactory.getLogger(UserController.class);
@Autowired
@DubboReference(version = "1.0.0", group = "system", timeout = 3000, retries = 0)
private SysUserService sysUserService;
// ================= 用户相关接口 =================

View File

@@ -1,5 +1,6 @@
package org.xyzh.system.controller;
import org.apache.dubbo.config.annotation.DubboReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -22,7 +23,7 @@ public class ViewController {
private static final Logger logger = LoggerFactory.getLogger(ViewController.class);
@Autowired
@DubboReference(version = "1.0.0", group = "system", timeout = 3000, retries = 0)
private ViewService viewService;
// ================= 视图相关接口 =================

View File

@@ -95,5 +95,5 @@ dubbo:
# ================== MyBatis ==================
mybatis-plus:
mapper-locations: classpath:mapper/*.xml
mapper-locations: classpath:mapper/**/*.xml
type-aliases-package: org.xyzh.common.dto, org.xyzh.api

View File

@@ -110,7 +110,7 @@ dubbo:
# ================== MyBatis ==================
mybatis-plus:
mapper-locations: classpath:mapper/*.xml
mapper-locations: classpath:mapper/**/*.xml
type-aliases-package: org.xyzh.common.dto, org.xyzh.api
# ================== Logging ==================

View File

@@ -12,8 +12,8 @@
<result column="principal_id" property="principalId" jdbcType="VARCHAR"/>
<result column="principal_dept_id" property="principalDeptId" jdbcType="VARCHAR"/>
<result column="permission" property="permission" jdbcType="VARCHAR"/>
<result column="allow" property="allow" jdbcType="Boolean"/>
<result column="include_descendants" property="includeDescendants" jdbcType="Boolean"/>
<result column="allow" property="allow" jdbcType="BOOLEAN"/>
<result column="include_descendants" property="includeDescendants" jdbcType="BOOLEAN"/>
<!-- 基础字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
@@ -23,7 +23,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -35,9 +35,9 @@
<result column="principal_type" property="principalType" jdbcType="VARCHAR"/>
<result column="principal_id" property="principalId" jdbcType="VARCHAR"/>
<result column="principal_dept_id" property="principalDeptId" jdbcType="VARCHAR"/>
<result column="permission" property="permission" jdbcType="Integer"/>
<result column="allow" property="allow" jdbcType="Boolean"/>
<result column="include_descendants" property="includeDescendants" jdbcType="Boolean"/>
<result column="permission" property="permission" jdbcType="INTEGER"/>
<result column="allow" property="allow" jdbcType="BOOLEAN"/>
<result column="include_descendants" property="includeDescendants" jdbcType="BOOLEAN"/>
<!-- BaseVO 基础字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
@@ -47,7 +47,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -10,9 +10,9 @@
<result column="object_type" property="objectType" jdbcType="VARCHAR"/>
<result column="edit_hierarchy_rule" property="editHierarchyRule" jdbcType="VARCHAR"/>
<result column="view_hierarchy_rule" property="viewHierarchyRule" jdbcType="VARCHAR"/>
<result column="default_permission" property="defaultPermission" jdbcType="Integer"/>
<result column="default_allow" property="defaultAllow" jdbcType="Boolean"/>
<result column="apply_to_children" property="applyToChildren" jdbcType="Boolean"/>
<result column="default_permission" property="defaultPermission" jdbcType="INTEGER"/>
<result column="default_allow" property="defaultAllow" jdbcType="BOOLEAN"/>
<result column="apply_to_children" property="applyToChildren" jdbcType="BOOLEAN"/>
<!-- 基础字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
@@ -22,7 +22,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -33,9 +33,9 @@
<result column="object_type" property="policyObjectType" jdbcType="VARCHAR"/>
<result column="edit_hierarchy_rule" property="editHierarchyRule" jdbcType="VARCHAR"/>
<result column="view_hierarchy_rule" property="viewHierarchyRule" jdbcType="VARCHAR"/>
<result column="default_permission" property="defaultPermission" jdbcType="Integer"/>
<result column="default_allow" property="defaultAllow" jdbcType="Boolean"/>
<result column="apply_to_children" property="applyToChildren" jdbcType="Boolean"/>
<result column="default_permission" property="defaultPermission" jdbcType="INTEGER"/>
<result column="default_allow" property="defaultAllow" jdbcType="BOOLEAN"/>
<result column="apply_to_children" property="applyToChildren" jdbcType="BOOLEAN"/>
<!-- BaseVO 基础字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
@@ -45,7 +45,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -4,7 +4,6 @@
<!-- 结果映射 -->
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.sys.TbSysConfigDTO">
<!-- 配置字段 -->
<id column="config_id" property="configId" jdbcType="VARCHAR"/>
<result column="key" property="key" jdbcType="VARCHAR"/>
<result column="name" property="name" jdbcType="VARCHAR"/>
@@ -12,13 +11,12 @@
<result column="config_type" property="configType" jdbcType="VARCHAR"/>
<result column="render_type" property="renderType" jdbcType="VARCHAR"/>
<result column="description" property="description" jdbcType="VARCHAR"/>
<result column="re" property="re" jdbcType="OTHER"/>
<result column="options" property="options" jdbcType="OTHER"/>
<result column="re" property="re" typeHandler="org.xyzh.common.utils.json.FastJson2TypeHandler"/>
<result column="options" property="options" typeHandler="org.xyzh.common.utils.json.FastJson2TypeHandler"/>
<result column="group" property="group" jdbcType="VARCHAR"/>
<result column="module_id" property="moduleId" jdbcType="VARCHAR"/>
<result column="order_num" property="orderNum" jdbcType="Integer"/>
<result column="status" property="status" jdbcType="Integer"/>
<!-- 基础字段 -->
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
<result column="updater" property="updater" jdbcType="VARCHAR"/>
@@ -27,12 +25,11 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
<resultMap id="ConfigVOResultMap" type="org.xyzh.api.system.vo.SysConfigVO">
<!-- 配置字段 -->
<id column="config_id" property="configId" jdbcType="VARCHAR"/>
<result column="key" property="key" jdbcType="VARCHAR"/>
<result column="name" property="name" jdbcType="VARCHAR"/>
@@ -40,16 +37,14 @@
<result column="config_type" property="configType" jdbcType="VARCHAR"/>
<result column="render_type" property="renderType" jdbcType="VARCHAR"/>
<result column="description" property="description" jdbcType="VARCHAR"/>
<result column="re" property="re" jdbcType="OTHER"/>
<result column="options" property="options" jdbcType="OTHER"/>
<result column="re" property="re" typeHandler="org.xyzh.common.utils.json.FastJson2TypeHandler"/>
<result column="options" property="options" typeHandler="org.xyzh.common.utils.json.FastJson2TypeHandler"/>
<result column="group" property="group" jdbcType="VARCHAR"/>
<result column="module_id" property="moduleId" jdbcType="VARCHAR"/>
<result column="order_num" property="orderNum" jdbcType="Integer"/>
<result column="status" property="status" jdbcType="Integer"/>
<!-- 模块关联字段 -->
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="module_name" property="moduleName" jdbcType="VARCHAR"/>
<result column="module_description" property="moduleDescription" jdbcType="VARCHAR"/>
<!-- BaseVO 基础字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
<result column="updater" property="updater" jdbcType="VARCHAR"/>
@@ -58,7 +53,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->
@@ -69,11 +64,11 @@
<!-- selectSysConfigByKey -->
<select id="selectSysConfigByKey">
<select id="selectSysConfigByKey" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM config.tb_sys_config
WHERE config_key = #{configKey}
AND deleted = 0
WHERE key = #{configKey}
AND (deleted IS NULL OR deleted = false)
</select>
<!-- 插入系统配置 -->
@@ -241,27 +236,26 @@
SELECT COUNT(1)
FROM config.tb_sys_config
<where>
<if test="filter.configId != null and filter.configId != ''">
AND config_id = #{filter.configId}
<if test="configId != null and configId != ''">
AND config_id = #{configId}
</if>
<if test="filter.key != null and filter.key != ''">
AND key LIKE CONCAT('%', #{filter.key}, '%')
<if test="key != null and key != ''">
AND key LIKE CONCAT('%', #{key}, '%')
</if>
<if test="filter.configType != null and filter.configType != ''">
AND config_type = #{filter.configType}
<if test="configType != null and configType != ''">
AND config_type = #{configType}
</if>
<if test="filter.moduleId != null and filter.moduleId != ''">
AND module_id = #{filter.moduleId}
<if test="moduleId != null and moduleId != ''">
AND module_id = #{moduleId}
</if>
<if test="filter.status != null and filter.status != ''">
AND status = #{filter.status}
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="filter.deptPath != null and filter.deptPath != ''">
AND dept_path LIKE CONCAT(#{filter.deptPath}, '%')
<if test="deptPath != null and deptPath != ''">
AND dept_path LIKE CONCAT(#{deptPath}, '%')
</if>
AND (deleted IS NULL OR deleted = false)
</where>
</select>
</mapper>

View File

@@ -18,7 +18,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -37,7 +37,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -17,7 +17,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -35,7 +35,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -20,7 +20,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -44,7 +44,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -10,7 +10,7 @@
<result column="description" property="description" jdbcType="VARCHAR"/>
<result column="scope" property="scope" jdbcType="VARCHAR"/>
<result column="owner_dept_id" property="ownerDeptId" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="Boolean"/>
<result column="status" property="status" jdbcType="BOOLEAN"/>
<!-- 基础字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
@@ -20,7 +20,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -31,7 +31,7 @@
<result column="description" property="roleDescription" jdbcType="VARCHAR"/>
<result column="scope" property="roleScope" jdbcType="VARCHAR"/>
<result column="owner_dept_id" property="roleOwnerDeptId" jdbcType="VARCHAR"/>
<result column="status" property="roleStatus" jdbcType="Boolean"/>
<result column="status" property="roleStatus" jdbcType="BOOLEAN"/>
<!-- BaseVO 基础字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
@@ -41,7 +41,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -16,7 +16,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -27,7 +27,7 @@
<result column="role_description" property="roleDescription" jdbcType="VARCHAR"/>
<result column="role_scope" property="roleScope" jdbcType="VARCHAR"/>
<result column="role_owner_dept_id" property="roleOwnerDeptId" jdbcType="VARCHAR"/>
<result column="role_status" property="roleStatus" jdbcType="Boolean"/>
<result column="role_status" property="roleStatus" jdbcType="BOOLEAN"/>
<!-- 权限字段 -->
<result column="permission_id" property="permissionId" jdbcType="VARCHAR"/>
<result column="permission_name" property="permissionName" jdbcType="VARCHAR"/>
@@ -47,7 +47,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -7,11 +7,11 @@
<!-- 用户信息字段 -->
<id column="user_id" property="userId" jdbcType="VARCHAR"/>
<result column="avatar" property="avatar" jdbcType="VARCHAR"/>
<result column="gender" property="gender" jdbcType="Integer"/>
<result column="gender" property="gender" jdbcType="INTEGER"/>
<result column="family_name" property="familyName" jdbcType="VARCHAR"/>
<result column="given_name" property="givenName" jdbcType="VARCHAR"/>
<result column="full_name" property="fullName" jdbcType="VARCHAR"/>
<result column="level" property="level" jdbcType="Integer"/>
<result column="level" property="level" jdbcType="INTEGER"/>
<result column="id_card" property="idCard" jdbcType="VARCHAR"/>
<result column="address" property="address" jdbcType="VARCHAR"/>
<!-- 基础字段 -->
@@ -23,7 +23,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -10,14 +10,14 @@
<result column="email" property="email" jdbcType="VARCHAR"/>
<result column="phone" property="phone" jdbcType="VARCHAR"/>
<result column="wechat_id" property="wechatId" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="Integer"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<!-- BaseDTO 中在该表实际存在的字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -28,14 +28,14 @@
<result column="email" property="email" jdbcType="VARCHAR"/>
<result column="phone" property="phone" jdbcType="VARCHAR"/>
<result column="wechat_id" property="wechatId" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="Integer"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<!-- 用户信息关联字段 -->
<result column="avatar" property="avatar" jdbcType="VARCHAR"/>
<result column="gender" property="gender" jdbcType="Integer"/>
<result column="gender" property="gender" jdbcType="INTEGER"/>
<result column="family_name" property="familyName" jdbcType="VARCHAR"/>
<result column="given_name" property="givenName" jdbcType="VARCHAR"/>
<result column="full_name" property="fullName" jdbcType="VARCHAR"/>
<result column="level" property="level" jdbcType="Integer"/>
<result column="level" property="level" jdbcType="INTEGER"/>
<result column="id_card" property="idCard" jdbcType="VARCHAR"/>
<result column="address" property="address" jdbcType="VARCHAR"/>
<!-- BaseVO 中在该表实际存在的字段 -->
@@ -43,7 +43,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列(完全按表结构) -->

View File

@@ -16,7 +16,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -32,11 +32,11 @@
<result column="user_type" property="userType" jdbcType="VARCHAR"/>
<!-- 用户信息字段 -->
<result column="avatar" property="avatar" jdbcType="VARCHAR"/>
<result column="gender" property="gender" jdbcType="Integer"/>
<result column="gender" property="gender" jdbcType="INTEGER"/>
<result column="family_name" property="familyName" jdbcType="VARCHAR"/>
<result column="given_name" property="givenName" jdbcType="VARCHAR"/>
<result column="full_name" property="fullName" jdbcType="VARCHAR"/>
<result column="level" property="level" jdbcType="Integer"/>
<result column="level" property="level" jdbcType="INTEGER"/>
<result column="id_card" property="idCard" jdbcType="VARCHAR"/>
<result column="address" property="address" jdbcType="VARCHAR"/>
<!-- 部门字段 -->
@@ -50,7 +50,7 @@
<result column="role_description" property="roleDescription" jdbcType="VARCHAR"/>
<result column="scope" property="scope" jdbcType="VARCHAR"/>
<result column="owner_dept_id" property="ownerDeptId" jdbcType="VARCHAR"/>
<result column="role_status" property="roleStatus" jdbcType="Boolean"/>
<result column="role_status" property="roleStatus" jdbcType="BOOLEAN"/>
<!-- BaseVO 基础字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
@@ -60,7 +60,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -11,9 +11,9 @@
<result column="url" property="url" jdbcType="VARCHAR"/>
<result column="component" property="component" jdbcType="VARCHAR"/>
<result column="icon" property="icon" jdbcType="VARCHAR"/>
<result column="type" property="type" jdbcType="Integer"/>
<result column="type" property="type" jdbcType="INTEGER"/>
<result column="layout" property="layout" jdbcType="VARCHAR"/>
<result column="order_num" property="orderNum" jdbcType="Integer"/>
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
<result column="description" property="description" jdbcType="VARCHAR"/>
<!-- 基础字段 -->
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
@@ -24,7 +24,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->

View File

@@ -16,7 +16,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- VO结果映射用于前端展示 -->
@@ -28,9 +28,9 @@
<result column="view_url" property="viewUrl" jdbcType="VARCHAR"/>
<result column="view_component" property="viewComponent" jdbcType="VARCHAR"/>
<result column="view_icon" property="viewIcon" jdbcType="VARCHAR"/>
<result column="view_type" property="viewType" jdbcType="Integer"/>
<result column="view_type" property="viewType" jdbcType="INTEGER"/>
<result column="view_layout" property="viewLayout" jdbcType="VARCHAR"/>
<result column="view_order_num" property="viewOrderNum" jdbcType="Integer"/>
<result column="view_order_num" property="viewOrderNum" jdbcType="INTEGER"/>
<result column="view_description" property="viewDescription" jdbcType="VARCHAR"/>
<!-- 权限字段 -->
<result column="permission_id" property="permissionId" jdbcType="VARCHAR"/>
@@ -51,7 +51,7 @@
<result column="create_time" property="createTime" jdbcType="DATE"/>
<result column="update_time" property="updateTime" jdbcType="DATE"/>
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
<result column="deleted" property="deleted" jdbcType="Boolean"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
</resultMap>
<!-- 基础列 -->