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);