Commit b7545fce5afd4f70b983bf78353162f5bc8062de
1 parent
00e9351b
update
Showing
2 changed files
with
11 additions
and
8 deletions
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| ... | ... | @@ -23,7 +23,8 @@ import java.util.List; |
| 23 | 23 | @RequestMapping("/videos") |
| 24 | 24 | public class VideosController { |
| 25 | 25 | |
| 26 | - | |
| 26 | + @Autowired | |
| 27 | + AuditPass Pass; | |
| 27 | 28 | @Autowired |
| 28 | 29 | VideosServiceImpl videosService; |
| 29 | 30 | @PostMapping("/import") |
| ... | ... | @@ -42,7 +43,7 @@ public class VideosController { |
| 42 | 43 | List<String> asList = Arrays.asList(business); |
| 43 | 44 | if(asList.contains(CommonConst.BUSINESS_VIDEO+"")){ |
| 44 | 45 | shyVideos.setState(CommonConst.AUDIT_SUCCESS); |
| 45 | - AuditPass.auditPass(json.getString("videoId"),CommonConst.AUDIT_SUCCESS,"",""); | |
| 46 | + Pass.auditPass(json.getString("videoId"),CommonConst.AUDIT_SUCCESS,"",""); | |
| 46 | 47 | }else { |
| 47 | 48 | shyVideos.setState(CommonConst.AUDIT_INTT); |
| 48 | 49 | } |
| ... | ... | @@ -69,7 +70,7 @@ public class VideosController { |
| 69 | 70 | @RequestMapping("/shenheNotify") |
| 70 | 71 | @ResponseBody |
| 71 | 72 | public ResponseBean shenheInfo(String activity_id,int state,String attr_tags,String msg){ |
| 72 | - String code = AuditPass.auditPass(activity_id, state, attr_tags, msg); | |
| 73 | + String code = Pass.auditPass(activity_id, state, attr_tags, msg); | |
| 73 | 74 | if(code.equals("-1")){ |
| 74 | 75 | return new ResponseBean(ErrorEnum.ERROR); |
| 75 | 76 | } | ... | ... |
src/main/java/com/cnlive/shenhe/utils/AuditPass.java
| 1 | 1 | package com.cnlive.shenhe.utils; |
| 2 | 2 | |
| 3 | 3 | import org.springframework.beans.factory.annotation.Value; |
| 4 | +import org.springframework.stereotype.Component; | |
| 4 | 5 | |
| 5 | 6 | import java.io.UnsupportedEncodingException; |
| 6 | 7 | import java.security.NoSuchAlgorithmException; |
| ... | ... | @@ -12,15 +13,16 @@ import java.util.Map; |
| 12 | 13 | * @Date: 2018/12/3 16:00 |
| 13 | 14 | * @Description:如果是白名单直接审核通过 |
| 14 | 15 | */ |
| 16 | +@Component | |
| 15 | 17 | public class AuditPass { |
| 16 | 18 | |
| 17 | 19 | @Value("${url}") |
| 18 | - private static String url; | |
| 20 | + private String url; | |
| 19 | 21 | @Value("${platformKey}") |
| 20 | - private static String platformKey; | |
| 22 | + private String platformKey; | |
| 21 | 23 | @Value("${platformValue}") |
| 22 | - private static String platformValue; | |
| 23 | - public static String auditPass(String activity_id,int state,String attr_tags,String msg){ | |
| 24 | + private String platformValue; | |
| 25 | + public String auditPass(String activity_id,int state,String attr_tags,String msg){ | |
| 24 | 26 | String token = null; |
| 25 | 27 | try { |
| 26 | 28 | token = CommonUtils.md5(url+platformKey+platformValue); |
| ... | ... | @@ -35,7 +37,7 @@ public class AuditPass { |
| 35 | 37 | params.put("attr_tags",attr_tags); |
| 36 | 38 | params.put("msg",msg); |
| 37 | 39 | HttpUtil httpUtil = HttpUtil.init(); |
| 38 | - String URL =url+"platform="+platformKey+"&token="+token; | |
| 40 | + String URL =url+"?platform="+platformKey+"&token="+token; | |
| 39 | 41 | httpUtil.setParamMap(params); |
| 40 | 42 | Map<String, String> post = httpUtil.post(URL); |
| 41 | 43 | String code = post.get("code"); | ... | ... |