提交 | 用户 | 时间
|
8b3ee3
|
1 |
package com.iailab.module.model.mpk.controller.admin; |
潘 |
2 |
|
|
3 |
import com.iailab.framework.common.page.PageData; |
|
4 |
import com.iailab.framework.common.pojo.CommonResult; |
|
5 |
import com.iailab.framework.common.pojo.PageResult; |
|
6 |
import com.iailab.framework.common.util.object.BeanUtils; |
|
7 |
import com.iailab.module.model.mpk.entity.IconEntity; |
|
8 |
import com.iailab.module.model.mpk.service.IconService; |
|
9 |
import com.iailab.module.model.mpk.vo.IconPageReqVO; |
|
10 |
import io.swagger.v3.oas.annotations.Operation; |
|
11 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
12 |
import org.springframework.beans.factory.annotation.Autowired; |
|
13 |
import org.springframework.web.bind.annotation.*; |
|
14 |
|
|
15 |
import javax.validation.Valid; |
|
16 |
|
|
17 |
import java.util.List; |
|
18 |
|
|
19 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
20 |
|
|
21 |
/** |
|
22 |
* @author PanZhibao |
|
23 |
* @Description |
|
24 |
* @createTime 2024年09月22日 |
|
25 |
*/ |
|
26 |
@Tag(name = "模型服务 - MDK菜单图标管理") |
|
27 |
@RestController |
|
28 |
@RequestMapping("/model/mpk/icon") |
|
29 |
public class IconController { |
|
30 |
|
|
31 |
@Autowired |
|
32 |
private IconService iconService; |
|
33 |
|
|
34 |
@GetMapping("/page") |
|
35 |
@Operation(summary = "获得分页") |
|
36 |
public CommonResult<PageResult<IconEntity>> page(@Valid IconPageReqVO reqVO) { |
|
37 |
PageResult<IconEntity> page = iconService.page(reqVO); |
|
38 |
return success(BeanUtils.toBean(page, IconEntity.class)); |
|
39 |
} |
|
40 |
|
|
41 |
@GetMapping("/list") |
|
42 |
@Operation(summary = "获得列表") |
|
43 |
public CommonResult<List<IconEntity>> list() { |
|
44 |
List<IconEntity> list = iconService.list(); |
|
45 |
return success(list); |
|
46 |
} |
|
47 |
|
|
48 |
@GetMapping("/get") |
|
49 |
@Operation(summary = "获得详情") |
|
50 |
public CommonResult<IconEntity> get(@RequestParam("id") String id) { |
|
51 |
IconEntity data = iconService.get(id); |
|
52 |
return success(data); |
|
53 |
} |
|
54 |
|
|
55 |
@PostMapping("/create") |
|
56 |
@Operation(summary = "创建") |
|
57 |
public CommonResult<Boolean> save(@Valid @RequestBody IconEntity entity) { |
|
58 |
iconService.create(entity); |
|
59 |
return success(true); |
|
60 |
} |
|
61 |
|
|
62 |
@PutMapping("/update") |
|
63 |
@Operation(summary = "更新") |
|
64 |
public CommonResult<Boolean> update(@Valid @RequestBody IconEntity entity) { |
|
65 |
iconService.update(entity); |
|
66 |
return success(true); |
|
67 |
} |
|
68 |
|
|
69 |
@DeleteMapping("/delete") |
|
70 |
public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
|
71 |
iconService.delete(id); |
|
72 |
return success(true); |
|
73 |
} |
|
74 |
} |