feat: add service manager logic to use i18n

This commit is contained in:
Andy Yang 2026-03-03 17:37:55 +08:00
parent 6e61714019
commit ed5ac67942
4 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package com.zhangy.skyeye.jm.controller;
import com.zhangy.skyeye.common.extend.anno.IgnoreAuth;
import com.zhangy.skyeye.common.extend.util.MessageUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* i18n 测试
*
* @author zhangy
*/
@RestController
@RequestMapping("/test/i18n")
public class TestI18nController {
@IgnoreAuth
@GetMapping
public String test(String code) {
return MessageUtils.message(code);
}
}

View File

@ -14,6 +14,9 @@ spring:
allow-circular-references: true allow-circular-references: true
application: application:
name: @artifactId@ name: @artifactId@
messages:
basename: i18n/messages
fallback-to-system-locale: false
profiles: profiles:
# active: dev # active: dev
config: config:

View File

@ -0,0 +1,3 @@
# Default messages
user.login.success=Login success
user.login.error=Login error

View File

@ -0,0 +1,3 @@
# 中文消息
user.login.success=登录成功
user.login.error=登录失败