|
@@ -63,6 +63,10 @@ public class VideoUserController {
|
|
|
String token = RequestUtil.getRequest().getHeader("token");
|
|
|
Document document = MongoDBUtil.queryVLoginTokenByToken(token);
|
|
|
if (!Objects.isNull(document)) {
|
|
|
+ Date expirationDate = (Date) document.get("ExpirationDate");
|
|
|
+ if (expirationDate.compareTo(new Date()) <= 0) {
|
|
|
+ return "timeout";
|
|
|
+ }
|
|
|
userId = (String) document.get("AccountId");
|
|
|
}
|
|
|
}
|
|
@@ -79,6 +83,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
return videoService.listVideoByHome(userId, selectDTO);
|
|
|
}
|
|
@@ -97,6 +103,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
return videoService.listVideoByHomePage(userId, selectDTO);
|
|
|
}
|
|
@@ -109,6 +117,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
if (video.getId() != null) {
|
|
|
video = videoService.getPlayInfo(video.getId(), userId);
|
|
@@ -123,6 +133,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(selectDTO.getName())) {
|
|
|
VideoHotsearch videoHotsearch = new VideoHotsearch();
|
|
@@ -146,6 +158,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
return videoService.getDoctorVideoPage(userId, selectDTO);
|
|
|
}
|
|
@@ -164,6 +178,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
return videoUserAttentionService.getUserFollowList(userId, selectDTO);
|
|
|
}
|
|
@@ -174,6 +190,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
return videoService.getMyLikeList(userId, selectDTO);
|
|
|
}
|
|
@@ -185,6 +203,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
VideoStatisticsIntermediate oldPlayLog = videoStatisticsIntermediateService.getOne(new QueryWrapper<VideoStatisticsIntermediate>().eq("superior_id", video.getId()).eq("subordinate_id", userId));
|
|
|
VideoStatisticsIntermediate playLog = null;
|
|
@@ -216,6 +236,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
if (videoLikeIntermediateService.count(new QueryWrapper<VideoLikeIntermediate>().eq("superior_id", video.getId()).eq("subordinate_id", userId)) > 0) {
|
|
|
return PageResultInfo.createFail("保存失败,已有用户点赞记录");
|
|
@@ -244,6 +266,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
if (videoLikeIntermediateService.remove(new QueryWrapper<VideoLikeIntermediate>().eq("superior_id", video.getId()).eq("subordinate_id", userId))) {
|
|
|
return PageResultInfo.createSuccess("用户取消点赞成功", null);
|
|
@@ -259,6 +283,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
VideoStatisticsIntermediate shareLog = new VideoStatisticsIntermediate();
|
|
|
shareLog.setSuperiorID(video.getId());
|
|
@@ -283,6 +309,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
if (videoUserAttentionService.count(new QueryWrapper<VideoUserAttention>().eq("superior_id", doctor.getId()).eq("subordinate_id", userId)) > 0) {
|
|
|
return PageResultInfo.createFail("保存失败,已有用户关注该医生记录");
|
|
@@ -310,6 +338,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
if (videoUserAttentionService.remove(new QueryWrapper<VideoUserAttention>().eq("superior_id", doctor.getId()).eq("subordinate_id", userId))) {
|
|
|
return PageResultInfo.createSuccess("用户取关医生成功", null);
|
|
@@ -325,6 +355,8 @@ public class VideoUserController {
|
|
|
String userId = getUser(RequestUtil.getRequest());
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
return PageResultInfo.createFail("token不能为空");
|
|
|
+ }else if("timeout".equals(userId)){
|
|
|
+ return PageResultInfo.createTimeOutFail("token/cookies过期,请重新请求授权");
|
|
|
}
|
|
|
if (videoCommentDTO.getVideoID() == null || StringUtils.isEmpty(videoCommentDTO.getContent())) {
|
|
|
return PageResultInfo.createFail("缺少参数");
|