package cn.reghao.oss.console.app.rpc;

import cn.reghao.oss.console.app.model.po.StoreNode;
import cn.reghao.oss.storeapi.iface.StoreService;
import org.springframework.stereotype.Service;

/**
 * @author reghao
 * @date 2024-03-04 18:01:22
 */
@Service
public class RpcService {
    public StoreService getStoreService(StoreNode storeNode) {
        String host = storeNode.getNodeAddr();
        int port = storeNode.getRpcPort();
        RemoteService<StoreService> remoteService = new RemoteService<>();
        return remoteService.getService(host, port, StoreService.class);
    }
}
