package cn.ey.biz.module.external.api.hr.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cn.ey.biz.module.external.api.hr.feign.config.HrFeignConfiguration;
import cn.ey.biz.module.external.api.hr.feign.reqdto.GetAccessTokenRequest;
import cn.ey.biz.module.external.api.hr.feign.reqdto.GetDataRequest;
import cn.ey.biz.module.external.api.hr.feign.reqdto.RecycleAccessTokenRequest;
import cn.ey.biz.module.external.api.hr.feign.resdto.ResponseResult;
import cn.ey.biz.module.external.api.hr.service.responsedto.CodeTableResDTO;
import cn.ey.biz.module.external.common.Constants;

/**
 * 人事中台接口feign服务
 * @author 86182
 *
 */

@FeignClient(name= Constants.HR_FEIGN_NAME, url="${hr.service.url}", configuration = HrFeignConfiguration.class)
public interface IHrFeignService {

	/**
	 *token 获取
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/KayangWebAPIS/KayangWebApi/Data/StartSession",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	ResponseResult<String> getAccessToken(@RequestBody GetAccessTokenRequest request);
	
	/**
	 *token 回收
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/KayangWebAPIS/KayangWebApi/Data/CloseSession",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	ResponseResult<String> recycleAccessToken(@RequestBody RecycleAccessTokenRequest  request);
	
	
	/**
	 *数据 获取
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/KayangWebAPIS/KayangWebApi/Data/GetData",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	ResponseResult<CodeTableResDTO> getData(@RequestBody GetDataRequest request);
	
	
}
