From df244ea8697b42f6b48582be381ee8b6f4aca331 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 16 十月 2021 14:36:50 +0800
Subject: [PATCH] 隐私投诉接口

---
 src/main/java/com/yeshi/buwan/controller/parser/UserParser.java |   50 ++++++++++++++++++++++++++++----------------------
 1 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/src/main/java/com/yeshi/buwan/controller/parser/UserParser.java b/src/main/java/com/yeshi/buwan/controller/parser/UserParser.java
index d3450b0..764d781 100644
--- a/src/main/java/com/yeshi/buwan/controller/parser/UserParser.java
+++ b/src/main/java/com/yeshi/buwan/controller/parser/UserParser.java
@@ -17,7 +17,7 @@
 import com.yeshi.buwan.dto.user.LoginInfoDto;
 import com.yeshi.buwan.exception.user.LoginUserException;
 import com.yeshi.buwan.exception.user.RegisterUserException;
-import com.yeshi.buwan.pptv.PPTVUtil;
+import com.yeshi.buwan.videos.pptv.PPTVUtil;
 import com.yeshi.buwan.service.imp.*;
 import com.yeshi.buwan.service.inter.juhe.InternetSearchVideoService;
 import com.yeshi.buwan.service.inter.system.SystemConfigService;
@@ -34,7 +34,7 @@
 import com.yeshi.buwan.util.log.UserActiveLogFactory;
 import com.yeshi.buwan.util.video.VideoCategoryConstant;
 import com.yeshi.buwan.util.video.VideoConstant;
-import com.yeshi.buwan.util.video.shortvideo.ShortVideoUtil;
+import com.yeshi.buwan.util.video.VideoUtil;
 import com.yeshi.buwan.vo.AcceptData;
 import com.yeshi.buwan.vo.video.VideoListResultVO;
 import net.sf.json.JSONArray;
@@ -105,7 +105,7 @@
             out.print(JsonUtil.loadFalseJson("鑾峰彇uid澶辫触"));
             return;
         } else {
-            Map<String, String> map = configService.getConfigAsMap(detailSystem, acceptData.getVersion());
+            Map<String, String> map = configService.getConfigAsMap(acceptData.getChildDetailSystem(), acceptData.getVersion());
             ShareContent share = shareService.getShareContent(detailSystem.getId());
             JSONObject object = new JSONObject();
             object.put("Uid", uid);
@@ -538,11 +538,13 @@
                 }
             }
 
-
-            vt = new VideoType();
-            vt.setId(Constant.SEARCH_RESULT_TYPE_HIGH_DEFINITION);
-            vt.setName("楂樻竻");
-            typeList.add(vt);
+            //闊╁墽涓嶈繑鍥為珮娓�
+            if (!acceptData.getDetailSystem().getId().equalsIgnoreCase("48")) {
+                vt = new VideoType();
+                vt.setId(Constant.SEARCH_RESULT_TYPE_HIGH_DEFINITION);
+                vt.setName("楂樻竻");
+                typeList.add(vt);
+            }
 
 
             JSONArray array1 = new JSONArray();
@@ -651,14 +653,14 @@
     public void guessLike(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
 
         String videoId = request.getParameter("VideoId");
-        if (!NumberUtil.isNumeric(videoId)) {
-            if (ShortVideoUtil.isShortVideoId(videoId)) {
+        int fromtype = VideoUtil.getVideoFromType(videoId);
+        switch (fromtype) {
+            case HomeVideo.FROM_TYPE_INTERNET:
+                guessLikeForInternetSearch(acceptData, videoId, out);
+                return;
+            case HomeVideo.FROM_TYPE_SHORT:
                 guessLikeForShortVideo(acceptData, videoId, out);
                 return;
-            }
-
-            guessLikeForInternetSearch(acceptData, videoId, out);
-            return;
         }
 
         DetailSystem ds = systemService.getDetailSystemByPackage(acceptData.getPackageName());
@@ -719,7 +721,7 @@
 
     //鏂扮増鐑棬鎼滅储
     public void getHotSearchNew(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
-        DetailSystemConfig config = configService.getConfigByKey("hot_search", acceptData.getDetailSystem(), acceptData.getVersion());
+        DetailSystemConfig config = configService.getConfigByKey("hot_search",  acceptData.getDetailSystem(), acceptData.getVersion());
         if (config == null) {
             out.print(JsonUtil.loadFalseJson("鏃犲唴瀹�"));
             return;
@@ -991,15 +993,14 @@
             return;
         }
 
-        if (!NumberUtil.isNumeric(videoId)) {
-            if (ShortVideoUtil.isShortVideoId(videoId)) {
+        int fromtype = VideoUtil.getVideoFromType(videoId);
+        switch (fromtype) {
+            case HomeVideo.FROM_TYPE_INTERNET:
+                getRelativeVideosForInternetSearch(acceptData, videoId, out);
+                return;
+            case HomeVideo.FROM_TYPE_SHORT:
                 getRelativeVideosForShortVideo(acceptData, videoId, out);
                 return;
-            }
-
-
-            getRelativeVideosForInternetSearch(acceptData, videoId, out);
-            return;
         }
 
         List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(), acceptData.getChannel());
@@ -1203,6 +1204,7 @@
         loginInfoDto.setSystemId(acceptData.getDetailSystem().getSystem().getId());
         loginInfoDto.setEmail(account);
         loginInfoDto.setPwd(StringUtil.Md5(pwd));
+        loginInfoDto.setIpInfo(IPUtil.getRemotIP(request) + ":" + request.getRemotePort());
         try {
             LoginUser user = userService.login(loginInfoDto);
             out.print(JsonUtil.loadTrueJson(StringUtil.outPutResultJson(user)));
@@ -1266,6 +1268,10 @@
 
         // 娉ㄥ唽 --鐢ㄦ埛鍚�,鏄电О,瀵嗙爜
         LoginUser user = userService.getLoginUser(loginUid);
+        if (user.getState() != null && user.getState() == LoginUser.STATE_UNREGISTER) {
+            out.print(JsonUtil.loadFalseJson("璐︽埛宸叉敞閿�"));
+            return;
+        }
         //闅愯棌user涓殑email
         user.setEmail(UserInfoVOFactory.getHiddenEmail(user.getEmail()));
         if (user.getPortrait() != null && !user.getPortrait().startsWith("http"))

--
Gitblit v1.8.0