Skip to content

Commit

Permalink
feat(master-api): 내부 아이피를 main-api의 핸들러를 통해 직접 저장하는 구현체 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
inferior3x committed Jan 13, 2025
1 parent cd2e72c commit 90f5382
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.whoz_in.master_api.private_ip;

import com.whoz_in.main_api.command.private_ip.PrivateIpUpdate;
import com.whoz_in.main_api.command.private_ip.PrivateIpUpdateHandler;
import com.whoz_in.network_api.private_ip.PrivateIpWriter;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

//main-api의 핸들러를 직접 호출하여 내부 아이피를 최신화함
@Primary
@Component
@RequiredArgsConstructor
public class MainApiHandlerPrivateIpWriter implements PrivateIpWriter {
private final PrivateIpUpdateHandler privateIpUpdateHandler;
@Override
public boolean write(String room, Map<String, String> privateIps) {
privateIpUpdateHandler.handle(new PrivateIpUpdate(room, privateIps));
return true;
}
}

0 comments on commit 90f5382

Please sign in to comment.