|
@@ -16,6 +16,7 @@ import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -210,4 +211,24 @@ public class ExamProcessController extends ControllerSupport {
|
|
|
return examRecordDataService.findCourseNameById(id);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "违纪(非法考生端应用)")
|
|
|
+ @PostMapping("/discipline")
|
|
|
+ public void discipline(@RequestParam(required = false) String reason) {
|
|
|
+ User user = getAccessUser();
|
|
|
+ ExamingSession examingSession = examingSessionService.getExamingSession(user.getUserId());
|
|
|
+ if (examingSession == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(reason)) {
|
|
|
+ // 限制字符串最大长度
|
|
|
+ reason = StringUtils.substring(reason, 0, 1000);
|
|
|
+ } else {
|
|
|
+ reason = "非法考生端应用";
|
|
|
+ }
|
|
|
+
|
|
|
+ String cacheKey = Constants.OE_DISCIPLINE_ILLEGAL_CLIENT + examingSession.getExamRecordDataId();
|
|
|
+ redisClient.set(cacheKey, reason, 3 * 60 * 60);
|
|
|
+ }
|
|
|
+
|
|
|
}
|