添加关注、取消关注、获取关注列表、粉丝列表相关接口

This commit is contained in:
2024-08-19 11:52:53 +08:00
parent ac28ba233c
commit fa86a2af45
10 changed files with 217 additions and 34 deletions

View File

@@ -1,12 +1,11 @@
package com.ai.da.controller;
import com.ai.da.common.config.exception.BusinessException;
import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.entity.Account;
import com.ai.da.model.dto.*;
import com.ai.da.model.vo.CommentVO;
import com.ai.da.model.vo.PortfolioVO;
import com.ai.da.model.vo.UserLikeChooseVO;
import com.ai.da.model.vo.UserLikeGroupVO;
import com.ai.da.model.vo.*;
import com.ai.da.service.PortfolioService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -16,6 +15,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
@Api(tags = "Portfolio模块")
@Slf4j
@@ -117,4 +117,31 @@ public class PortfolioController {
public Response<Boolean> commentDelete(@Valid @RequestBody CommentDTO commentDTO) {
return Response.success(portfolioService.commentDelete(commentDTO));
}
@ApiOperation(value = "关注")
@GetMapping("/follow")
public Response<String> follow(@RequestParam("followeeId") Long followeeId) {
portfolioService.follow(followeeId);
return Response.success(BusinessException.getMessageFromResource("subscription.success"));
}
@ApiOperation(value = "取消关注")
@GetMapping("/cancelFollow")
public Response<String> cancelFollow(@RequestParam("followeeId") Long followeeId) {
portfolioService.cancelFollow(followeeId);
return Response.success(BusinessException.getMessageFromResource("unsubscribe.success"));
}
@ApiOperation(value = "获取关注列表")
@PostMapping("/getFolloweeList")
public Response<List<Account>> getFolloweeList(@Valid @RequestBody PageQueryBaseVo pageQueryBaseVo) {
return Response.success(portfolioService.getFolloweeList(pageQueryBaseVo));
}
@ApiOperation(value = "获取粉丝列表")
@PostMapping("/getFollowerList")
public Response<List<Account>> getFollowerList(@Valid @RequestBody PageQueryBaseVo pageQueryBaseVo) {
return Response.success(portfolioService.getFollowerList(pageQueryBaseVo));
}
}