feat: add service manager logic to use i18n
This commit is contained in:
parent
6e61714019
commit
ed5ac67942
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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:
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
# Default messages
|
||||||
|
user.login.success=Login success
|
||||||
|
user.login.error=Login error
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
# 中文消息
|
||||||
|
user.login.success=登录成功
|
||||||
|
user.login.error=登录失败
|
||||||
Loading…
Reference in New Issue
Block a user