提交 | 用户 | 时间
|
8b3ee3
|
1 |
package com.iailab.module.model.mpk.controller.admin; |
潘 |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.CommonResult; |
0a2f6f
|
4 |
import com.iailab.framework.common.util.object.ConvertUtils; |
8b3ee3
|
5 |
import com.iailab.module.model.mpk.dto.FileGroupDTO; |
潘 |
6 |
import com.iailab.module.model.mpk.entity.FileGroupEntity; |
|
7 |
import com.iailab.module.model.mpk.service.FileGroupService; |
|
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 javax.validation.Valid; |
|
14 |
import java.util.List; |
|
15 |
|
|
16 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
17 |
|
|
18 |
/** |
|
19 |
* @author PanZhibao |
|
20 |
* @Description |
|
21 |
* @createTime 2024年09月22日 |
|
22 |
*/ |
|
23 |
@Tag(name = "模型服务 - 模型文件分组管理") |
|
24 |
@RestController |
|
25 |
@RequestMapping("/model/mpk/group") |
|
26 |
public class FileGroupController { |
|
27 |
@Autowired |
|
28 |
private FileGroupService fileGroupService; |
|
29 |
|
|
30 |
@GetMapping("/list") |
|
31 |
@Operation(summary = "获得列表") |
|
32 |
public CommonResult<List<FileGroupDTO>> list(@RequestParam("menuId") String menuId) { |
|
33 |
List<FileGroupDTO> list = fileGroupService.list(menuId); |
|
34 |
return success(list); |
|
35 |
} |
|
36 |
|
0a2f6f
|
37 |
@GetMapping("/get") |
潘 |
38 |
@Operation(summary = "获取详情") |
|
39 |
public CommonResult<FileGroupDTO> get(@RequestParam("id") String id) { |
|
40 |
FileGroupDTO data = ConvertUtils.sourceToTarget(fileGroupService.get(id), FileGroupDTO.class); |
|
41 |
return success(data); |
|
42 |
} |
|
43 |
|
8b3ee3
|
44 |
@PostMapping("/create") |
潘 |
45 |
public CommonResult<Boolean> create(@Valid @RequestBody FileGroupEntity entity) { |
|
46 |
fileGroupService.create(entity); |
|
47 |
return success(true); |
|
48 |
} |
|
49 |
|
|
50 |
@PostMapping("/update") |
|
51 |
public CommonResult<Boolean> update(@Valid @RequestBody FileGroupEntity entity) { |
|
52 |
fileGroupService.update(entity); |
|
53 |
return success(true); |
|
54 |
} |
|
55 |
|
|
56 |
@DeleteMapping("/delete") |
|
57 |
public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
|
58 |
fileGroupService.deleteById(id); |
|
59 |
return success(true); |
|
60 |
} |
|
61 |
|
|
62 |
} |