| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- package com.chuanghai.controller;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.chuanghai.entity.PushProject;
- import com.chuanghai.service.PushProjectService;
- import com.chuanghai.utils.CommonResult;
- import com.chuanghai.vo.PushProjectVO;
- import org.apache.ibatis.annotations.Param;
- import org.springframework.beans.BeanUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import sun.awt.image.VolatileSurfaceManager;
- import java.util.List;
- /**
- * 推送项目设置
- *
- * @Author: binguo
- * @Date: 2022/12/28 星期三 10:48
- * @Description: 推送项目设置
- * @Version: 1.0
- */
- @RestController
- @RequestMapping("/push")
- public class PushProjectController {
- @Autowired
- private PushProjectService pushProjectService;
- // @PostMapping("jjjj")
- // public void ss(){
- // System.out.println("11111");
- // }
- /**
- * 查询推送项目
- * @return
- */
- @GetMapping("queryPushProject")
- public CommonResult queryPushProject() {
- QueryWrapper<PushProject> wrapper = new QueryWrapper<>();
- wrapper.eq("statu", "0");
- List<PushProject> pushProjectList = pushProjectService.list(wrapper);
- return CommonResult.ok().setResult(pushProjectList);
- }
- /**
- * 添加推送项目
- * @param url 推送服务接口:post请求 json参数
- * @param project 服务名称
- * @return
- */
- @PostMapping("addPushProject")
- public CommonResult addPushProject(@Param("url") String url, @Param("project") String project) {
- pushProjectService.addPushProject(url, project);
- return CommonResult.ok();
- }
- /**
- * 修改推送项目
- * @param pushProjectVo
- * @return
- */
- @PutMapping("updatePushProject")
- public CommonResult updatePushProject(@RequestBody PushProjectVO pushProjectVo){
- PushProject pushProject = new PushProject();
- BeanUtils.copyProperties(pushProjectVo, pushProject);
- pushProjectService.updateById(pushProject);
- return CommonResult.ok();
- }
- /**
- * 删除推送项目
- * @param id
- * @return
- */
- @DeleteMapping("deletePushProject")
- public CommonResult deletePushProject(Long id){
- pushProjectService.deletePushProject(id);
- return CommonResult.ok();
- }
- }
|