提交代码
This commit is contained in:
parent
4b11b41b5e
commit
a65c068051
|
|
@ -109,7 +109,7 @@ public class DataSetBasicFileController extends BaseController
|
|||
* 获取文件基础详细信息
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:dataSetBasicFile:query")
|
||||
@GetMapping(value = "/{fileId}")
|
||||
@GetMapping(value = "getFile/{fileId}")
|
||||
public AjaxResult getInfo(@PathVariable("fileId") Long fileId)
|
||||
{
|
||||
return dataSetBasicFileService.selectDataSetBasicFileByFileId(fileId);
|
||||
|
|
@ -215,9 +215,9 @@ public class DataSetBasicFileController extends BaseController
|
|||
* 获取文件树型结构
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getFileTerr")
|
||||
public AjaxResult getFileTerr(){
|
||||
return dataSetBasicFileService.getFileTerr();
|
||||
@PostMapping("/getFileTerr/{fileId}")
|
||||
public AjaxResult getFileTerr(@PathVariable("fileId") Long fileId){
|
||||
return dataSetBasicFileService.getFileTerr(fileId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,5 +111,5 @@ public interface DataSetBasicFileService
|
|||
* 获取树形结构
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getFileTerr();
|
||||
AjaxResult getFileTerr(Long fileId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class DataSetBasicFileServiceImpl implements DataSetBasicFileService {
|
|||
if (ObjectUtils.isEmpty(aiBasicFile)) {
|
||||
return AjaxResult.error();
|
||||
} else {
|
||||
return AjaxResult.success();
|
||||
return AjaxResult.success(aiBasicFile);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
|
|
@ -291,42 +291,15 @@ public class DataSetBasicFileServiceImpl implements DataSetBasicFileService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getFileTerr() {
|
||||
public AjaxResult getFileTerr(Long fileId) {
|
||||
DataSetBasicFileEntity entity = new DataSetBasicFileEntity();
|
||||
entity.setIsDirectory("1");
|
||||
entity.setCreateBy(SecurityUtils.getUserId().toString());
|
||||
List<DataSetBasicFileEntity> allFiles = dataSetBasicFileMapper.selectDataSetBasicFileList(entity);
|
||||
allFiles.removeIf(file -> file.getFileId().equals(fileId));
|
||||
return AjaxResult.success(allFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归树形结构
|
||||
* @param allFiles
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
private List<TreeNode> buildTree(List<DataSetBasicFileEntity> allFiles, Long parentId) {
|
||||
List<TreeNode> result = new ArrayList<>();
|
||||
for (DataSetBasicFileEntity entity : allFiles) {
|
||||
// 判断当前节点的 parentId 是否与给定的 parentId 相等
|
||||
if (entity.getParentId().equals(parentId) && "1".equals(entity.getIsDirectory())) {
|
||||
// 将当前实体转换成 TreeNode
|
||||
TreeNode node = new TreeNode();
|
||||
node.setId(entity.getFileId());
|
||||
node.setLabel(entity.getFileName());
|
||||
node.setParentId(entity.getParentId());
|
||||
// 递归查找当前节点的子节点
|
||||
node.setChildren(buildTree(allFiles, entity.getFileId()));
|
||||
// 将该节点添加到结果列表中
|
||||
result.add(node);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取同级目录是否是否存在共享数据
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -23,25 +23,27 @@
|
|||
select file_id, parent_id, ancestors, file_name, file_url, file_size, file_last_modifytime, upload_time, is_directory, is_public, del_flag, create_by, create_time, update_by, update_time from ai_basic_file
|
||||
</sql>
|
||||
|
||||
<select id="selectDataSetBasicFileList" parameterType="com.bonus.ai.domain.DataSetBasicFileEntity" resultMap="DataSetBasicFileResult">
|
||||
<select id="selectDataSetBasicFileList" parameterType="com.bonus.ai.domain.DataSetBasicFileEntity" resultMap="DataSetBasicFileResult">
|
||||
<include refid="selectDataSetBasicFileVo"/>
|
||||
<where>
|
||||
where
|
||||
del_flag ='0' and create_by = #{createBy}
|
||||
<if test="isDirectory != null and isDirectory != ''"> and is_directory = #{isDirectory}</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
||||
<if test="parentId != null"> and parent_id = #{parentId}</if>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="isPublic != null and isPublic != ''"> and is_public =#{isPublic}</if>
|
||||
</where>
|
||||
ORDER BY is_directory DESC ,create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDataSetBasicFileByFileId" parameterType="Long" resultMap="DataSetBasicFileResult">
|
||||
<include refid="selectDataSetBasicFileVo"/>
|
||||
where file_id = #{fileId}
|
||||
ORDER BY is_directory DESC ,create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDataSetBasicFileByParentId" resultMap="DataSetBasicFileResult">
|
||||
<include refid="selectDataSetBasicFileVo"/>
|
||||
where parent_id = #{parentId}
|
||||
ORDER BY is_directory DESC ,create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDataSetBasicDelFileList" parameterType="com.bonus.ai.domain.DataSetBasicFileEntity" resultMap="DataSetBasicFileResult">
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 18097
|
||||
port: 18087
|
||||
# Spring
|
||||
spring:
|
||||
servlet:
|
||||
multipart:
|
||||
# 文件最大
|
||||
max-file-size: 20MB
|
||||
max-file-size: 30MB
|
||||
# 设置总上传数据总大小
|
||||
max-request-size: 20MB
|
||||
max-request-size: 30MB
|
||||
application:
|
||||
# 应用名称
|
||||
name: bonus-ai
|
||||
|
|
@ -21,12 +21,12 @@ spring:
|
|||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 39c95294-eb64-4096-ada1-30a215bdd511
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: 9e2bf9d8-4515-4dfb-aeac-e10bc2b26294
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 39c95294-eb64-4096-ada1-30a215bdd511
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: 9e2bf9d8-4515-4dfb-aeac-e10bc2b26294
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 39c95294-eb64-4096-ada1-30a215bdd511
|
||||
namespace: 9e2bf9d8-4515-4dfb-aeac-e10bc2b26294
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 39c95294-eb64-4096-ada1-30a215bdd511
|
||||
namespace: 9e2bf9d8-4515-4dfb-aeac-e10bc2b26294
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,22 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
export deploy_path=/opt/webapps/bonus-ai
|
||||
export deploy_path=/opt/webapps/bonus-ai-v2
|
||||
|
||||
export app_workspace=/home/jenkins/workspace/Bonus-Cloud
|
||||
export ai_workspace=/home/jenkins/workspace/Bonus-AI-Cloud
|
||||
export ai_workspace=/home/jenkins/workspace/Bonus-Cloud-AI-V2
|
||||
|
||||
suffix="-ai"
|
||||
suffix="-ai-v2"
|
||||
|
||||
|
||||
app_source_jars=(
|
||||
"bonus-auth/target/bonus-auth.jar"
|
||||
"bonus-gateway/target/bonus-gateway.jar"
|
||||
"bonus-modules/bonus-file/target/bonus-file.jar"
|
||||
"bonus-modules/bonus-gen/target/bonus-gen.jar"
|
||||
"bonus-modules/bonus-job/target/bonus-job.jar"
|
||||
"bonus-modules/bonus-oss/target/bonus-oss.jar"
|
||||
"bonus-modules/bonus-system/target/bonus-system.jar"
|
||||
"bonus-visual/bonus-monitor/target/bonus-visual-monitor.jar"
|
||||
)
|
||||
|
||||
#for source_jar in "${app_source_jars[@]}"; do
|
||||
|
|
@ -38,18 +33,13 @@ for source_jar in "${app_source_jars[@]}"; do
|
|||
echo "copied ${app_workspace}/${source_jar} to '$deploy_path/$new_filename'"
|
||||
done
|
||||
|
||||
cp -f ${ai_workspace}/"bonus-modules/bonus-ai/target/bonus-modules-ai.jar" $deploy_path
|
||||
cp -f ${ai_workspace}/"bonus-modules/bonus-ai/target/bonus-modules-ai-v2.jar" $deploy_path
|
||||
echo "copied ${app_workspace}/${source_jar} to $deploy_path"
|
||||
|
||||
# Define an array of JAR files to run
|
||||
jars=("bonus-auth-ai.jar --spring.config.location=file:auth_bootstrap.yml"
|
||||
"bonus-gateway-ai.jar --spring.config.location=file:gateway_bootstrap.yml"
|
||||
"bonus-system-ai.jar --spring.config.location=file:system_bootstrap.yml"
|
||||
"bonus-gen-ai.jar --spring.config.location=file:gen_bootstrap.yml"
|
||||
"bonus-job-ai.jar --spring.config.location=file:job_bootstrap.yml"
|
||||
"bonus-file-ai.jar --spring.config.location=file:file_bootstrap.yml"
|
||||
"bonus-visual-monitor-ai.jar --spring.config.location=file:visual_bootstrap.yml"
|
||||
"bonus-modules-ai.jar --spring.config.location=file:ai_bootstrap.yml")
|
||||
jars=("bonus-auth-ai-v2.jar --spring.config.location=file:auth_bootstrap.yml"
|
||||
"bonus-gateway-ai-v2.jar --spring.config.location=file:gateway_bootstrap.yml"
|
||||
"bonus-system-ai-v2.jar --spring.config.location=file:system_bootstrap.yml")
|
||||
|
||||
# 遍历数组并检查每个JAR文件的进程
|
||||
for jar_with_args in "${jars[@]}"; do
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 39c95294-eb64-4096-ada1-30a215bdd511
|
||||
namespace: 9e2bf9d8-4515-4dfb-aeac-e10bc2b26294
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 39c95294-eb64-4096-ada1-30a215bdd511
|
||||
namespace: 9e2bf9d8-4515-4dfb-aeac-e10bc2b26294
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ spring:
|
|||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 39c95294-eb64-4096-ada1-30a215bdd511
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: 9e2bf9d8-4515-4dfb-aeac-e10bc2b26294
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 39c95294-eb64-4096-ada1-30a215bdd511
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: 9e2bf9d8-4515-4dfb-aeac-e10bc2b26294
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ create table ai_basic_file
|
|||
ancestors varchar(200) comment '祖级列表',
|
||||
file_name varchar(200) comment '文件名',
|
||||
file_url varchar(200) comment '文件网络路径',
|
||||
file_size long comment '文件大小',
|
||||
file_size bigint comment '文件大小',
|
||||
file_last_modifytime datetime default null comment '文件最后修改时间',
|
||||
upload_time datetime default null comment '上传时间',
|
||||
is_directory char(1) comment '是否文件夹',
|
||||
|
|
|
|||
Loading…
Reference in New Issue