package com.iailab.module.data.http.controller.admin;
|
|
import com.iailab.module.data.common.utils.PageUtils;
|
import com.iailab.module.data.common.utils.R;
|
import com.iailab.framework.common.pojo.CommonResult;
|
import com.iailab.module.data.http.dto.HttpTagDTO;
|
import com.iailab.module.data.http.entity.HttpTagEntity;
|
import com.iailab.module.data.http.service.HttpTagService;
|
import javax.annotation.Resource;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
import java.util.Map;
|
import java.util.UUID;
|
|
/**
|
* @author Houzhongjian
|
* @Description
|
* @createTime 2024年04月10日 17:37:00
|
*/
|
@RestController
|
@RequestMapping("/data/http/tag")
|
public class HttpTagController {
|
|
@Resource
|
private HttpTagService tagService;
|
|
/**
|
* 分页
|
*
|
* @param params
|
*/
|
@GetMapping("/page")
|
public R tagPageList(@RequestParam Map<String, Object> params) {
|
PageUtils page = tagService.queryPage(params);
|
|
return R.ok().put("page", page);
|
}
|
|
/**
|
* 查询tagList
|
*
|
*/
|
@GetMapping("/list")
|
public R tagList(@RequestParam Map<String, Object> params){
|
List<HttpTagEntity> data = tagService.selectList(params);
|
|
return R.ok().put("data", data);
|
}
|
|
/**
|
* 详情
|
*
|
* @param id
|
*/
|
@GetMapping("/info/{id}")
|
public R tagInfo(@PathVariable("id") String id) {
|
HttpTagEntity info = tagService.selectById(id);
|
return R.ok().put("data", info);
|
}
|
|
/**
|
* 添加
|
*
|
* @param entity
|
*/
|
@PostMapping("/add")
|
public R tagAdd(@RequestBody HttpTagEntity entity) {
|
entity.setId(UUID.randomUUID().toString());
|
tagService.insert(entity);
|
return R.ok();
|
}
|
|
/**
|
* 修改
|
*
|
* @param entity
|
*/
|
@PostMapping("/update")
|
public R tagUpdate(@RequestBody HttpTagEntity entity) {
|
tagService.updateById(entity);
|
return R.ok();
|
}
|
|
/**
|
* 删除
|
*
|
* @param params
|
*/
|
@PostMapping("/delete")
|
public R tagDelete(@RequestBody Map<String, Object> params) {
|
String id = (String) params.get("id");
|
tagService.deleteById(id);
|
return R.ok();
|
}
|
|
|
@GetMapping("tagNo")
|
public CommonResult<List<HttpTagDTO>> list(@RequestParam Map<String, Object> params){
|
List<HttpTagDTO> list = tagService.list(params);
|
return new CommonResult<List<HttpTagDTO>>().setData(list);
|
}
|
}
|