|
@@ -1,13 +1,18 @@
|
|
|
package cn.com.qmth.examcloud.bridge.modules.school1.controller;
|
|
|
|
|
|
+import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import org.apache.commons.lang3.RandomUtils;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
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 com.google.common.collect.Maps;
|
|
|
+
|
|
|
import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
|
import cn.com.qmth.examcloud.commons.util.Util;
|
|
|
|
|
@@ -24,7 +29,7 @@ public class School1Controller {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = {"/", ""}, method = RequestMethod.GET)
|
|
|
- public String get(@RequestParam(required = false) Boolean bug,
|
|
|
+ public ResponseEntity<?> get(@RequestParam(required = false) Boolean bug,
|
|
|
@RequestParam(required = false) Integer elapsedTime) {
|
|
|
if (null != bug && bug) {
|
|
|
if (RandomUtils.nextBoolean()) {
|
|
@@ -35,7 +40,11 @@ public class School1Controller {
|
|
|
if (null != elapsedTime && 0 < elapsedTime && elapsedTime < 10000) {
|
|
|
Util.sleep(TimeUnit.MILLISECONDS, elapsedTime);
|
|
|
}
|
|
|
- return DateUtil.chinaNow();
|
|
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
|
+ map.put("date", DateUtil.chinaNow());
|
|
|
+ map.put("author", "qmth");
|
|
|
+ ResponseEntity<Map<String, Object>> entity = ResponseEntity.status(HttpStatus.OK).body(map);
|
|
|
+ return entity;
|
|
|
}
|
|
|
|
|
|
}
|