提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.data.http.controller.admin; |
H |
2 |
|
|
3 |
import com.iailab.module.data.common.utils.PageUtils; |
|
4 |
import com.iailab.module.data.common.utils.R; |
|
5 |
import com.iailab.framework.common.pojo.CommonResult; |
|
6 |
import com.iailab.module.data.http.dto.HttpTagDTO; |
|
7 |
import com.iailab.module.data.http.entity.HttpTagEntity; |
|
8 |
import com.iailab.module.data.http.service.HttpTagService; |
|
9 |
import javax.annotation.Resource; |
|
10 |
import org.springframework.web.bind.annotation.*; |
|
11 |
|
|
12 |
import java.util.List; |
|
13 |
import java.util.Map; |
|
14 |
import java.util.UUID; |
|
15 |
|
|
16 |
/** |
|
17 |
* @author Houzhongjian |
|
18 |
* @Description |
|
19 |
* @createTime 2024年04月10日 17:37:00 |
|
20 |
*/ |
|
21 |
@RestController |
|
22 |
@RequestMapping("/data/http/tag") |
|
23 |
public class HttpTagController { |
|
24 |
|
|
25 |
@Resource |
|
26 |
private HttpTagService tagService; |
|
27 |
|
|
28 |
/** |
|
29 |
* 分页 |
|
30 |
* |
|
31 |
* @param params |
|
32 |
*/ |
|
33 |
@GetMapping("/page") |
|
34 |
public R tagPageList(@RequestParam Map<String, Object> params) { |
|
35 |
PageUtils page = tagService.queryPage(params); |
|
36 |
|
|
37 |
return R.ok().put("page", page); |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* 查询tagList |
|
42 |
* |
|
43 |
*/ |
|
44 |
@GetMapping("/list") |
|
45 |
public R tagList(@RequestParam Map<String, Object> params){ |
|
46 |
List<HttpTagEntity> data = tagService.selectList(params); |
|
47 |
|
|
48 |
return R.ok().put("data", data); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* 详情 |
|
53 |
* |
|
54 |
* @param id |
|
55 |
*/ |
|
56 |
@GetMapping("/info/{id}") |
|
57 |
public R tagInfo(@PathVariable("id") String id) { |
|
58 |
HttpTagEntity info = tagService.selectById(id); |
|
59 |
return R.ok().put("data", info); |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* 添加 |
|
64 |
* |
|
65 |
* @param entity |
|
66 |
*/ |
|
67 |
@PostMapping("/add") |
|
68 |
public R tagAdd(@RequestBody HttpTagEntity entity) { |
|
69 |
entity.setId(UUID.randomUUID().toString()); |
|
70 |
tagService.insert(entity); |
|
71 |
return R.ok(); |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* 修改 |
|
76 |
* |
|
77 |
* @param entity |
|
78 |
*/ |
|
79 |
@PostMapping("/update") |
|
80 |
public R tagUpdate(@RequestBody HttpTagEntity entity) { |
|
81 |
tagService.updateById(entity); |
|
82 |
return R.ok(); |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* 删除 |
|
87 |
* |
|
88 |
* @param params |
|
89 |
*/ |
|
90 |
@PostMapping("/delete") |
|
91 |
public R tagDelete(@RequestBody Map<String, Object> params) { |
|
92 |
String id = (String) params.get("id"); |
|
93 |
tagService.deleteById(id); |
|
94 |
return R.ok(); |
|
95 |
} |
|
96 |
|
|
97 |
|
|
98 |
@GetMapping("tagNo") |
|
99 |
public CommonResult<List<HttpTagDTO>> list(@RequestParam Map<String, Object> params){ |
|
100 |
List<HttpTagDTO> list = tagService.list(params); |
|
101 |
return new CommonResult<List<HttpTagDTO>>().setData(list); |
|
102 |
} |
|
103 |
} |