forked from github/dataease
fix: 恢复因为增加日志修改的api
This commit is contained in:
parent
39ed55c1bb
commit
5973f9beac
@ -7,8 +7,10 @@ import io.dataease.auth.annotation.DePermissions;
|
||||
import io.dataease.commons.constants.DePermissionType;
|
||||
import io.dataease.commons.constants.ResourceAuthLevel;
|
||||
import io.dataease.commons.constants.SysLogConstants;
|
||||
import io.dataease.commons.utils.DeLogUtils;
|
||||
import io.dataease.controller.dataset.request.DeleteGroupRequest;
|
||||
import io.dataease.controller.request.dataset.DataSetGroupRequest;
|
||||
import io.dataease.dto.SysLogDTO;
|
||||
import io.dataease.dto.dataset.DataSetGroupDTO;
|
||||
import io.dataease.plugins.common.base.domain.DatasetGroup;
|
||||
import io.dataease.service.dataset.DataSetGroupService;
|
||||
@ -60,15 +62,12 @@ public class DataSetGroupController {
|
||||
|
||||
@DePermission(type = DePermissionType.DATASET, level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
|
||||
@ApiOperation("删除")
|
||||
@PostMapping("/delete")
|
||||
@DeLog(
|
||||
operatetype = SysLogConstants.OPERATE_TYPE.DELETE,
|
||||
sourcetype = SysLogConstants.SOURCE_TYPE.DATASET,
|
||||
positionIndex = 0,positionKey = "pid",
|
||||
value = "id"
|
||||
)
|
||||
public void tree(@RequestBody DeleteGroupRequest request) throws Exception {
|
||||
dataSetGroupService.delete(request.getId());
|
||||
@PostMapping("/delete/{id}")
|
||||
public void delete(@PathVariable String id) throws Exception {
|
||||
DatasetGroup datasetGroup = dataSetGroupService.getScene(id);
|
||||
SysLogDTO sysLogDTO = DeLogUtils.buildLog(SysLogConstants.OPERATE_TYPE.DELETE, SysLogConstants.SOURCE_TYPE.DATASET, id, datasetGroup.getPid(), null, null);
|
||||
dataSetGroupService.delete(id);
|
||||
DeLogUtils.save(sysLogDTO);
|
||||
}
|
||||
|
||||
@ApiIgnore
|
||||
|
@ -4,7 +4,8 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.auth.annotation.DeLog;
|
||||
import io.dataease.auth.annotation.DePermission;
|
||||
import io.dataease.commons.constants.SysLogConstants;
|
||||
import io.dataease.controller.datasource.request.DeleteDsRequest;
|
||||
import io.dataease.commons.utils.DeLogUtils;
|
||||
import io.dataease.dto.SysLogDTO;
|
||||
import io.dataease.plugins.common.base.domain.Datasource;
|
||||
import io.dataease.commons.constants.DePermissionType;
|
||||
import io.dataease.commons.constants.ResourceAuthLevel;
|
||||
@ -14,13 +15,12 @@ import io.dataease.controller.datasource.request.UpdataDsRequest;
|
||||
import io.dataease.controller.request.DatasourceUnionRequest;
|
||||
import io.dataease.controller.request.datasource.ApiDefinition;
|
||||
import io.dataease.dto.datasource.DBTableDTO;
|
||||
import io.dataease.plugins.common.dto.datasource.DataSourceType;
|
||||
import io.dataease.service.datasource.DatasourceService;
|
||||
import io.dataease.dto.DatasourceDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.pentaho.di.core.database.DataSourceProviderInterface;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@ -90,15 +90,14 @@ public class DatasourceController {
|
||||
@RequiresPermissions("datasource:read")
|
||||
@DePermission(type = DePermissionType.DATASOURCE, level = ResourceAuthLevel.DATASOURCE_LEVEL_MANAGE, value = "id")
|
||||
@ApiOperation("删除数据源")
|
||||
@PostMapping("/delete")
|
||||
@DeLog(
|
||||
operatetype = SysLogConstants.OPERATE_TYPE.DELETE,
|
||||
sourcetype = SysLogConstants.SOURCE_TYPE.DATASOURCE,
|
||||
positionIndex = 0,positionKey = "type",
|
||||
value = "id"
|
||||
)
|
||||
public ResultHolder deleteDatasource(@RequestBody DeleteDsRequest request) throws Exception {
|
||||
return datasourceService.deleteDatasource(request.getId());
|
||||
@PostMapping("/delete/{datasourceID}")
|
||||
public ResultHolder deleteDatasource(@PathVariable(value = "datasourceID") String datasourceID) throws Exception {
|
||||
Datasource datasource = datasourceService.get(datasourceID);
|
||||
SysLogDTO sysLogDTO = DeLogUtils.buildLog(SysLogConstants.OPERATE_TYPE.DELETE, SysLogConstants.SOURCE_TYPE.DATASOURCE, datasourceID, datasource.getType(), null, null);
|
||||
ResultHolder resultHolder = datasourceService.deleteDatasource(datasourceID);
|
||||
if (ObjectUtils.isNotEmpty(resultHolder) && resultHolder.isSuccess())
|
||||
DeLogUtils.save(sysLogDTO);
|
||||
return resultHolder;
|
||||
}
|
||||
|
||||
@RequiresPermissions("datasource:read")
|
||||
|
@ -1,16 +0,0 @@
|
||||
package io.dataease.controller.datasource.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class DeleteDsRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "ID",required = true)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "类型", required = true)
|
||||
private String type;
|
||||
}
|
@ -26,12 +26,11 @@ export function addGroup(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function delGroup(data) {
|
||||
export function delGroup(groupId) {
|
||||
return request({
|
||||
url: '/dataset/group/delete',
|
||||
url: '/dataset/group/delete/' + groupId,
|
||||
loading: true,
|
||||
method: 'post',
|
||||
data
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -61,12 +61,11 @@ export function editDs(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function delDs(data) {
|
||||
export function delDs(id) {
|
||||
return request({
|
||||
url: 'datasource/delete',
|
||||
url: 'datasource/delete/' + id,
|
||||
loading: true,
|
||||
method: 'post',
|
||||
data
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -461,8 +461,7 @@ export default {
|
||||
cancelButtonText: this.$t('dataset.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const param = { id: data.id, pid: data.pid }
|
||||
delGroup(param).then(response => {
|
||||
delGroup(data.id).then(response => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: this.$t('dataset.delete_success'),
|
||||
|
@ -2,9 +2,8 @@
|
||||
<el-col class="tree-style">
|
||||
<el-col>
|
||||
<el-row>
|
||||
<el-tabs v-model="showView" @tab-click="changeTab" type="card">
|
||||
<el-tab-pane v-for="(item, index) in editableTabs" :key="item.name" :label="item.title" :name="item.name">
|
||||
</el-tab-pane>
|
||||
<el-tabs v-model="showView" type="card" @tab-click="changeTab">
|
||||
<el-tab-pane v-for="(item, index) in editableTabs" :key="item.name" :label="item.title" :name="item.name" />
|
||||
</el-tabs>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@ -138,14 +137,13 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</el-col>
|
||||
</el-col>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import { mapGetters } from 'vuex'
|
||||
import i18n from "@/lang";
|
||||
import i18n from '@/lang'
|
||||
import {
|
||||
listDatasource,
|
||||
listDatasourceByType,
|
||||
@ -156,7 +154,7 @@ import {
|
||||
delDriver,
|
||||
listDriverByType
|
||||
} from '@/api/system/datasource'
|
||||
import {ApplicationContext} from "@/utils/ApplicationContext";
|
||||
import { ApplicationContext } from '@/utils/ApplicationContext'
|
||||
|
||||
export default {
|
||||
name: 'DsTree',
|
||||
@ -215,7 +213,6 @@ export default {
|
||||
name: 'Driver'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
@ -368,8 +365,12 @@ export default {
|
||||
cancelButtonText: this.$t('commons.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const parma = {type: datasource.type, id: datasource.id}
|
||||
const method = this.showView === 'Datasource' ? delDs : delDriver
|
||||
let method = delDriver
|
||||
let parma = { type: datasource.type, id: datasource.id }
|
||||
if (this.showView === 'Datasource') {
|
||||
method = delDs
|
||||
parma = datasource.id
|
||||
}
|
||||
method(parma).then(res => {
|
||||
if (res.success) {
|
||||
this.$success(this.$t('commons.delete_success'))
|
||||
@ -437,7 +438,7 @@ export default {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user