update 格式化全部代码
This commit is contained in:
+1
-5
@@ -1,10 +1,6 @@
|
||||
package org.dromara.common.translation.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 通用翻译注解
|
||||
|
||||
+3
-9
@@ -7,13 +7,7 @@ import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
@@ -37,7 +31,7 @@ public interface TranslationInterface<T> {
|
||||
/**
|
||||
* 批量翻译。
|
||||
*
|
||||
* @param keys 需要被翻译的键集合
|
||||
* @param keys 需要被翻译的键集合
|
||||
* @param other 其他参数
|
||||
* @return 翻译结果映射
|
||||
*/
|
||||
@@ -88,8 +82,8 @@ public interface TranslationInterface<T> {
|
||||
*
|
||||
* @param ids 原始 ID 字符串
|
||||
* @param mapper ID 到值的映射函数
|
||||
* @param <E> 值类型
|
||||
* @return 拼接后的结果字符串
|
||||
* @param <E> 值类型
|
||||
*/
|
||||
default <E> String joinMappedValues(String ids, Function<Long, E> mapper) {
|
||||
return StreamUtils.join(parseLongIds(ids), id -> {
|
||||
|
||||
+1
-6
@@ -12,12 +12,7 @@ import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 翻译响应处理器。
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ public class DeptNameTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 将部门 ID 或 ID 集合翻译为部门名称。
|
||||
*
|
||||
* @param key 部门 ID 或逗号分隔的 ID 字符串
|
||||
* @param key 部门 ID 或逗号分隔的 ID 字符串
|
||||
* @param other 额外参数
|
||||
* @return 部门名称
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ public class DeptNameTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 批量将部门 ID 翻译为部门名称。
|
||||
*
|
||||
* @param keys 部门 ID 集合
|
||||
* @param keys 部门 ID 集合
|
||||
* @param other 额外参数
|
||||
* @return 部门 ID 与部门名称映射
|
||||
*/
|
||||
@@ -63,7 +63,7 @@ public class DeptNameTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 根据原始键构建部门名称翻译值。
|
||||
*
|
||||
* @param source 原始键
|
||||
* @param source 原始键
|
||||
* @param deptNames 部门 ID 与部门名称映射
|
||||
* @return 部门名称
|
||||
*/
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ public class DictTypeTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 根据字典类型和字典值翻译显示标签。
|
||||
*
|
||||
* @param key 字典值
|
||||
* @param key 字典值
|
||||
* @param other 字典类型
|
||||
* @return 字典标签
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ public class DictTypeTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 批量根据字典类型和字典值翻译显示标签。
|
||||
*
|
||||
* @param keys 字典值集合
|
||||
* @param keys 字典值集合
|
||||
* @param other 字典类型
|
||||
* @return 字典值与字典标签映射
|
||||
*/
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ public class NicknameTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 将用户 ID 或 ID 集合翻译为用户昵称。
|
||||
*
|
||||
* @param key 用户 ID 或逗号分隔的 ID 字符串
|
||||
* @param key 用户 ID 或逗号分隔的 ID 字符串
|
||||
* @param other 额外参数
|
||||
* @return 用户昵称
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ public class NicknameTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 批量将用户 ID 翻译为用户昵称。
|
||||
*
|
||||
* @param keys 用户 ID 集合
|
||||
* @param keys 用户 ID 集合
|
||||
* @param other 额外参数
|
||||
* @return 用户 ID 与用户昵称映射
|
||||
*/
|
||||
@@ -63,7 +63,7 @@ public class NicknameTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 根据原始键构建用户昵称翻译值。
|
||||
*
|
||||
* @param source 原始键
|
||||
* @param source 原始键
|
||||
* @param userNames 用户 ID 与用户昵称映射
|
||||
* @return 用户昵称
|
||||
*/
|
||||
|
||||
+3
-3
@@ -28,7 +28,7 @@ public class OssUrlTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 将 OSS ID 或 ID 集合翻译为访问地址。
|
||||
*
|
||||
* @param key OSS ID 或逗号分隔的 ID 字符串
|
||||
* @param key OSS ID 或逗号分隔的 ID 字符串
|
||||
* @param other 额外参数
|
||||
* @return 访问地址
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ public class OssUrlTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 批量将 OSS ID 翻译为访问地址。
|
||||
*
|
||||
* @param keys OSS ID 集合
|
||||
* @param keys OSS ID 集合
|
||||
* @param other 额外参数
|
||||
* @return OSS ID 与访问地址映射
|
||||
*/
|
||||
@@ -67,7 +67,7 @@ public class OssUrlTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 根据原始键构建 OSS 地址翻译值。
|
||||
*
|
||||
* @param source 原始键
|
||||
* @param source 原始键
|
||||
* @param ossUrls OSS ID 与访问地址映射
|
||||
* @return OSS 访问地址
|
||||
*/
|
||||
|
||||
+3
-3
@@ -27,7 +27,7 @@ public class UserNameTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 将用户 ID 翻译为用户名。
|
||||
*
|
||||
* @param key 用户 ID
|
||||
* @param key 用户 ID
|
||||
* @param other 额外参数
|
||||
* @return 用户名
|
||||
*/
|
||||
@@ -39,7 +39,7 @@ public class UserNameTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 批量将用户 ID 翻译为用户名。
|
||||
*
|
||||
* @param keys 用户 ID 集合
|
||||
* @param keys 用户 ID 集合
|
||||
* @param other 额外参数
|
||||
* @return 用户 ID 与用户名映射
|
||||
*/
|
||||
@@ -60,7 +60,7 @@ public class UserNameTranslationImpl implements TranslationInterface<String> {
|
||||
/**
|
||||
* 根据原始键构建用户名翻译值。
|
||||
*
|
||||
* @param source 原始键
|
||||
* @param source 原始键
|
||||
* @param userNames 用户 ID 与用户名映射
|
||||
* @return 用户名
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user