|
@@ -0,0 +1,41 @@
|
|
|
|
+package cn.com.qmth.examcloud.bridge.modules.school1.controller;
|
|
|
|
+
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
+
|
|
|
|
+import org.apache.commons.lang3.RandomUtils;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
|
|
+import cn.com.qmth.examcloud.commons.util.Util;
|
|
|
|
+
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("school1")
|
|
|
|
+public class School1Controller {
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 测试
|
|
|
|
+ *
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ * @param bug
|
|
|
|
+ * @param elapsedTime
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = {"/", ""}, method = RequestMethod.GET)
|
|
|
|
+ public String get(@RequestParam(required = false) Boolean bug,
|
|
|
|
+ @RequestParam(required = false) Integer elapsedTime) {
|
|
|
|
+ if (null != bug && bug) {
|
|
|
|
+ if (RandomUtils.nextBoolean()) {
|
|
|
|
+ throw new RuntimeException("Ha Ha Ha ... ...");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (null != elapsedTime && 0 < elapsedTime && elapsedTime < 10000) {
|
|
|
|
+ Util.sleep(TimeUnit.MILLISECONDS, elapsedTime);
|
|
|
|
+ }
|
|
|
|
+ return DateUtil.chinaNow();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|