refactor: 用户分页接口优化,添加创建时间范围查询参数

This commit is contained in:
haoxr
2023-10-17 21:50:55 +08:00
parent b6ee9d913a
commit 652bc18fd2
5 changed files with 58 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
package com.youlai.system.common.util;
import cn.hutool.core.collection.CollectionUtil;
import java.util.List;
/**
* 日期工具类
*
* @author haoxr
* @since 2.4.2
*/
public class DateUtils {
/**
* 格式化日期范围
*
* @param createTimeRange
* @return
*/
public static List<String> formatDateRange(List<String> createTimeRange) {
if (CollectionUtil.isNotEmpty(createTimeRange) && createTimeRange.size() == 2) {
createTimeRange.set(0, createTimeRange.get(0) + " 00:00:00");
createTimeRange.set(1, createTimeRange.get(1) + " 23:59:59");
return createTimeRange;
} else {
return null;
}
}
}