This commit is contained in:
2026-08-14 09:04:58 +08:00
parent 863c4f5c13
commit ea13c4ea7c
16 changed files with 74 additions and 69 deletions
@@ -1,5 +1,6 @@
package com.yunhai.bschclassmanage.utils;
import com.yunhai.platform.utils.exception.DException;
import org.apache.http.client.utils.DateUtils;
import java.time.DayOfWeek;
@@ -39,7 +40,7 @@ public class DateRangeUtil {
break;
default:
throw new IllegalArgumentException("不支持的type类型: " + type);
throw new DException("不支持的type类型: " + type);
}
return result;
@@ -144,7 +144,7 @@ public class OtherUtil {
public static <T extends BaseEntity> void setBaseEntityValue(UserContext.UserInfo user, T entity) {
if (user == null || entity == null) {
throw new IllegalArgumentException("参数不能为null");
throw new DException("参数不能为null");
}
Date now = new Date();
Integer userId = user.getUserId();
@@ -31,7 +31,7 @@ public class ValidationUtil {
*/
public static List<String> validateMsgs(Object object) {
if (object == null) {
return new ArrayList<>(); // 或 throw new IllegalArgumentException("校验对象不能为空")
return new ArrayList<>(); // 或 throw new DException("校验对象不能为空")
}
Set<ConstraintViolation<Object>> violations = validator.validate(object);
if (violations.isEmpty()) {