Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
13aff751
提交
13aff751
authored
5月 22, 2022
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 驱动管理的日志记录
上级
df174684
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
76 行增加
和
13 行删除
+76
-13
DeLogAnnotationHandler.java
...ain/java/io/dataease/auth/aop/DeLogAnnotationHandler.java
+1
-0
SysLogConstants.java
...n/java/io/dataease/commons/constants/SysLogConstants.java
+5
-2
DriverMgmController.java
...o/dataease/controller/datasource/DriverMgmController.java
+41
-6
ExtSysLogMapper.xml
backend/src/main/java/io/dataease/ext/ExtSysLogMapper.xml
+22
-0
DriverService.java
...in/java/io/dataease/service/datasource/DriverService.java
+2
-1
datasource.js
frontend/src/api/system/datasource.js
+4
-3
DriverForm.vue
frontend/src/views/system/datasource/DriverForm.vue
+1
-1
没有找到文件。
backend/src/main/java/io/dataease/auth/aop/DeLogAnnotationHandler.java
浏览文件 @
13aff751
...
...
@@ -43,6 +43,7 @@ public class DeLogAnnotationHandler {
befores
.
add
(
SysLogConstants
.
OPERATE_TYPE
.
DELETE
.
getValue
());
befores
.
add
(
SysLogConstants
.
OPERATE_TYPE
.
UNSHARE
.
getValue
());
befores
.
add
(
SysLogConstants
.
OPERATE_TYPE
.
UNAUTHORIZE
.
getValue
());
befores
.
add
(
SysLogConstants
.
OPERATE_TYPE
.
UPLOADFILE
.
getValue
());
}
private
SysLogDTO
exec
(
JoinPoint
point
,
DeLog
deLog
)
throws
Exception
{
...
...
backend/src/main/java/io/dataease/commons/constants/SysLogConstants.java
浏览文件 @
13aff751
...
...
@@ -21,7 +21,8 @@ public class SysLogConstants {
UNAUTHORIZE
(
7
,
"OPERATE_TYPE_UNAUTHORIZE"
),
CREATELINK
(
8
,
"OPERATE_TYPE_CREATELINK"
),
DELETELINK
(
9
,
"OPERATE_TYPE_DELETELINK"
),
MODIFYLINK
(
10
,
"OPERATE_TYPE_MODIFYLINK"
);
MODIFYLINK
(
10
,
"OPERATE_TYPE_MODIFYLINK"
),
UPLOADFILE
(
11
,
"OPERATE_TYPE_UPLOADFILE"
);
private
Integer
value
;
private
String
name
;
OPERATE_TYPE
(
Integer
value
,
String
name
)
{
...
...
@@ -52,7 +53,9 @@ public class SysLogConstants {
/*LINK(5, "SOURCE_TYPE_LINK"),*/
USER
(
6
,
"SOURCE_TYPE_USER"
),
DEPT
(
7
,
"SOURCE_TYPE_DEPT"
),
ROLE
(
8
,
"SOURCE_TYPE_ROLE"
);
ROLE
(
8
,
"SOURCE_TYPE_ROLE"
),
DRIVER
(
9
,
"SOURCE_TYPE_DRIVER"
),
DRIVER_FILE
(
10
,
"SOURCE_TYPE_DRIVER_FILE"
);
private
Integer
value
;
private
String
name
;
...
...
backend/src/main/java/io/dataease/controller/datasource/DriverMgmController.java
浏览文件 @
13aff751
package
io
.
dataease
.
controller
.
datasource
;
import
io.dataease.auth.annotation.DeLog
;
import
io.dataease.commons.constants.SysLogConstants
;
import
io.dataease.dto.DriverDTO
;
import
io.dataease.plugins.common.base.domain.DeDriver
;
import
io.dataease.plugins.common.base.domain.DeDriverDetails
;
...
...
@@ -9,7 +11,6 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.security.core.parameters.P
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
springfox.documentation.annotations.ApiIgnore
;
...
...
@@ -36,6 +37,13 @@ public class DriverMgmController {
@RequiresPermissions
(
"datasource:read"
)
@ApiOperation
(
"删除驱动"
)
@PostMapping
(
"/delete"
)
@DeLog
(
operatetype
=
SysLogConstants
.
OPERATE_TYPE
.
DELETE
,
sourcetype
=
SysLogConstants
.
SOURCE_TYPE
.
DRIVER
,
positionIndex
=
0
,
positionKey
=
"type"
,
value
=
"id"
)
public
void
delete
(
@RequestBody
DeDriver
deDriver
)
throws
Exception
{
driverService
.
delete
(
deDriver
.
getId
());
}
...
...
@@ -50,6 +58,13 @@ public class DriverMgmController {
@RequiresPermissions
(
"datasource:read"
)
@ApiOperation
(
"添加驱动"
)
@PostMapping
(
"/save"
)
@DeLog
(
operatetype
=
SysLogConstants
.
OPERATE_TYPE
.
CREATE
,
sourcetype
=
SysLogConstants
.
SOURCE_TYPE
.
DRIVER
,
positionIndex
=
0
,
positionKey
=
"type"
,
value
=
"id"
)
public
DeDriver
save
(
@RequestBody
DeDriver
deDriver
)
throws
Exception
{
return
driverService
.
save
(
deDriver
);
}
...
...
@@ -57,6 +72,12 @@ public class DriverMgmController {
@RequiresPermissions
(
"datasource:read"
)
@ApiOperation
(
"更新驱动"
)
@PostMapping
(
"/update"
)
@DeLog
(
operatetype
=
SysLogConstants
.
OPERATE_TYPE
.
MODIFY
,
sourcetype
=
SysLogConstants
.
SOURCE_TYPE
.
DRIVER
,
positionIndex
=
0
,
positionKey
=
"type"
,
value
=
"id"
)
public
DeDriver
update
(
@RequestBody
DeDriver
deDriver
)
throws
Exception
{
return
driverService
.
update
(
deDriver
);
}
...
...
@@ -70,20 +91,34 @@ public class DriverMgmController {
@RequiresPermissions
(
"datasource:read"
)
@ApiOperation
(
"删除驱动文件"
)
@PostMapping
(
"/deleteDriverFile/{id}"
)
public
void
deleteDriverFile
(
@PathVariable
String
id
)
throws
Exception
{
driverService
.
deleteDriverFile
(
id
);
@PostMapping
(
"/deleteDriverFile"
)
@DeLog
(
operatetype
=
SysLogConstants
.
OPERATE_TYPE
.
DELETE
,
sourcetype
=
SysLogConstants
.
SOURCE_TYPE
.
DRIVER_FILE
,
positionIndex
=
0
,
positionKey
=
"deDriverId"
,
value
=
"id"
)
public
void
deleteDriverFile
(
@RequestBody
DeDriverDetails
deDriverDetails
)
throws
Exception
{
driverService
.
deleteDriverFile
(
deDriverDetails
.
getId
());
}
@RequiresPermissions
(
"datasource:read"
)
@ApiOperation
(
"驱动文件上传"
)
@PostMapping
(
"file/upload"
)
@DeLog
(
operatetype
=
SysLogConstants
.
OPERATE_TYPE
.
UPLOADFILE
,
sourcetype
=
SysLogConstants
.
SOURCE_TYPE
.
DRIVER_FILE
,
positionIndex
=
0
,
positionKey
=
"deDriverId"
,
value
=
"id"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"file"
,
value
=
"文件"
,
required
=
true
,
dataType
=
"MultipartFile"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"驱动D"
,
required
=
true
,
dataType
=
"String"
)
})
public
void
excelUpload
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"id"
)
String
id
)
throws
Exception
{
driverService
.
saveJar
(
file
,
id
);
public
DeDriverDetails
excelUpload
(
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
return
driverService
.
saveJar
(
file
,
id
);
}
...
...
backend/src/main/java/io/dataease/ext/ExtSysLogMapper.xml
浏览文件 @
13aff751
...
...
@@ -112,6 +112,28 @@
</where>
</if>
<if
test=
"type == 9"
>
id, name
from de_driver
<where>
id in
<foreach
collection=
"ids"
item=
"id"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</where>
</if>
<if
test=
"type == 10"
>
id, name
from de_driver
<where>
id in
<foreach
collection=
"ids"
item=
"id"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</where>
</if>
</select>
...
...
backend/src/main/java/io/dataease/service/datasource/DriverService.java
浏览文件 @
13aff751
...
...
@@ -89,7 +89,7 @@ public class DriverService {
deDriverDetailsMapper
.
deleteByPrimaryKey
(
driverFileId
);
}
public
void
saveJar
(
MultipartFile
file
,
String
driverId
)
throws
Exception
{
public
DeDriverDetails
saveJar
(
MultipartFile
file
,
String
driverId
)
throws
Exception
{
String
filename
=
file
.
getOriginalFilename
();
String
dirPath
=
DRIVER_PATH
+
driverId
+
"/"
;
String
filePath
=
dirPath
+
filename
;
...
...
@@ -112,6 +112,7 @@ public class DriverService {
deDriverDetails
.
setFileName
(
filename
);
deDriverDetails
.
setDriverClass
(
String
.
join
(
","
,
jdbcList
));
deDriverDetailsMapper
.
insert
(
deDriverDetails
);
return
deDriverDetails
;
}
private
List
<
String
>
getClassNameFrom
(
String
jarName
)
{
...
...
frontend/src/api/system/datasource.js
浏览文件 @
13aff751
...
...
@@ -122,11 +122,12 @@ export function listDriverDetails(id) {
})
}
export
function
deleteDriverFile
(
id
)
{
export
function
deleteDriverFile
(
data
)
{
return
request
({
url
:
'/driver/deleteDriverFile
/'
+
id
,
url
:
'/driver/deleteDriverFile
'
,
method
:
'post'
,
loading
:
true
loading
:
true
,
data
})
}
...
...
frontend/src/views/system/datasource/DriverForm.vue
浏览文件 @
13aff751
...
...
@@ -211,7 +211,7 @@ export default {
})
},
deleteDriverFile
(
row
){
deleteDriverFile
(
row
.
id
).
then
(
res
=>
{
deleteDriverFile
(
row
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.delete_success'
))
this
.
listDriverDetails
()
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论