From 94383b9e230621d5b7809397627157a8d6d9bfdd Mon Sep 17 00:00:00 2001 From: easonzhu Date: Thu, 6 Feb 2025 19:32:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/upchina/common/filter/AuthFilter.java | 6 +++++- .../com/upchina/group/constant/QueryGroupMessageType.java | 5 ++++- .../group/query/message/ListGroupMessageAppQuery.java | 5 +++++ .../com/upchina/video/service/app/AppVideoInfoService.java | 3 ++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/upchina/common/filter/AuthFilter.java b/src/main/java/com/upchina/common/filter/AuthFilter.java index 3f38efa..99afb09 100644 --- a/src/main/java/com/upchina/common/filter/AuthFilter.java +++ b/src/main/java/com/upchina/common/filter/AuthFilter.java @@ -112,7 +112,10 @@ public class AuthFilter implements Filter { if (expireCheck(req, resp, token)) { return; } - if (frontUserVO.getClientType() == ClientType.H5.value() || frontUserVO.getClientType() == ClientType.Web.value()) { + if (frontUserVO.getClientType() == null) { + handlerExceptionResolver.resolveException(req, resp, null, new BizException(ResponseStatus.TOKEN_DATA_ERROR)); + return; + } else if (frontUserVO.getClientType() == ClientType.H5.value() || frontUserVO.getClientType() == ClientType.Web.value()) { if (StrUtil.isBlank(frontUserVO.getReCookie()) || StrUtil.isBlank(frontUserVO.getCookie())) { handlerExceptionResolver.resolveException(req, resp, null, new BizException(ResponseStatus.TOKEN_DATA_ERROR)); return; @@ -206,4 +209,5 @@ public class AuthFilter implements Filter { } return JSON.parseObject(user, BackendUserVO.class); } + } diff --git a/src/main/java/com/upchina/group/constant/QueryGroupMessageType.java b/src/main/java/com/upchina/group/constant/QueryGroupMessageType.java index 48223c7..73d658a 100644 --- a/src/main/java/com/upchina/group/constant/QueryGroupMessageType.java +++ b/src/main/java/com/upchina/group/constant/QueryGroupMessageType.java @@ -1,5 +1,8 @@ package com.upchina.group.constant; +import com.upchina.common.handler.BizException; +import com.upchina.common.result.ResponseStatus; + //查询类型:1全部;2投顾;3用户;4精选 public enum QueryGroupMessageType { ALL(1, "全部"), @@ -19,7 +22,7 @@ public enum QueryGroupMessageType { public static QueryGroupMessageType fromValue(Integer value) { if (value == null) { - return null; + throw new BizException(ResponseStatus.PARM_ERROR, "消息类型错误"); } for (QueryGroupMessageType type : values()) { if (type.value.equals(value)) { diff --git a/src/main/java/com/upchina/group/query/message/ListGroupMessageAppQuery.java b/src/main/java/com/upchina/group/query/message/ListGroupMessageAppQuery.java index 6630b61..23f9460 100644 --- a/src/main/java/com/upchina/group/query/message/ListGroupMessageAppQuery.java +++ b/src/main/java/com/upchina/group/query/message/ListGroupMessageAppQuery.java @@ -2,6 +2,8 @@ package com.upchina.group.query.message; import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; public class ListGroupMessageAppQuery { @@ -14,6 +16,9 @@ public class ListGroupMessageAppQuery { private Integer lastId; @ApiModelProperty("查询类型:1全部;2投顾;3用户;4精选;5私聊") + @NotNull + @Min(1) + @Max(5) private Integer type; @ApiModelProperty("每页大小") diff --git a/src/main/java/com/upchina/video/service/app/AppVideoInfoService.java b/src/main/java/com/upchina/video/service/app/AppVideoInfoService.java index 0903380..a117abc 100644 --- a/src/main/java/com/upchina/video/service/app/AppVideoInfoService.java +++ b/src/main/java/com/upchina/video/service/app/AppVideoInfoService.java @@ -404,7 +404,8 @@ public class AppVideoInfoService { List advisorIds = vos.stream().map(AdvisorInfoAppVO::getId).collect(Collectors.toList()); List videoList = videoCacheService.getVideoList(); List videoPlanList = videoList.stream() - .filter(item -> item.getStartTime().toLocalDate().equals(LocalDate.now())) + .filter(item -> item != null && item.getStartTime() != null && + item.getStartTime().toLocalDate().equals(LocalDate.now())) .collect(Collectors.toList()); SortedSet sortedSet = new TreeSet<>(AbstractVideoSortComparator.VIDEO_COMP_PLAN_LIST);