diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteDictService.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteDictService.java index a279f659..3ca11474 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteDictService.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteDictService.java @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2020 pig4cloud Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package com.pig4cloud.pig.admin.api.feign; import com.pig4cloud.pig.admin.api.entity.SysDictItem; @@ -26,16 +10,18 @@ import org.springframework.web.bind.annotation.PathVariable; import java.util.List; /** - * 字典调用 - * * @author lengleng + * @date 2020/5/12 + *
+ * 查询参数相关
*/
@FeignClient(contextId = "remoteDictService", value = ServiceNameConstants.UMPS_SERVICE)
public interface RemoteDictService {
/**
+ * 通过字典类型查找字典
* @param type 字典类型
- * @return 返回字典项列表
+ * @return 同类型字典
*/
@GetMapping("/dict/type/{type}")
R> getDictByType(@PathVariable("type") String type);
diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/util/DictResolver.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/util/DictResolver.java
new file mode 100644
index 00000000..6c7a7193
--- /dev/null
+++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/util/DictResolver.java
@@ -0,0 +1,99 @@
+package com.pig4cloud.pig.admin.api.util;
+
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.pig4cloud.pig.admin.api.entity.SysDictItem;
+import com.pig4cloud.pig.admin.api.feign.RemoteDictService;
+import com.pig4cloud.pig.common.core.util.SpringContextHolder;
+import lombok.experimental.UtilityClass;
+
+import java.util.List;
+
+/**
+ * @author fxz
+ * @date 2022/3/24 字典解析器
+ */
+@UtilityClass
+public class DictResolver {
+
+ /**
+ * 根据字典类型获取所有字典项
+ * @param type 字典类型
+ * @return 字典数据项集合
+ */
+ public List