package jnpf.personnels.controller.web.roster;

import jnpf.base.ActionResult;
import jnpf.model.personnels.dto.roster.FtbPersonnelsTrialDTO;
import jnpf.model.personnels.dto.roster.FtbjobTrialRejectedDTO;
import jnpf.personnels.service.FtbPersonnelsTrialService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 试岗模块
 *
 * @author wangchunxiang
 * @date 2024/07/01
 */
@RestController
@RequestMapping("/web/trial")
public class FtbPersonnelsTrialController {

    @Resource
    private FtbPersonnelsTrialService ftbPersonnelsTrialService;

    /**
     * 试岗通过
     *
     * @return {@link ActionResult }
     */
    @PostMapping("/passed-trial-job")
    public ActionResult passedTheTrialJob(@Validated @RequestBody FtbPersonnelsTrialDTO ftbPersonnelsTrialDTO) {
        ftbPersonnelsTrialService.passedTheTrialJob(ftbPersonnelsTrialDTO);
        return ActionResult.success();
    }

    /**
     * 试岗驳回
     *
     * @return {@link ActionResult }
     */
    @PostMapping("/job-trial-rejected")
    public ActionResult jobTrialRejected(@Validated @RequestBody FtbjobTrialRejectedDTO ftbjobTrialRejectedDTO) {
        ftbPersonnelsTrialService.jobTrialRejected(ftbjobTrialRejectedDTO);
        return ActionResult.success();
    }


}
