提交 | 用户 | 时间
|
a63a4f
|
1 |
package com.iailab.module.data.ind.data.controller.admin; |
潘 |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.CommonResult; |
|
4 |
import com.iailab.framework.common.pojo.PageResult; |
|
5 |
import com.iailab.framework.common.util.object.BeanUtils; |
976e14
|
6 |
import com.iailab.module.data.common.xss.SQLFilter; |
a63a4f
|
7 |
import com.iailab.module.data.ind.data.entity.IndDataSetEntity; |
潘 |
8 |
import com.iailab.module.data.ind.data.service.IndDataSetService; |
|
9 |
import com.iailab.module.data.ind.data.vo.IndDataSetPageReqVO; |
|
10 |
import com.iailab.module.data.ind.data.vo.IndDataSetRespVO; |
|
11 |
import com.iailab.module.data.ind.data.vo.IndDataSetSaveReqVO; |
|
12 |
import io.swagger.v3.oas.annotations.Operation; |
|
13 |
import io.swagger.v3.oas.annotations.Parameter; |
|
14 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
15 |
import org.springframework.beans.factory.annotation.Autowired; |
|
16 |
import org.springframework.security.access.prepost.PreAuthorize; |
|
17 |
import org.springframework.validation.annotation.Validated; |
|
18 |
import org.springframework.web.bind.annotation.*; |
|
19 |
|
|
20 |
import javax.validation.Valid; |
|
21 |
|
215dbc
|
22 |
import java.util.List; |
潘 |
23 |
|
a63a4f
|
24 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
潘 |
25 |
|
|
26 |
/** |
|
27 |
* @author PanZhibao |
|
28 |
* @Description |
|
29 |
* @createTime 2024年09月10日 |
|
30 |
*/ |
|
31 |
@Tag(name = "数据平台 - 指标数据集") |
|
32 |
@RestController |
ac6fb5
|
33 |
@RequestMapping("/data/ind/data-set") |
a63a4f
|
34 |
@Validated |
潘 |
35 |
public class IndDataSetController { |
|
36 |
@Autowired |
|
37 |
private IndDataSetService indDataSetService; |
|
38 |
|
|
39 |
@GetMapping("/page") |
e41062
|
40 |
@Operation(summary = "获取指标数据集列表", description = "用于【指标数据集】界面") |
a63a4f
|
41 |
@PreAuthorize("@ss.hasPermission('data:ind-data-set:query')") |
潘 |
42 |
public CommonResult<PageResult<IndDataSetRespVO>> page(IndDataSetPageReqVO reqVO) { |
|
43 |
PageResult<IndDataSetEntity> page = indDataSetService.page(reqVO); |
|
44 |
return success(BeanUtils.toBean(page, IndDataSetRespVO.class)); |
|
45 |
} |
|
46 |
|
|
47 |
@PostMapping("/create") |
e41062
|
48 |
@Operation(summary = "创建指标数据集") |
a63a4f
|
49 |
@PreAuthorize("@ss.hasPermission('data:ind-data-set:create')") |
潘 |
50 |
public CommonResult<Boolean> create(@Valid @RequestBody IndDataSetSaveReqVO createReqVO) { |
976e14
|
51 |
SQLFilter.sqlInject(createReqVO.getQuerySql()); |
a63a4f
|
52 |
indDataSetService.create(createReqVO); |
潘 |
53 |
return success(true); |
|
54 |
} |
|
55 |
|
|
56 |
@PutMapping("/update") |
e41062
|
57 |
@Operation(summary = "修改指标数据集") |
a63a4f
|
58 |
@PreAuthorize("@ss.hasPermission('data:ind-data-set:update')") |
潘 |
59 |
public CommonResult<Boolean> update(@Valid @RequestBody IndDataSetSaveReqVO updateReqVO) { |
976e14
|
60 |
SQLFilter.sqlInject(updateReqVO.getQuerySql()); |
a63a4f
|
61 |
indDataSetService.update(updateReqVO); |
潘 |
62 |
return success(true); |
|
63 |
} |
|
64 |
|
|
65 |
@DeleteMapping("/delete") |
e41062
|
66 |
@Operation(summary = "删除指标数据集") |
潘 |
67 |
@Parameter(name = "id", description = "指标数据集编号", required= true, example = "1024") |
a63a4f
|
68 |
@PreAuthorize("@ss.hasPermission('data:ind-data-set:delete')") |
潘 |
69 |
public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
|
70 |
indDataSetService.delete(id); |
|
71 |
return success(true); |
|
72 |
} |
|
73 |
|
|
74 |
@GetMapping("/get") |
e41062
|
75 |
@Operation(summary = "获取指标数据集信息") |
ac6fb5
|
76 |
@PreAuthorize("@ss.hasPermission('data:ind-data-set:query')") |
a63a4f
|
77 |
public CommonResult<IndDataSetRespVO> get(String id) { |
潘 |
78 |
IndDataSetEntity entity = indDataSetService.get(id); |
|
79 |
return success(BeanUtils.toBean(entity, IndDataSetRespVO.class)); |
|
80 |
} |
215dbc
|
81 |
|
潘 |
82 |
@GetMapping("/list-all-simple") |
|
83 |
@Operation(summary = "获取指标数据集列表", description = "用于【指标数据集】界面") |
|
84 |
@PreAuthorize("@ss.hasPermission('data:ind-data-set:query')") |
|
85 |
public CommonResult<List<IndDataSetRespVO>> list(IndDataSetPageReqVO reqVO) { |
|
86 |
List<IndDataSetEntity> list = indDataSetService.list(reqVO); |
|
87 |
return success(BeanUtils.toBean(list, IndDataSetRespVO.class)); |
|
88 |
} |
a63a4f
|
89 |
} |