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:
gewuyou 2025-05-29 22:12:48 +08:00
parent 35a0f5eb32
commit d357a3d754
5 changed files with 9 additions and 2 deletions

View File

@ -18,4 +18,10 @@ interface ResponseInformation {
* @return 响应信息 code
*/
val responseI8nMessageCode: String
/**
* 获取i18n响应信息参数
* @return 响应信息 参数数组
*/
val responseI8nMessageArgs: Array<Any>?
}

View File

@ -1,5 +1,6 @@
package com.gewuyou.forgeboot.i18n.impl.exception
import com.gewuyou.forgeboot.i18n.api.ResponseInformation
/**
@ -64,6 +65,6 @@ open class I18nBaseException : RuntimeException {
*
* @return 国际化消息参数数组
*/
val errorI18nMessageArgs: Array<Any>
get() = responseInformation.args
val errorI18nMessageArgs: Array<Any>?
get() = responseInformation.responseI8nMessageArgs
}