|  |  |  | 
|---|
|  |  |  | package com.matrix.system.shopXcx.api.action; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.core.pojo.AjaxResult; | 
|---|
|  |  |  | import com.matrix.biz.bean.BizUser; | 
|---|
|  |  |  | import com.matrix.system.hive.bean.SysVipInfo; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.component.redis.RedisUserLoginUtils; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.bean.ShopCollection; | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping(value = "/saveCollection") | 
|---|
|  |  |  | public @ResponseBody | 
|---|
|  |  |  | AjaxResult saveCollection(@RequestBody ShopCollection collection) { | 
|---|
|  |  |  | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); | 
|---|
|  |  |  | collection.setCreateBy(loginUser.getOpenId()); | 
|---|
|  |  |  | collection.setUpdateBy(loginUser.getOpenId()); | 
|---|
|  |  |  | collection.setCollUserid(loginUser.getOpenId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public AjaxResult deleteByProductId(@PathVariable("collProductid") Integer collProductid){ | 
|---|
|  |  |  | Map<String, Object> deleteMap = new HashMap<>(); | 
|---|
|  |  |  | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); | 
|---|
|  |  |  | String collUserid = loginUser.getOpenId(); | 
|---|
|  |  |  | deleteMap.put("collProductid", collProductid); | 
|---|
|  |  |  | deleteMap.put("collUserid", collUserid); | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/findCollection") | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public AjaxResult getCollectionByUserId(@RequestBody ShopCollection collection) { | 
|---|
|  |  |  | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); | 
|---|
|  |  |  | String userId = loginUser.getOpenId(); | 
|---|
|  |  |  | collection.setCollUserid(userId); | 
|---|
|  |  |  | List<ShopCollection> list = collectionDao.selectByUserId(collection); | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/findByUserIdAndProid/{collProductid}") | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public AjaxResult findByUserIdAndProid(@PathVariable("collProductid") Integer collProductid) { | 
|---|
|  |  |  | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); | 
|---|
|  |  |  | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); | 
|---|
|  |  |  | String userId = loginUser.getOpenId(); | 
|---|
|  |  |  | List<ShopCollection> list = collectionDao.selectByUserIdAndProid(collProductid,userId); | 
|---|
|  |  |  | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size()); | 
|---|