mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-12-26 18:15:59 +08:00
update 优化 翻译实现类逻辑
This commit is contained in:
@@ -20,7 +20,7 @@ public class NicknameTranslationImpl implements TranslationInterface<String> {
|
|||||||
@Override
|
@Override
|
||||||
public String translation(Object key, String other) {
|
public String translation(Object key, String other) {
|
||||||
if (key instanceof Long id) {
|
if (key instanceof Long id) {
|
||||||
return userService.selectNicknameByIds(id.toString());
|
return userService.selectNicknameById(id);
|
||||||
} else if (key instanceof String ids) {
|
} else if (key instanceof String ids) {
|
||||||
return userService.selectNicknameByIds(ids);
|
return userService.selectNicknameByIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.dromara.common.translation.core.impl;
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
import org.dromara.common.core.service.UserService;
|
import org.dromara.common.core.service.UserService;
|
||||||
import org.dromara.common.translation.annotation.TranslationType;
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
@@ -19,9 +20,6 @@ public class UserNameTranslationImpl implements TranslationInterface<String> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String translation(Object key, String other) {
|
public String translation(Object key, String other) {
|
||||||
if (key instanceof Long id) {
|
return userService.selectUserNameById(Convert.toLong(key));
|
||||||
return userService.selectUserNameById(id);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user