1
0

feat(web): 增加删除数据资源接口

This commit is contained in:
2024-11-25 18:33:37 +08:00
parent c820ef2a39
commit 1c0c32ddcb
2 changed files with 8 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ import {
resourceDetailDialog, resourceDetailDialog,
resourceEditeDialog resourceEditeDialog
} from "../../components/resource/dialog-resource.js"; } from "../../components/resource/dialog-resource.js";
import {apiPost, crudCommonOptions} from "../../components/constants.js"; import {apiGet, apiPost, crudCommonOptions} from "../../components/constants.js";
export function tabData() { export function tabData() {
return { return {
@@ -66,6 +66,10 @@ export function tabData() {
label: '删除', label: '删除',
level: 'link', level: 'link',
className: 'text-danger', className: 'text-danger',
confirmTitle: '确认删除',
confirmText: '确认删除名称为「${name}」的数据资源吗?',
actionType: 'ajax',
api: apiGet('${base}/data_resource/remove/${id}')
}, },
] ]
}, },

View File

@@ -74,9 +74,9 @@ public class DataResourceController {
return AmisResponse.responseSuccess(new DataResourceDetail(mapper, dataResourceService.detail(id))); return AmisResponse.responseSuccess(new DataResourceDetail(mapper, dataResourceService.detail(id)));
} }
@PostMapping("/update/{id}") @GetMapping("/remove/{id}")
public void update(@PathVariable Long id, @RequestBody UpdateRequest request) throws JsonProcessingException { public void remove(@PathVariable Long id) {
dataResourceService.remove(id);
} }
@Data @Data