package com.gtiit.shr.controller;

import com.gtiit.shr.common.ResponseResult;
import com.gtiit.shr.common.Result;
import com.gtiit.shr.entity.vo.JobInfoVo;
import com.gtiit.shr.service.JobService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"/job"})
public class JobController {
    @Autowired
    private JobService jobService;


    @RequestMapping({"/insertBatch"})
    public Result insertBatchJob(@RequestBody List<JobInfoVo> jobInfoVos) {
        int result = this.jobService.insertBatchJob(jobInfoVos);
        return result == 0 ? ResponseResult.isError("职务保存失败！", (Object)null) : ResponseResult.isOk("职务保存成功！", (Object)null);
    }

    public Result updateBatchJob(@RequestBody List<JobInfoVo> jobInfoVos) {
        int result = this.jobService.updateBatchJob(jobInfoVos);
        return result == 0 ? ResponseResult.isError("职务更新失败！", (Object)null) : ResponseResult.isOk("职务更新成功！", (Object)null);
    }

    @RequestMapping({"/findPage"})
    public Result findPage(@RequestParam("shrId") List<String> shrIds) {
        return this.jobService.findPage(shrIds);
    }
}
