优化收藏
This commit is contained in:
parent
89479763d5
commit
cd5c601a36
|
|
@ -168,8 +168,11 @@ public class CmsUserController {
|
|||
@ResponseBody
|
||||
public AjaxResult addCollectionquestion(String questionId) {
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
examUserCollectionQuestionService.insertSelectiveBySelf(Integer.parseInt(questionId),sysUser);
|
||||
AjaxResult success = AjaxResult.success("插入成功");
|
||||
int i = examUserCollectionQuestionService.insertSelectiveBySelf(Integer.parseInt(questionId), sysUser);
|
||||
AjaxResult success = AjaxResult.success("收藏成功");
|
||||
if(i==0){
|
||||
success = AjaxResult.success("已收藏,无法重复收藏");
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ document.write(unescape("%3Cspan id='cnzz_stat_icon_30088308'%3E%3C/span%3E%3Csc
|
|||
success: function (result) {
|
||||
if (result.code != web_status.SUCCESS) {
|
||||
layer.msg(result.msg, {icon: 2});
|
||||
}else{
|
||||
layer.msg(result.msg, {icon: 1});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ public class ExamUserCollectionQuestionServiceImpl extends AbstractBaseServiceIm
|
|||
ExamUserCollectionQuestion examUserCollectionQuestion = new ExamUserCollectionQuestion();
|
||||
examUserCollectionQuestion.setExamQuestionId( questionId );
|
||||
examUserCollectionQuestion.setVipUserId( sysUser.getUserId().intValue() );
|
||||
List<ExamUserCollectionQuestion> db = examUserCollectionQuestionMapper.select(examUserCollectionQuestion);
|
||||
if(db.size()>0){
|
||||
return 0;
|
||||
}
|
||||
examUserCollectionQuestion.setCreateBy( sysUser.getLoginName() );
|
||||
examUserCollectionQuestion.setCreateDate( new Date() );
|
||||
examUserCollectionQuestion.setDelFlag( "0" );
|
||||
|
|
|
|||
Loading…
Reference in New Issue