|
@@ -14,6 +14,7 @@ import org.aspectj.lang.annotation.*;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.List;
|
|
@@ -43,6 +44,9 @@ public class BlockChainAspect {
|
|
|
|
|
|
private static final String blockChainHost="http://111.231.68.200:8082/";
|
|
|
|
|
|
+ @Value("${mooctest.url}")
|
|
|
+ private String MOOCTEST_HOST;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 定义切入点,切入点为com.example.demo.aop.AopController中的所有函数
|
|
@@ -129,7 +133,7 @@ public class BlockChainAspect {
|
|
|
}
|
|
|
|
|
|
private Task getAndSaveTaskInfo(String id){
|
|
|
- String result = HTTP.sendGet("http://www.mooctest.net/api/exam/" + id + "/info", "");
|
|
|
+ String result = HTTP.sendGet(MOOCTEST_HOST+"/api/exam/" + id + "/info", "");
|
|
|
if (!"".equals(result)) {
|
|
|
JSONObject json = new JSONObject(result);
|
|
|
long beginTime = json.getLong("beginTime");
|