mateclaw/mateclaw-server/src/main/java/vip/mate/i18n/I18nAutoConfig.java

25 lines
555 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package vip.mate.i18n;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import vip.mate.common.result.R;
/**
* 在启动时将 I18nService 注入到 R统一响应类
* 使 R.ok() / R.fail() 返回的 msg 跟随系统语言设置。
*
* @author MateClaw Team
*/
@Component
@RequiredArgsConstructor
public class I18nAutoConfig {
private final I18nService i18nService;
@PostConstruct
public void init() {
R.setI18n(i18nService);
}
}