mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-08 05:17:42 +00:00
update 优化 与 vue 版本同步代码结构
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package org.dromara.common.translation.annotation;
|
||||
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 翻译类型注解 (标注到{@link org.dromara.common.translation.core.TranslationInterface} 的实现类)
|
||||
* 翻译类型注解 (标注到{@link TranslationInterface} 的实现类)
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
|
@@ -5,11 +5,11 @@ import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
import org.dromara.common.translation.core.handler.TranslationBeanSerializerModifier;
|
||||
import org.dromara.common.translation.core.handler.TranslationHandler;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@@ -1,7 +1,9 @@
|
||||
package org.dromara.common.translation.core;
|
||||
|
||||
import org.dromara.common.translation.annotation.TranslationType;
|
||||
|
||||
/**
|
||||
* 翻译接口 (实现类需标注 {@link org.dromara.common.translation.annotation.TranslationType} 注解标明翻译类型)
|
||||
* 翻译接口 (实现类需标注 {@link TranslationType} 注解标明翻译类型)
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@@ -10,7 +12,8 @@ public interface TranslationInterface<T> {
|
||||
/**
|
||||
* 翻译
|
||||
*
|
||||
* @param key 需要被翻译的键(不为空)
|
||||
* @param key 需要被翻译的键(不为空)
|
||||
* @param other 其他参数
|
||||
* @return 返回键对应的值
|
||||
*/
|
||||
T translation(Object key, String other);
|
||||
|
@@ -19,8 +19,8 @@ public class TranslationBeanSerializerModifier extends BeanSerializerModifier {
|
||||
List<BeanPropertyWriter> beanProperties) {
|
||||
for (BeanPropertyWriter writer : beanProperties) {
|
||||
// 如果序列化器为 TranslationHandler 的话 将 Null 值也交给他处理
|
||||
if (writer.getSerializer() instanceof TranslationHandler) {
|
||||
writer.assignNullSerializer(writer.getSerializer());
|
||||
if (writer.getSerializer() instanceof TranslationHandler serializer) {
|
||||
writer.assignNullSerializer(serializer);
|
||||
}
|
||||
}
|
||||
return beanProperties;
|
||||
|
Reference in New Issue
Block a user