Skip to content

Commit

Permalink
✨ feat: 파이어베이스 권한정책 강화
Browse files Browse the repository at this point in the history
  • Loading branch information
jun02160 committed Mar 23, 2024
1 parent 869523d commit 32fcaf6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.google.firebase.database.DataSnapshot;
Expand All @@ -26,7 +27,8 @@
@RequiredArgsConstructor
public class FirebaseService {

public static final String COLLECTION_NAME = "Users";
@Value("${firebase.collection}")
private String COLLECTION_NAME = "Users";


public void insertFBData(Map<String, Integer> values) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ public class FirebaseConfig {
@Value("${firebase.database}")
private String FIREBASE_DB;

@Value("${firebase.collection}")
private String COLLECTION_NAME;

public static DatabaseReference ref;
public static final String COLLECTION_NAME = "Users";

@PostConstruct
public void init() {
Expand All @@ -49,7 +51,7 @@ public void init() {
FirebaseApp.initializeApp(options);
log.info("파이어베이스 연결에 성공했습니다.");
ref = FirebaseDatabase.getInstance().getReference(COLLECTION_NAME);

log.info("ref = {}", ref.getDatabase()+" "+COLLECTION_NAME);
} catch (IOException e) {
log.error("파이어베이스 서버와의 연결에 실패했습니다.");
throw new BusinessException(FIREBASE_CONNECTION_ERROR);
Expand Down

0 comments on commit 32fcaf6

Please sign in to comment.