提交 | 用户 | 时间
|
200ade
|
1 |
package com.iailab.module.model.mpk.controller.admin; |
D |
2 |
|
|
3 |
import com.iailab.framework.common.page.PageData; |
|
4 |
import com.iailab.framework.common.pojo.CommonResult; |
730d19
|
5 |
import com.iailab.module.model.api.mcs.dto.ChartParamDTO; |
200ade
|
6 |
import com.iailab.module.model.mpk.entity.ChartParamEntity; |
D |
7 |
import com.iailab.module.model.mpk.service.ChartParamService; |
|
8 |
import io.swagger.v3.oas.annotations.Operation; |
|
9 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
10 |
import org.springframework.beans.factory.annotation.Autowired; |
|
11 |
import org.springframework.web.bind.annotation.*; |
|
12 |
|
|
13 |
import java.util.Map; |
|
14 |
|
|
15 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
16 |
|
|
17 |
/** |
|
18 |
* @description: |
|
19 |
* @author: dzd |
|
20 |
* @date: 2024/11/5 11:43 |
|
21 |
**/ |
|
22 |
@Tag(name = "图表参数") |
|
23 |
@RestController |
|
24 |
@RequestMapping("/model/chart/param") |
|
25 |
public class ChartParamController { |
|
26 |
|
|
27 |
@Autowired |
|
28 |
private ChartParamService chartParamService; |
|
29 |
|
|
30 |
@GetMapping("page") |
|
31 |
@Operation(summary = "分页") |
|
32 |
public CommonResult<PageData<ChartParamDTO>> page(@RequestParam Map<String, Object> params) { |
|
33 |
PageData<ChartParamDTO> page = chartParamService.page(params); |
|
34 |
return success(page); |
|
35 |
} |
|
36 |
|
|
37 |
@GetMapping("/get") |
|
38 |
@Operation(summary = "获得详情") |
|
39 |
public CommonResult<ChartParamEntity> get(@RequestParam("id") String id) { |
|
40 |
ChartParamEntity data = chartParamService.get(id); |
|
41 |
return success(data); |
|
42 |
} |
|
43 |
|
|
44 |
@PostMapping("/create") |
|
45 |
@Operation(summary = "创建") |
|
46 |
public CommonResult<Boolean> save(@RequestBody ChartParamEntity entity) { |
|
47 |
chartParamService.create(entity); |
|
48 |
return success(true); |
|
49 |
} |
|
50 |
|
|
51 |
@PutMapping("/update") |
|
52 |
@Operation(summary = "更新") |
|
53 |
public CommonResult<Boolean> update(@RequestBody ChartParamEntity entity) { |
|
54 |
chartParamService.update(entity); |
|
55 |
return success(true); |
|
56 |
} |
|
57 |
|
|
58 |
@DeleteMapping("/delete") |
|
59 |
public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
|
60 |
chartParamService.delete(id); |
|
61 |
return success(true); |
|
62 |
} |
|
63 |
} |