-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(master-api): 내부 아이피를 main-api의 핸들러를 통해 직접 저장하는 구현체 추가
- Loading branch information
1 parent
cd2e72c
commit 90f5382
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...er-api/src/main/java/com/whoz_in/master_api/private_ip/MainApiHandlerPrivateIpWriter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |