package com.madeu.config;

import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Configuration;

import com.madeu.util.MessageUtils;

import jakarta.annotation.PostConstruct;

@Configuration
public class MessageConfig {

    private final MessageSource messageSource;

    public MessageConfig(MessageSource messageSource) {
        this.messageSource = messageSource;
    }

    @PostConstruct
    public void init() {
        // 여기서 딱 한 번 MessageUtils의 static 필드에 값을 셋팅합니다.
        MessageUtils.setMessageSource(messageSource);
    }
}
