package org.jeecg.modules.api.controller2;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiBean.PageBean;
import org.jeecg.modules.apiService.ContractService;
import org.jeecg.modules.employContract.entity.EmployContract;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags="电子合同信息相关接口")
@RestController
@RequestMapping("/employ/contract")
@Slf4j
public class ContractController {

    /******************************************************************************************************************/
    //电子合同信息
    @Resource
    private ContractService contractService;
    /******************************************************************************************************************/

    //我的服务-电子合同
    @ApiOperation(value="电子合同-获取电子合同列表", notes="role(用户类型): 0-个人 1-企业")
    @RequestMapping(value = "/queryContractList", method = {RequestMethod.GET})
    public Result<?> queryContractBossList(@RequestHeader("X-Access-Token")String token, String role, EmployContract employContract, PageBean pageBean){
        return contractService.queryContractList(token, role, employContract, pageBean);
    }

    //我的服务-电子合同
    @ApiOperation(value="电子合同-根据id查询电子合同详情", notes="电子合同-根据id查询电子合同详情")
    @RequestMapping(value = "/queryContracById", method = {RequestMethod.GET})
    public Result<?> queryContracById(@RequestHeader("X-Access-Token") String token, String contractId){
        return contractService.queryContracById(token, contractId);
    }

}
