package com.yanzhu.system.api;

import com.yanzhu.common.core.constant.SecurityConstants;
import com.yanzhu.common.core.constant.ServiceNameConstants;
import com.yanzhu.common.core.domain.R;
import com.yanzhu.system.api.domain.SysRole;
import com.yanzhu.system.api.factory.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 用户服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteRoleService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteRoleService
{

    /**
     * 通过用户主键查询角色信息
     *
     * @param roleId 角色主键
     * @param source 请求来源
     * @return 结果
     */
    @GetMapping("/role/info/{roleId}")
    public R<SysRole> getRoleInfo(@PathVariable("roleId") Long roleId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
