提交 8aab79ce authored 作者: 李秋林's avatar 李秋林

更新服务-执行sql

上级 f27bcf11
......@@ -74,6 +74,13 @@
<artifactId>wangxiaolu-sfa-common-swagger</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid-spring-boot-starter.version}</version>
</dependency>
</dependencies>
<build>
......
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>/Library/apache-maven-3.8.6/repository</localRepository>
<mirrors>
<!-- <mirror>-->
<!-- <id>mirror</id>-->
<!-- <mirrorOf>!rdc-releases,!rdc-snapshots</mirrorOf>-->
<!-- <name>mirror</name>-->
<!-- <url>http://maven.aliyun.com/nexus/content/groups/public</url>-->
<!-- </mirror>-->
<mirror>
<id>nexus-tencentyun</id>
<!-- 此配置避免了本仓库制品的拉取流量被切换到腾讯云镜像源,保证您在使用镜像加速的同时可以从本仓库拉取制品 -->
<mirrorOf>!g-pkkp8204-wangxiaolu-sfa-maven</mirrorOf>
<name>Nexus tencentyun</name>
<url>http://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url>
</mirror>
</mirrors>
<servers>
<server>
<id>rdc-releases</id>
<username>G8G0iR</username>
<password>Do1l7QXnPg</password>
</server>
<server>
<id>rdc-snapshots</id>
<username>G8G0iR</username>
<password>Do1l7QXnPg</password>
</server>
<server>
<id>g-pkkp8204-wangxiaolu-sfa-maven</id>
<username>liqiulin@wangxiaolu.com.cn</username>
<password>Wangxiaolu_lql123</password>
</server>
</servers>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>rdc-releases</id>
<url>https://repo.rdc.aliyun.com/repository/35126-release-kef1BI/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>rdc-snapshots</id>
<url>https://repo.rdc.aliyun.com/repository/35126-snapshot-j8LEe7/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>rdc-releases</id>
<url>https://repo.rdc.aliyun.com/repository/35126-release-kef1BI/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>rdc-snapshots</id>
<url>https://repo.rdc.aliyun.com/repository/35126-snapshot-j8LEe7/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>Repository Proxy</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>g-pkkp8204-wangxiaolu-sfa-maven</id>
<name>maven</name>
<url>https://g-pkkp8204-maven.pkg.coding.net/repository/wangxiaolu-sfa/maven/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
\ No newline at end of file
......@@ -29,7 +29,7 @@ import com.sfa.common.core.web.page.TableDataInfo;
import com.sfa.common.log.annotation.Log;
import com.sfa.common.log.enums.BusinessType;
import com.sfa.common.security.annotation.RequiresPermissions;
import com.ruoyi.common.utils.sql.SqlUtil;
import com.sfa.common.core.utils.sql.SqlUtil;
import com.sfa.gen.domain.GenTable;
import com.sfa.gen.domain.GenTableColumn;
import com.sfa.gen.service.IGenTableColumnService;
......@@ -65,7 +65,7 @@ public class GenController extends BaseController
/**
* 创建表结构(保存)
*/
@PreAuthorize("@ss.hasRole('admin')")
@RequiresPermissions("@ss.hasRole('admin')")
@Log(title = "创建表", businessType = BusinessType.OTHER)
@PostMapping("/createTable")
public AjaxResult createTableSave(String sql)
......@@ -87,9 +87,8 @@ public class GenController extends BaseController
}
}
}
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames.toArray(new String[tableNames.size()]));
String operName = SecurityUtils.getUsername();
genTableService.importGenTable(tableList, operName);
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames.toArray(new String[0]));
genTableService.importGenTable(tableList);
return AjaxResult.success();
}
catch (Exception e)
......
......@@ -91,5 +91,5 @@ public interface GenTableMapper
* @param sql 创建表语句
* @return 结果
*/
public boolean createTable(String sql);
public int createTable(String sql);
}
\ No newline at end of file
......@@ -72,7 +72,7 @@ public interface IGenTableService
* @param sql 表结构
* @return 结果
*/
public int createTable(String sql);
public boolean createTable(String sql);
/**
* 导入表结构
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论