|
|
@@ -2,6 +2,7 @@ package com.xunmei.gen.service;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xunmei.common.core.constant.Constants;
|
|
|
import com.xunmei.common.core.constant.GenConstants;
|
|
|
import com.xunmei.common.core.exception.ServiceException;
|
|
|
@@ -40,11 +41,11 @@ import java.util.zip.ZipOutputStream;
|
|
|
|
|
|
/**
|
|
|
* 业务 服务层实现
|
|
|
- *
|
|
|
+ *
|
|
|
* @author xunmei
|
|
|
*/
|
|
|
@Service
|
|
|
-public class GenTableServiceImpl implements IGenTableService
|
|
|
+public class GenTableServiceImpl extends ServiceImpl<GenTableMapper, GenTable> implements IGenTableService
|
|
|
{
|
|
|
private static final Logger log = LoggerFactory.getLogger(GenTableServiceImpl.class);
|
|
|
|
|
|
@@ -56,7 +57,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 查询业务信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param id 业务ID
|
|
|
* @return 业务信息
|
|
|
*/
|
|
|
@@ -70,7 +71,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 查询业务列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param genTable 业务信息
|
|
|
* @return 业务集合
|
|
|
*/
|
|
|
@@ -82,7 +83,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 查询据库列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param genTable 业务信息
|
|
|
* @return 数据库表集合
|
|
|
*/
|
|
|
@@ -94,7 +95,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 查询据库列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param tableNames 表名称组
|
|
|
* @return 数据库表集合
|
|
|
*/
|
|
|
@@ -106,7 +107,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 查询所有表信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @return 表信息集合
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -117,7 +118,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 修改业务
|
|
|
- *
|
|
|
+ *
|
|
|
* @param genTable 业务信息
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -139,7 +140,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 删除业务对象
|
|
|
- *
|
|
|
+ *
|
|
|
* @param tableIds 需要删除的数据ID
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@@ -153,7 +154,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 导入表结构
|
|
|
- *
|
|
|
+ *
|
|
|
* @param tableList 导入表列表
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -188,7 +189,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 预览代码
|
|
|
- *
|
|
|
+ *
|
|
|
* @param tableId 表编号
|
|
|
* @return 预览数据列表
|
|
|
*/
|
|
|
@@ -221,7 +222,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 生成代码(下载方式)
|
|
|
- *
|
|
|
+ *
|
|
|
* @param tableName 表名称
|
|
|
* @return 数据
|
|
|
*/
|
|
|
@@ -237,7 +238,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 生成代码(自定义路径)
|
|
|
- *
|
|
|
+ *
|
|
|
* @param tableName 表名称
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -279,7 +280,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 同步数据库
|
|
|
- *
|
|
|
+ *
|
|
|
* @param tableName 表名称
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -334,7 +335,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 批量生成代码(下载方式)
|
|
|
- *
|
|
|
+ *
|
|
|
* @param tableNames 表数组
|
|
|
* @return 数据
|
|
|
*/
|
|
|
@@ -393,7 +394,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 修改保存参数校验
|
|
|
- *
|
|
|
+ *
|
|
|
* @param genTable 业务信息
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -431,7 +432,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 设置主键列信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param table 业务表信息
|
|
|
*/
|
|
|
public void setPkColumn(GenTable table)
|
|
|
@@ -467,7 +468,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 设置主子表信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param table 业务表信息
|
|
|
*/
|
|
|
public void setSubTable(GenTable table)
|
|
|
@@ -481,7 +482,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 设置代码生成其他选项值
|
|
|
- *
|
|
|
+ *
|
|
|
* @param genTable 设置后的生成对象
|
|
|
*/
|
|
|
public void setTableFromOptions(GenTable genTable)
|
|
|
@@ -505,7 +506,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
|
|
|
|
/**
|
|
|
* 获取代码生成地址
|
|
|
- *
|
|
|
+ *
|
|
|
* @param table 业务表信息
|
|
|
* @param template 模板文件路径
|
|
|
* @return 生成地址
|