完善空指针异常处理
This commit is contained in:
parent
9604c14dce
commit
94383b9e23
@ -112,7 +112,10 @@ public class AuthFilter implements Filter {
|
|||||||
if (expireCheck(req, resp, token)) {
|
if (expireCheck(req, resp, token)) {
|
||||||
return;
|
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())) {
|
if (StrUtil.isBlank(frontUserVO.getReCookie()) || StrUtil.isBlank(frontUserVO.getCookie())) {
|
||||||
handlerExceptionResolver.resolveException(req, resp, null, new BizException(ResponseStatus.TOKEN_DATA_ERROR));
|
handlerExceptionResolver.resolveException(req, resp, null, new BizException(ResponseStatus.TOKEN_DATA_ERROR));
|
||||||
return;
|
return;
|
||||||
@ -206,4 +209,5 @@ public class AuthFilter implements Filter {
|
|||||||
}
|
}
|
||||||
return JSON.parseObject(user, BackendUserVO.class);
|
return JSON.parseObject(user, BackendUserVO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
package com.upchina.group.constant;
|
package com.upchina.group.constant;
|
||||||
|
|
||||||
|
import com.upchina.common.handler.BizException;
|
||||||
|
import com.upchina.common.result.ResponseStatus;
|
||||||
|
|
||||||
//查询类型:1全部;2投顾;3用户;4精选
|
//查询类型:1全部;2投顾;3用户;4精选
|
||||||
public enum QueryGroupMessageType {
|
public enum QueryGroupMessageType {
|
||||||
ALL(1, "全部"),
|
ALL(1, "全部"),
|
||||||
@ -19,7 +22,7 @@ public enum QueryGroupMessageType {
|
|||||||
|
|
||||||
public static QueryGroupMessageType fromValue(Integer value) {
|
public static QueryGroupMessageType fromValue(Integer value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return null;
|
throw new BizException(ResponseStatus.PARM_ERROR, "消息类型错误");
|
||||||
}
|
}
|
||||||
for (QueryGroupMessageType type : values()) {
|
for (QueryGroupMessageType type : values()) {
|
||||||
if (type.value.equals(value)) {
|
if (type.value.equals(value)) {
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package com.upchina.group.query.message;
|
|||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Max;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
public class ListGroupMessageAppQuery {
|
public class ListGroupMessageAppQuery {
|
||||||
@ -14,6 +16,9 @@ public class ListGroupMessageAppQuery {
|
|||||||
private Integer lastId;
|
private Integer lastId;
|
||||||
|
|
||||||
@ApiModelProperty("查询类型:1全部;2投顾;3用户;4精选;5私聊")
|
@ApiModelProperty("查询类型:1全部;2投顾;3用户;4精选;5私聊")
|
||||||
|
@NotNull
|
||||||
|
@Min(1)
|
||||||
|
@Max(5)
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty("每页大小")
|
@ApiModelProperty("每页大小")
|
||||||
|
|||||||
@ -404,7 +404,8 @@ public class AppVideoInfoService {
|
|||||||
List<Integer> advisorIds = vos.stream().map(AdvisorInfoAppVO::getId).collect(Collectors.toList());
|
List<Integer> advisorIds = vos.stream().map(AdvisorInfoAppVO::getId).collect(Collectors.toList());
|
||||||
List<VideoSortEntity> videoList = videoCacheService.getVideoList();
|
List<VideoSortEntity> videoList = videoCacheService.getVideoList();
|
||||||
List<VideoSortEntity> videoPlanList = videoList.stream()
|
List<VideoSortEntity> 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());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
SortedSet<VideoSortEntity> sortedSet = new TreeSet<>(AbstractVideoSortComparator.VIDEO_COMP_PLAN_LIST);
|
SortedSet<VideoSortEntity> sortedSet = new TreeSet<>(AbstractVideoSortComparator.VIDEO_COMP_PLAN_LIST);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user