龚焕茏
2024-06-13 08afe9556ce0578cd879fff194d01f66610c86e7
src/main/java/com/ycl/jxkg/service/impl/QuestionServiceImpl.java
@@ -18,6 +18,7 @@
import com.ycl.jxkg.service.QuestionService;
import com.ycl.jxkg.utils.DateTimeUtil;
import com.ycl.jxkg.utils.ExamUtil;
import com.ycl.jxkg.utils.HtmlUtil;
import com.ycl.jxkg.utils.JsonUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
@@ -60,6 +61,9 @@
        question.setDifficult(model.getDifficult());
        question.setContent(questionObject);
        question.setCreateUser(userId);
        question.setTitle(HtmlUtil.clear(model.getTitle()));
        question.setAudioFile(model.getAudioFile());
        question.setOriginalFile(model.getOriginalFile());
        questionMapper.insert(question);
        return question;
    }
@@ -74,6 +78,9 @@
        //题干、解析、选项等 更新
        String questionObject = setQuestionInfoFromVM(model);
        question.setContent(questionObject);
        question.setTitle(HtmlUtil.clear(model.getTitle()));
        question.setAudioFile(model.getAudioFile());
        question.setOriginalFile(model.getOriginalFile());
        questionMapper.updateById(question);
        return question;
    }