package com.xindazhou.platform.framework.rpc.config;

import com.xindazhou.framework.security.core.rpc.LoginUserRequestInterceptor;
import com.xindazhou.user.api.user.MemberUserApi;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Platform 服务 RPC 配置类
 *
 * @author 新大洲
 */
@Configuration
@EnableFeignClients(clients = {MemberUserApi.class})
public class RpcConfiguration {

    /**
     * LoginUser 请求拦截器
     * 用于在 Feign 调用时传递用户信息到目标服务
     */
    @Bean
    public LoginUserRequestInterceptor loginUserRequestInterceptor() {
        return new LoginUserRequestInterceptor();
    }

}

