|
@@ -52,7 +52,7 @@ public class QuestionSubmitServiceImpl extends ServiceImpl<QuestionSubmitMapper,
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public long doQuestionSubmit(QuestionSubmitAddRequest questionSubmitAddRequest, User loginUser) {
|
|
|
|
|
|
+ public long doQuestionSubmit(QuestionSubmitAddRequest questionSubmitAddRequest, Long loginUserId) {
|
|
// 校验编程语言是否合法
|
|
// 校验编程语言是否合法
|
|
String language = questionSubmitAddRequest.getLanguage();
|
|
String language = questionSubmitAddRequest.getLanguage();
|
|
QuestionSubmitLanguageEnum languageEnum = QuestionSubmitLanguageEnum.getEnumByValue(language);
|
|
QuestionSubmitLanguageEnum languageEnum = QuestionSubmitLanguageEnum.getEnumByValue(language);
|
|
@@ -66,10 +66,10 @@ public class QuestionSubmitServiceImpl extends ServiceImpl<QuestionSubmitMapper,
|
|
throw new BusinessException(ResultCode.NOT_FOUND_ERROR);
|
|
throw new BusinessException(ResultCode.NOT_FOUND_ERROR);
|
|
}
|
|
}
|
|
// 是否已提交题目
|
|
// 是否已提交题目
|
|
- long userId = loginUser.getId();
|
|
|
|
|
|
+
|
|
// 每个用户串行提交题目
|
|
// 每个用户串行提交题目
|
|
QuestionSubmit questionSubmit = new QuestionSubmit();
|
|
QuestionSubmit questionSubmit = new QuestionSubmit();
|
|
- questionSubmit.setUserId(userId);
|
|
|
|
|
|
+ questionSubmit.setUserId(loginUserId);
|
|
questionSubmit.setQuestionId(questionId);
|
|
questionSubmit.setQuestionId(questionId);
|
|
questionSubmit.setCode(questionSubmitAddRequest.getCode());
|
|
questionSubmit.setCode(questionSubmitAddRequest.getCode());
|
|
questionSubmit.setLanguage(language);
|
|
questionSubmit.setLanguage(language);
|