提交 | 用户 | 时间
|
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; |
a477ef
|
11 |
import org.springframework.security.access.prepost.PreAuthorize; |
a6de49
|
12 |
import org.springframework.web.bind.annotation.*; |
H |
13 |
|
aecc49
|
14 |
import javax.annotation.Resource; |
L |
15 |
import javax.validation.Valid; |
|
16 |
import java.util.Date; |
a6de49
|
17 |
import java.util.UUID; |
H |
18 |
|
aecc49
|
19 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
L |
20 |
|
a6de49
|
21 |
/** |
c7f709
|
22 |
|
a6de49
|
23 |
*/ |
H |
24 |
@RestController |
|
25 |
@RequestMapping("/data/channel/kio/tag") |
|
26 |
public class ChannelKioTagController { |
|
27 |
@Resource |
|
28 |
private ChannelKioTagService channelKioTagService; |
|
29 |
|
|
30 |
/** |
|
31 |
* 分页查询tag |
|
32 |
* */ |
a477ef
|
33 |
@PreAuthorize("@ss.hasPermission('data:channel-kio:query')") |
a6de49
|
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 |
|
a477ef
|
40 |
@PreAuthorize("@ss.hasPermission('data:channel-kio:query')") |
aecc49
|
41 |
@GetMapping("/info/{id}") |
a6de49
|
42 |
@Operation(summary = "信息") |
aecc49
|
43 |
public CommonResult<ChannelKioTagEntity> info(@PathVariable("id") String id) { |
L |
44 |
ChannelKioTagEntity info = channelKioTagService.info(id); |
|
45 |
return success(info); |
a6de49
|
46 |
} |
H |
47 |
|
a477ef
|
48 |
@PreAuthorize("@ss.hasPermission('data:channel-kio:create')") |
潘 |
49 |
@PostMapping("/create") |
|
50 |
public CommonResult<Boolean> create(@RequestBody ChannelKioTagEntity channelKioTagEntity) { |
aecc49
|
51 |
String id = UUID.randomUUID().toString(); |
L |
52 |
channelKioTagEntity.setId(id); |
|
53 |
channelKioTagEntity.setCreateTime(new Date()); |
|
54 |
channelKioTagService.add(channelKioTagEntity); |
|
55 |
return success(true); |
a6de49
|
56 |
} |
H |
57 |
|
a477ef
|
58 |
@PreAuthorize("@ss.hasPermission('data:channel-kio:update')") |
aecc49
|
59 |
@PutMapping("/update") |
L |
60 |
public CommonResult<Boolean> update(@RequestBody ChannelKioTagEntity channelKioTagEntity) { |
|
61 |
channelKioTagEntity.setUpdateTime(new Date()); |
|
62 |
channelKioTagService.update(channelKioTagEntity); |
|
63 |
return success(true); |
a6de49
|
64 |
} |
H |
65 |
|
a477ef
|
66 |
@PreAuthorize("@ss.hasPermission('data:channel-kio:delete')") |
aecc49
|
67 |
@DeleteMapping("/delete") |
L |
68 |
public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
|
69 |
channelKioTagService.delete(id); |
|
70 |
return success(true); |
a6de49
|
71 |
} |
H |
72 |
|
|
73 |
} |