Fancy
2024-07-11 82d35b69cd7ef94945c00539aeaecd3896cb9e93
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/DevOpsPlanCtrl.java
@@ -1,8 +1,17 @@
package com.dy.pmsProduct.taskPlan;
import com.dy.common.aop.SsoPowerAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.aop.Log;
import com.dy.pmsGlobal.pojoPr.PrDevOpsPlan;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * 安装运维任务计划
@@ -11,4 +20,77 @@
@RestController
@RequestMapping(path="devOps")
public class DevOpsPlanCtrl {
    private DevOpsSv sv;
    @Autowired
    public void setSv(DevOpsSv sv) {
        this.sv = sv;
    }
    @PostMapping(path="save")
    @SsoPowerAop(power = "-1")
    @Log("保存组装任务计划")
    public BaseResponse<Boolean> save(@RequestBody @Valid PrDevOpsPlan plan){
        int count = sv.save(plan);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
    /**
     * 更新
     * @param plan
     * @return
     */
    @PostMapping(path="update")
    @SsoPowerAop(power = "-1")
    @Log("更新组装任务计划")
    public BaseResponse<Boolean> update(@RequestBody @Valid PrDevOpsPlan plan){
        int count = sv.update(plan);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
    @PostMapping(path="updateStatus")
    @SsoPowerAop(power = "-1")
    @Log("更新任务计划状态")
    public BaseResponse<Boolean> updateStatus(@RequestBody PrDevOpsPlan plan){
        int count = sv.updateStatus(plan);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
    /**
     * 根据ID查询
     * @return
     */
    @GetMapping(path="one")
    @SsoPowerAop(power = "-1")
    @Log("根据ID查询组装任务计划")
    public BaseResponse<PrDevOpsPlan> one(Long id){
        PrDevOpsPlan plan=sv.selectById(id);
        return BaseResponseUtils.buildSuccess(plan);
    }
    /**
     * 分页查询
     * @param vo
     * @return
     */
    @PostMapping(path="some")
    @SsoPowerAop(power = "-1")
    @Log("分页查询组装任务计划")
    public BaseResponse<QueryResultVo<List<PrDevOpsPlan>>> some(@RequestBody QueryVo vo){
        QueryResultVo<List<PrDevOpsPlan>> list = sv.selectSome(vo) ;
        return BaseResponseUtils.buildSuccess(list);
    }
}