Commit 9f72e1ee authored by hezhen's avatar hezhen

修改id

parent 647fb36b
package com.github.wxiaoqi.security.admin.biz; package com.github.wxiaoqi.security.admin.biz;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.dto.AppUserCollectDTO; import com.github.wxiaoqi.security.admin.dto.AppUserCollectDTO;
...@@ -64,8 +65,17 @@ public class AppUserCollectBiz extends BaseBiz<AppUserCollectMapper, AppUserColl ...@@ -64,8 +65,17 @@ public class AppUserCollectBiz extends BaseBiz<AppUserCollectMapper, AppUserColl
Example example = new Example(AppUserCollect.class); Example example = new Example(AppUserCollect.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId",userId).andEqualTo("typeId",id).andEqualTo("type",type).andEqualTo("isDel",0); criteria.andEqualTo("userId",userId).andEqualTo("typeId",id).andEqualTo("type",type).andEqualTo("isDel",0);
int count=selectCountByExample(example); int count=0;
return ObjectRestResponse.succ(count+""); Integer collect_id=0;
List<AppUserCollect> list=selectByExample(example);
if(list.size()>0){
count=1;
collect_id= list.get(0).getId();
}
JSONObject obj=new JSONObject();
obj.put("status",count);
obj.put("id",collect_id);
return ObjectRestResponse.succ(obj);
} }
//我的收藏 //我的收藏
public ObjectRestResponse getCollectList(Integer userId,int page,int limit){ public ObjectRestResponse getCollectList(Integer userId,int page,int limit){
......
...@@ -92,7 +92,7 @@ public class AppUserCollectController extends CommonBaseController { ...@@ -92,7 +92,7 @@ public class AppUserCollectController extends CommonBaseController {
throw new Exception(); throw new Exception();
} }
Integer userid=Integer.parseInt(username); Integer userid=Integer.parseInt(username);
return collectBiz.checkUserCollect(userid,id,type); return collectBiz.checkUserCollect(id,userid,type);
} }
/** /**
* 取消收藏 * 取消收藏
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment