package com.style24.core.support.message;

import java.util.Locale;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.style24.core.support.config.TscLocaleMessageConfig;

/**
 * 메시지 처리
 * 
 * @author gagamel
 * @since 2020. 10. 5
 */
@Component
public class TscMessageByLocale {

	@Autowired
	private TscLocaleMessageConfig localeMessageConfig;

	public String getMessage(String id) {
		return this.getMessage(id, Locale.KOREA);
	}

	public String getMessage(String id, Locale locale) {
		return this.getMessage(id, null, locale);
	}

	public String getMessage(String id, Object[] object) {
		return localeMessageConfig.messageSource().getMessage(id, object, Locale.KOREA);
	}

	public String getMessage(String id, Object[] object, Locale locale) {
		return localeMessageConfig.messageSource().getMessage(id, object, locale);
	}

}
