package com.its.op.global;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.concurrent.ConcurrentHashMap;

@Slf4j
@RequiredArgsConstructor
@Getter
@Component
public class CctvManager {

//    private final TbCctvCtlrRepository repo;

//    private static final ConcurrentHashMap<Long, TbCctvCtlr> objMap = new ConcurrentHashMap<>();
    private static final ConcurrentHashMap<Long, Object> objMap = new ConcurrentHashMap<>();

    @PostConstruct
    void init() {
        load();
    }

    public void load() {

//        List<TbCctvCtlr> objList = repo.findAll();
//        objList.forEach(obj -> {
//            objMap.put(obj.getCctvCtlrNmbr(), obj);
//        });
        //log.info("=== {}", objMap);
    }

//    public static TbCctvCtlr get(Long id) {
//        return objMap.get(id);
//    }
}
