From f84f3a363171315c84b0e6221977e04becb9da68 Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 22 Jul 2022 10:24:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=97=B6=E9=97=B4=E5=8C=BA?= =?UTF-8?q?=E9=97=B4=E6=9F=A5=E8=AF=A2=E4=BC=A0=E5=85=A5=E6=95=B0=E7=BB=84?= =?UTF-8?q?-=E6=B5=8B=E8=AF=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../definition/BpmUserGroupServiceTest.java | 6 ++- .../codegen/java/test/serviceTest.vm | 3 +- .../resources/codegen/vue/views/index.vue.vm | 38 ++++--------------- .../service/config/ConfigServiceTest.java | 7 ++-- .../file/FileConfigServiceImplTest.java | 4 +- .../infra/service/file/FileServiceTest.java | 5 ++- .../logger/ApiAccessLogServiceImplTest.java | 6 +-- .../logger/ApiErrorLogServiceImplTest.java | 6 +-- .../service/test/TestDemoServiceImplTest.java | 8 ++-- .../activity/ActivityServiceImplTest.java | 15 +++----- .../service/brand/BrandServiceImplTest.java | 6 +-- .../category/CategoryServiceImplTest.java | 6 +-- .../service/sku/SkuServiceImplTest.java | 6 +-- .../spu/ProductSpuServiceImplTest.java | 6 +-- .../service/merchant/PayAppServiceTest.java | 7 ++-- .../merchant/PayChannelServiceTest.java | 7 ++-- .../merchant/PayMerchantServiceTest.java | 7 ++-- .../service/order/PayOrderServiceTest.java | 8 ++-- .../service/refund/PayRefundServiceTest.java | 9 ++--- .../service/dict/DictTypeServiceTest.java | 7 ++-- .../errorcode/ErrorCodeServiceTest.java | 7 ++-- .../logger/LoginLogServiceImplTest.java | 9 ++--- .../logger/OperateLogServiceImplTest.java | 7 ++-- .../service/permission/RoleServiceTest.java | 7 ++-- .../SensitiveWordServiceImplTest.java | 8 ++-- .../service/sms/SmsChannelServiceTest.java | 3 +- .../system/service/sms/SmsLogServiceTest.java | 12 ++---- .../service/sms/SmsTemplateServiceTest.java | 6 +-- .../tenant/TenantPackageServiceImplTest.java | 5 ++- .../service/tenant/TenantServiceImplTest.java | 7 ++-- .../user/AdminUserServiceImplTest.java | 7 ++-- 31 files changed, 92 insertions(+), 153 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupServiceTest.java b/yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupServiceTest.java index 78e388700..1053c95e1 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupServiceTest.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/definition/BpmUserGroupServiceTest.java @@ -17,6 +17,9 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.USER_GROUP_NOT_EXISTS; @@ -116,8 +119,7 @@ public class BpmUserGroupServiceTest extends BaseDbUnitTest { BpmUserGroupPageReqVO reqVO = new BpmUserGroupPageReqVO(); reqVO.setName("源码"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 11, 10)); - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 11, 12)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 10),buildTime(2021, 11, 12)})); // 调用 PageResult pageResult = userGroupService.getUserGroupPage(reqVO); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm index 6cf0c6196..1b5c60a3f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm @@ -51,8 +51,7 @@ import static org.mockito.Mockito.*; #if (${column.listOperation}) #set ($JavaField = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})##首字母大写 #if (${column.listOperationCondition} == "BETWEEN")## BETWEEN 的情况 - reqVO.setBegin${JavaField}(null); - reqVO.setEnd${JavaField}(null); + reqVO.set${JavaField}((new Date[]{})); #else reqVO.set$JavaField(null); #end diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm index 87bb2b21f..d49fa93c5 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm @@ -30,9 +30,9 @@ #else## 范围 - - + + #end #end @@ -234,6 +234,9 @@ export default { #foreach ($column in $columns) #if ($column.listOperation && $column.listOperationCondition != 'BETWEEN') $column.javaField: null, + #else if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") + $column.javaField: [], + #end #end #end }, @@ -257,18 +260,8 @@ export default { /** 查询列表 */ getList() { this.loading = true; - // 处理查询参数 - let params = {...this.queryParams}; - #foreach ($column in $columns) - #if ($column.listOperation) - #if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") - #set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) - this.addBeginAndEndTime(params, this.dateRange${AttrName}, '${column.javaField}'); - #end - #end - #end // 执行查询 - get${simpleClassName}Page(params).then(response => { + get${simpleClassName}Page(this.queryParams).then(response => { this.list = response.data.list; this.total = response.data.total; this.loading = false; @@ -301,14 +294,6 @@ export default { }, /** 重置按钮操作 */ resetQuery() { - #foreach ($column in $columns) - #if ($column.listOperation) - #if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") - #set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) - this.dateRange${AttrName} = []; - #end - #end - #end this.resetForm("queryForm"); this.handleQuery(); }, @@ -377,15 +362,6 @@ export default { let params = {...this.queryParams}; params.pageNo = undefined; params.pageSize = undefined; - #foreach ($column in $columns) - #if ($column.listOperation) - #if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") - #set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) - this.addBeginAndEndTime(params, this.dateRange${AttrName}, '${column.javaField}'); - #end - #end - #end - // 执行导出 this.#[[$modal]]#.confirm('是否确认导出所有${table.classComment}数据项?').then(() => { this.exportLoading = true; return export${simpleClassName}Excel(params); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceTest.java index 2750a981a..1dccfb27f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceTest.java @@ -19,6 +19,7 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; import java.util.List; import java.util.function.Consumer; @@ -180,8 +181,7 @@ public class ConfigServiceTest extends BaseDbUnitTest { reqVO.setName("艿"); reqVO.setKey("nai"); reqVO.setType(ConfigTypeEnum.SYSTEM.getType()); - reqVO.setBeginTime(buildTime(2021, 1, 15)); - reqVO.setEndTime(buildTime(2021, 2, 15)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 15),buildTime(2021, 2, 15)})); // 调用 PageResult pageResult = configService.getConfigPage(reqVO); @@ -214,8 +214,7 @@ public class ConfigServiceTest extends BaseDbUnitTest { reqVO.setName("艿"); reqVO.setKey("nai"); reqVO.setType(ConfigTypeEnum.SYSTEM.getType()); - reqVO.setBeginTime(buildTime(2021, 1, 15)); - reqVO.setEndTime(buildTime(2021, 2, 15)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 15),buildTime(2021, 2, 15)})); // 调用 List list = configService.getConfigList(reqVO); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java index 9eb3a70f1..e22495228 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java @@ -22,6 +22,7 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; import javax.validation.Validator; import java.io.Serializable; +import java.util.Date; import java.util.Map; import static cn.hutool.core.util.RandomUtil.randomEle; @@ -216,8 +217,7 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { FileConfigPageReqVO reqVO = new FileConfigPageReqVO(); reqVO.setName("芋道"); reqVO.setStorage(FileStorageEnum.LOCAL.getStorage()); - reqVO.setBeginCreateTime(buildTime(2022, 11, 10)); - reqVO.setEndCreateTime(buildTime(2022, 11, 12)); + reqVO.setCreateTime((new Date[]{buildTime(2022, 11, 10),buildTime(2022, 11, 12)})); // 调用 PageResult pageResult = fileConfigService.getFileConfigPage(reqVO); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java index b5acbb8a4..2ccceac69 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java @@ -15,6 +15,8 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; + import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; @@ -58,8 +60,7 @@ public class FileServiceTest extends BaseDbUnitTest { FilePageReqVO reqVO = new FilePageReqVO(); reqVO.setPath("yunai"); reqVO.setType("jp"); - reqVO.setBeginCreateTime(buildTime(2021, 1, 10)); - reqVO.setEndCreateTime(buildTime(2021, 1, 20)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 10),buildTime(2021, 1, 20)})); // 调用 PageResult pageResult = fileService.getFilePage(reqVO); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java index 5f00b3bf5..568365a56 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java @@ -77,8 +77,7 @@ public class ApiAccessLogServiceImplTest extends BaseDbUnitTest { reqVO.setUserType(userType); reqVO.setApplicationName(applicationName); reqVO.setRequestUrl(requestUrl); - reqVO.setBeginBeginTime(buildTime(2021, 3, 12)); - reqVO.setEndBeginTime(buildTime(2021, 3, 14)); + reqVO.setBeginTime((new Date[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); reqVO.setDuration(duration); reqVO.setResultCode(resultCode); @@ -135,8 +134,7 @@ public class ApiAccessLogServiceImplTest extends BaseDbUnitTest { reqVO.setUserType(userType); reqVO.setApplicationName(applicationName); reqVO.setRequestUrl(requestUrl); - reqVO.setBeginBeginTime(buildTime(2021, 3, 12)); - reqVO.setEndBeginTime(buildTime(2021, 3, 14)); + reqVO.setBeginTime((new Date[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); reqVO.setDuration(duration); reqVO.setResultCode(resultCode); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java index fbe9ebc05..4c4612716 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java @@ -77,8 +77,7 @@ public class ApiErrorLogServiceImplTest extends BaseDbUnitTest { reqVO.setUserType(userType); reqVO.setApplicationName(applicationName); reqVO.setRequestUrl(requestUrl); - reqVO.setBeginExceptionTime(buildTime(2021, 3, 12)); - reqVO.setEndExceptionTime(buildTime(2021, 3, 14)); + reqVO.setExceptionTime((new Date[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); reqVO.setProcessStatus(progressStatus); // 调用service方法 @@ -130,8 +129,7 @@ public class ApiErrorLogServiceImplTest extends BaseDbUnitTest { reqVO.setUserType(userType); reqVO.setApplicationName(applicationName); reqVO.setRequestUrl(requestUrl); - reqVO.setBeginExceptionTime(buildTime(2021, 3, 12)); - reqVO.setEndExceptionTime(buildTime(2021, 3, 14)); + reqVO.setExceptionTime((new Date[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); reqVO.setProcessStatus(progressStatus); // 调用service方法 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/test/TestDemoServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/test/TestDemoServiceImplTest.java index be02b0ed6..a099bc787 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/test/TestDemoServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/test/TestDemoServiceImplTest.java @@ -14,8 +14,10 @@ import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; import java.util.List; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; @@ -132,8 +134,7 @@ public class TestDemoServiceImplTest extends BaseDbUnitTest { reqVO.setType(1); reqVO.setCategory(2); reqVO.setRemark("哈哈哈"); - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 11, 10)); - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 11, 12)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 10),buildTime(2021, 11, 12)})); // 调用 PageResult pageResult = testDemoService.getTestDemoPage(reqVO); @@ -174,8 +175,7 @@ public class TestDemoServiceImplTest extends BaseDbUnitTest { reqVO.setType(1); reqVO.setCategory(2); reqVO.setRemark("哈哈哈"); - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 11, 10)); - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 11, 12)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 10),buildTime(2021, 11, 12)})); // 调用 List list = testDemoService.getTestDemoList(reqVO); diff --git a/yudao-module-mall/yudao-module-market-biz/src/test/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImplTest.java b/yudao-module-mall/yudao-module-market-biz/src/test/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImplTest.java index f5b9a8b50..b292251a4 100644 --- a/yudao-module-mall/yudao-module-market-biz/src/test/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImplTest.java +++ b/yudao-module-mall/yudao-module-market-biz/src/test/java/cn/iocoder/yudao/module/market/service/activity/ActivityServiceImplTest.java @@ -139,18 +139,13 @@ public class ActivityServiceImplTest extends BaseDbUnitTest { reqVO.setTitle(null); reqVO.setActivityType(null); reqVO.setStatus(null); - reqVO.setBeginStartTime(null); - reqVO.setEndStartTime(null); - reqVO.setBeginEndTime(null); - reqVO.setEndEndTime(null); - reqVO.setBeginInvalidTime(null); - reqVO.setEndInvalidTime(null); - reqVO.setBeginDeleteTime(null); - reqVO.setEndDeleteTime(null); + reqVO.setStartTime(null); + reqVO.setEndTime(null); + reqVO.setInvalidTime(null); + reqVO.setDeleteTime(null); reqVO.setTimeLimitedDiscount(null); reqVO.setFullPrivilege(null); - reqVO.setBeginCreateTime(null); - reqVO.setEndCreateTime(null); + reqVO.setCreateTime(null); // 调用 PageResult pageResult = activityService.getActivityPage(reqVO); diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImplTest.java index eb1a07cfa..fc819e6b6 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImplTest.java +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/brand/BrandServiceImplTest.java @@ -127,8 +127,7 @@ public class BrandServiceImplTest extends BaseDbUnitTest { reqVO.setCategoryId(null); reqVO.setName(null); reqVO.setStatus(null); - reqVO.setBeginCreateTime(null); - reqVO.setEndCreateTime(null); + reqVO.setCreateTime((new Date[]{})); // 调用 PageResult pageResult = brandService.getBrandPage(reqVO); @@ -162,8 +161,7 @@ public class BrandServiceImplTest extends BaseDbUnitTest { reqVO.setCategoryId(null); reqVO.setName(null); reqVO.setStatus(null); - reqVO.setBeginCreateTime(null); - reqVO.setEndCreateTime(null); + reqVO.setCreateTime((new Date[]{})); // 调用 List list = brandService.getBrandList(reqVO); diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImplTest.java index 5749e65ee..34384201b 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImplTest.java +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/category/CategoryServiceImplTest.java @@ -135,8 +135,7 @@ public class CategoryServiceImplTest extends BaseDbUnitTest { CategoryPageReqVO reqVO = new CategoryPageReqVO(); reqVO.setName(null); reqVO.setStatus(null); - reqVO.setBeginCreateTime(null); - reqVO.setEndCreateTime(null); + reqVO.setCreateTime(null); // 调用 PageResult pageResult = categoryService.getCategoryPage(reqVO); @@ -181,8 +180,7 @@ public class CategoryServiceImplTest extends BaseDbUnitTest { CategoryExportReqVO reqVO = new CategoryExportReqVO(); reqVO.setName(null); reqVO.setStatus(null); - reqVO.setBeginCreateTime(null); - reqVO.setEndCreateTime(null); + reqVO.setCreateTime(null); // 调用 List list = categoryService.getCategoryList(reqVO); diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/sku/SkuServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/sku/SkuServiceImplTest.java index 4253b6fd0..42eb96fd8 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/sku/SkuServiceImplTest.java +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/sku/SkuServiceImplTest.java @@ -147,8 +147,7 @@ public class SkuServiceImplTest extends BaseDbUnitTest { reqVO.setBarCode(null); reqVO.setPicUrl(null); reqVO.setStatus(null); - reqVO.setBeginCreateTime(null); - reqVO.setEndCreateTime(null); + reqVO.setCreateTime(null); // 调用 PageResult pageResult = ProductSkuService.getSkuPage(reqVO); @@ -202,8 +201,7 @@ public class SkuServiceImplTest extends BaseDbUnitTest { reqVO.setBarCode(null); reqVO.setPicUrl(null); reqVO.setStatus(null); - reqVO.setBeginCreateTime(null); - reqVO.setEndCreateTime(null); + reqVO.setCreateTime(null); // 调用 List list = ProductSkuService.getSkuList(reqVO); diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java index 6e943f234..fae41788f 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java @@ -155,8 +155,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { reqVO.setPrice(null); reqVO.setQuantity(null); reqVO.setStatus(null); - reqVO.setBeginCreateTime(null); - reqVO.setEndCreateTime(null); + reqVO.setCreateTime(null); // 调用 PageResult pageResult = spuService.getSpuPage(reqVO); @@ -218,8 +217,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { reqVO.setPrice(null); reqVO.setQuantity(null); reqVO.setStatus(null); - reqVO.setBeginCreateTime(null); - reqVO.setEndCreateTime(null); + reqVO.setCreateTime(null); // 调用 List list = spuService.getSpuList(reqVO); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayAppServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayAppServiceTest.java index cc378a367..aae818307 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayAppServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayAppServiceTest.java @@ -19,6 +19,7 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; import java.util.Collections; +import java.util.Date; import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; @@ -162,8 +163,7 @@ public class PayAppServiceTest extends BaseDbUnitTest { reqVO.setPayNotifyUrl("https://www.hc.com"); reqVO.setRefundNotifyUrl("https://www.xm.com"); reqVO.setMerchantName(dbMerchant.getName()); - reqVO.setBeginCreateTime(buildTime(2021,11,19)); - reqVO.setEndCreateTime(buildTime(2021,11,21)); + reqVO.setCreateTime((new Date[]{buildTime(2021,11,19),buildTime(2021,11,21)})); // 调用 PageResult pageResult = appService.getAppPage(reqVO); @@ -226,8 +226,7 @@ public class PayAppServiceTest extends BaseDbUnitTest { reqVO.setPayNotifyUrl("https://www.hc.com"); reqVO.setRefundNotifyUrl("https://www.xm.com"); reqVO.setMerchantName(dbMerchant.getName()); - reqVO.setBeginCreateTime(buildTime(2021,11,19)); - reqVO.setEndCreateTime(buildTime(2021,11,21)); + reqVO.setCreateTime((new Date[]{buildTime(2021,11,19),buildTime(2021,11,21)})); // 调用 List list = appService.getAppList(reqVO); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayChannelServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayChannelServiceTest.java index ebf4b0680..550a78823 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayChannelServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayChannelServiceTest.java @@ -20,6 +20,7 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; import javax.validation.Validator; +import java.util.Date; import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; @@ -263,8 +264,7 @@ public class PayChannelServiceTest extends BaseDbUnitTest { reqVO.setMerchantId(1L); reqVO.setAppId(1L); reqVO.setConfig(JSON.toJSONString(payClientConfig)); - reqVO.setBeginCreateTime(buildTime(2021,11,19)); - reqVO.setEndCreateTime(buildTime(2021,11,21)); + reqVO.setCreateTime((new Date[]{buildTime(2021,11,19),buildTime(2021,11,21)})); // 调用 PageResult pageResult = channelService.getChannelPage(reqVO); @@ -337,8 +337,7 @@ public class PayChannelServiceTest extends BaseDbUnitTest { reqVO.setMerchantId(1L); reqVO.setAppId(1L); reqVO.setConfig(JSON.toJSONString(payClientConfig)); - reqVO.setBeginCreateTime(buildTime(2021,11,19)); - reqVO.setEndCreateTime(buildTime(2021,11,21)); + reqVO.setCreateTime((new Date[]{buildTime(2021,11,19),buildTime(2021,11,21)})); // 调用 List list = channelService.getChannelList(reqVO); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayMerchantServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayMerchantServiceTest.java index 2a0adf22d..385c92202 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayMerchantServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/merchant/PayMerchantServiceTest.java @@ -14,6 +14,7 @@ import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; @@ -137,8 +138,7 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { reqVO.setShortName("灿灿子"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); reqVO.setRemark("灿哥的杂货铺"); - reqVO.setBeginCreateTime(buildTime(2021,11,2)); - reqVO.setEndCreateTime(buildTime(2021,11,4)); + reqVO.setCreateTime((new Date[]{buildTime(2021,11,2),buildTime(2021,11,4)})); // 调用 PageResult pageResult = merchantService.getMerchantPage(reqVO); @@ -179,8 +179,7 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { reqVO.setShortName("灿灿子"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); reqVO.setRemark("灿哥的杂货铺"); - reqVO.setBeginCreateTime(buildTime(2021,11,2)); - reqVO.setEndCreateTime(buildTime(2021,11,4)); + reqVO.setCreateTime((new Date[]{buildTime(2021,11,2),buildTime(2021,11,4)})); // 调用 List list = merchantService.getMerchantList(reqVO); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceTest.java index c0219018d..09cd6c3ec 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceTest.java @@ -26,6 +26,7 @@ import javax.annotation.Resource; import java.util.Date; import java.util.List; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; @@ -124,9 +125,7 @@ public class PayOrderServiceTest extends BaseDbUnitTest { reqVO.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); reqVO.setStatus(PayOrderStatusEnum.SUCCESS.getStatus()); reqVO.setRefundStatus(PayRefundTypeEnum.NO.getStatus()); - reqVO.setBeginCreateTime(DateUtils.buildTime(2018, 1, 1, 10, 1, 0)); - reqVO.setEndCreateTime(DateUtils.buildTime(2018, 1, 1, 10, 1, 0)); - + reqVO.setCreateTime((new Date[]{buildTime(2018, 1, 1, 10, 1, 0),buildTime(2018, 1, 1, 10, 1, 0)})); // 调用 PageResult pageResult = orderService.getOrderPage(reqVO); // 断言 @@ -199,8 +198,7 @@ public class PayOrderServiceTest extends BaseDbUnitTest { reqVO.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); reqVO.setStatus(PayOrderStatusEnum.SUCCESS.getStatus()); reqVO.setRefundStatus(PayRefundTypeEnum.NO.getStatus()); - reqVO.setBeginCreateTime(DateUtils.buildTime(2018, 1, 1, 10, 1, 0)); - reqVO.setEndCreateTime(DateUtils.buildTime(2018, 1, 1, 10, 1, 0)); + reqVO.setCreateTime((new Date[]{buildTime(2018, 1, 1, 10, 1, 0),buildTime(2018, 1, 1, 10, 1, 0)})); // 调用 List list = orderService.getOrderList(reqVO); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceTest.java index 18bfb6aa5..d35ad3cb8 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceTest.java @@ -22,8 +22,10 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; import java.util.List; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; @@ -110,9 +112,7 @@ public class PayRefundServiceTest extends BaseDbUnitTest { reqVO.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); reqVO.setStatus(PayRefundStatusEnum.SUCCESS.getStatus()); reqVO.setType(PayRefundTypeEnum.SOME.getStatus()); - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 1, 1, 10, 10, 10)); - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 1, 1, 10, 10, 12)); - + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 1, 10, 10, 10),buildTime(2021, 1, 1, 10, 10, 12)})); // 调用 PageResult pageResult = refundService.getRefundPage(reqVO); @@ -182,8 +182,7 @@ public class PayRefundServiceTest extends BaseDbUnitTest { reqVO.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); reqVO.setStatus(PayRefundStatusEnum.SUCCESS.getStatus()); reqVO.setType(PayRefundTypeEnum.SOME.getStatus()); - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 1, 1, 10, 10, 10)); - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 1, 1, 10, 10, 12)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 1, 10, 10, 10),buildTime(2021, 1, 1, 10, 10, 12)})); // 调用 List list = refundService.getRefundList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java index 127e602ea..0925427c9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java @@ -16,6 +16,7 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; import java.util.List; import java.util.function.Consumer; @@ -63,8 +64,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest { reqVO.setName("nai"); reqVO.setType("艿"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginCreateTime(buildTime(2021, 1, 10)); - reqVO.setEndCreateTime(buildTime(2021, 1, 20)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 10),buildTime(2021, 1, 20)})); // 调用 PageResult pageResult = dictTypeService.getDictTypePage(reqVO); @@ -97,8 +97,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest { reqVO.setName("nai"); reqVO.setType("艿"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginCreateTime(buildTime(2021, 1, 10)); - reqVO.setEndCreateTime(buildTime(2021, 1, 20)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 10),buildTime(2021, 1, 20)})); // 调用 List list = dictTypeService.getDictTypeList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java index 717640525..6998521ee 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java @@ -17,6 +17,7 @@ import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; import java.util.List; import java.util.function.Consumer; @@ -95,8 +96,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { reqVO.setApplicationName("tu"); reqVO.setCode(1); reqVO.setMessage("ma"); - reqVO.setBeginCreateTime(buildTime(2020, 11, 1)); - reqVO.setEndCreateTime(buildTime(2020, 11, 30)); + reqVO.setCreateTime((new Date[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); // 调用 PageResult pageResult = errorCodeService.getErrorCodePage(reqVO); @@ -141,8 +141,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { reqVO.setApplicationName("tu"); reqVO.setCode(1); reqVO.setMessage("ma"); - reqVO.setBeginCreateTime(buildTime(2020, 11, 1)); - reqVO.setEndCreateTime(buildTime(2020, 11, 30)); + reqVO.setCreateTime((new Date[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); // 调用 List list = errorCodeService.getErrorCodeList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java index b42a7db96..363f497dc 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java @@ -18,6 +18,7 @@ import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; import java.util.List; import static cn.hutool.core.util.RandomUtil.randomEle; @@ -66,8 +67,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { reqVO.setUsername("wangkai"); reqVO.setUserIp("192.168.199"); reqVO.setStatus(true); - reqVO.setBeginTime(buildTime(2021, 3, 5)); - reqVO.setEndTime(buildTime(2021, 3, 7)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 3, 5),buildTime(2021, 3, 5)})); // 调用service方法 PageResult pageResult = loginLogService.getLoginLogPage(reqVO); @@ -105,15 +105,12 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { // 构造一个早期时间 2021-02-06 00:00:00 loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setCreateTime(buildTime(2021, 2, 6)))); - // 构造调用参数 LoginLogExportReqVO reqVO = new LoginLogExportReqVO(); reqVO.setUsername("wangxiaokai"); reqVO.setUserIp("192.168.111"); reqVO.setStatus(true); - reqVO.setBeginTime(buildTime(2021, 3, 5)); - reqVO.setEndTime(buildTime(2021, 3, 7)); - + reqVO.setCreateTime((new Date[]{buildTime(2021, 3, 5),buildTime(2021, 3, 5)})); // 调用service方法 List loginLogList = loginLogService.getLoginLogList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java index f1b043524..1f1c0809e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java @@ -24,6 +24,7 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; import java.util.Collections; +import java.util.Date; import java.util.List; import static cn.hutool.core.util.RandomUtil.randomEle; @@ -103,8 +104,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { reqVO.setUserNickname("wangkai"); reqVO.setModule("order"); reqVO.setType(OperateTypeEnum.CREATE.getType()); - reqVO.setBeginTime(buildTime(2021, 3, 5)); - reqVO.setEndTime(buildTime(2021, 3, 7)); + reqVO.setStartTime((new Date[]{buildTime(2021, 3, 5),buildTime(2021, 3, 7)})); reqVO.setSuccess(true); // 调用service方法 @@ -155,8 +155,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { reqVO.setUserNickname("wangkai"); reqVO.setModule("order"); reqVO.setType(OperateTypeEnum.CREATE.getType()); - reqVO.setBeginTime(buildTime(2021, 3, 5)); - reqVO.setEndTime(buildTime(2021, 3, 7)); + reqVO.setStartTime((new Date[]{buildTime(2021, 3, 5),buildTime(2021, 3, 7)})); reqVO.setSuccess(true); // 调用 service 方法 diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java index b81777fb6..b471a4cd5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java @@ -22,6 +22,7 @@ import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; @@ -178,8 +179,7 @@ public class RoleServiceTest extends BaseDbUnitTest { reqVO.setName("土豆"); reqVO.setCode("tu"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginTime(DateUtils.buildTime(2022, 2, 1)); - reqVO.setEndTime(DateUtils.buildTime(2022, 2, 12)); + reqVO.setCreateTime((new Date[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); // 调用 List list = roleService.getRoleList(reqVO); @@ -209,8 +209,7 @@ public class RoleServiceTest extends BaseDbUnitTest { reqVO.setName("土豆"); reqVO.setCode("tu"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginTime(DateUtils.buildTime(2022, 2, 1)); - reqVO.setEndTime(DateUtils.buildTime(2022, 2, 12)); + reqVO.setCreateTime((new Date[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); // 调用 PageResult pageResult = roleService.getRolePage(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImplTest.java index 09edfb910..8c347b97d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImplTest.java @@ -18,8 +18,10 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; import java.util.Arrays; +import java.util.Date; import java.util.List; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; @@ -157,8 +159,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { reqVO.setName("笨"); reqVO.setTag("论坛"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginCreateTime(DateUtils.buildTime(2022, 2, 1)); - reqVO.setEndCreateTime(DateUtils.buildTime(2022, 2, 12)); + reqVO.setCreateTime((new Date[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); // 调用 PageResult pageResult = sensitiveWordService.getSensitiveWordPage(reqVO); @@ -189,8 +190,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { reqVO.setName("笨"); reqVO.setTag("论坛"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginCreateTime(DateUtils.buildTime(2022, 2, 1)); - reqVO.setEndCreateTime(DateUtils.buildTime(2022, 2, 12)); + reqVO.setCreateTime((new Date[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); // 调用 List list = sensitiveWordService.getSensitiveWordList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java index a53a06fab..64554e3fe 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java @@ -172,8 +172,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { SmsChannelPageReqVO reqVO = new SmsChannelPageReqVO(); reqVO.setSignature("芋道"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginCreateTime(buildTime(2020, 12, 1)); - reqVO.setEndCreateTime(buildTime(2020, 12, 24)); + reqVO.setCreateTime((new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)})); // 调用 PageResult pageResult = smsChannelService.getSmsChannelPage(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java index c4205f538..2d8f9c2bf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java @@ -74,11 +74,9 @@ public class SmsLogServiceTest extends BaseDbUnitTest { reqVO.setTemplateId(10L); reqVO.setMobile("156"); reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); - reqVO.setBeginSendTime(buildTime(2020, 11, 1)); - reqVO.setEndSendTime(buildTime(2020, 11, 30)); + reqVO.setSendTime((new Date[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); - reqVO.setBeginReceiveTime(buildTime(2021, 11, 1)); - reqVO.setEndReceiveTime(buildTime(2021, 11, 30)); + reqVO.setReceiveTime((new Date[]{buildTime(2021, 11, 1),buildTime(2021, 11, 30)})); // 调用 PageResult pageResult = smsLogService.getSmsLogPage(reqVO); @@ -121,11 +119,9 @@ public class SmsLogServiceTest extends BaseDbUnitTest { reqVO.setTemplateId(10L); reqVO.setMobile("156"); reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); - reqVO.setBeginSendTime(buildTime(2020, 11, 1)); - reqVO.setEndSendTime(buildTime(2020, 11, 30)); + reqVO.setSendTime((new Date[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); - reqVO.setBeginReceiveTime(buildTime(2021, 11, 1)); - reqVO.setEndReceiveTime(buildTime(2021, 11, 30)); + reqVO.setReceiveTime((new Date[]{buildTime(2021, 11, 1),buildTime(2021, 11, 30)})); // 调用 List list = smsLogService.getSmsLogList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java index 50f1b3fd8..bf7a1ca81 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java @@ -230,8 +230,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { reqVO.setContent("芋道"); reqVO.setApiTemplateId("yu"); reqVO.setChannelId(1L); - reqVO.setBeginCreateTime(buildTime(2021, 11, 1)); - reqVO.setEndCreateTime(buildTime(2021, 12, 1)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 1),buildTime(2021, 12, 1)})); // 调用 PageResult pageResult = smsTemplateService.getSmsTemplatePage(reqVO); @@ -276,8 +275,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { reqVO.setContent("芋道"); reqVO.setApiTemplateId("yu"); reqVO.setChannelId(1L); - reqVO.setBeginCreateTime(buildTime(2021, 11, 1)); - reqVO.setEndCreateTime(buildTime(2021, 12, 1)); + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 1),buildTime(2021, 12, 1)})); // 调用 List list = smsTemplateService.getSmsTemplateList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImplTest.java index 32ed34972..66d25f1bb 100755 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImplTest.java @@ -15,6 +15,8 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Date; + import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; @@ -156,8 +158,7 @@ public class TenantPackageServiceImplTest extends BaseDbUnitTest { reqVO.setName("芋道"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); reqVO.setRemark("源码"); - reqVO.setBeginCreateTime(buildTime(2022, 10, 9)); - reqVO.setEndCreateTime(buildTime(2022, 10, 11)); + reqVO.setCreateTime((new Date[]{buildTime(2022, 10, 9),buildTime(2022, 10, 11)})); // 调用 PageResult pageResult = tenantPackageService.getTenantPackagePage(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java index 61daa866f..56445506f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java @@ -31,6 +31,7 @@ import javax.annotation.Resource; import java.time.Duration; import java.util.Arrays; import java.util.Collections; +import java.util.Date; import java.util.List; import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; @@ -311,8 +312,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest { reqVO.setContactName("艿"); reqVO.setContactMobile("1560"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginCreateTime(buildTime(2020, 12, 1)); - reqVO.setEndCreateTime(buildTime(2020, 12, 24)); + reqVO.setCreateTime(new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)}); // 调用 PageResult pageResult = tenantService.getTenantPage(reqVO); @@ -349,8 +349,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest { reqVO.setContactName("艿"); reqVO.setContactMobile("1560"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginCreateTime(buildTime(2020, 12, 1)); - reqVO.setEndCreateTime(buildTime(2020, 12, 24)); + reqVO.setCreateTime(new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)}); // 调用 List list = tenantService.getTenantList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java index 39f4c0152..0884f8187 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java @@ -33,6 +33,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; import javax.annotation.Resource; import java.io.ByteArrayInputStream; import java.util.Collection; +import java.util.Date; import java.util.List; import java.util.function.Consumer; @@ -294,8 +295,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { reqVO.setUsername("tu"); reqVO.setMobile("1560"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginTime(buildTime(2020, 12, 1)); - reqVO.setEndTime(buildTime(2020, 12, 24)); + reqVO.setCreateTime((new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)})); reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 // mock 方法 List deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L))); @@ -318,8 +318,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { reqVO.setUsername("tu"); reqVO.setMobile("1560"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setBeginTime(buildTime(2020, 12, 1)); - reqVO.setEndTime(buildTime(2020, 12, 24)); + reqVO.setCreateTime((new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)})); reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 // mock 方法 List deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L)));