update 按代码规范补全重写注解
parent
920e51a8aa
commit
0f3b1c50a7
|
|
@ -19,6 +19,7 @@ public class DeptNameTranslationImpl implements TranslationInterface<String> {
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private RemoteDeptService remoteDeptService;
|
private RemoteDeptService remoteDeptService;
|
||||||
|
|
||||||
|
@Override
|
||||||
public String translation(Object key, String other) {
|
public String translation(Object key, String other) {
|
||||||
return remoteDeptService.selectDeptNameByIds(key.toString());
|
return remoteDeptService.selectDeptNameByIds(key.toString());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import com.ruoyi.common.translation.annotation.TranslationType;
|
||||||
import com.ruoyi.common.translation.constant.TransConstant;
|
import com.ruoyi.common.translation.constant.TransConstant;
|
||||||
import com.ruoyi.common.translation.core.TranslationInterface;
|
import com.ruoyi.common.translation.core.TranslationInterface;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典翻译实现
|
* 字典翻译实现
|
||||||
|
|
@ -19,6 +18,7 @@ public class DictTypeTranslationImpl implements TranslationInterface<String> {
|
||||||
|
|
||||||
private final DictService dictService;
|
private final DictService dictService;
|
||||||
|
|
||||||
|
@Override
|
||||||
public String translation(Object key, String other) {
|
public String translation(Object key, String other) {
|
||||||
if (key instanceof String && StringUtils.isNotBlank(other)) {
|
if (key instanceof String && StringUtils.isNotBlank(other)) {
|
||||||
return dictService.getDictLabel(other, key.toString());
|
return dictService.getDictLabel(other, key.toString());
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import com.ruoyi.common.translation.core.TranslationInterface;
|
||||||
import com.ruoyi.resource.api.RemoteFileService;
|
import com.ruoyi.resource.api.RemoteFileService;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OSS翻译实现
|
* OSS翻译实现
|
||||||
|
|
@ -20,6 +19,7 @@ public class OssUrlTranslationImpl implements TranslationInterface<String> {
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private RemoteFileService ossService;
|
private RemoteFileService ossService;
|
||||||
|
|
||||||
|
@Override
|
||||||
public String translation(Object key, String other) {
|
public String translation(Object key, String other) {
|
||||||
return ossService.selectUrlByIds(key.toString());
|
return ossService.selectUrlByIds(key.toString());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import com.ruoyi.common.translation.core.TranslationInterface;
|
||||||
import com.ruoyi.system.api.RemoteUserService;
|
import com.ruoyi.system.api.RemoteUserService;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名翻译实现
|
* 用户名翻译实现
|
||||||
|
|
@ -20,6 +19,7 @@ public class UserNameTranslationImpl implements TranslationInterface<String> {
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private RemoteUserService remoteUserService;
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
@Override
|
||||||
public String translation(Object key, String other) {
|
public String translation(Object key, String other) {
|
||||||
return remoteUserService.selectUserNameById((Long) key);
|
return remoteUserService.selectUserNameById((Long) key);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue