|
@@ -1,6 +1,7 @@
|
|
package cn.com.qmth.examcloud.web.support;
|
|
package cn.com.qmth.examcloud.web.support;
|
|
|
|
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import org.apache.commons.lang3.RandomUtils;
|
|
import org.apache.commons.lang3.RandomUtils;
|
|
import org.springframework.http.HttpEntity;
|
|
import org.springframework.http.HttpEntity;
|
|
@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
|
|
import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
|
|
+import cn.com.qmth.examcloud.commons.util.Util;
|
|
|
|
|
|
/**
|
|
/**
|
|
* examcloud controller
|
|
* examcloud controller
|
|
@@ -31,12 +33,17 @@ public class ExamCloudController {
|
|
|
|
|
|
@Naked
|
|
@Naked
|
|
@RequestMapping(value = {"/", ""}, method = RequestMethod.GET)
|
|
@RequestMapping(value = {"/", ""}, method = RequestMethod.GET)
|
|
- public String get(@RequestParam(required = false) Boolean bug) {
|
|
|
|
|
|
+ public String get(@RequestParam(required = false) Boolean bug,
|
|
|
|
+ @RequestParam(required = false) Integer elapsedTime) {
|
|
if (null != bug && bug) {
|
|
if (null != bug && bug) {
|
|
if (RandomUtils.nextBoolean()) {
|
|
if (RandomUtils.nextBoolean()) {
|
|
throw new RuntimeException("Ha Ha Ha ... ...");
|
|
throw new RuntimeException("Ha Ha Ha ... ...");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (null != elapsedTime && 0 < elapsedTime) {
|
|
|
|
+ Util.sleep(TimeUnit.MILLISECONDS, elapsedTime);
|
|
|
|
+ }
|
|
return DateUtil.chinaNow();
|
|
return DateUtil.chinaNow();
|
|
}
|
|
}
|
|
|
|
|