Commit f84f3a363171315c84b0e6221977e04becb9da68
1 parent
dad10d85
refactor: 时间区间查询传入数组-测试模块
Showing
31 changed files
with
92 additions
and
153 deletions
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; |
| 17 | 17 | |
| 18 | 18 | import javax.annotation.Resource; |
| 19 | 19 | |
| 20 | +import java.util.Date; | |
| 21 | + | |
| 22 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | |
| 20 | 23 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 21 | 24 | import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.USER_GROUP_NOT_EXISTS; |
| 22 | 25 | |
| ... | ... | @@ -116,8 +119,7 @@ public class BpmUserGroupServiceTest extends BaseDbUnitTest { |
| 116 | 119 | BpmUserGroupPageReqVO reqVO = new BpmUserGroupPageReqVO(); |
| 117 | 120 | reqVO.setName("源码"); |
| 118 | 121 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 119 | - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 11, 10)); | |
| 120 | - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 11, 12)); | |
| 122 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 10),buildTime(2021, 11, 12)})); | |
| 121 | 123 | |
| 122 | 124 | // 调用 |
| 123 | 125 | PageResult<BpmUserGroupDO> pageResult = userGroupService.getUserGroupPage(reqVO); | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm
| ... | ... | @@ -51,8 +51,7 @@ import static org.mockito.Mockito.*; |
| 51 | 51 | #if (${column.listOperation}) |
| 52 | 52 | #set ($JavaField = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})##首字母大写 |
| 53 | 53 | #if (${column.listOperationCondition} == "BETWEEN")## BETWEEN 的情况 |
| 54 | - reqVO.setBegin${JavaField}(null); | |
| 55 | - reqVO.setEnd${JavaField}(null); | |
| 54 | + reqVO.set${JavaField}((new Date[]{})); | |
| 56 | 55 | #else |
| 57 | 56 | reqVO.set$JavaField(null); |
| 58 | 57 | #end | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm
| ... | ... | @@ -30,9 +30,9 @@ |
| 30 | 30 | <el-date-picker clearable v-model="queryParams.${javaField}" type="date" value-format="yyyy-MM-dd" placeholder="选择${comment}" /> |
| 31 | 31 | </el-form-item> |
| 32 | 32 | #else## 范围 |
| 33 | - <el-form-item label="${comment}"> | |
| 34 | - <el-date-picker v-model="dateRange${AttrName}" style="width: 240px" value-format="yyyy-MM-dd" | |
| 35 | - type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" /> | |
| 33 | + <el-form-item label="${comment}" prop="${javaField}"> | |
| 34 | + <el-date-picker v-model="queryParams.${javaField}" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" | |
| 35 | + range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> | |
| 36 | 36 | </el-form-item> |
| 37 | 37 | #end |
| 38 | 38 | #end |
| ... | ... | @@ -234,6 +234,9 @@ export default { |
| 234 | 234 | #foreach ($column in $columns) |
| 235 | 235 | #if ($column.listOperation && $column.listOperationCondition != 'BETWEEN') |
| 236 | 236 | $column.javaField: null, |
| 237 | + #else if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") | |
| 238 | + $column.javaField: [], | |
| 239 | + #end | |
| 237 | 240 | #end |
| 238 | 241 | #end |
| 239 | 242 | }, |
| ... | ... | @@ -257,18 +260,8 @@ export default { |
| 257 | 260 | /** 查询列表 */ |
| 258 | 261 | getList() { |
| 259 | 262 | this.loading = true; |
| 260 | - // 处理查询参数 | |
| 261 | - let params = {...this.queryParams}; | |
| 262 | - #foreach ($column in $columns) | |
| 263 | - #if ($column.listOperation) | |
| 264 | - #if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") | |
| 265 | - #set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) | |
| 266 | - this.addBeginAndEndTime(params, this.dateRange${AttrName}, '${column.javaField}'); | |
| 267 | - #end | |
| 268 | - #end | |
| 269 | - #end | |
| 270 | 263 | // 执行查询 |
| 271 | - get${simpleClassName}Page(params).then(response => { | |
| 264 | + get${simpleClassName}Page(this.queryParams).then(response => { | |
| 272 | 265 | this.list = response.data.list; |
| 273 | 266 | this.total = response.data.total; |
| 274 | 267 | this.loading = false; |
| ... | ... | @@ -301,14 +294,6 @@ export default { |
| 301 | 294 | }, |
| 302 | 295 | /** 重置按钮操作 */ |
| 303 | 296 | resetQuery() { |
| 304 | - #foreach ($column in $columns) | |
| 305 | - #if ($column.listOperation) | |
| 306 | - #if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") | |
| 307 | - #set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) | |
| 308 | - this.dateRange${AttrName} = []; | |
| 309 | - #end | |
| 310 | - #end | |
| 311 | - #end | |
| 312 | 297 | this.resetForm("queryForm"); |
| 313 | 298 | this.handleQuery(); |
| 314 | 299 | }, |
| ... | ... | @@ -377,15 +362,6 @@ export default { |
| 377 | 362 | let params = {...this.queryParams}; |
| 378 | 363 | params.pageNo = undefined; |
| 379 | 364 | params.pageSize = undefined; |
| 380 | - #foreach ($column in $columns) | |
| 381 | - #if ($column.listOperation) | |
| 382 | - #if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") | |
| 383 | - #set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) | |
| 384 | - this.addBeginAndEndTime(params, this.dateRange${AttrName}, '${column.javaField}'); | |
| 385 | - #end | |
| 386 | - #end | |
| 387 | - #end | |
| 388 | - // 执行导出 | |
| 389 | 365 | this.#[[$modal]]#.confirm('是否确认导出所有${table.classComment}数据项?').then(() => { |
| 390 | 366 | this.exportLoading = true; |
| 391 | 367 | return export${simpleClassName}Excel(params); | ... | ... |
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; |
| 19 | 19 | import org.springframework.context.annotation.Import; |
| 20 | 20 | |
| 21 | 21 | import javax.annotation.Resource; |
| 22 | +import java.util.Date; | |
| 22 | 23 | import java.util.List; |
| 23 | 24 | import java.util.function.Consumer; |
| 24 | 25 | |
| ... | ... | @@ -180,8 +181,7 @@ public class ConfigServiceTest extends BaseDbUnitTest { |
| 180 | 181 | reqVO.setName("艿"); |
| 181 | 182 | reqVO.setKey("nai"); |
| 182 | 183 | reqVO.setType(ConfigTypeEnum.SYSTEM.getType()); |
| 183 | - reqVO.setBeginTime(buildTime(2021, 1, 15)); | |
| 184 | - reqVO.setEndTime(buildTime(2021, 2, 15)); | |
| 184 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 15),buildTime(2021, 2, 15)})); | |
| 185 | 185 | |
| 186 | 186 | // 调用 |
| 187 | 187 | PageResult<ConfigDO> pageResult = configService.getConfigPage(reqVO); |
| ... | ... | @@ -214,8 +214,7 @@ public class ConfigServiceTest extends BaseDbUnitTest { |
| 214 | 214 | reqVO.setName("艿"); |
| 215 | 215 | reqVO.setKey("nai"); |
| 216 | 216 | reqVO.setType(ConfigTypeEnum.SYSTEM.getType()); |
| 217 | - reqVO.setBeginTime(buildTime(2021, 1, 15)); | |
| 218 | - reqVO.setEndTime(buildTime(2021, 2, 15)); | |
| 217 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 15),buildTime(2021, 2, 15)})); | |
| 219 | 218 | |
| 220 | 219 | // 调用 |
| 221 | 220 | List<ConfigDO> list = configService.getConfigList(reqVO); | ... | ... |
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; |
| 22 | 22 | import javax.annotation.Resource; |
| 23 | 23 | import javax.validation.Validator; |
| 24 | 24 | import java.io.Serializable; |
| 25 | +import java.util.Date; | |
| 25 | 26 | import java.util.Map; |
| 26 | 27 | |
| 27 | 28 | import static cn.hutool.core.util.RandomUtil.randomEle; |
| ... | ... | @@ -216,8 +217,7 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { |
| 216 | 217 | FileConfigPageReqVO reqVO = new FileConfigPageReqVO(); |
| 217 | 218 | reqVO.setName("芋道"); |
| 218 | 219 | reqVO.setStorage(FileStorageEnum.LOCAL.getStorage()); |
| 219 | - reqVO.setBeginCreateTime(buildTime(2022, 11, 10)); | |
| 220 | - reqVO.setEndCreateTime(buildTime(2022, 11, 12)); | |
| 220 | + reqVO.setCreateTime((new Date[]{buildTime(2022, 11, 10),buildTime(2022, 11, 12)})); | |
| 221 | 221 | |
| 222 | 222 | // 调用 |
| 223 | 223 | PageResult<FileConfigDO> pageResult = fileConfigService.getFileConfigPage(reqVO); | ... | ... |
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; |
| 15 | 15 | |
| 16 | 16 | import javax.annotation.Resource; |
| 17 | 17 | |
| 18 | +import java.util.Date; | |
| 19 | + | |
| 18 | 20 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; |
| 19 | 21 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; |
| 20 | 22 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; |
| ... | ... | @@ -58,8 +60,7 @@ public class FileServiceTest extends BaseDbUnitTest { |
| 58 | 60 | FilePageReqVO reqVO = new FilePageReqVO(); |
| 59 | 61 | reqVO.setPath("yunai"); |
| 60 | 62 | reqVO.setType("jp"); |
| 61 | - reqVO.setBeginCreateTime(buildTime(2021, 1, 10)); | |
| 62 | - reqVO.setEndCreateTime(buildTime(2021, 1, 20)); | |
| 63 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 10),buildTime(2021, 1, 20)})); | |
| 63 | 64 | |
| 64 | 65 | // 调用 |
| 65 | 66 | PageResult<FileDO> pageResult = fileService.getFilePage(reqVO); | ... | ... |
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 { |
| 77 | 77 | reqVO.setUserType(userType); |
| 78 | 78 | reqVO.setApplicationName(applicationName); |
| 79 | 79 | reqVO.setRequestUrl(requestUrl); |
| 80 | - reqVO.setBeginBeginTime(buildTime(2021, 3, 12)); | |
| 81 | - reqVO.setEndBeginTime(buildTime(2021, 3, 14)); | |
| 80 | + reqVO.setBeginTime((new Date[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); | |
| 82 | 81 | reqVO.setDuration(duration); |
| 83 | 82 | reqVO.setResultCode(resultCode); |
| 84 | 83 | |
| ... | ... | @@ -135,8 +134,7 @@ public class ApiAccessLogServiceImplTest extends BaseDbUnitTest { |
| 135 | 134 | reqVO.setUserType(userType); |
| 136 | 135 | reqVO.setApplicationName(applicationName); |
| 137 | 136 | reqVO.setRequestUrl(requestUrl); |
| 138 | - reqVO.setBeginBeginTime(buildTime(2021, 3, 12)); | |
| 139 | - reqVO.setEndBeginTime(buildTime(2021, 3, 14)); | |
| 137 | + reqVO.setBeginTime((new Date[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); | |
| 140 | 138 | reqVO.setDuration(duration); |
| 141 | 139 | reqVO.setResultCode(resultCode); |
| 142 | 140 | ... | ... |
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 { |
| 77 | 77 | reqVO.setUserType(userType); |
| 78 | 78 | reqVO.setApplicationName(applicationName); |
| 79 | 79 | reqVO.setRequestUrl(requestUrl); |
| 80 | - reqVO.setBeginExceptionTime(buildTime(2021, 3, 12)); | |
| 81 | - reqVO.setEndExceptionTime(buildTime(2021, 3, 14)); | |
| 80 | + reqVO.setExceptionTime((new Date[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); | |
| 82 | 81 | reqVO.setProcessStatus(progressStatus); |
| 83 | 82 | |
| 84 | 83 | // 调用service方法 |
| ... | ... | @@ -130,8 +129,7 @@ public class ApiErrorLogServiceImplTest extends BaseDbUnitTest { |
| 130 | 129 | reqVO.setUserType(userType); |
| 131 | 130 | reqVO.setApplicationName(applicationName); |
| 132 | 131 | reqVO.setRequestUrl(requestUrl); |
| 133 | - reqVO.setBeginExceptionTime(buildTime(2021, 3, 12)); | |
| 134 | - reqVO.setEndExceptionTime(buildTime(2021, 3, 14)); | |
| 132 | + reqVO.setExceptionTime((new Date[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); | |
| 135 | 133 | reqVO.setProcessStatus(progressStatus); |
| 136 | 134 | |
| 137 | 135 | // 调用service方法 | ... | ... |
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; |
| 14 | 14 | import org.springframework.context.annotation.Import; |
| 15 | 15 | |
| 16 | 16 | import javax.annotation.Resource; |
| 17 | +import java.util.Date; | |
| 17 | 18 | import java.util.List; |
| 18 | 19 | |
| 20 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | |
| 19 | 21 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 20 | 22 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| 21 | 23 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; |
| ... | ... | @@ -132,8 +134,7 @@ public class TestDemoServiceImplTest extends BaseDbUnitTest { |
| 132 | 134 | reqVO.setType(1); |
| 133 | 135 | reqVO.setCategory(2); |
| 134 | 136 | reqVO.setRemark("哈哈哈"); |
| 135 | - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 11, 10)); | |
| 136 | - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 11, 12)); | |
| 137 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 10),buildTime(2021, 11, 12)})); | |
| 137 | 138 | |
| 138 | 139 | // 调用 |
| 139 | 140 | PageResult<TestDemoDO> pageResult = testDemoService.getTestDemoPage(reqVO); |
| ... | ... | @@ -174,8 +175,7 @@ public class TestDemoServiceImplTest extends BaseDbUnitTest { |
| 174 | 175 | reqVO.setType(1); |
| 175 | 176 | reqVO.setCategory(2); |
| 176 | 177 | reqVO.setRemark("哈哈哈"); |
| 177 | - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 11, 10)); | |
| 178 | - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 11, 12)); | |
| 178 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 10),buildTime(2021, 11, 12)})); | |
| 179 | 179 | |
| 180 | 180 | // 调用 |
| 181 | 181 | List<TestDemoDO> list = testDemoService.getTestDemoList(reqVO); | ... | ... |
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 { |
| 139 | 139 | reqVO.setTitle(null); |
| 140 | 140 | reqVO.setActivityType(null); |
| 141 | 141 | reqVO.setStatus(null); |
| 142 | - reqVO.setBeginStartTime(null); | |
| 143 | - reqVO.setEndStartTime(null); | |
| 144 | - reqVO.setBeginEndTime(null); | |
| 145 | - reqVO.setEndEndTime(null); | |
| 146 | - reqVO.setBeginInvalidTime(null); | |
| 147 | - reqVO.setEndInvalidTime(null); | |
| 148 | - reqVO.setBeginDeleteTime(null); | |
| 149 | - reqVO.setEndDeleteTime(null); | |
| 142 | + reqVO.setStartTime(null); | |
| 143 | + reqVO.setEndTime(null); | |
| 144 | + reqVO.setInvalidTime(null); | |
| 145 | + reqVO.setDeleteTime(null); | |
| 150 | 146 | reqVO.setTimeLimitedDiscount(null); |
| 151 | 147 | reqVO.setFullPrivilege(null); |
| 152 | - reqVO.setBeginCreateTime(null); | |
| 153 | - reqVO.setEndCreateTime(null); | |
| 148 | + reqVO.setCreateTime(null); | |
| 154 | 149 | |
| 155 | 150 | // 调用 |
| 156 | 151 | PageResult<ActivityDO> pageResult = activityService.getActivityPage(reqVO); | ... | ... |
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 { |
| 127 | 127 | reqVO.setCategoryId(null); |
| 128 | 128 | reqVO.setName(null); |
| 129 | 129 | reqVO.setStatus(null); |
| 130 | - reqVO.setBeginCreateTime(null); | |
| 131 | - reqVO.setEndCreateTime(null); | |
| 130 | + reqVO.setCreateTime((new Date[]{})); | |
| 132 | 131 | |
| 133 | 132 | // 调用 |
| 134 | 133 | PageResult<BrandDO> pageResult = brandService.getBrandPage(reqVO); |
| ... | ... | @@ -162,8 +161,7 @@ public class BrandServiceImplTest extends BaseDbUnitTest { |
| 162 | 161 | reqVO.setCategoryId(null); |
| 163 | 162 | reqVO.setName(null); |
| 164 | 163 | reqVO.setStatus(null); |
| 165 | - reqVO.setBeginCreateTime(null); | |
| 166 | - reqVO.setEndCreateTime(null); | |
| 164 | + reqVO.setCreateTime((new Date[]{})); | |
| 167 | 165 | |
| 168 | 166 | // 调用 |
| 169 | 167 | List<BrandDO> list = brandService.getBrandList(reqVO); | ... | ... |
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 { |
| 135 | 135 | CategoryPageReqVO reqVO = new CategoryPageReqVO(); |
| 136 | 136 | reqVO.setName(null); |
| 137 | 137 | reqVO.setStatus(null); |
| 138 | - reqVO.setBeginCreateTime(null); | |
| 139 | - reqVO.setEndCreateTime(null); | |
| 138 | + reqVO.setCreateTime(null); | |
| 140 | 139 | |
| 141 | 140 | // 调用 |
| 142 | 141 | PageResult<CategoryDO> pageResult = categoryService.getCategoryPage(reqVO); |
| ... | ... | @@ -181,8 +180,7 @@ public class CategoryServiceImplTest extends BaseDbUnitTest { |
| 181 | 180 | CategoryExportReqVO reqVO = new CategoryExportReqVO(); |
| 182 | 181 | reqVO.setName(null); |
| 183 | 182 | reqVO.setStatus(null); |
| 184 | - reqVO.setBeginCreateTime(null); | |
| 185 | - reqVO.setEndCreateTime(null); | |
| 183 | + reqVO.setCreateTime(null); | |
| 186 | 184 | |
| 187 | 185 | // 调用 |
| 188 | 186 | List<CategoryDO> list = categoryService.getCategoryList(reqVO); | ... | ... |
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 { |
| 147 | 147 | reqVO.setBarCode(null); |
| 148 | 148 | reqVO.setPicUrl(null); |
| 149 | 149 | reqVO.setStatus(null); |
| 150 | - reqVO.setBeginCreateTime(null); | |
| 151 | - reqVO.setEndCreateTime(null); | |
| 150 | + reqVO.setCreateTime(null); | |
| 152 | 151 | |
| 153 | 152 | // 调用 |
| 154 | 153 | PageResult<ProductSkuDO> pageResult = ProductSkuService.getSkuPage(reqVO); |
| ... | ... | @@ -202,8 +201,7 @@ public class SkuServiceImplTest extends BaseDbUnitTest { |
| 202 | 201 | reqVO.setBarCode(null); |
| 203 | 202 | reqVO.setPicUrl(null); |
| 204 | 203 | reqVO.setStatus(null); |
| 205 | - reqVO.setBeginCreateTime(null); | |
| 206 | - reqVO.setEndCreateTime(null); | |
| 204 | + reqVO.setCreateTime(null); | |
| 207 | 205 | |
| 208 | 206 | // 调用 |
| 209 | 207 | List<ProductSkuDO> list = ProductSkuService.getSkuList(reqVO); | ... | ... |
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 { |
| 155 | 155 | reqVO.setPrice(null); |
| 156 | 156 | reqVO.setQuantity(null); |
| 157 | 157 | reqVO.setStatus(null); |
| 158 | - reqVO.setBeginCreateTime(null); | |
| 159 | - reqVO.setEndCreateTime(null); | |
| 158 | + reqVO.setCreateTime(null); | |
| 160 | 159 | |
| 161 | 160 | // 调用 |
| 162 | 161 | PageResult<SpuRespVO> pageResult = spuService.getSpuPage(reqVO); |
| ... | ... | @@ -218,8 +217,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 218 | 217 | reqVO.setPrice(null); |
| 219 | 218 | reqVO.setQuantity(null); |
| 220 | 219 | reqVO.setStatus(null); |
| 221 | - reqVO.setBeginCreateTime(null); | |
| 222 | - reqVO.setEndCreateTime(null); | |
| 220 | + reqVO.setCreateTime(null); | |
| 223 | 221 | |
| 224 | 222 | // 调用 |
| 225 | 223 | List<ProductSpuDO> list = spuService.getSpuList(reqVO); | ... | ... |
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; |
| 19 | 19 | |
| 20 | 20 | import javax.annotation.Resource; |
| 21 | 21 | import java.util.Collections; |
| 22 | +import java.util.Date; | |
| 22 | 23 | import java.util.List; |
| 23 | 24 | |
| 24 | 25 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; |
| ... | ... | @@ -162,8 +163,7 @@ public class PayAppServiceTest extends BaseDbUnitTest { |
| 162 | 163 | reqVO.setPayNotifyUrl("https://www.hc.com"); |
| 163 | 164 | reqVO.setRefundNotifyUrl("https://www.xm.com"); |
| 164 | 165 | reqVO.setMerchantName(dbMerchant.getName()); |
| 165 | - reqVO.setBeginCreateTime(buildTime(2021,11,19)); | |
| 166 | - reqVO.setEndCreateTime(buildTime(2021,11,21)); | |
| 166 | + reqVO.setCreateTime((new Date[]{buildTime(2021,11,19),buildTime(2021,11,21)})); | |
| 167 | 167 | |
| 168 | 168 | // 调用 |
| 169 | 169 | PageResult<PayAppDO> pageResult = appService.getAppPage(reqVO); |
| ... | ... | @@ -226,8 +226,7 @@ public class PayAppServiceTest extends BaseDbUnitTest { |
| 226 | 226 | reqVO.setPayNotifyUrl("https://www.hc.com"); |
| 227 | 227 | reqVO.setRefundNotifyUrl("https://www.xm.com"); |
| 228 | 228 | reqVO.setMerchantName(dbMerchant.getName()); |
| 229 | - reqVO.setBeginCreateTime(buildTime(2021,11,19)); | |
| 230 | - reqVO.setEndCreateTime(buildTime(2021,11,21)); | |
| 229 | + reqVO.setCreateTime((new Date[]{buildTime(2021,11,19),buildTime(2021,11,21)})); | |
| 231 | 230 | |
| 232 | 231 | // 调用 |
| 233 | 232 | List<PayAppDO> list = appService.getAppList(reqVO); | ... | ... |
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; |
| 20 | 20 | |
| 21 | 21 | import javax.annotation.Resource; |
| 22 | 22 | import javax.validation.Validator; |
| 23 | +import java.util.Date; | |
| 23 | 24 | import java.util.List; |
| 24 | 25 | |
| 25 | 26 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; |
| ... | ... | @@ -263,8 +264,7 @@ public class PayChannelServiceTest extends BaseDbUnitTest { |
| 263 | 264 | reqVO.setMerchantId(1L); |
| 264 | 265 | reqVO.setAppId(1L); |
| 265 | 266 | reqVO.setConfig(JSON.toJSONString(payClientConfig)); |
| 266 | - reqVO.setBeginCreateTime(buildTime(2021,11,19)); | |
| 267 | - reqVO.setEndCreateTime(buildTime(2021,11,21)); | |
| 267 | + reqVO.setCreateTime((new Date[]{buildTime(2021,11,19),buildTime(2021,11,21)})); | |
| 268 | 268 | |
| 269 | 269 | // 调用 |
| 270 | 270 | PageResult<PayChannelDO> pageResult = channelService.getChannelPage(reqVO); |
| ... | ... | @@ -337,8 +337,7 @@ public class PayChannelServiceTest extends BaseDbUnitTest { |
| 337 | 337 | reqVO.setMerchantId(1L); |
| 338 | 338 | reqVO.setAppId(1L); |
| 339 | 339 | reqVO.setConfig(JSON.toJSONString(payClientConfig)); |
| 340 | - reqVO.setBeginCreateTime(buildTime(2021,11,19)); | |
| 341 | - reqVO.setEndCreateTime(buildTime(2021,11,21)); | |
| 340 | + reqVO.setCreateTime((new Date[]{buildTime(2021,11,19),buildTime(2021,11,21)})); | |
| 342 | 341 | |
| 343 | 342 | // 调用 |
| 344 | 343 | List<PayChannelDO> list = channelService.getChannelList(reqVO); | ... | ... |
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; |
| 14 | 14 | import org.springframework.context.annotation.Import; |
| 15 | 15 | |
| 16 | 16 | import javax.annotation.Resource; |
| 17 | +import java.util.Date; | |
| 17 | 18 | import java.util.List; |
| 18 | 19 | |
| 19 | 20 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; |
| ... | ... | @@ -137,8 +138,7 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { |
| 137 | 138 | reqVO.setShortName("灿灿子"); |
| 138 | 139 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 139 | 140 | reqVO.setRemark("灿哥的杂货铺"); |
| 140 | - reqVO.setBeginCreateTime(buildTime(2021,11,2)); | |
| 141 | - reqVO.setEndCreateTime(buildTime(2021,11,4)); | |
| 141 | + reqVO.setCreateTime((new Date[]{buildTime(2021,11,2),buildTime(2021,11,4)})); | |
| 142 | 142 | |
| 143 | 143 | // 调用 |
| 144 | 144 | PageResult<PayMerchantDO> pageResult = merchantService.getMerchantPage(reqVO); |
| ... | ... | @@ -179,8 +179,7 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { |
| 179 | 179 | reqVO.setShortName("灿灿子"); |
| 180 | 180 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 181 | 181 | reqVO.setRemark("灿哥的杂货铺"); |
| 182 | - reqVO.setBeginCreateTime(buildTime(2021,11,2)); | |
| 183 | - reqVO.setEndCreateTime(buildTime(2021,11,4)); | |
| 182 | + reqVO.setCreateTime((new Date[]{buildTime(2021,11,2),buildTime(2021,11,4)})); | |
| 184 | 183 | |
| 185 | 184 | // 调用 |
| 186 | 185 | List<PayMerchantDO> list = merchantService.getMerchantList(reqVO); | ... | ... |
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; |
| 26 | 26 | import java.util.Date; |
| 27 | 27 | import java.util.List; |
| 28 | 28 | |
| 29 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | |
| 29 | 30 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 30 | 31 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| 31 | 32 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; |
| ... | ... | @@ -124,9 +125,7 @@ public class PayOrderServiceTest extends BaseDbUnitTest { |
| 124 | 125 | reqVO.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); |
| 125 | 126 | reqVO.setStatus(PayOrderStatusEnum.SUCCESS.getStatus()); |
| 126 | 127 | reqVO.setRefundStatus(PayRefundTypeEnum.NO.getStatus()); |
| 127 | - reqVO.setBeginCreateTime(DateUtils.buildTime(2018, 1, 1, 10, 1, 0)); | |
| 128 | - reqVO.setEndCreateTime(DateUtils.buildTime(2018, 1, 1, 10, 1, 0)); | |
| 129 | - | |
| 128 | + reqVO.setCreateTime((new Date[]{buildTime(2018, 1, 1, 10, 1, 0),buildTime(2018, 1, 1, 10, 1, 0)})); | |
| 130 | 129 | // 调用 |
| 131 | 130 | PageResult<PayOrderDO> pageResult = orderService.getOrderPage(reqVO); |
| 132 | 131 | // 断言 |
| ... | ... | @@ -199,8 +198,7 @@ public class PayOrderServiceTest extends BaseDbUnitTest { |
| 199 | 198 | reqVO.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); |
| 200 | 199 | reqVO.setStatus(PayOrderStatusEnum.SUCCESS.getStatus()); |
| 201 | 200 | reqVO.setRefundStatus(PayRefundTypeEnum.NO.getStatus()); |
| 202 | - reqVO.setBeginCreateTime(DateUtils.buildTime(2018, 1, 1, 10, 1, 0)); | |
| 203 | - reqVO.setEndCreateTime(DateUtils.buildTime(2018, 1, 1, 10, 1, 0)); | |
| 201 | + reqVO.setCreateTime((new Date[]{buildTime(2018, 1, 1, 10, 1, 0),buildTime(2018, 1, 1, 10, 1, 0)})); | |
| 204 | 202 | |
| 205 | 203 | // 调用 |
| 206 | 204 | List<PayOrderDO> list = orderService.getOrderList(reqVO); | ... | ... |
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; |
| 22 | 22 | import org.springframework.context.annotation.Import; |
| 23 | 23 | |
| 24 | 24 | import javax.annotation.Resource; |
| 25 | +import java.util.Date; | |
| 25 | 26 | import java.util.List; |
| 26 | 27 | |
| 28 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | |
| 27 | 29 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 28 | 30 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| 29 | 31 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; |
| ... | ... | @@ -110,9 +112,7 @@ public class PayRefundServiceTest extends BaseDbUnitTest { |
| 110 | 112 | reqVO.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); |
| 111 | 113 | reqVO.setStatus(PayRefundStatusEnum.SUCCESS.getStatus()); |
| 112 | 114 | reqVO.setType(PayRefundTypeEnum.SOME.getStatus()); |
| 113 | - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 1, 1, 10, 10, 10)); | |
| 114 | - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 1, 1, 10, 10, 12)); | |
| 115 | - | |
| 115 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 1, 10, 10, 10),buildTime(2021, 1, 1, 10, 10, 12)})); | |
| 116 | 116 | |
| 117 | 117 | // 调用 |
| 118 | 118 | PageResult<PayRefundDO> pageResult = refundService.getRefundPage(reqVO); |
| ... | ... | @@ -182,8 +182,7 @@ public class PayRefundServiceTest extends BaseDbUnitTest { |
| 182 | 182 | reqVO.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); |
| 183 | 183 | reqVO.setStatus(PayRefundStatusEnum.SUCCESS.getStatus()); |
| 184 | 184 | reqVO.setType(PayRefundTypeEnum.SOME.getStatus()); |
| 185 | - reqVO.setBeginCreateTime(DateUtils.buildTime(2021, 1, 1, 10, 10, 10)); | |
| 186 | - reqVO.setEndCreateTime(DateUtils.buildTime(2021, 1, 1, 10, 10, 12)); | |
| 185 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 1, 10, 10, 10),buildTime(2021, 1, 1, 10, 10, 12)})); | |
| 187 | 186 | |
| 188 | 187 | // 调用 |
| 189 | 188 | List<PayRefundDO> list = refundService.getRefundList(reqVO); | ... | ... |
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; |
| 16 | 16 | import org.springframework.context.annotation.Import; |
| 17 | 17 | |
| 18 | 18 | import javax.annotation.Resource; |
| 19 | +import java.util.Date; | |
| 19 | 20 | import java.util.List; |
| 20 | 21 | import java.util.function.Consumer; |
| 21 | 22 | |
| ... | ... | @@ -63,8 +64,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest { |
| 63 | 64 | reqVO.setName("nai"); |
| 64 | 65 | reqVO.setType("艿"); |
| 65 | 66 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 66 | - reqVO.setBeginCreateTime(buildTime(2021, 1, 10)); | |
| 67 | - reqVO.setEndCreateTime(buildTime(2021, 1, 20)); | |
| 67 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 10),buildTime(2021, 1, 20)})); | |
| 68 | 68 | |
| 69 | 69 | // 调用 |
| 70 | 70 | PageResult<DictTypeDO> pageResult = dictTypeService.getDictTypePage(reqVO); |
| ... | ... | @@ -97,8 +97,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest { |
| 97 | 97 | reqVO.setName("nai"); |
| 98 | 98 | reqVO.setType("艿"); |
| 99 | 99 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 100 | - reqVO.setBeginCreateTime(buildTime(2021, 1, 10)); | |
| 101 | - reqVO.setEndCreateTime(buildTime(2021, 1, 20)); | |
| 100 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 1, 10),buildTime(2021, 1, 20)})); | |
| 102 | 101 | |
| 103 | 102 | // 调用 |
| 104 | 103 | List<DictTypeDO> list = dictTypeService.getDictTypeList(reqVO); | ... | ... |
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; |
| 17 | 17 | import org.springframework.context.annotation.Import; |
| 18 | 18 | |
| 19 | 19 | import javax.annotation.Resource; |
| 20 | +import java.util.Date; | |
| 20 | 21 | import java.util.List; |
| 21 | 22 | import java.util.function.Consumer; |
| 22 | 23 | |
| ... | ... | @@ -95,8 +96,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { |
| 95 | 96 | reqVO.setApplicationName("tu"); |
| 96 | 97 | reqVO.setCode(1); |
| 97 | 98 | reqVO.setMessage("ma"); |
| 98 | - reqVO.setBeginCreateTime(buildTime(2020, 11, 1)); | |
| 99 | - reqVO.setEndCreateTime(buildTime(2020, 11, 30)); | |
| 99 | + reqVO.setCreateTime((new Date[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); | |
| 100 | 100 | |
| 101 | 101 | // 调用 |
| 102 | 102 | PageResult<ErrorCodeDO> pageResult = errorCodeService.getErrorCodePage(reqVO); |
| ... | ... | @@ -141,8 +141,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { |
| 141 | 141 | reqVO.setApplicationName("tu"); |
| 142 | 142 | reqVO.setCode(1); |
| 143 | 143 | reqVO.setMessage("ma"); |
| 144 | - reqVO.setBeginCreateTime(buildTime(2020, 11, 1)); | |
| 145 | - reqVO.setEndCreateTime(buildTime(2020, 11, 30)); | |
| 144 | + reqVO.setCreateTime((new Date[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); | |
| 146 | 145 | |
| 147 | 146 | // 调用 |
| 148 | 147 | List<ErrorCodeDO> list = errorCodeService.getErrorCodeList(reqVO); | ... | ... |
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; |
| 18 | 18 | import org.springframework.context.annotation.Import; |
| 19 | 19 | |
| 20 | 20 | import javax.annotation.Resource; |
| 21 | +import java.util.Date; | |
| 21 | 22 | import java.util.List; |
| 22 | 23 | |
| 23 | 24 | import static cn.hutool.core.util.RandomUtil.randomEle; |
| ... | ... | @@ -66,8 +67,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { |
| 66 | 67 | reqVO.setUsername("wangkai"); |
| 67 | 68 | reqVO.setUserIp("192.168.199"); |
| 68 | 69 | reqVO.setStatus(true); |
| 69 | - reqVO.setBeginTime(buildTime(2021, 3, 5)); | |
| 70 | - reqVO.setEndTime(buildTime(2021, 3, 7)); | |
| 70 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 3, 5),buildTime(2021, 3, 5)})); | |
| 71 | 71 | |
| 72 | 72 | // 调用service方法 |
| 73 | 73 | PageResult<LoginLogDO> pageResult = loginLogService.getLoginLogPage(reqVO); |
| ... | ... | @@ -105,15 +105,12 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { |
| 105 | 105 | // 构造一个早期时间 2021-02-06 00:00:00 |
| 106 | 106 | loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setCreateTime(buildTime(2021, 2, 6)))); |
| 107 | 107 | |
| 108 | - | |
| 109 | 108 | // 构造调用参数 |
| 110 | 109 | LoginLogExportReqVO reqVO = new LoginLogExportReqVO(); |
| 111 | 110 | reqVO.setUsername("wangxiaokai"); |
| 112 | 111 | reqVO.setUserIp("192.168.111"); |
| 113 | 112 | reqVO.setStatus(true); |
| 114 | - reqVO.setBeginTime(buildTime(2021, 3, 5)); | |
| 115 | - reqVO.setEndTime(buildTime(2021, 3, 7)); | |
| 116 | - | |
| 113 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 3, 5),buildTime(2021, 3, 5)})); | |
| 117 | 114 | |
| 118 | 115 | // 调用service方法 |
| 119 | 116 | List<LoginLogDO> loginLogList = loginLogService.getLoginLogList(reqVO); | ... | ... |
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; |
| 24 | 24 | |
| 25 | 25 | import javax.annotation.Resource; |
| 26 | 26 | import java.util.Collections; |
| 27 | +import java.util.Date; | |
| 27 | 28 | import java.util.List; |
| 28 | 29 | |
| 29 | 30 | import static cn.hutool.core.util.RandomUtil.randomEle; |
| ... | ... | @@ -103,8 +104,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { |
| 103 | 104 | reqVO.setUserNickname("wangkai"); |
| 104 | 105 | reqVO.setModule("order"); |
| 105 | 106 | reqVO.setType(OperateTypeEnum.CREATE.getType()); |
| 106 | - reqVO.setBeginTime(buildTime(2021, 3, 5)); | |
| 107 | - reqVO.setEndTime(buildTime(2021, 3, 7)); | |
| 107 | + reqVO.setStartTime((new Date[]{buildTime(2021, 3, 5),buildTime(2021, 3, 7)})); | |
| 108 | 108 | reqVO.setSuccess(true); |
| 109 | 109 | |
| 110 | 110 | // 调用service方法 |
| ... | ... | @@ -155,8 +155,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { |
| 155 | 155 | reqVO.setUserNickname("wangkai"); |
| 156 | 156 | reqVO.setModule("order"); |
| 157 | 157 | reqVO.setType(OperateTypeEnum.CREATE.getType()); |
| 158 | - reqVO.setBeginTime(buildTime(2021, 3, 5)); | |
| 159 | - reqVO.setEndTime(buildTime(2021, 3, 7)); | |
| 158 | + reqVO.setStartTime((new Date[]{buildTime(2021, 3, 5),buildTime(2021, 3, 7)})); | |
| 160 | 159 | reqVO.setSuccess(true); |
| 161 | 160 | |
| 162 | 161 | // 调用 service 方法 | ... | ... |
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; |
| 22 | 22 | import java.util.*; |
| 23 | 23 | import java.util.stream.Collectors; |
| 24 | 24 | |
| 25 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | |
| 25 | 26 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 26 | 27 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; |
| 27 | 28 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| ... | ... | @@ -178,8 +179,7 @@ public class RoleServiceTest extends BaseDbUnitTest { |
| 178 | 179 | reqVO.setName("土豆"); |
| 179 | 180 | reqVO.setCode("tu"); |
| 180 | 181 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 181 | - reqVO.setBeginTime(DateUtils.buildTime(2022, 2, 1)); | |
| 182 | - reqVO.setEndTime(DateUtils.buildTime(2022, 2, 12)); | |
| 182 | + reqVO.setCreateTime((new Date[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); | |
| 183 | 183 | |
| 184 | 184 | // 调用 |
| 185 | 185 | List<RoleDO> list = roleService.getRoleList(reqVO); |
| ... | ... | @@ -209,8 +209,7 @@ public class RoleServiceTest extends BaseDbUnitTest { |
| 209 | 209 | reqVO.setName("土豆"); |
| 210 | 210 | reqVO.setCode("tu"); |
| 211 | 211 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 212 | - reqVO.setBeginTime(DateUtils.buildTime(2022, 2, 1)); | |
| 213 | - reqVO.setEndTime(DateUtils.buildTime(2022, 2, 12)); | |
| 212 | + reqVO.setCreateTime((new Date[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); | |
| 214 | 213 | |
| 215 | 214 | // 调用 |
| 216 | 215 | PageResult<RoleDO> pageResult = roleService.getRolePage(reqVO); | ... | ... |
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; |
| 18 | 18 | |
| 19 | 19 | import javax.annotation.Resource; |
| 20 | 20 | import java.util.Arrays; |
| 21 | +import java.util.Date; | |
| 21 | 22 | import java.util.List; |
| 22 | 23 | |
| 24 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | |
| 23 | 25 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 24 | 26 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; |
| 25 | 27 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| ... | ... | @@ -157,8 +159,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { |
| 157 | 159 | reqVO.setName("笨"); |
| 158 | 160 | reqVO.setTag("论坛"); |
| 159 | 161 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 160 | - reqVO.setBeginCreateTime(DateUtils.buildTime(2022, 2, 1)); | |
| 161 | - reqVO.setEndCreateTime(DateUtils.buildTime(2022, 2, 12)); | |
| 162 | + reqVO.setCreateTime((new Date[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); | |
| 162 | 163 | |
| 163 | 164 | // 调用 |
| 164 | 165 | PageResult<SensitiveWordDO> pageResult = sensitiveWordService.getSensitiveWordPage(reqVO); |
| ... | ... | @@ -189,8 +190,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { |
| 189 | 190 | reqVO.setName("笨"); |
| 190 | 191 | reqVO.setTag("论坛"); |
| 191 | 192 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 192 | - reqVO.setBeginCreateTime(DateUtils.buildTime(2022, 2, 1)); | |
| 193 | - reqVO.setEndCreateTime(DateUtils.buildTime(2022, 2, 12)); | |
| 193 | + reqVO.setCreateTime((new Date[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); | |
| 194 | 194 | |
| 195 | 195 | // 调用 |
| 196 | 196 | List<SensitiveWordDO> list = sensitiveWordService.getSensitiveWordList(reqVO); | ... | ... |
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 { |
| 172 | 172 | SmsChannelPageReqVO reqVO = new SmsChannelPageReqVO(); |
| 173 | 173 | reqVO.setSignature("芋道"); |
| 174 | 174 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 175 | - reqVO.setBeginCreateTime(buildTime(2020, 12, 1)); | |
| 176 | - reqVO.setEndCreateTime(buildTime(2020, 12, 24)); | |
| 175 | + reqVO.setCreateTime((new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)})); | |
| 177 | 176 | |
| 178 | 177 | // 调用 |
| 179 | 178 | PageResult<SmsChannelDO> pageResult = smsChannelService.getSmsChannelPage(reqVO); | ... | ... |
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 { |
| 74 | 74 | reqVO.setTemplateId(10L); |
| 75 | 75 | reqVO.setMobile("156"); |
| 76 | 76 | reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); |
| 77 | - reqVO.setBeginSendTime(buildTime(2020, 11, 1)); | |
| 78 | - reqVO.setEndSendTime(buildTime(2020, 11, 30)); | |
| 77 | + reqVO.setSendTime((new Date[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); | |
| 79 | 78 | reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); |
| 80 | - reqVO.setBeginReceiveTime(buildTime(2021, 11, 1)); | |
| 81 | - reqVO.setEndReceiveTime(buildTime(2021, 11, 30)); | |
| 79 | + reqVO.setReceiveTime((new Date[]{buildTime(2021, 11, 1),buildTime(2021, 11, 30)})); | |
| 82 | 80 | |
| 83 | 81 | // 调用 |
| 84 | 82 | PageResult<SmsLogDO> pageResult = smsLogService.getSmsLogPage(reqVO); |
| ... | ... | @@ -121,11 +119,9 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 121 | 119 | reqVO.setTemplateId(10L); |
| 122 | 120 | reqVO.setMobile("156"); |
| 123 | 121 | reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); |
| 124 | - reqVO.setBeginSendTime(buildTime(2020, 11, 1)); | |
| 125 | - reqVO.setEndSendTime(buildTime(2020, 11, 30)); | |
| 122 | + reqVO.setSendTime((new Date[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); | |
| 126 | 123 | reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); |
| 127 | - reqVO.setBeginReceiveTime(buildTime(2021, 11, 1)); | |
| 128 | - reqVO.setEndReceiveTime(buildTime(2021, 11, 30)); | |
| 124 | + reqVO.setReceiveTime((new Date[]{buildTime(2021, 11, 1),buildTime(2021, 11, 30)})); | |
| 129 | 125 | |
| 130 | 126 | // 调用 |
| 131 | 127 | List<SmsLogDO> list = smsLogService.getSmsLogList(reqVO); | ... | ... |
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 { |
| 230 | 230 | reqVO.setContent("芋道"); |
| 231 | 231 | reqVO.setApiTemplateId("yu"); |
| 232 | 232 | reqVO.setChannelId(1L); |
| 233 | - reqVO.setBeginCreateTime(buildTime(2021, 11, 1)); | |
| 234 | - reqVO.setEndCreateTime(buildTime(2021, 12, 1)); | |
| 233 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 1),buildTime(2021, 12, 1)})); | |
| 235 | 234 | |
| 236 | 235 | // 调用 |
| 237 | 236 | PageResult<SmsTemplateDO> pageResult = smsTemplateService.getSmsTemplatePage(reqVO); |
| ... | ... | @@ -276,8 +275,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { |
| 276 | 275 | reqVO.setContent("芋道"); |
| 277 | 276 | reqVO.setApiTemplateId("yu"); |
| 278 | 277 | reqVO.setChannelId(1L); |
| 279 | - reqVO.setBeginCreateTime(buildTime(2021, 11, 1)); | |
| 280 | - reqVO.setEndCreateTime(buildTime(2021, 12, 1)); | |
| 278 | + reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 1),buildTime(2021, 12, 1)})); | |
| 281 | 279 | |
| 282 | 280 | // 调用 |
| 283 | 281 | List<SmsTemplateDO> list = smsTemplateService.getSmsTemplateList(reqVO); | ... | ... |
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; |
| 15 | 15 | |
| 16 | 16 | import javax.annotation.Resource; |
| 17 | 17 | |
| 18 | +import java.util.Date; | |
| 19 | + | |
| 18 | 20 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; |
| 19 | 21 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 20 | 22 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| ... | ... | @@ -156,8 +158,7 @@ public class TenantPackageServiceImplTest extends BaseDbUnitTest { |
| 156 | 158 | reqVO.setName("芋道"); |
| 157 | 159 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 158 | 160 | reqVO.setRemark("源码"); |
| 159 | - reqVO.setBeginCreateTime(buildTime(2022, 10, 9)); | |
| 160 | - reqVO.setEndCreateTime(buildTime(2022, 10, 11)); | |
| 161 | + reqVO.setCreateTime((new Date[]{buildTime(2022, 10, 9),buildTime(2022, 10, 11)})); | |
| 161 | 162 | |
| 162 | 163 | // 调用 |
| 163 | 164 | PageResult<TenantPackageDO> pageResult = tenantPackageService.getTenantPackagePage(reqVO); | ... | ... |
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; |
| 31 | 31 | import java.time.Duration; |
| 32 | 32 | import java.util.Arrays; |
| 33 | 33 | import java.util.Collections; |
| 34 | +import java.util.Date; | |
| 34 | 35 | import java.util.List; |
| 35 | 36 | |
| 36 | 37 | import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; |
| ... | ... | @@ -311,8 +312,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest { |
| 311 | 312 | reqVO.setContactName("艿"); |
| 312 | 313 | reqVO.setContactMobile("1560"); |
| 313 | 314 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 314 | - reqVO.setBeginCreateTime(buildTime(2020, 12, 1)); | |
| 315 | - reqVO.setEndCreateTime(buildTime(2020, 12, 24)); | |
| 315 | + reqVO.setCreateTime(new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)}); | |
| 316 | 316 | |
| 317 | 317 | // 调用 |
| 318 | 318 | PageResult<TenantDO> pageResult = tenantService.getTenantPage(reqVO); |
| ... | ... | @@ -349,8 +349,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest { |
| 349 | 349 | reqVO.setContactName("艿"); |
| 350 | 350 | reqVO.setContactMobile("1560"); |
| 351 | 351 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 352 | - reqVO.setBeginCreateTime(buildTime(2020, 12, 1)); | |
| 353 | - reqVO.setEndCreateTime(buildTime(2020, 12, 24)); | |
| 352 | + reqVO.setCreateTime(new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)}); | |
| 354 | 353 | |
| 355 | 354 | // 调用 |
| 356 | 355 | List<TenantDO> list = tenantService.getTenantList(reqVO); | ... | ... |
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; |
| 33 | 33 | import javax.annotation.Resource; |
| 34 | 34 | import java.io.ByteArrayInputStream; |
| 35 | 35 | import java.util.Collection; |
| 36 | +import java.util.Date; | |
| 36 | 37 | import java.util.List; |
| 37 | 38 | import java.util.function.Consumer; |
| 38 | 39 | |
| ... | ... | @@ -294,8 +295,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { |
| 294 | 295 | reqVO.setUsername("tu"); |
| 295 | 296 | reqVO.setMobile("1560"); |
| 296 | 297 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 297 | - reqVO.setBeginTime(buildTime(2020, 12, 1)); | |
| 298 | - reqVO.setEndTime(buildTime(2020, 12, 24)); | |
| 298 | + reqVO.setCreateTime((new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)})); | |
| 299 | 299 | reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 |
| 300 | 300 | // mock 方法 |
| 301 | 301 | List<DeptDO> deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L))); |
| ... | ... | @@ -318,8 +318,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { |
| 318 | 318 | reqVO.setUsername("tu"); |
| 319 | 319 | reqVO.setMobile("1560"); |
| 320 | 320 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 321 | - reqVO.setBeginTime(buildTime(2020, 12, 1)); | |
| 322 | - reqVO.setEndTime(buildTime(2020, 12, 24)); | |
| 321 | + reqVO.setCreateTime((new Date[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)})); | |
| 323 | 322 | reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 |
| 324 | 323 | // mock 方法 |
| 325 | 324 | List<DeptDO> deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L))); | ... | ... |