提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.data.channel.kio.controller.admin; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.CommonResult; |
aecc49
|
4 |
import com.iailab.framework.common.pojo.PageResult; |
L |
5 |
import com.iailab.framework.common.util.object.BeanUtils; |
|
6 |
import com.iailab.module.data.channel.kio.entity.ChannelKioTagEntity; |
a6de49
|
7 |
import com.iailab.module.data.channel.kio.service.ChannelKioTagService; |
aecc49
|
8 |
import com.iailab.module.data.channel.kio.vo.KioTagPageReqVO; |
L |
9 |
import com.iailab.module.data.channel.kio.vo.KioTagRespVO; |
a6de49
|
10 |
import io.swagger.v3.oas.annotations.Operation; |
H |
11 |
import org.springframework.web.bind.annotation.*; |
|
12 |
|
aecc49
|
13 |
import javax.annotation.Resource; |
L |
14 |
import javax.validation.Valid; |
|
15 |
import java.util.Date; |
a6de49
|
16 |
import java.util.UUID; |
H |
17 |
|
aecc49
|
18 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
L |
19 |
|
a6de49
|
20 |
/** |
aecc49
|
21 |
* @author lirm |
L |
22 |
* @Description |
|
23 |
* @createTime 2024年08月26日 |
a6de49
|
24 |
*/ |
H |
25 |
@RestController |
|
26 |
@RequestMapping("/data/channel/kio/tag") |
|
27 |
public class ChannelKioTagController { |
|
28 |
@Resource |
|
29 |
private ChannelKioTagService channelKioTagService; |
|
30 |
|
|
31 |
/** |
|
32 |
* 分页查询tag |
|
33 |
* */ |
|
34 |
@GetMapping("page") |
aecc49
|
35 |
public CommonResult<PageResult<KioTagRespVO>> page(@Valid KioTagPageReqVO reqVO){ |
L |
36 |
PageResult<ChannelKioTagEntity> page = channelKioTagService.queryPage(reqVO); |
|
37 |
return success(BeanUtils.toBean(page, KioTagRespVO.class)); |
a6de49
|
38 |
} |
H |
39 |
|
aecc49
|
40 |
@GetMapping("/info/{id}") |
a6de49
|
41 |
@Operation(summary = "信息") |
aecc49
|
42 |
public CommonResult<ChannelKioTagEntity> info(@PathVariable("id") String id) { |
L |
43 |
ChannelKioTagEntity info = channelKioTagService.info(id); |
|
44 |
return success(info); |
a6de49
|
45 |
} |
H |
46 |
|
aecc49
|
47 |
@PostMapping("/add") |
L |
48 |
public CommonResult<Boolean> add(@RequestBody ChannelKioTagEntity channelKioTagEntity) { |
|
49 |
String id = UUID.randomUUID().toString(); |
|
50 |
channelKioTagEntity.setId(id); |
|
51 |
channelKioTagEntity.setCreateTime(new Date()); |
|
52 |
channelKioTagService.add(channelKioTagEntity); |
|
53 |
return success(true); |
a6de49
|
54 |
} |
H |
55 |
|
aecc49
|
56 |
@PutMapping("/update") |
L |
57 |
public CommonResult<Boolean> update(@RequestBody ChannelKioTagEntity channelKioTagEntity) { |
|
58 |
channelKioTagEntity.setUpdateTime(new Date()); |
|
59 |
channelKioTagService.update(channelKioTagEntity); |
|
60 |
return success(true); |
a6de49
|
61 |
} |
H |
62 |
|
aecc49
|
63 |
@DeleteMapping("/delete") |
L |
64 |
public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
|
65 |
channelKioTagService.delete(id); |
|
66 |
return success(true); |
a6de49
|
67 |
} |
H |
68 |
|
|
69 |
} |