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