| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @PostMapping(value = "/addStudySet") |
| | | @ResponseBody |
| | | public AjaxResult addStudySet(@RequestBody AddStudySetDTO dto) { |
| | | studyClient.addStudySet(dto); |
| | | System.err.println("后台"+dto); |
| | | if(dto.getDay()==6 && dto.getGame().getCount()>dto.getGame().getSubjectIds().split(",").length){ |
| | | return AjaxResult.error("超级听力选择题目数量不足"); |
| | | } |
| | | if(dto.getDay()==6 && dto.getGame().getAnswerCount()>dto.getGame().getSubjectIdsOne().split(",").length){ |
| | | return AjaxResult.error("超级记忆选择题目数量不足"); |
| | | } |
| | | R<Object> objectR = studyClient.addStudySet(dto); |
| | | int code = objectR.getCode(); |
| | | if (code == 500){ |
| | | String string = objectR.getMsg().toString(); |
| | | return AjaxResult.error(string); |
| | | } |
| | | return AjaxResult.success("保存成功"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "听图选音设置常规/示例", tags = {"后台-学习"}) |
| | | @PostMapping(value = "/setStudyType") |
| | | @ResponseBody |
| | | public AjaxResult setStudyType(@RequestBody @Valid SetStudyTypeDto dto) { |
| | | R<Object> objectR = studyClient.setStudyType(dto); |
| | | int code = objectR.getCode(); |
| | | if (code == 500){ |
| | | String string = objectR.getMsg().toString(); |
| | | return AjaxResult.error(string); |
| | | } |
| | | return AjaxResult.success("设置成功"); |
| | | } |
| | | |
| | | /** |
| | | * 通过类型、周目、day查询学习配置 |
| | | * @return |