Skip to content

Commit

Permalink
Merge branch 'master-jdk21' of https://gitee.com/zhijiantianya/yudao-…
Browse files Browse the repository at this point in the history
  • Loading branch information
YunaiV committed Feb 28, 2024
2 parents 7a1aff9 + 1661315 commit 65e804d
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 96 deletions.
5 changes: 0 additions & 5 deletions yudao-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
Expand Down
1 change: 0 additions & 1 deletion yudao-framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<module>yudao-spring-boot-starter-test</module>

<module>yudao-spring-boot-starter-biz-operatelog</module>
<module>yudao-spring-boot-starter-biz-dict</module>
<module>yudao-spring-boot-starter-biz-tenant</module>
<module>yudao-spring-boot-starter-biz-data-permission</module>
<module>yudao-spring-boot-starter-biz-ip</module>
Expand Down
57 changes: 0 additions & 57 deletions yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml

This file was deleted.

30 changes: 28 additions & 2 deletions yudao-framework/yudao-spring-boot-starter-excel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,24 @@
<artifactId>yudao-common</artifactId>
</dependency>

<!-- Spring 核心 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<!-- RPC 远程调用相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
<optional>true</optional>
</dependency>

<!-- 业务组件 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
<optional>true</optional> <!-- 如果希望使用 @DictFormat 注解,需要引入该依赖 -->
<artifactId>yudao-module-system-api</artifactId> <!-- 需要使用它,进行 Dict 的查询 -->
<version>${revision}</version>
</dependency>

<!-- Web 相关 -->
Expand All @@ -46,11 +59,24 @@
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-ip</artifactId>
<optional>true</optional> <!-- 设置为 optional,只有在 AreaConvert 的时候使用 -->
</dependency>

<!-- Test 测试相关 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -29,17 +32,18 @@ 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()));
}

@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));
// 断言返回值
Expand Down
4 changes: 0 additions & 4 deletions yudao-module-crm/yudao-module-crm-biz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
</dependency>

<!-- 监控相关 -->
<dependency>
Expand Down
4 changes: 0 additions & 4 deletions yudao-module-erp/yudao-module-erp-biz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
</dependency>

<!-- 监控相关 -->
<dependency>
Expand Down
4 changes: 0 additions & 4 deletions yudao-module-mall/yudao-module-product-biz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
</dependency>

<!-- Web 相关 -->
<dependency>
Expand Down
4 changes: 0 additions & 4 deletions yudao-module-mall/yudao-module-promotion-biz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
</dependency>

<!-- 监控相关 -->
<dependency>
Expand Down
4 changes: 0 additions & 4 deletions yudao-module-mall/yudao-module-statistics-biz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
</dependency>

<!-- 监控相关 -->
<dependency>
Expand Down
4 changes: 0 additions & 4 deletions yudao-module-mall/yudao-module-trade-biz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
</dependency>

<!-- 监控相关 -->
<dependency>
Expand Down
4 changes: 0 additions & 4 deletions yudao-module-system/yudao-module-system-biz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-data-permission</artifactId>
Expand Down

0 comments on commit 65e804d

Please sign in to comment.