package jnpf.personnels.controller.app.audit;

import jnpf.base.ActionResult;
import jnpf.model.personnels.vo.task.FtbPersonnelsAuditRunTaskVO;
import jnpf.personnels.service.FtbPersonnelsAuditRunTaskService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * app人事审核正在执行的任务信息模块
 *
 * @author peng.hao
 */
@RestController
@RequestMapping("/app/personnels-task")
public class FtbPersonnelsAuditRunTaskForAppController {


    @Resource
    private FtbPersonnelsAuditRunTaskService service;

//    /**
//     * 查看当前审批流程
//     *
//     * @param id 审批ID
//     * @return 当前审批流程的结果Action
//     */
//    @GetMapping("/view-list/{id}")
//    @Deprecated
//    public ActionResult<FtbPersonnelsAuditRunTaskVO> viewTheCurrentApprovalProcess(@PathVariable("id") String id){
//        return ActionResult.success(service.viewTheCurrentApprovalProcess(id));
//    }

    /**
     * 查看对应业务的审批流程
     *
     * @param id 运行的 taskId
     * @return 当前审批流程的结果Action
     */
    @GetMapping("/view-list-by-task/{id}")
    public ActionResult<FtbPersonnelsAuditRunTaskVO> viewTheCurrentApprovalProcessByTaskId(@PathVariable("id") String id){
        return ActionResult.success(service.viewTheCurrentApprovalProcessByTaskId(id));
    }

}
