From 1661315cd0be8525df66a057ffee928d6f9ed2b1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 28 Feb 2024 21:44:30 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E5=85=A8=E5=B1=80=EF=BC=9A?= =?UTF-8?q?=E5=B0=86=20dict=20=E7=BB=84=E4=BB=B6=EF=BC=8C=E8=9E=8D?= =?UTF-8?q?=E5=90=88=E5=88=B0=20excel=20=E7=BB=84=E4=BB=B6=E9=87=8C?= =?UTF-8?q?=EF=BC=8C=E5=87=8F=E5=B0=91=20starter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-dependencies/pom.xml | 5 -- yudao-framework/pom.xml | 1 - .../pom.xml | 57 ------------------- .../yudao-spring-boot-starter-excel/pom.xml | 30 +++++++++- .../config/YudaoDictAutoConfiguration.java | 0 .../config/YudaoDictRpcAutoConfiguration.java | 0 .../framework/dict/core/package-info.java | 0 .../dict/core/util/DictFrameworkUtils.java | 1 - .../yudao/framework/dict/package-info.java | 0 ...ot.autoconfigure.AutoConfiguration.imports | 0 .../core/util/DictFrameworkUtilsTest.java | 8 ++- yudao-module-crm/yudao-module-crm-biz/pom.xml | 4 -- yudao-module-erp/yudao-module-erp-biz/pom.xml | 4 -- .../yudao-module-product-biz/pom.xml | 4 -- .../yudao-module-promotion-biz/pom.xml | 4 -- .../yudao-module-statistics-biz/pom.xml | 4 -- .../yudao-module-trade-biz/pom.xml | 4 -- .../yudao-module-system-biz/pom.xml | 4 -- 18 files changed, 34 insertions(+), 96 deletions(-) delete mode 100644 yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml rename yudao-framework/{yudao-spring-boot-starter-biz-dict => yudao-spring-boot-starter-excel}/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java (100%) rename yudao-framework/{yudao-spring-boot-starter-biz-dict => yudao-spring-boot-starter-excel}/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictRpcAutoConfiguration.java (100%) rename yudao-framework/{yudao-spring-boot-starter-biz-dict => yudao-spring-boot-starter-excel}/src/main/java/cn/iocoder/yudao/framework/dict/core/package-info.java (100%) rename yudao-framework/{yudao-spring-boot-starter-biz-dict => yudao-spring-boot-starter-excel}/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java (97%) rename yudao-framework/{yudao-spring-boot-starter-biz-dict => yudao-spring-boot-starter-excel}/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java (100%) rename yudao-framework/{yudao-spring-boot-starter-biz-dict => yudao-spring-boot-starter-excel}/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (100%) rename yudao-framework/{yudao-spring-boot-starter-biz-dict => yudao-spring-boot-starter-excel}/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java (80%) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 4b3c8934c6..7f07c1e97d 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -126,11 +126,6 @@ - - cn.iocoder.cloud - yudao-spring-boot-starter-biz-dict - ${revision} - cn.iocoder.cloud yudao-spring-boot-starter-biz-tenant diff --git a/yudao-framework/pom.xml b/yudao-framework/pom.xml index a531110e3b..a707e1449d 100644 --- a/yudao-framework/pom.xml +++ b/yudao-framework/pom.xml @@ -29,7 +29,6 @@ yudao-spring-boot-starter-test yudao-spring-boot-starter-biz-operatelog - yudao-spring-boot-starter-biz-dict yudao-spring-boot-starter-biz-tenant yudao-spring-boot-starter-biz-data-permission yudao-spring-boot-starter-biz-ip diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml deleted file mode 100644 index 9da365e3e1..0000000000 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - cn.iocoder.cloud - yudao-framework - ${revision} - - 4.0.0 - yudao-spring-boot-starter-biz-dict - jar - - ${project.artifactId} - 字典类型、数据 - https://github.com/YunaiV/ruoyi-vue-pro - - - - cn.iocoder.cloud - yudao-common - - - - - org.springframework.boot - spring-boot-starter - - - - - cn.iocoder.cloud - yudao-spring-boot-starter-rpc - true - - - - - cn.iocoder.cloud - yudao-module-system-api - ${revision} - - - - - com.google.guava - guava - - - - - cn.iocoder.cloud - yudao-spring-boot-starter-test - test - - - diff --git a/yudao-framework/yudao-spring-boot-starter-excel/pom.xml b/yudao-framework/yudao-spring-boot-starter-excel/pom.xml index 740451c2dd..feb7b9ac26 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-excel/pom.xml @@ -21,11 +21,24 @@ yudao-common + + + org.springframework.boot + spring-boot-starter + + + + + cn.iocoder.cloud + yudao-spring-boot-starter-rpc + true + + cn.iocoder.cloud - yudao-spring-boot-starter-biz-dict - true + yudao-module-system-api + ${revision} @@ -46,11 +59,24 @@ com.alibaba easyexcel + + + com.google.guava + guava + + cn.iocoder.cloud yudao-spring-boot-starter-biz-ip true + + + + cn.iocoder.cloud + yudao-spring-boot-starter-test + test + diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java similarity index 100% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java rename to yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictRpcAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictRpcAutoConfiguration.java similarity index 100% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictRpcAutoConfiguration.java rename to yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictRpcAutoConfiguration.java diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/package-info.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/package-info.java similarity index 100% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/package-info.java rename to yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/package-info.java diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java similarity index 97% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java rename to yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java index ad8de43d7d..2f84accf16 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java @@ -2,7 +2,6 @@ import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.core.KeyValue; -import cn.iocoder.yudao.framework.common.util.cache.CacheUtils; import cn.iocoder.yudao.module.system.api.dict.DictDataApi; import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; import com.google.common.cache.CacheLoader; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java similarity index 100% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java rename to yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/yudao-framework/yudao-spring-boot-starter-excel/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 100% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to yudao-framework/yudao-spring-boot-starter-excel/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java b/yudao-framework/yudao-spring-boot-starter-excel/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java similarity index 80% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java rename to yudao-framework/yudao-spring-boot-starter-excel/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java index 9de6ac3263..0d3bd6078f 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java @@ -2,15 +2,18 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.module.system.api.dict.DictDataApi; import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mock; +import org.mockito.Mockito; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.*; import static org.mockito.Mockito.when; /** @@ -29,9 +32,10 @@ public void setUp() { @Test public void testGetDictDataLabel() { // mock 数据 - DictDataRespDTO dataRespDTO = randomPojo(DictDataRespDTO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + DictDataRespDTO dataRespDTO = RandomUtils.randomPojo(DictDataRespDTO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); // mock 方法 when(dictDataApi.getDictData(dataRespDTO.getDictType(), dataRespDTO.getValue())).thenReturn(success(dataRespDTO)); + // 断言返回值 assertEquals(dataRespDTO.getLabel(), DictFrameworkUtils.getDictDataLabel(dataRespDTO.getDictType(), dataRespDTO.getValue())); } @@ -39,7 +43,7 @@ public void testGetDictDataLabel() { @Test public void testParseDictDataValue() { // mock 数据 - DictDataRespDTO resp = randomPojo(DictDataRespDTO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + DictDataRespDTO resp = RandomUtils.randomPojo(DictDataRespDTO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); // mock 方法 when(dictDataApi.parseDictData(resp.getDictType(), resp.getLabel())).thenReturn(success(resp)); // 断言返回值 diff --git a/yudao-module-crm/yudao-module-crm-biz/pom.xml b/yudao-module-crm/yudao-module-crm-biz/pom.xml index 323e873d95..22d5aba51e 100644 --- a/yudao-module-crm/yudao-module-crm-biz/pom.xml +++ b/yudao-module-crm/yudao-module-crm-biz/pom.xml @@ -100,10 +100,6 @@ cn.iocoder.cloud yudao-spring-boot-starter-excel - - cn.iocoder.cloud - yudao-spring-boot-starter-biz-dict - diff --git a/yudao-module-erp/yudao-module-erp-biz/pom.xml b/yudao-module-erp/yudao-module-erp-biz/pom.xml index a5b4270061..9e866f51ae 100644 --- a/yudao-module-erp/yudao-module-erp-biz/pom.xml +++ b/yudao-module-erp/yudao-module-erp-biz/pom.xml @@ -90,10 +90,6 @@ cn.iocoder.cloud yudao-spring-boot-starter-excel - - cn.iocoder.cloud - yudao-spring-boot-starter-biz-dict - diff --git a/yudao-module-mall/yudao-module-product-biz/pom.xml b/yudao-module-mall/yudao-module-product-biz/pom.xml index 7506d4e07a..58c3a9c1c8 100644 --- a/yudao-module-mall/yudao-module-product-biz/pom.xml +++ b/yudao-module-mall/yudao-module-product-biz/pom.xml @@ -50,10 +50,6 @@ cn.iocoder.cloud yudao-spring-boot-starter-biz-tenant - - cn.iocoder.cloud - yudao-spring-boot-starter-biz-dict - diff --git a/yudao-module-mall/yudao-module-promotion-biz/pom.xml b/yudao-module-mall/yudao-module-promotion-biz/pom.xml index 64a66236d0..cf51faa29e 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/pom.xml +++ b/yudao-module-mall/yudao-module-promotion-biz/pom.xml @@ -119,10 +119,6 @@ cn.iocoder.cloud yudao-spring-boot-starter-excel - - cn.iocoder.cloud - yudao-spring-boot-starter-biz-dict - diff --git a/yudao-module-mall/yudao-module-statistics-biz/pom.xml b/yudao-module-mall/yudao-module-statistics-biz/pom.xml index d908131f54..7dfd2384d3 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/pom.xml +++ b/yudao-module-mall/yudao-module-statistics-biz/pom.xml @@ -126,10 +126,6 @@ cn.iocoder.cloud yudao-spring-boot-starter-excel - - cn.iocoder.cloud - yudao-spring-boot-starter-biz-dict - diff --git a/yudao-module-mall/yudao-module-trade-biz/pom.xml b/yudao-module-mall/yudao-module-trade-biz/pom.xml index d57c8810a0..3273bcdda7 100644 --- a/yudao-module-mall/yudao-module-trade-biz/pom.xml +++ b/yudao-module-mall/yudao-module-trade-biz/pom.xml @@ -132,10 +132,6 @@ cn.iocoder.cloud yudao-spring-boot-starter-excel - - cn.iocoder.cloud - yudao-spring-boot-starter-biz-dict - diff --git a/yudao-module-system/yudao-module-system-biz/pom.xml b/yudao-module-system/yudao-module-system-biz/pom.xml index 205a12ba34..d12f4ae6ea 100644 --- a/yudao-module-system/yudao-module-system-biz/pom.xml +++ b/yudao-module-system/yudao-module-system-biz/pom.xml @@ -46,10 +46,6 @@ cn.iocoder.cloud yudao-spring-boot-starter-biz-operatelog - - cn.iocoder.cloud - yudao-spring-boot-starter-biz-dict - cn.iocoder.cloud yudao-spring-boot-starter-biz-data-permission