|
@@ -73,7 +73,7 @@ public class QuestionWrongController extends BaseController{
|
|
|
|
|
|
@PostMapping("wrongs")
|
|
|
@ApiOperation("合并本机和云端错题")
|
|
|
- public Response<Integer> wrongs(@RequestBody List<QuestionWrongDTO> list){
|
|
|
+ public Response<Integer> wrongs(@RequestBody Long[] questionids,String km){
|
|
|
//查询该用户已收藏的题目列表
|
|
|
QuestionWrongListDTO dto = new QuestionWrongListDTO();
|
|
|
dto.setUserId(SecurityUtils.getLoginUser().getStudent().getId());
|
|
@@ -81,13 +81,14 @@ public class QuestionWrongController extends BaseController{
|
|
|
List<String> questionIds = dblist.stream().map(o -> o.getQuestionId()+","+o.getKm()).collect(Collectors.toList());
|
|
|
|
|
|
List<QuestionWrong> qlist = new ArrayList<QuestionWrong>();
|
|
|
- for (QuestionWrongDTO questionWrongDTO : list) {
|
|
|
- if (questionIds.contains(questionWrongDTO.getQuestionId()+","+questionWrongDTO.getKm())) {
|
|
|
+ for (Long qid : questionids) {
|
|
|
+ if (questionIds.contains(qid+","+km)) {
|
|
|
continue;
|
|
|
}
|
|
|
QuestionWrong questionWrong = new QuestionWrong();
|
|
|
- BeanUtils.copyProperties(questionWrongDTO, questionWrong);
|
|
|
questionWrong.setUserId(SecurityUtils.getLoginUser().getStudent().getId());
|
|
|
+ questionWrong.setKm(km);
|
|
|
+ questionWrong.setQuestionId(qid);
|
|
|
qlist.add(questionWrong);
|
|
|
}
|
|
|
if (qlist.isEmpty()) {
|