package com.xueyi.modules.auth.api.feign;

import com.xueyi.common.core.constant.basic.SecurityConstants;
import com.xueyi.common.core.constant.basic.ServiceConstants;
import com.xueyi.common.core.web.result.AjaxResult;
import com.xueyi.modules.auth.api.domain.vo.IntentionReqDto;
import com.xueyi.modules.auth.api.feign.factory.RemoteSkillAuthFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
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.ResponseBody;

import javax.validation.Valid;

/**
 * 数据源服务
 *
 * @author xueyi
 */
@FeignClient(contextId = "remoteSkillAuthService", value = ServiceConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSkillAuthFallbackFactory.class)
public interface RemoteSkillAuthService {
    @RequestMapping(value = "/skill/inner/auth", method = {RequestMethod.POST})
    @ResponseBody
    public AjaxResult skillAuth(@Valid @RequestBody IntentionReqDto intentionSkillAuth, @RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}