初始化
This commit is contained in:
parent
c5ae3151ca
commit
6b1947d7ee
@ -13,8 +13,8 @@ import io.swagger.v3.oas.annotations.info.License;
|
||||
* XML解析器应用程序主类
|
||||
* Spring Boot应用程序的入口点
|
||||
*
|
||||
* @author system
|
||||
* @since 1.0.0
|
||||
* @author 岳佳君 (2025年09月23日 16:53:14)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.example.demo.parser.mapper") // 扫描Mapper接口
|
||||
|
@ -13,8 +13,8 @@ import java.util.concurrent.TimeUnit;
|
||||
* 缓存配置类
|
||||
* 配置H2内存缓存,用于缓存解析规则和映射规则等数据
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月24日 17:30:09)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
@EnableCaching
|
||||
|
@ -1,49 +1,49 @@
|
||||
//package com.example.demo.common.config;
|
||||
//
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.boot.CommandLineRunner;
|
||||
//import org.springframework.core.io.ClassPathResource;
|
||||
//import org.springframework.jdbc.datasource.init.ScriptUtils;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import javax.sql.DataSource;
|
||||
//import java.sql.Connection;
|
||||
//
|
||||
///**
|
||||
// * 数据库初始化配置
|
||||
// * 应用启动时自动执行数据库脚本
|
||||
// *
|
||||
// * @author system
|
||||
// * @version 1.0
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
//public class DatabaseInitializer implements CommandLineRunner {
|
||||
//
|
||||
// private final DataSource dataSource;
|
||||
//
|
||||
// /**
|
||||
// * 应用启动时执行数据库初始化
|
||||
// *
|
||||
// * @param args 命令行参数
|
||||
// * @throws Exception 异常
|
||||
// */
|
||||
// @Override
|
||||
// public void run(String... args) throws Exception {
|
||||
// log.info("开始初始化数据库...");
|
||||
//
|
||||
// try (Connection connection = dataSource.getConnection()) {
|
||||
// // 执行数据库初始化脚本
|
||||
// ClassPathResource schemaResource = new ClassPathResource("schema.sql");
|
||||
// ScriptUtils.executeSqlScript(connection, schemaResource);
|
||||
//
|
||||
// log.info("数据库初始化完成");
|
||||
// } catch (Exception e) {
|
||||
// log.error("数据库初始化失败: {}", e.getMessage(), e);
|
||||
// throw new RuntimeException("数据库初始化失败", e);
|
||||
// }
|
||||
// log.info("应用启动成功....");
|
||||
// }
|
||||
//}
|
||||
package com.example.demo.common.config;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.jdbc.datasource.init.ScriptUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
|
||||
/**
|
||||
* 数据库初始化配置
|
||||
* 应用启动时自动执行数据库脚本,包括创建表结构、插入初始数据等
|
||||
*
|
||||
* @author 岳佳君 (2025年09月25日 15:00:27)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DatabaseInitializer implements CommandLineRunner {
|
||||
|
||||
private final DataSource dataSource;
|
||||
|
||||
/**
|
||||
* 应用启动时执行数据库初始化
|
||||
*
|
||||
* @param args 命令行参数
|
||||
* @throws Exception 初始化过程中可能抛出的异常
|
||||
*/
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
log.info("开始初始化数据库...");
|
||||
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
// 执行数据库初始化脚本
|
||||
ClassPathResource schemaResource = new ClassPathResource("schema.sql");
|
||||
ScriptUtils.executeSqlScript(connection, schemaResource);
|
||||
|
||||
log.info("数据库初始化完成");
|
||||
} catch (Exception e) {
|
||||
log.error("数据库初始化失败: {}", e.getMessage(), e);
|
||||
throw new RuntimeException("数据库初始化失败", e);
|
||||
}
|
||||
log.info("应用启动成功....");
|
||||
}
|
||||
}
|
@ -15,8 +15,9 @@ import javax.sql.DataSource;
|
||||
* H2数据源配置类
|
||||
* 配置缓存数据库H2的数据源和初始化
|
||||
*
|
||||
* @author system
|
||||
* @author 岳佳君 (2025年09月25日 18:41:00)
|
||||
* @since 1.0.0
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
public class H2DataSourceConfig {
|
||||
|
@ -16,7 +16,7 @@ import javax.sql.DataSource;
|
||||
* SQLite数据源配置类
|
||||
* 配置主数据库SQLite的数据源和初始化
|
||||
*
|
||||
* @author 岳佳君 (2025年09月25日 10:44:21)
|
||||
* @author 岳佳君 (2025年09月24日 20:13:04)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
|
@ -6,8 +6,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
* Bean Searcher配置类
|
||||
* 配置Bean Searcher框架,用于高级查询功能
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月23日 16:28:52)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
public class BeanSearcherConfig {
|
||||
|
@ -10,8 +10,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
* OpenAPI配置类
|
||||
* 配置Swagger/OpenAPI文档生成
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月26日 13:33:14)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
@OpenAPIDefinition(
|
||||
|
@ -37,8 +37,8 @@ import java.io.InputStream;
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*
|
||||
* @see Tika
|
||||
* @see TikaConfig
|
||||
|
@ -15,8 +15,8 @@ import java.nio.charset.Charset;
|
||||
* 主要用于识别文件或数据流的字符集,如UTF-8、GBK、ISO-8859-1等。
|
||||
* </p>
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class FileCharsetCheck {
|
||||
|
@ -16,8 +16,8 @@ import java.util.List;
|
||||
* 使用Apache Tika库检测文件真实类型,防止文件类型欺骗攻击
|
||||
* 通过白名单机制限制可上传的文件类型,增强系统安全性
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class FileTypeCheck {
|
||||
|
@ -8,8 +8,8 @@ package com.example.demo.common.config.tika.handle;
|
||||
* 参考了标准MIME类型定义及常见文件格式:cite[2]:cite[9]。
|
||||
* </p>
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class FileTypeConst {
|
||||
|
||||
|
@ -4,8 +4,8 @@ package com.example.demo.common.constant;
|
||||
* 系统常量类
|
||||
* 定义系统中使用的各种常量,包括错误码、文件类型、状态码等
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月24日 19:16:15)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class GlobalConstants {
|
||||
|
||||
|
@ -12,8 +12,8 @@ import java.util.Date;
|
||||
* 基础数据传输对象
|
||||
* 所有DTO类的基类,用于数据在不同层之间的传递
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月24日 18:29:58)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "基础数据传输对象")
|
||||
@Getter
|
||||
|
@ -19,8 +19,8 @@ import java.util.Date;
|
||||
* 基础实体类
|
||||
* 所有数据库实体类的基类,包含通用字段和注解
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月24日 17:40:34)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "基础实体类")
|
||||
@Getter
|
||||
|
@ -13,8 +13,8 @@ import java.util.Date;
|
||||
* 基础查询数据传输对象
|
||||
* 所有查询DTO类的基类,用于封装查询条件
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月23日 17:41:39)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "基础查询数据传输对象")
|
||||
@Getter
|
||||
|
@ -14,8 +14,8 @@ import java.util.Date;
|
||||
* 基础视图对象
|
||||
* 所有VO类的基类,用于向前端返回数据
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月24日 10:07:13)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "基础视图对象")
|
||||
@Getter
|
||||
|
@ -10,8 +10,8 @@ import java.io.Serial;
|
||||
* 业务异常类
|
||||
* 用于表示业务逻辑中的异常情况
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 14:22:43)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter(value = AccessLevel.PRIVATE)
|
||||
|
@ -23,8 +23,8 @@ import java.util.stream.Collectors;
|
||||
* 全局异常处理器
|
||||
* 统一处理系统异常,返回规范的错误响应
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 17:37:47)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice
|
||||
|
@ -4,8 +4,8 @@ package com.example.demo.common.typography;
|
||||
* 统一 Controller 接口
|
||||
* 统一定义 Controller 基础接口
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 22:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public abstract class BaseController {
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ import java.util.List;
|
||||
* 统一 Service 接口
|
||||
* 统一定义Service基础接口
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 22:47:55)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public interface BaseService<Entity extends BaseEntity, VO extends BaseVO, DTO extends BaseDTO, QueryDTO extends BaseQueryDTO>
|
||||
extends IService<Entity> {
|
||||
|
@ -27,6 +27,13 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 统一 Service 实现类
|
||||
* 提供Service基础功能的通用实现
|
||||
*
|
||||
* @author 岳佳君 (2025年9月25日 22:55:54)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public abstract class BaseServiceImpl<
|
||||
|
@ -17,8 +17,8 @@ import java.util.concurrent.TimeUnit;
|
||||
* 文件操作工具类
|
||||
* 提供文件读写、复制、删除等通用功能
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月26日 13:48:12)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class FileUtil {
|
||||
|
||||
|
@ -15,8 +15,8 @@ import java.util.*;
|
||||
* XML解析工具类
|
||||
* 提供XML文件解析和转换为TXT文件的核心功能
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月24日 23:09:02)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class XmlParserUtil {
|
||||
|
||||
|
@ -4,8 +4,8 @@ package com.example.demo.common.wrapper;
|
||||
* 统一响应包装工具类
|
||||
* 提供静态方法创建Wrapper实例
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class WrapMapper {
|
||||
|
||||
|
@ -12,8 +12,8 @@ import java.io.Serializable;
|
||||
* 用于封装所有RESTful API的响应数据
|
||||
*
|
||||
* @param <T> 响应数据类型
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
|
@ -18,11 +18,11 @@ public class ApplicationTest__03 {
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
List<String> dataList = new ArrayList<>() {{
|
||||
add("20250923_4c32c8.xml");
|
||||
// add("20250923_4c32c8.xml");
|
||||
add("20250923_82c579.xml");
|
||||
add("20250923_422dc2.xml");
|
||||
add("20250923_b43a26.xml");
|
||||
add("20250923_c87aa1.xml");
|
||||
// add("20250923_422dc2.xml");
|
||||
// add("20250923_b43a26.xml");
|
||||
// add("20250923_c87aa1.xml");
|
||||
}};
|
||||
|
||||
String prefix = "src/main/resources/data/03-任务航线/";
|
||||
|
@ -10,6 +10,8 @@ import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* 测试LevelConfig的loopCount字段修复
|
||||
* @author 岳佳君 (2025年09月27日 17:53:39)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class TestLoopCountFix {
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
//import com.example.demo.common.exception.BusinessException;
|
||||
//import com.example.demo.common.utils.FileUtil;
|
||||
//import com.example.demo.common.utils.XmlParserUtil;
|
||||
//import com.example.demo.parser.entity.FileRecordEntity;
|
||||
//import com.example.demo.parser.model.dto.FileRecordDTO;
|
||||
//import com.example.demo.parser.model.vo.FileRecordVO;
|
||||
//import com.example.demo.parser.service.FileRecordService;
|
||||
@ -20,19 +19,16 @@
|
||||
//import org.springframework.web.multipart.MultipartFile;
|
||||
//
|
||||
//import java.io.File;
|
||||
//import java.nio.file.Files;
|
||||
//import java.nio.file.Path;
|
||||
//import java.nio.file.Paths;
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.List;
|
||||
//import java.util.UUID;
|
||||
//
|
||||
///**
|
||||
// * 文件解析控制器
|
||||
// * 提供文件上传、解析和转换的RESTful API接口
|
||||
// * 提供XML文件上传、解析和转换的RESTful API接口
|
||||
// *
|
||||
// * @author system
|
||||
// * @version 1.0
|
||||
// * @author 岳佳君 (2025年09月25日 16:30:00)
|
||||
// * @version 1.0.0
|
||||
// */
|
||||
//@Slf4j
|
||||
//@RestController
|
||||
@ -53,7 +49,7 @@
|
||||
// * 上传XML文件
|
||||
// *
|
||||
// * @param file 上传的XML文件
|
||||
// * @return 操作结果
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @PostMapping("/upload")
|
||||
// @Operation(summary = "上传XML文件", description = "上传XML文件并进行解析准备")
|
||||
@ -102,7 +98,7 @@
|
||||
// * 解析XML文件
|
||||
// *
|
||||
// * @param recordId 文件记录ID
|
||||
// * @return 操作结果
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @PostMapping("/parse/{recordId}")
|
||||
// @Operation(summary = "解析XML文件", description = "解析已上传的XML文件")
|
||||
@ -150,7 +146,7 @@
|
||||
// * 获取文件记录详情
|
||||
// *
|
||||
// * @param recordId 文件记录ID
|
||||
// * @return 文件记录详情
|
||||
// * @return 文件记录详情包装对象
|
||||
// */
|
||||
// @GetMapping("/{recordId}")
|
||||
// @Operation(summary = "获取文件记录详情", description = "根据ID获取文件记录的详细信息")
|
||||
@ -174,7 +170,7 @@
|
||||
// *
|
||||
// * @param pageNumber 页码
|
||||
// * @param pageSize 每页大小
|
||||
// * @return 分页结果
|
||||
// * @return 分页结果包装对象
|
||||
// */
|
||||
// @GetMapping("/page")
|
||||
// @Operation(summary = "分页查询文件记录", description = "分页查询文件记录列表")
|
||||
@ -195,7 +191,7 @@
|
||||
// /**
|
||||
// * 获取所有文件记录列表
|
||||
// *
|
||||
// * @return 文件记录列表
|
||||
// * @return 文件记录列表包装对象
|
||||
// */
|
||||
// @GetMapping("/list")
|
||||
// @Operation(summary = "获取所有文件记录", description = "获取所有文件记录的列表")
|
||||
|
@ -1,8 +1,8 @@
|
||||
//package com.example.demo.parser.controller;
|
||||
//
|
||||
//import com.example.demo.common.exception.BusinessException;
|
||||
//import com.example.demo.common.wrapper.WrapMapper;
|
||||
//import com.example.demo.common.wrapper.Wrapper;
|
||||
//import com.example.demo.common.exception.BusinessException;
|
||||
//import com.example.demo.parser.model.dto.MapperRuleDTO;
|
||||
//import com.example.demo.parser.model.vo.MapperRuleVO;
|
||||
//import com.example.demo.parser.service.MapperRuleService;
|
||||
@ -10,27 +10,24 @@
|
||||
//import io.swagger.v3.oas.annotations.Operation;
|
||||
//import io.swagger.v3.oas.annotations.Parameter;
|
||||
//import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
//import jakarta.validation.Valid;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.validation.annotation.Validated;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * 映射规则控制器
|
||||
// * 提供映射规则的RESTful API接口
|
||||
// * 提供XML映射规则管理的RESTful API接口
|
||||
// *
|
||||
// * @author system
|
||||
// * @version 1.0
|
||||
// * @author 岳佳君 (2025年09月25日 16:30:00)
|
||||
// * @version 1.0.0
|
||||
// */
|
||||
//@Slf4j
|
||||
//@RestController
|
||||
//@RequestMapping("/parser/mapper-rules")
|
||||
//@RequiredArgsConstructor
|
||||
//@Validated
|
||||
//@Tag(name = "映射规则管理", description = "提供XML到TXT映射规则的增删改查接口")
|
||||
//@Tag(name = "映射规则管理", description = "提供XML映射规则管理的接口")
|
||||
//public class MapperRuleController {
|
||||
//
|
||||
// private final MapperRuleService mapperRuleService;
|
||||
@ -38,81 +35,90 @@
|
||||
// /**
|
||||
// * 创建映射规则
|
||||
// *
|
||||
// * @param dto 映射规则数据传输对象
|
||||
// * @return 操作结果
|
||||
// * @param rule 映射规则数据
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @PostMapping
|
||||
// @Operation(summary = "创建映射规则", description = "创建新的XML到TXT映射规则")
|
||||
// public Wrapper<String> create(@Valid @RequestBody MapperRuleDTO dto) {
|
||||
// @Operation(summary = "创建映射规则", description = "创建新的映射规则")
|
||||
// public Wrapper<MapperRuleVO> createRule(
|
||||
// @Parameter(description = "映射规则数据", required = true)
|
||||
// @RequestBody MapperRuleDTO rule) {
|
||||
// try {
|
||||
// String id = mapperRuleService.create(dto);
|
||||
// return WrapMapper.ok(id, "创建映射规则成功");
|
||||
// String ruleId = mapperRuleService.create(rule);
|
||||
// MapperRuleVO result = mapperRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "映射规则创建成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("创建映射规则失败: {}", e.getMessage(), e);
|
||||
// log.error("映射规则创建失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("创建映射规则异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("创建映射规则失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除映射规则
|
||||
// *
|
||||
// * @param id 映射规则ID
|
||||
// * @return 操作结果
|
||||
// */
|
||||
// @DeleteMapping("/{id}")
|
||||
// @Operation(summary = "删除映射规则", description = "根据ID删除映射规则")
|
||||
// public Wrapper<Boolean> delete(
|
||||
// @Parameter(description = "映射规则ID", required = true)
|
||||
// @PathVariable String id) {
|
||||
// try {
|
||||
// boolean result = mapperRuleService.delete(id);
|
||||
// return WrapMapper.ok(result, "删除映射规则成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("删除映射规则失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("删除映射规则异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("删除映射规则失败");
|
||||
// log.error("映射规则创建异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("映射规则创建失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 更新映射规则
|
||||
// *
|
||||
// * @param dto 映射规则数据传输对象
|
||||
// * @return 操作结果
|
||||
// * @param ruleId 规则ID
|
||||
// * @param rule 映射规则数据
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @PutMapping
|
||||
// @Operation(summary = "更新映射规则", description = "更新现有的映射规则")
|
||||
// public Wrapper<Boolean> update(@Valid @RequestBody MapperRuleDTO dto) {
|
||||
// @PutMapping("/{ruleId}")
|
||||
// @Operation(summary = "更新映射规则", description = "更新指定的映射规则")
|
||||
// public Wrapper<MapperRuleVO> updateRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId,
|
||||
// @Parameter(description = "映射规则数据", required = true)
|
||||
// @RequestBody MapperRuleDTO rule) {
|
||||
// try {
|
||||
// boolean result = mapperRuleService.update(dto);
|
||||
// return WrapMapper.ok(result, "更新映射规则成功");
|
||||
// mapperRuleService.update(ruleId, rule);
|
||||
// MapperRuleVO result = mapperRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "映射规则更新成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("更新映射规则失败: {}", e.getMessage(), e);
|
||||
// log.error("映射规则更新失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("更新映射规则异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("更新映射规则失败");
|
||||
// log.error("映射规则更新异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("映射规则更新失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据ID获取映射规则详情
|
||||
// * 删除映射规则
|
||||
// *
|
||||
// * @param id 映射规则ID
|
||||
// * @return 映射规则详情
|
||||
// * @param ruleId 规则ID
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @GetMapping("/{id}")
|
||||
// @Operation(summary = "获取映射规则详情", description = "根据ID获取映射规则的详细信息")
|
||||
// public Wrapper<MapperRuleVO> getById(
|
||||
// @Parameter(description = "映射规则ID", required = true)
|
||||
// @PathVariable String id) {
|
||||
// @DeleteMapping("/{ruleId}")
|
||||
// @Operation(summary = "删除映射规则", description = "删除指定的映射规则")
|
||||
// public Wrapper<Void> deleteRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId) {
|
||||
// try {
|
||||
// MapperRuleVO result = mapperRuleService.getById(id);
|
||||
// mapperRuleService.delete(ruleId);
|
||||
// return WrapMapper.ok(null, "映射规则删除成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("映射规则删除失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("映射规则删除异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("映射规则删除失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取映射规则详情
|
||||
// *
|
||||
// * @param ruleId 规则ID
|
||||
// * @return 映射规则详情包装对象
|
||||
// */
|
||||
// @GetMapping("/{ruleId}")
|
||||
// @Operation(summary = "获取映射规则详情", description = "根据ID获取映射规则的详细信息")
|
||||
// public Wrapper<MapperRuleVO> getRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId) {
|
||||
// try {
|
||||
// MapperRuleVO result = mapperRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "获取映射规则详情成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("获取映射规则详情失败: {}", e.getMessage(), e);
|
||||
@ -128,7 +134,7 @@
|
||||
// *
|
||||
// * @param pageNumber 页码
|
||||
// * @param pageSize 每页大小
|
||||
// * @return 分页结果
|
||||
// * @return 分页结果包装对象
|
||||
// */
|
||||
// @GetMapping("/page")
|
||||
// @Operation(summary = "分页查询映射规则", description = "分页查询映射规则列表")
|
||||
@ -147,32 +153,9 @@
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据解析规则ID获取映射规则列表
|
||||
// *
|
||||
// * @param parseRuleId 解析规则ID
|
||||
// * @return 映射规则列表
|
||||
// */
|
||||
// @GetMapping("/by-parse-rule/{parseRuleId}")
|
||||
// @Operation(summary = "根据解析规则获取映射规则", description = "根据解析规则ID获取对应的映射规则列表")
|
||||
// public Wrapper<List<MapperRuleVO>> getByParseRuleId(
|
||||
// @Parameter(description = "解析规则ID", required = true)
|
||||
// @PathVariable String parseRuleId) {
|
||||
// try {
|
||||
// List<MapperRuleVO> result = mapperRuleService.getByParseRuleId(parseRuleId);
|
||||
// return WrapMapper.ok(result, "根据解析规则获取映射规则成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("根据解析规则获取映射规则失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("根据解析规则获取映射规则异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("根据解析规则获取映射规则失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取所有映射规则列表
|
||||
// *
|
||||
// * @return 映射规则列表
|
||||
// * @return 映射规则列表包装对象
|
||||
// */
|
||||
// @GetMapping("/list")
|
||||
// @Operation(summary = "获取所有映射规则", description = "获取所有映射规则的列表")
|
||||
@ -185,4 +168,52 @@
|
||||
// return WrapMapper.fail("获取所有映射规则失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 启用映射规则
|
||||
// *
|
||||
// * @param ruleId 规则ID
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @PostMapping("/{ruleId}/enable")
|
||||
// @Operation(summary = "启用映射规则", description = "启用指定的映射规则")
|
||||
// public Wrapper<MapperRuleVO> enableRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId) {
|
||||
// try {
|
||||
// mapperRuleService.enable(ruleId);
|
||||
// MapperRuleVO result = mapperRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "映射规则启用成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("映射规则启用失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("映射规则启用异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("映射规则启用失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 禁用映射规则
|
||||
// *
|
||||
// * @param ruleId 规则ID
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @PostMapping("/{ruleId}/disable")
|
||||
// @Operation(summary = "禁用映射规则", description = "禁用指定的映射规则")
|
||||
// public Wrapper<MapperRuleVO> disableRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId) {
|
||||
// try {
|
||||
// mapperRuleService.disable(ruleId);
|
||||
// MapperRuleVO result = mapperRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "映射规则禁用成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("映射规则禁用失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("映射规则禁用异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("映射规则禁用失败");
|
||||
// }
|
||||
// }
|
||||
//}
|
@ -1,10 +1,8 @@
|
||||
//package com.example.demo.parser.controller;
|
||||
//
|
||||
//import cn.zhxu.bs.SearchResult;
|
||||
//import com.example.demo.common.exception.BusinessException;
|
||||
//import com.example.demo.common.wrapper.WrapMapper;
|
||||
//import com.example.demo.common.wrapper.Wrapper;
|
||||
//import com.example.demo.parser.entity.ParseRuleEntity;
|
||||
//import com.example.demo.common.exception.BusinessException;
|
||||
//import com.example.demo.parser.model.dto.ParseRuleDTO;
|
||||
//import com.example.demo.parser.model.vo.ParseRuleVO;
|
||||
//import com.example.demo.parser.service.ParseRuleService;
|
||||
@ -12,27 +10,24 @@
|
||||
//import io.swagger.v3.oas.annotations.Operation;
|
||||
//import io.swagger.v3.oas.annotations.Parameter;
|
||||
//import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
//import jakarta.validation.Valid;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.validation.annotation.Validated;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * 解析规则控制器
|
||||
// * 提供解析规则的RESTful API接口
|
||||
// * 提供XML解析规则管理的RESTful API接口
|
||||
// *
|
||||
// * @author system
|
||||
// * @version 1.0
|
||||
// * @author 岳佳君 (2025年09月25日 16:30:00)
|
||||
// * @version 1.0.0
|
||||
// */
|
||||
//@Slf4j
|
||||
//@RestController
|
||||
//@RequestMapping("/parser/parse-rules")
|
||||
//@RequestMapping("/parser/rules")
|
||||
//@RequiredArgsConstructor
|
||||
//@Validated
|
||||
//@Tag(name = "解析规则管理", description = "提供XML解析规则的增删改查接口")
|
||||
//@Tag(name = "解析规则管理", description = "提供XML解析规则管理的接口")
|
||||
//public class ParseRuleController {
|
||||
//
|
||||
// private final ParseRuleService parseRuleService;
|
||||
@ -40,81 +35,90 @@
|
||||
// /**
|
||||
// * 创建解析规则
|
||||
// *
|
||||
// * @param dto 解析规则数据传输对象
|
||||
// * @return 操作结果
|
||||
// * @param rule 解析规则数据
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @PostMapping
|
||||
// @Operation(summary = "创建解析规则", description = "创建新的XML解析规则")
|
||||
// public Wrapper<String> create(@Valid @RequestBody ParseRuleDTO dto) {
|
||||
// @Operation(summary = "创建解析规则", description = "创建新的解析规则")
|
||||
// public Wrapper<ParseRuleVO> createRule(
|
||||
// @Parameter(description = "解析规则数据", required = true)
|
||||
// @RequestBody ParseRuleDTO rule) {
|
||||
// try {
|
||||
// String id = parseRuleService.create(dto);
|
||||
// return WrapMapper.ok(id, "创建解析规则成功");
|
||||
// String ruleId = parseRuleService.create(rule);
|
||||
// ParseRuleVO result = parseRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "解析规则创建成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("创建解析规则失败: {}", e.getMessage(), e);
|
||||
// log.error("解析规则创建失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("创建解析规则异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("创建解析规则失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除解析规则
|
||||
// *
|
||||
// * @param id 解析规则ID
|
||||
// * @return 操作结果
|
||||
// */
|
||||
// @DeleteMapping("/{id}")
|
||||
// @Operation(summary = "删除解析规则", description = "根据ID删除解析规则")
|
||||
// public Wrapper<Boolean> delete(
|
||||
// @Parameter(description = "解析规则ID", required = true)
|
||||
// @PathVariable String id) {
|
||||
// try {
|
||||
// boolean result = parseRuleService.delete(id);
|
||||
// return WrapMapper.ok(result, "删除解析规则成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("删除解析规则失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("删除解析规则异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("删除解析规则失败");
|
||||
// log.error("解析规则创建异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("解析规则创建失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 更新解析规则
|
||||
// *
|
||||
// * @param dto 解析规则数据传输对象
|
||||
// * @return 操作结果
|
||||
// * @param ruleId 规则ID
|
||||
// * @param rule 解析规则数据
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @PutMapping
|
||||
// @Operation(summary = "更新解析规则", description = "更新现有的解析规则")
|
||||
// public Wrapper<Boolean> update(@Valid @RequestBody ParseRuleDTO dto) {
|
||||
// @PutMapping("/{ruleId}")
|
||||
// @Operation(summary = "更新解析规则", description = "更新指定的解析规则")
|
||||
// public Wrapper<ParseRuleVO> updateRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId,
|
||||
// @Parameter(description = "解析规则数据", required = true)
|
||||
// @RequestBody ParseRuleDTO rule) {
|
||||
// try {
|
||||
// boolean result = parseRuleService.update(dto);
|
||||
// return WrapMapper.ok(result, "更新解析规则成功");
|
||||
// parseRuleService.update(ruleId, rule);
|
||||
// ParseRuleVO result = parseRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "解析规则更新成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("更新解析规则失败: {}", e.getMessage(), e);
|
||||
// log.error("解析规则更新失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("更新解析规则异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("更新解析规则失败");
|
||||
// log.error("解析规则更新异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("解析规则更新失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据ID获取解析规则详情
|
||||
// * 删除解析规则
|
||||
// *
|
||||
// * @param id 解析规则ID
|
||||
// * @return 解析规则详情
|
||||
// * @param ruleId 规则ID
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @GetMapping("/{id}")
|
||||
// @Operation(summary = "获取解析规则详情", description = "根据ID获取解析规则的详细信息")
|
||||
// public Wrapper<ParseRuleVO> getById(
|
||||
// @Parameter(description = "解析规则ID", required = true)
|
||||
// @PathVariable String id) {
|
||||
// @DeleteMapping("/{ruleId}")
|
||||
// @Operation(summary = "删除解析规则", description = "删除指定的解析规则")
|
||||
// public Wrapper<Void> deleteRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId) {
|
||||
// try {
|
||||
// ParseRuleVO result = parseRuleService.getById(id);
|
||||
// parseRuleService.delete(ruleId);
|
||||
// return WrapMapper.ok(null, "解析规则删除成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("解析规则删除失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("解析规则删除异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("解析规则删除失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取解析规则详情
|
||||
// *
|
||||
// * @param ruleId 规则ID
|
||||
// * @return 解析规则详情包装对象
|
||||
// */
|
||||
// @GetMapping("/{ruleId}")
|
||||
// @Operation(summary = "获取解析规则详情", description = "根据ID获取解析规则的详细信息")
|
||||
// public Wrapper<ParseRuleVO> getRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId) {
|
||||
// try {
|
||||
// ParseRuleVO result = parseRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "获取解析规则详情成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("获取解析规则详情失败: {}", e.getMessage(), e);
|
||||
@ -130,7 +134,7 @@
|
||||
// *
|
||||
// * @param pageNumber 页码
|
||||
// * @param pageSize 每页大小
|
||||
// * @return 分页结果
|
||||
// * @return 分页结果包装对象
|
||||
// */
|
||||
// @GetMapping("/page")
|
||||
// @Operation(summary = "分页查询解析规则", description = "分页查询解析规则列表")
|
||||
@ -151,7 +155,7 @@
|
||||
// /**
|
||||
// * 获取所有解析规则列表
|
||||
// *
|
||||
// * @return 解析规则列表
|
||||
// * @return 解析规则列表包装对象
|
||||
// */
|
||||
// @GetMapping("/list")
|
||||
// @Operation(summary = "获取所有解析规则", description = "获取所有解析规则的列表")
|
||||
@ -166,23 +170,50 @@
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据XML标签名获取解析规则详情
|
||||
// * 启用解析规则
|
||||
// *
|
||||
// * @param xmlTag XML标签名
|
||||
// * @return 解析规则详情
|
||||
// * @param ruleId 规则ID
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @GetMapping("/by-xml-tag/{xmlTag}")
|
||||
// @Operation(summary = "根据XML标签名获取解析规则详情")
|
||||
// public Wrapper<ParseRuleVO> getByXmlTag(@PathVariable String xmlTag) {
|
||||
// log.info("根据XML标签名获取解析规则详情: {}", xmlTag);
|
||||
//
|
||||
// ParseRuleEntity entity = parseRuleService.getByXmlTag(xmlTag);
|
||||
// if (entity == null) {
|
||||
// return WrapMapper.fail("解析规则不存在: " + xmlTag);
|
||||
// @PostMapping("/{ruleId}/enable")
|
||||
// @Operation(summary = "启用解析规则", description = "启用指定的解析规则")
|
||||
// public Wrapper<ParseRuleVO> enableRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId) {
|
||||
// try {
|
||||
// parseRuleService.enable(ruleId);
|
||||
// ParseRuleVO result = parseRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "解析规则启用成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("解析规则启用失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("解析规则启用异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("解析规则启用失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 通过getById方法获取VO对象
|
||||
// ParseRuleVO result = parseRuleService.getById(entity.getId());
|
||||
// return WrapMapper.ok(result);
|
||||
// /**
|
||||
// * 禁用解析规则
|
||||
// *
|
||||
// * @param ruleId 规则ID
|
||||
// * @return 操作结果包装对象
|
||||
// */
|
||||
// @PostMapping("/{ruleId}/disable")
|
||||
// @Operation(summary = "禁用解析规则", description = "禁用指定的解析规则")
|
||||
// public Wrapper<ParseRuleVO> disableRule(
|
||||
// @Parameter(description = "规则ID", required = true)
|
||||
// @PathVariable String ruleId) {
|
||||
// try {
|
||||
// parseRuleService.disable(ruleId);
|
||||
// ParseRuleVO result = parseRuleService.getById(ruleId);
|
||||
// return WrapMapper.ok(result, "解析规则禁用成功");
|
||||
// } catch (BusinessException e) {
|
||||
// log.error("解析规则禁用失败: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail(e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("解析规则禁用异常: {}", e.getMessage(), e);
|
||||
// return WrapMapper.fail("解析规则禁用失败");
|
||||
// }
|
||||
// }
|
||||
//}
|
@ -13,8 +13,8 @@ import java.util.Date;
|
||||
* 文件记录实体类
|
||||
* 对应数据库中的file_record表,用于存储文件上传、解析、转换等操作记录
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 19:42:26)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "文件记录")
|
||||
@Getter
|
||||
|
@ -12,8 +12,8 @@ import java.io.Serial;
|
||||
* 映射规则实体类
|
||||
* 对应数据库中的mapper_rule表,用于存储XML到TXT的映射规则
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月26日 14:53:50)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "映射规则")
|
||||
@Getter
|
||||
|
@ -12,8 +12,8 @@ import java.io.Serial;
|
||||
* 解析规则实体类
|
||||
* 对应数据库中的parse_rule表,用于存储XML解析规则
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月27日 11:35:15)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "解析规则")
|
||||
@Getter
|
||||
|
@ -8,8 +8,8 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* 文件记录Mapper接口
|
||||
* 用于文件记录的数据库操作
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月23日 18:35:58)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface FileRecordMapper extends BaseMapper<FileRecordEntity> {
|
||||
|
@ -8,8 +8,8 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* 映射规则Mapper接口
|
||||
* 用于映射规则的数据库操作
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月23日 19:56:13)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface MapperRuleMapper extends BaseMapper<MapperRuleEntity> {
|
||||
|
@ -8,8 +8,8 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* 解析规则Mapper接口
|
||||
* 用于解析规则的数据库操作
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月24日 21:13:19)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ParseRuleMapper extends BaseMapper<ParseRuleEntity> {
|
||||
|
@ -18,8 +18,8 @@ import java.util.Date;
|
||||
* 文件记录查询数据传输对象
|
||||
* 用于映射规则的创建和更新操作
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月26日 22:05:26)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
@ -13,8 +13,8 @@ import java.util.Date;
|
||||
* 文件记录查询数据传输对象
|
||||
* 用于封装文件记录的查询条件
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月23日 17:40:27)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
@ -15,8 +15,8 @@ import java.io.Serializable;
|
||||
* 映射规则数据传输对象
|
||||
* 用于映射规则的创建和更新操作
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月24日 11:06:33)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "映射规则数据传输对象")
|
||||
@Getter
|
||||
|
@ -13,8 +13,8 @@ import java.io.Serializable;
|
||||
* 映射规则查询数据传输对象
|
||||
* 用于封装映射规则的查询条件
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月27日 18:04:23)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "映射规则查询数据传输对象")
|
||||
@Getter
|
||||
|
@ -14,8 +14,8 @@ import java.io.Serializable;
|
||||
* 解析规则数据传输对象
|
||||
* 用于解析规则的创建和更新操作
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月23日 21:21:27)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "解析规则数据传输对象")
|
||||
@Getter
|
||||
|
@ -13,8 +13,8 @@ import java.io.Serializable;
|
||||
* 解析规则查询数据传输对象
|
||||
* 用于封装解析规则的查询条件
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月23日 18:05:25)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "解析规则查询数据传输对象")
|
||||
@Getter
|
||||
|
@ -17,8 +17,8 @@ import java.util.Date;
|
||||
* 文件记录视图对象
|
||||
* 用于向前端返回文件记录数据
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月23日 16:21:17)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "文件记录视图对象")
|
||||
@Getter
|
||||
|
@ -14,8 +14,8 @@ import java.io.Serializable;
|
||||
* 映射规则视图对象
|
||||
* 用于向前端返回映射规则数据
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月26日 21:44:29)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "映射规则视图对象")
|
||||
@Getter
|
||||
|
@ -14,8 +14,8 @@ import java.io.Serializable;
|
||||
* 解析规则视图对象
|
||||
* 用于向前端返回解析规则数据
|
||||
*
|
||||
* @author system
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月26日 14:30:51)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Schema(description = "解析规则视图对象")
|
||||
@Getter
|
||||
|
@ -1,4 +1,11 @@
|
||||
package com.example.demo.parser.process.constant;
|
||||
|
||||
/**
|
||||
* 解析处理常量类
|
||||
* 定义XML解析和TXT转换过程中使用的常量
|
||||
*
|
||||
* @author 岳佳君 (2025年09月29日 09:58:32)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public final class ParserProcessConstant {
|
||||
}
|
||||
|
@ -24,6 +24,8 @@ import java.util.regex.Pattern;
|
||||
* <li>枚举映射转换</li>
|
||||
* <li>工具函数调用</li>
|
||||
* </ul>
|
||||
* @author 岳佳君 (2025年09月27日 19:54:24)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class EnhancedConfigProcessor {
|
||||
|
||||
|
@ -46,9 +46,8 @@ import java.util.Map;
|
||||
* String result2 = EnhancedTemplateGenerator.generateCode(data, "templates/custom-template.j2");
|
||||
* }</pre>
|
||||
*
|
||||
* @author Template Generator Team
|
||||
* @author 岳佳君 (2025年09月26日 19:57:01)
|
||||
* @version 1.0.0
|
||||
* @since 2024-01-01
|
||||
* @see TemplateFileLoader
|
||||
*/
|
||||
public class EnhancedTemplateGenerator {
|
||||
|
@ -33,8 +33,8 @@ import java.util.Map;
|
||||
* String template3 = TemplateFileLoader.loadTemplate("templates/default.html");
|
||||
* </pre>
|
||||
*
|
||||
* @author 岳佳君
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class TemplateFileLoader {
|
||||
|
@ -27,8 +27,8 @@ import java.util.regex.Pattern;
|
||||
* <li>生成标准JSON数组格式输出</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author 岳佳君
|
||||
* @version 1.0
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class Xml2AFSIMTransformation {
|
||||
|
@ -33,9 +33,8 @@ import java.util.Map;
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Generated
|
||||
* @version 1.0
|
||||
* @since 2024
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
|
@ -9,15 +9,18 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 配置值实体
|
||||
*
|
||||
*
|
||||
* <p>表示单个配置值的详细信息,支持带单位的数值配置和标志位配置。</p>
|
||||
*
|
||||
*
|
||||
* <p><b>值类型说明:</b></p>
|
||||
* <ul>
|
||||
* <li>数值类型:如超时时间、重试次数等</li>
|
||||
* <li>字符串类型:如文件路径、模式名称等</li>
|
||||
* <li>布尔类型:如启用/禁用标志</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
|
@ -9,17 +9,16 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 层级配置实体
|
||||
*
|
||||
*
|
||||
* <p>表示配置中的一个层级节点,可以包含值配置和子层级,形成树状结构。</p>
|
||||
*
|
||||
*
|
||||
* <p><b>典型应用场景:</b></p>
|
||||
* <ul>
|
||||
* <li>系统级配置(system)</li>
|
||||
* <li>数据库配置(database)</li>
|
||||
* <li>日志配置(logging)</li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
*
|
||||
* <h3>模板中的表现形式:</h3>
|
||||
* <pre>{@code
|
||||
* section param1 param2 # 层级备注
|
||||
@ -27,6 +26,9 @@ import java.util.Map;
|
||||
* values 100 ms 200 kb
|
||||
* end_section
|
||||
* }</pre>
|
||||
*
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
|
@ -9,10 +9,13 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 值配置实体
|
||||
*
|
||||
*
|
||||
* <p>表示具体的配置项,包含配置名称、值列表和注释信息。</p>
|
||||
*
|
||||
*
|
||||
* <p><b>注意:</b>values字段可以包含不同类型的配置值,支持复杂配置场景。</p>
|
||||
*
|
||||
* @author 岳佳君 (2025年09月25日 23:42:44)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
|
@ -10,8 +10,9 @@ import com.example.demo.parser.model.vo.FileRecordVO;
|
||||
* 文件记录服务接口
|
||||
* 提供文件记录的CRUD及文件上传下载等业务操作
|
||||
*
|
||||
* @author system
|
||||
* @author 岳佳君 (2025年09月25日 15:35:47)
|
||||
* @since 1.0.0
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public interface FileRecordService
|
||||
extends BaseService<FileRecordEntity, FileRecordVO, FileRecordDTO, FileRecordQueryDTO> {
|
||||
|
@ -10,8 +10,9 @@ import com.example.demo.parser.model.vo.MapperRuleVO;
|
||||
* 映射规则服务接口
|
||||
* 提供映射规则的CRUD及其他业务操作
|
||||
*
|
||||
* @author system
|
||||
* @author 岳佳君 (2025年09月25日 13:08:30)
|
||||
* @since 1.0.0
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public interface MapperRuleService
|
||||
extends BaseService<MapperRuleEntity, MapperRuleVO, MapperRuleDTO, MapperRuleQueryDTO> {
|
||||
|
@ -10,8 +10,9 @@ import com.example.demo.parser.model.vo.ParseRuleVO;
|
||||
* 解析规则服务接口
|
||||
* 提供解析规则的CRUD及其他业务操作
|
||||
*
|
||||
* @author system
|
||||
* @author 岳佳君 (2025年09月27日 23:48:26)
|
||||
* @since 1.0.0
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public interface ParseRuleService
|
||||
extends BaseService<ParseRuleEntity, ParseRuleVO, ParseRuleDTO, ParseRuleQueryDTO> {
|
||||
|
@ -18,8 +18,8 @@
|
||||
// * 文件记录服务实现类
|
||||
// * 提供文件记录的CRUD和查询功能
|
||||
// *
|
||||
// * @author system
|
||||
// * @version 1.0
|
||||
// * @author 岳佳君 (2025年09月25日 16:57:00)
|
||||
// * @version 1.0.0
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Service
|
||||
|
@ -1,52 +1,44 @@
|
||||
//package com.example.demo.parser.service.impl;
|
||||
//
|
||||
//import cn.zhxu.bs.BeanSearcher;
|
||||
//import com.example.demo.common.exception.BusinessException;
|
||||
//import com.example.demo.common.typography.BaseServiceImpl;
|
||||
//import com.example.demo.parser.entity.FileRecordEntity;
|
||||
//import com.example.demo.parser.entity.MapperRuleEntity;
|
||||
//import com.example.demo.parser.mapper.FileRecordMapper;
|
||||
//import com.example.demo.parser.mapper.MapperRuleMapper;
|
||||
//import com.example.demo.parser.model.dto.FileRecordDTO;
|
||||
//import com.example.demo.parser.model.dto.FileRecordQueryDTO;
|
||||
//import com.example.demo.parser.model.dto.MapperRuleDTO;
|
||||
//import com.example.demo.parser.model.dto.MapperRuleQueryDTO;
|
||||
//import com.example.demo.parser.model.vo.FileRecordVO;
|
||||
//import com.example.demo.parser.model.vo.MapperRuleVO;
|
||||
//import com.example.demo.parser.service.MapperRuleService;
|
||||
//import com.example.demo.parser.service.ParseRuleService;
|
||||
//// import com.fhs.core.trans.TransService;
|
||||
//import com.fhs.trans.service.impl.TransService;
|
||||
//import com.mybatisflex.core.paginate.Page;
|
||||
//import com.mybatisflex.core.query.QueryWrapper;
|
||||
//import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
//import static com.example.demo.parser.entity.table.MapperRuleEntityTableDef.MAPPER_RULE_ENTITY;
|
||||
//
|
||||
///**
|
||||
// * 映射规则服务实现类
|
||||
// * 提供映射规则的CRUD和查询功能
|
||||
// *
|
||||
// * @author system
|
||||
// * @version 1.0
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Service
|
||||
//@Transactional(rollbackFor = Exception.class)
|
||||
//public class MapperRuleServiceImpl
|
||||
// extends BaseServiceImpl<MapperRuleEntity, MapperRuleVO, MapperRuleDTO, MapperRuleQueryDTO, MapperRuleMapper> {
|
||||
//
|
||||
// public MapperRuleServiceImpl(
|
||||
// BeanSearcher beanSearcher,
|
||||
// TransService transService
|
||||
// ) {
|
||||
// super(log, MapperRuleServiceImpl.class.getSimpleName(), MapperRuleVO.class, beanSearcher, transService);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
package com.example.demo.parser.service.impl;
|
||||
|
||||
import cn.zhxu.bs.BeanSearcher;
|
||||
import com.example.demo.common.exception.BusinessException;
|
||||
import com.example.demo.common.typography.BaseServiceImpl;
|
||||
import com.example.demo.parser.entity.MapperRuleEntity;
|
||||
import com.example.demo.parser.mapper.MapperRuleMapper;
|
||||
import com.example.demo.parser.model.dto.MapperRuleDTO;
|
||||
import com.example.demo.parser.model.dto.MapperRuleQueryDTO;
|
||||
import com.example.demo.parser.model.vo.MapperRuleVO;
|
||||
import com.example.demo.parser.service.MapperRuleService;
|
||||
import com.fhs.trans.service.impl.TransService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 映射规则服务实现类
|
||||
* 提供映射规则的CRUD和查询功能,继承BaseServiceImpl实现基础功能
|
||||
*
|
||||
* @author 岳佳君 (2025年09月25日 16:30:00)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class MapperRuleServiceImpl
|
||||
extends BaseServiceImpl<MapperRuleEntity, MapperRuleVO, MapperRuleDTO, MapperRuleQueryDTO, MapperRuleMapper>
|
||||
implements MapperRuleService {
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*
|
||||
* @param beanSearcher BeanSearcher实例,用于高级查询
|
||||
* @param transService 翻译服务实例,用于字段翻译
|
||||
*/
|
||||
public MapperRuleServiceImpl(
|
||||
BeanSearcher beanSearcher,
|
||||
TransService transService
|
||||
) {
|
||||
super(log, MapperRuleServiceImpl.class.getSimpleName(), MapperRuleVO.class, beanSearcher, transService);
|
||||
}
|
||||
|
||||
}
|
@ -1,51 +1,44 @@
|
||||
//package com.example.demo.parser.service.impl;
|
||||
//
|
||||
//import cn.zhxu.bs.BeanSearcher;
|
||||
//import com.example.demo.common.exception.BusinessException;
|
||||
//import com.example.demo.common.typography.BaseServiceImpl;
|
||||
//import com.example.demo.parser.entity.FileRecordEntity;
|
||||
//import com.example.demo.parser.entity.ParseRuleEntity;
|
||||
//import com.example.demo.parser.mapper.FileRecordMapper;
|
||||
//import com.example.demo.parser.mapper.ParseRuleMapper;
|
||||
//import com.example.demo.parser.model.dto.FileRecordDTO;
|
||||
//import com.example.demo.parser.model.dto.FileRecordQueryDTO;
|
||||
//import com.example.demo.parser.model.dto.ParseRuleDTO;
|
||||
//import com.example.demo.parser.model.dto.ParseRuleQueryDTO;
|
||||
//import com.example.demo.parser.model.vo.FileRecordVO;
|
||||
//import com.example.demo.parser.model.vo.ParseRuleVO;
|
||||
//import com.example.demo.parser.service.ParseRuleService;
|
||||
//// import com.fhs.core.trans.TransService;
|
||||
//import com.fhs.trans.service.impl.TransService;
|
||||
//import com.mybatisflex.core.paginate.Page;
|
||||
//import com.mybatisflex.core.query.QueryWrapper;
|
||||
//import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
//import static com.example.demo.parser.entity.table.ParseRuleEntityTableDef.PARSE_RULE_ENTITY;
|
||||
//
|
||||
///**
|
||||
// * 解析规则服务实现类
|
||||
// * 提供解析规则的CRUD和查询功能
|
||||
// *
|
||||
// * @author system
|
||||
// * @version 1.0
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Service
|
||||
//@Transactional(rollbackFor = Exception.class)
|
||||
//public class ParseRuleServiceImpl
|
||||
// extends BaseServiceImpl<ParseRuleEntity, ParseRuleVO, ParseRuleDTO, ParseRuleQueryDTO, ParseRuleMapper> {
|
||||
//
|
||||
// public ParseRuleServiceImpl(
|
||||
// BeanSearcher beanSearcher,
|
||||
// TransService transService
|
||||
// ) {
|
||||
// super(log, ParseRuleServiceImpl.class.getSimpleName(), ParseRuleVO.class, beanSearcher, transService);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
package com.example.demo.parser.service.impl;
|
||||
|
||||
import cn.zhxu.bs.BeanSearcher;
|
||||
import com.example.demo.common.exception.BusinessException;
|
||||
import com.example.demo.common.typography.BaseServiceImpl;
|
||||
import com.example.demo.parser.entity.ParseRuleEntity;
|
||||
import com.example.demo.parser.mapper.ParseRuleMapper;
|
||||
import com.example.demo.parser.model.dto.ParseRuleDTO;
|
||||
import com.example.demo.parser.model.dto.ParseRuleQueryDTO;
|
||||
import com.example.demo.parser.model.vo.ParseRuleVO;
|
||||
import com.example.demo.parser.service.ParseRuleService;
|
||||
import com.fhs.trans.service.impl.TransService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 解析规则服务实现类
|
||||
* 提供解析规则的CRUD和查询功能,继承BaseServiceImpl实现基础功能
|
||||
*
|
||||
* @author 岳佳君 (2025年09月25日 18:55:07)
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ParseRuleServiceImpl
|
||||
extends BaseServiceImpl<ParseRuleEntity, ParseRuleVO, ParseRuleDTO, ParseRuleQueryDTO, ParseRuleMapper>
|
||||
implements ParseRuleService {
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*
|
||||
* @param beanSearcher BeanSearcher实例,用于高级查询
|
||||
* @param transService 翻译服务实例,用于字段翻译
|
||||
*/
|
||||
public ParseRuleServiceImpl(
|
||||
BeanSearcher beanSearcher,
|
||||
TransService transService
|
||||
) {
|
||||
super(log, ParseRuleServiceImpl.class.getSimpleName(), ParseRuleVO.class, beanSearcher, transService);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user