|
@@ -0,0 +1,67 @@
|
|
|
|
+package com.chelvc.cloud.maintain.controller;
|
|
|
|
+
|
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.AttentionTotalDTO;
|
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.AttentionUserDTO;
|
|
|
|
+import com.chelvc.cloud.vehicle.api.param.QueryAttentionParam;
|
|
|
|
+import com.chelvc.cloud.vehicle.api.service.AttentionService;
|
|
|
|
+import com.chelvc.framework.base.context.SessionContextHolder;
|
|
|
|
+import com.chelvc.framework.common.model.PagedDTO;
|
|
|
|
+import com.chelvc.framework.common.model.Pagination;
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 用户关注
|
|
|
|
+ * @PACKAGE_NAME: net.yeeu.collision.user.client.controller
|
|
|
|
+ * @NAME: AttentionController
|
|
|
|
+ * @USER: igl
|
|
|
|
+ * @DATE: 2023/8/14 9:55
|
|
|
|
+ */
|
|
|
|
+@Validated
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/client/attention")
|
|
|
|
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
|
|
|
+public class AttentionController {
|
|
|
|
+
|
|
|
|
+ @DubboReference
|
|
|
|
+ private AttentionService attentionService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 关注/取关用户
|
|
|
|
+ *
|
|
|
|
+ * @param targetUserId 目标用户标识
|
|
|
|
+ * @author igl
|
|
|
|
+ * @date 2023/2/25 19:42
|
|
|
|
+ * @apiNote 如果已关注,则会取消关注
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/concern")
|
|
|
|
+ public void concern(@RequestParam("targetUserId") Long targetUserId) {
|
|
|
|
+ attentionService.concern(SessionContextHolder.getId(), targetUserId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 分页查看关注、粉丝、好友
|
|
|
|
+ *
|
|
|
|
+ * @param page
|
|
|
|
+ * @param param
|
|
|
|
+ * @author igl
|
|
|
|
+ * @date 2023/8/14 12:42
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ public Pagination<AttentionUserDTO> page(PagedDTO page, @Validated QueryAttentionParam param) {
|
|
|
|
+ return attentionService.page(page, param, SessionContextHolder.getId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查看关注、粉丝、好友总数
|
|
|
|
+ * @author igl
|
|
|
|
+ * @date 2023/8/15 19:42
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/total")
|
|
|
|
+ public AttentionTotalDTO queryTotalByUserId(){
|
|
|
|
+ return attentionService.queryTotalByUserId(SessionContextHolder.getId());
|
|
|
|
+ }
|
|
|
|
+}
|