收藏考试优化
This commit is contained in:
parent
8d64b3852a
commit
3eee859042
|
|
@ -36,14 +36,23 @@ public class ApiUserCollectionQuestionController extends BaseController {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/question/collection/{id}")
|
||||
@GetMapping("/v1/question/collection/{id}")
|
||||
public AjaxResult answer(@PathVariable("id") Integer id) {
|
||||
|
||||
SysUser sysUser = sysUserService.selectUserByLoginName( JwtUtil.getLoginName() );
|
||||
|
||||
int insert = examUserCollectionQuestionService.insertSelectiveBySelf(id,sysUser);
|
||||
AjaxResult success = success( "插入我的收藏记录成功" );
|
||||
return success;
|
||||
ExamUserCollectionQuestionVO examUserCollectionQuestionVO = new ExamUserCollectionQuestionVO();
|
||||
examUserCollectionQuestionVO.setVipUserId( sysUser.getUserId().intValue() );
|
||||
examUserCollectionQuestionVO.setExamQuestionId( id );
|
||||
List<ExamUserCollectionQuestionVO> collectionQuestionVOList = examUserCollectionQuestionService.selectExamUserCollectionQuestionPage( examUserCollectionQuestionVO );
|
||||
if (collectionQuestionVOList != null && collectionQuestionVOList.size() > 0) {
|
||||
//删除收藏记录
|
||||
examUserCollectionQuestionService.delete(examUserCollectionQuestionVO);
|
||||
return success( "取消收藏成功" );
|
||||
} else {
|
||||
//插入收藏记录
|
||||
int insert = examUserCollectionQuestionService.insertSelectiveBySelf( id, sysUser );
|
||||
return success( "收藏成功" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ public class ExamExaminationVO extends ExamExamination {
|
|||
|
||||
private String trainCourseName;
|
||||
|
||||
private String examExaminationUserId;
|
||||
|
||||
public String getTrainCourseName() {
|
||||
return trainCourseName;
|
||||
|
|
|
|||
|
|
@ -118,10 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remarks != null and remarks != '' "> and exam_examination.remarks = #{ination.remarks}</if>
|
||||
<if test="delFlag != null and delFlag != '' "> and exam_examination.del_flag = #{ination.delFlag}</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectEnterNameListFromWeb" resultMap="ExamExaminationResult">
|
||||
select
|
||||
<include refid="selectExamExaminationVo"/>,tc.name as traincourse_name
|
||||
|
|
|
|||
Loading…
Reference in New Issue