package com.iailab.module.data.channel.http.controller.admin;
|
|
import com.iailab.framework.common.pojo.CommonResult;
|
import com.iailab.framework.common.pojo.PageResult;
|
import com.iailab.framework.common.util.object.BeanUtils;
|
import com.iailab.module.data.channel.http.entity.HttpTagEntity;
|
import com.iailab.module.data.channel.http.service.HttpTagService;
|
import com.iailab.module.data.channel.http.vo.HttpTagPageReqVO;
|
import com.iailab.module.data.channel.http.vo.HttpTagRespVO;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import javax.validation.Valid;
|
import java.util.List;
|
import java.util.UUID;
|
|
import static com.iailab.framework.common.pojo.CommonResult.success;
|
|
|
/**
|
* @author lirm
|
* @Description
|
* @createTime 2024年08月27日
|
*/
|
@RestController
|
@RequestMapping("/data/http/tag")
|
public class HttpTagController {
|
|
@Resource
|
private HttpTagService tagService;
|
|
@GetMapping("page")
|
public CommonResult<PageResult<HttpTagRespVO>> page(@Valid HttpTagPageReqVO reqVO) {
|
PageResult<HttpTagEntity> page = tagService.queryPage(reqVO);
|
return success(BeanUtils.toBean(page, HttpTagRespVO.class));
|
}
|
|
@GetMapping("list")
|
public CommonResult<List<HttpTagEntity>> list(){
|
List<HttpTagEntity> list = tagService.list();
|
return new CommonResult<List<HttpTagEntity>>().setData(list);
|
}
|
|
@GetMapping("/info/{id}")
|
public CommonResult<HttpTagEntity> info(@PathVariable("id") String id){
|
HttpTagEntity info= tagService.info(id);
|
return success(info);
|
}
|
|
@PostMapping("/add")
|
public CommonResult<Boolean> add(@RequestBody HttpTagEntity httpTagEntity){
|
String id = UUID.randomUUID().toString();
|
httpTagEntity.setId(id);
|
tagService.add(httpTagEntity);
|
return success(true);
|
}
|
|
@PutMapping("/update")
|
public CommonResult<Boolean> update(@RequestBody HttpTagEntity httpTagEntity) {
|
tagService.update(httpTagEntity);
|
return success(true);
|
}
|
|
@DeleteMapping("/delete")
|
public CommonResult<Boolean> delete(@RequestParam("id") String id) {
|
tagService.delete(id);
|
return success(true);
|
}
|
}
|