Bläddra i källkod

Merge remote-tracking branch 'origin/master'

shenhao 3 år sedan
förälder
incheckning
7aeb19de72
1 ändrade filer med 4 tillägg och 26 borttagningar
  1. 4 26
      src/main/java/com/ssj/api/request/RequestOpenApiUtils.java

+ 4 - 26
src/main/java/com/ssj/api/request/RequestOpenApiUtils.java

@@ -55,9 +55,8 @@ public class RequestOpenApiUtils {
 	
 	public static JSONObject openApiServiceRecognitionResult(String homeworkPictureId,String accessToken) {
 		try {
-			//String host=PropertiesUtil.getValue("API_OPEN_URL");
-			//String accessToken=createOpenToken(appid, accessKey);
-			String url="https://master.sharingschool.com/sz/api/kmt/homeworkCorrect/V2/recognitionResult?accessToken="+accessToken;
+			String host=PropertiesUtil.getValue("API_OPEN_URL");
+			String url=host+"/api/kmt/homeworkCorrect/V2/recognitionResult?accessToken="+accessToken;
 			
 			JSONObject json=new JSONObject();
 			json.put("homeworkPictureId", homeworkPictureId);
@@ -81,12 +80,11 @@ public class RequestOpenApiUtils {
 	
 	public static JSONArray openApiServiceAnswerList(JSONObject json,String accessToken) {
 		try {
-			//String host=PropertiesUtil.getValue("API_OPEN_URL");
-			//String accessToken=createOpenToken(appid, accessKey);
+			String host=PropertiesUtil.getValue("API_OPEN_URL");
 			if(json==null) {
 				return null;
 			}
-			String url="https://master.sharingschool.com/sz/api/kmt/homeworkCorrect/V2/answerList?accessToken="+accessToken;
+			String url=host+"/api/kmt/homeworkCorrect/V2/answerList?accessToken="+accessToken;
 			logger.info("调用第三方接口【openApiServiceAnswerList】,请求URL:"+url);
 			logger.info("调用第三方接口【openApiServiceAnswerList】,请求参数:"+json);
 			String text=HttpRemote.POSTMethod(url, json.toJSONString());
@@ -102,24 +100,4 @@ public class RequestOpenApiUtils {
 		return null;
 	}
 	
-	
-	
-	public static void main(String[] args) {
-		String homeworkPictureId="20210302450448243884597248";
-		String accessToken="14DF5C279E734453ABA929744F81A833";
-		JSONObject json=openApiServiceRecognitionResult(homeworkPictureId, accessToken);
-		System.out.println(json);
-		json.put("homeworkPictureId", homeworkPictureId);
-		
-		JSONArray json1=openApiServiceAnswerList(json, accessToken);
-		System.out.println(json1);
-		
-		
-	}
-	
-	
-
-	
-	
-
 }