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