package com.sckw.mine.controller;

import com.sckw.core.web.response.HttpResult;
import com.sckw.mine.entity.req.WorkFlowInsertParam;
import com.sckw.mine.entity.req.WorkFlowPageListParam;
import com.sckw.mine.entity.req.WorkFlowUpdateParam;
import com.sckw.mine.service.WorkFlowService;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @desc:
 * @author: Lt
 * @date: 2024-05-31
 */
@RestController
@RequestMapping("/mine/workFlow")
public class WorkFlowController {

    @Autowired
    WorkFlowService workFlowService;

    /**
    * @Description: 流程新增
    * @Author: Lt
    * @Date: 2024/5/31 14:45
    */
    @PostMapping("/insert")
    public HttpResult insert(@RequestBody @Valid WorkFlowInsertParam workFlowInsertParam)
    {
        return workFlowService.insert(workFlowInsertParam);
    }

    /**
     * @Description: 流程编辑
     * @Author: Lt
     * @Date: 2024/5/31 15:34
     */
    @PostMapping("/update")
    public HttpResult update(@RequestBody @Valid WorkFlowUpdateParam workFlowUpdateParam)
    {
        return workFlowService.update(workFlowUpdateParam);
    }

    /**
    * @Description: 分页列表
    * @Author: Lt
    * @Date: 2024/5/31 15:34
    */
    @PostMapping("/pageList")
    public HttpResult pageList(@RequestBody @Valid WorkFlowPageListParam workFlowPageListParam)
    {
        return workFlowService.pageList(workFlowPageListParam);
    }

    ///**
    // * 查询 根据主键 id 查询
    // * @author lt
    // * @date 2024/05/30
    // **/
    //@GetMapping("/detail")
    //public HttpResult detail(@RequestParam("id") String id){
    //    return workFlowService.detail(id);
    //}





}
