Commit 415c15c6 by 18356073052

工具 侧边栏栏 素材收藏 修改

1 parent 863512e1
......@@ -33,7 +33,7 @@ public class WeChatCollectionController extends BaseController {
//@PreAuthorize("@ss.hasPermi('chat:collection:add')")
@Log(title = "添加收藏", businessType = BusinessType.INSERT)
@PutMapping("addCollection")
public AjaxResult addCollection(@RequestParam(value = "materialId") Long materialId,@RequestParam(value = "userId") Long userId) {
public AjaxResult addCollection(@RequestParam(value = "materialId") Long materialId,@RequestParam(value = "userName") String userId) {
return toAjax(weChatCollectionService.addCollection(materialId, userId));
}
......@@ -44,7 +44,7 @@ public class WeChatCollectionController extends BaseController {
@PreAuthorize("@ss.hasPermi('chat:collection:delete')")
// @Log(title = "取消收藏", businessType = BusinessType.UPDATE)
@PostMapping(value = "cancleCollection")
public AjaxResult cancleCollection(@RequestParam(value = "materialId") Long materialId,@RequestParam(value = "userId") Long userId) {
public AjaxResult cancleCollection(@RequestParam(value = "materialId") Long materialId,@RequestParam(value = "userName") String userId) {
return toAjax(weChatCollectionService.cancleCollection(materialId, userId));
}
......@@ -53,9 +53,9 @@ public class WeChatCollectionController extends BaseController {
*/
// @PreAuthorize("@ss.hasPermi('chat:collection:list')")
@GetMapping("/list")
public TableDataInfo list(@RequestParam(value = "userId") Long userId,@RequestParam(value = "keyword",required = false) String keyword) {
public TableDataInfo list(@RequestParam(value = "userName") String userName,@RequestParam(value = "keyword",required = false) String userId) {
startPage();
List<WeChatSideVo> collections = weChatCollectionService.collections(userId,keyword);
List<WeChatSideVo> collections = weChatCollectionService.collections(userName,userId);
return getDataTable(collections);
}
......
......@@ -24,6 +24,6 @@ public class WeChatCollection extends BaseEntity {
/**
* 用户id
*/
private Long userId;
private String userId;
}
......@@ -29,7 +29,7 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
* @param userId 用户id
* @return 结果
*/
public int dropCollection(@Param("materialId") Long materialId,@Param("userId") Long userId);
public int dropCollection(@Param("materialId") Long materialId,@Param("userId") String userId);
/**
* 通过素材id和用户id查询当前素材的收藏条数
......@@ -38,7 +38,7 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
* @param userId 用户id
* @return 当前素材收藏的条数
*/
public int countCollectionByMaterialIdAndUserId(@Param("materialId") Long materialId,@Param("userId") Long userId);
public int countCollectionByMaterialIdAndUserId(@Param("materialId") Long materialId,@Param("userId") String userId);
/**
* 收藏列表
......@@ -46,6 +46,6 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public List<WeChatSideVo> findCollections(@Param("userId") Long userId,@Param("keyword") String keyword);
public List<WeChatSideVo> findCollections(@Param("userId") String userId,@Param("keyword") String keyword);
}
......@@ -20,7 +20,7 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
* @param userId 用户id
* @return 结果
*/
public int addCollection( Long materialId, Long userId);
public int addCollection( Long materialId, String userId);
/**
* 取消收藏
......@@ -29,7 +29,7 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
* @param userId 用户id
* @return 结果
*/
public int cancleCollection( Long materialId, Long userId);
public int cancleCollection( Long materialId, String userId);
/**
* 收藏列表
......@@ -37,6 +37,6 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public List<WeChatSideVo> collections(Long userId,String keyword);
public List<WeChatSideVo> collections(String userId,String keyword);
}
......@@ -24,7 +24,7 @@ public class WeChatCollectionServiceImpl extends ServiceImpl<WeChatCollectionMap
@Override
public int addCollection(Long materialId, Long userId) {
public int addCollection(Long materialId, String userId) {
WeChatCollection chatCollection=new WeChatCollection();
chatCollection.setCollectionId(SnowFlakeUtil.nextId());
chatCollection.setMaterialId(materialId);
......@@ -33,12 +33,12 @@ public class WeChatCollectionServiceImpl extends ServiceImpl<WeChatCollectionMap
}
@Override
public int cancleCollection(Long materialId, Long userId) {
public int cancleCollection(Long materialId, String userId) {
return weChatCollectionMapper.dropCollection(materialId,userId);
}
@Override
public List<WeChatSideVo> collections(Long userId,String keyword) {
public List<WeChatSideVo> collections(String userId,String keyword) {
return weChatCollectionMapper.findCollections(userId,keyword);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!