| | |
| | | package com.ruoyi.user.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @GetMapping(value = "/collectList") |
| | | @ApiOperation(value = "服务收藏列表", tags = {"用户端-收藏"}) |
| | | public R<List<UserCollectVO>> collectList() { |
| | | public R<IPage<UserCollectVO>> collectList(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | List<UserCollectVO> collectList = userCollectService.collectList(loginUser.getUserid()); |
| | | IPage<UserCollectVO> collectList = userCollectService.collectList(loginUser.getUserid(), Page.of(pageNum, pageSize)); |
| | | return R.ok(collectList); |
| | | } |
| | | |
| | | /** |
| | | * 服务收藏列表 |
| | | */ |
| | | @GetMapping(value = "/detailHaveCollect") |
| | | @ApiOperation(value = "服务详情取消/添加收藏", tags = {"用户端-收藏"}) |
| | | public R<IPage<UserCollectVO>> collectList(@RequestParam Integer serveId) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | // IPage<UserCollectVO> collectList = userCollectService.collectList(loginUser.getUserid()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |