mirror of
https://github.moeyy.xyz/https://github.com/GeWuYou/forgeboot
synced 2025-10-28 01:36:38 +08:00
feat(i18n):Added the method of obtaining internationalization message parameters and optimized exception handling
- The responseI8nMessageArgs property is added to the ResponseInformation API to obtain the internationalization message parameters - Rename the I18nBaseException file to change its implementation language from Java to Kotlin - Update the errorI18nMessageArgs property in I18nBaseException so that it returns as a nullable array
This commit is contained in:
parent
35a0f5eb32
commit
d357a3d754
@ -18,4 +18,10 @@ interface ResponseInformation {
|
|||||||
* @return 响应信息 code
|
* @return 响应信息 code
|
||||||
*/
|
*/
|
||||||
val responseI8nMessageCode: String
|
val responseI8nMessageCode: String
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取i18n响应信息参数
|
||||||
|
* @return 响应信息 参数数组
|
||||||
|
*/
|
||||||
|
val responseI8nMessageArgs: Array<Any>?
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.gewuyou.forgeboot.i18n.impl.exception
|
package com.gewuyou.forgeboot.i18n.impl.exception
|
||||||
|
|
||||||
|
import com.gewuyou.forgeboot.i18n.api.ResponseInformation
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,6 +65,6 @@ open class I18nBaseException : RuntimeException {
|
|||||||
*
|
*
|
||||||
* @return 国际化消息参数数组
|
* @return 国际化消息参数数组
|
||||||
*/
|
*/
|
||||||
val errorI18nMessageArgs: Array<Any>
|
val errorI18nMessageArgs: Array<Any>?
|
||||||
get() = responseInformation.args
|
get() = responseInformation.responseI8nMessageArgs
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user