提交 | 用户 | 时间
|
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 |
/** |
c7f709
|
21 |
|
a6de49
|
22 |
*/ |
H |
23 |
@RestController |
|
24 |
@RequestMapping("/data/channel/kio/tag") |
|
25 |
public class ChannelKioTagController { |
|
26 |
@Resource |
|
27 |
private ChannelKioTagService channelKioTagService; |
|
28 |
|
|
29 |
/** |
|
30 |
* 分页查询tag |
|
31 |
* */ |
|
32 |
@GetMapping("page") |
aecc49
|
33 |
public CommonResult<PageResult<KioTagRespVO>> page(@Valid KioTagPageReqVO reqVO){ |
L |
34 |
PageResult<ChannelKioTagEntity> page = channelKioTagService.queryPage(reqVO); |
|
35 |
return success(BeanUtils.toBean(page, KioTagRespVO.class)); |
a6de49
|
36 |
} |
H |
37 |
|
aecc49
|
38 |
@GetMapping("/info/{id}") |
a6de49
|
39 |
@Operation(summary = "信息") |
aecc49
|
40 |
public CommonResult<ChannelKioTagEntity> info(@PathVariable("id") String id) { |
L |
41 |
ChannelKioTagEntity info = channelKioTagService.info(id); |
|
42 |
return success(info); |
a6de49
|
43 |
} |
H |
44 |
|
aecc49
|
45 |
@PostMapping("/add") |
L |
46 |
public CommonResult<Boolean> add(@RequestBody ChannelKioTagEntity channelKioTagEntity) { |
|
47 |
String id = UUID.randomUUID().toString(); |
|
48 |
channelKioTagEntity.setId(id); |
|
49 |
channelKioTagEntity.setCreateTime(new Date()); |
|
50 |
channelKioTagService.add(channelKioTagEntity); |
|
51 |
return success(true); |
a6de49
|
52 |
} |
H |
53 |
|
aecc49
|
54 |
@PutMapping("/update") |
L |
55 |
public CommonResult<Boolean> update(@RequestBody ChannelKioTagEntity channelKioTagEntity) { |
|
56 |
channelKioTagEntity.setUpdateTime(new Date()); |
|
57 |
channelKioTagService.update(channelKioTagEntity); |
|
58 |
return success(true); |
a6de49
|
59 |
} |
H |
60 |
|
aecc49
|
61 |
@DeleteMapping("/delete") |
L |
62 |
public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
|
63 |
channelKioTagService.delete(id); |
|
64 |
return success(true); |
a6de49
|
65 |
} |
H |
66 |
|
|
67 |
} |