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

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

import cn.ey.biz.module.external.api.smarthub.feign.config.SmartHubFeignConfiguration;
import cn.ey.biz.module.external.api.smarthub.feign.reqdto.CodeGroupRequestDTO;
import cn.ey.biz.module.external.api.smarthub.feign.resdto.CodeGroupResponseDTO;
import cn.ey.biz.module.external.api.smarthub.feign.resdto.DummyCodeListResponseDTO;
import cn.ey.biz.module.external.api.smarthub.feign.resdto.EngagementDetailResponseDTO;
import cn.ey.biz.module.external.api.smarthub.feign.resdto.EngagementResponseDTO;
import cn.ey.biz.module.external.common.Constants;

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

@FeignClient(name= Constants.SMART_HUB_FEIGN_NAME, url="${sh.service.url}", configuration = SmartHubFeignConfiguration.class,contextId = "SMARTHUB")
public interface ISmartHubFeignService {
	
	/**
	 * 通过商机ID查询Dummy code列表
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.GET, value="/api/tiger/dummy/code/{opportunityId}/{paceId}",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	DummyCodeListResponseDTO getDummyCodeList(@PathVariable("opportunityId") String opportunityId,@PathVariable("paceId")String paceId);
	
	/**
	 * 通过Group内的任意Code查询整个Group的预算结果
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.GET, value="/api/tiger/dummy/list/{code}",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	EngagementResponseDTO getGroupBudgetByDummyCode(@PathVariable("code") String code);
	
	
	/**
	 * 查找Dummy code的详细信息
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.GET, value="/api/tiger/dummy/detail/{code}",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	EngagementDetailResponseDTO getDummyCodeDetail(@PathVariable("code") String code);
	
	
	/**
	 * 分页查询所有Code的主从关系
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/api/tiger/code/group/page",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	CodeGroupResponseDTO getDummyCodeMasterSlaveRelationship(CodeGroupRequestDTO req);
	
	

}
