mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-05-12 06:42:08 +08:00
Revert "[重大更新] 使用 spring 新特性 HttpServiceClient 替代 Dubbo 降低框架使用难度(半成本 数据权限不好使)"
This reverts commit b6d2274b
This commit is contained in:
@@ -8,7 +8,6 @@ import org.dromara.common.translation.core.handler.TranslationBeanSerializerModi
|
||||
import org.dromara.common.translation.core.handler.TranslationHandler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
||||
import org.springframework.boot.jackson.autoconfigure.JsonMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import tools.jackson.databind.ser.SerializerFactory;
|
||||
@@ -43,4 +42,13 @@ public class TranslationConfig {
|
||||
TranslationHandler.TRANSLATION_MAPPER.putAll(map);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public JsonMapperBuilderCustomizer translationInitCustomizer() {
|
||||
return builder -> {
|
||||
SerializerFactory serializerFactory = builder.serializerFactory();
|
||||
serializerFactory = serializerFactory.withSerializerModifier(new TranslationBeanSerializerModifier());
|
||||
builder.serializerFactory(serializerFactory);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package org.dromara.common.translation.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.translation.core.handler.TranslationBeanSerializerModifier;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
||||
import org.springframework.boot.jackson.autoconfigure.JsonMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import tools.jackson.databind.ser.SerializerFactory;
|
||||
|
||||
/**
|
||||
* 翻译模块额外修改jackson配置
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration(before = JacksonAutoConfiguration.class)
|
||||
public class TranslationJacksonConfig {
|
||||
|
||||
@Bean
|
||||
public JsonMapperBuilderCustomizer translationInitCustomizer() {
|
||||
return builder -> {
|
||||
SerializerFactory serializerFactory = builder.serializerFactory();
|
||||
serializerFactory = serializerFactory.withSerializerModifier(new TranslationBeanSerializerModifier());
|
||||
builder.serializerFactory(serializerFactory);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
import org.dromara.system.api.RemoteDeptService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
|
||||
/**
|
||||
* 部门翻译实现
|
||||
@@ -15,7 +16,8 @@ import lombok.AllArgsConstructor;
|
||||
@TranslationType(type = TransConstant.DEPT_ID_TO_NAME)
|
||||
public class DeptNameTranslationImpl implements TranslationInterface<String> {
|
||||
|
||||
private final RemoteDeptService remoteDeptService;
|
||||
@DubboReference
|
||||
private RemoteDeptService remoteDeptService;
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.dromara.common.translation.core.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.constant.CacheNames;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.redis.utils.CacheUtils;
|
||||
@@ -22,7 +23,8 @@ import java.util.List;
|
||||
@TranslationType(type = TransConstant.USER_ID_TO_NICKNAME)
|
||||
public class NicknameTranslationImpl implements TranslationInterface<String> {
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
@DubboReference
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
import org.dromara.resource.api.RemoteFileService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
|
||||
/**
|
||||
* OSS翻译实现
|
||||
@@ -15,7 +16,8 @@ import lombok.AllArgsConstructor;
|
||||
@TranslationType(type = TransConstant.OSS_ID_TO_URL)
|
||||
public class OssUrlTranslationImpl implements TranslationInterface<String> {
|
||||
|
||||
private final RemoteFileService remoteFileService;
|
||||
@DubboReference(mock = "true")
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
|
||||
/**
|
||||
* 用户名翻译实现
|
||||
@@ -19,7 +20,8 @@ import lombok.AllArgsConstructor;
|
||||
@TranslationType(type = TransConstant.USER_ID_TO_NAME)
|
||||
public class UserNameTranslationImpl implements TranslationInterface<String> {
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
@DubboReference
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
org.dromara.common.translation.config.TranslationConfig
|
||||
org.dromara.common.translation.config.TranslationJacksonConfig
|
||||
org.dromara.common.translation.core.impl.DeptNameTranslationImpl
|
||||
org.dromara.common.translation.core.impl.DictTypeTranslationImpl
|
||||
org.dromara.common.translation.core.impl.OssUrlTranslationImpl
|
||||
|
||||
Reference in New Issue
Block a user