package com.red.circle.other.inner.endpoint.user.user.api;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.user.UserCheckSubscriptionCmd;
import com.red.circle.other.inner.model.dto.user.UserSubscriptionDTO;
import com.red.circle.other.inner.model.dto.user.WeekFriendshipCardCountDTO;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.tuple.ImmutableTriple;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 用户关注列表服务.
 *
 * @author pengliang on 2023/6/6
 */
public interface UserSubscriptionClientApi {

  String API_PREFIX = "/user-subscription/client";

  @GetMapping("/checkSubscription")
  ResultResponse<Boolean> checkSubscription(@RequestParam("userId") Long userId,
      @RequestParam("createUserId") Long createUserId);

  /**
   * 用户是否订阅指定用户集合.
   */
  @PostMapping("/mapIsSubscription")
  ResultResponse<Map<Long, Boolean>> mapIsSubscription(@RequestBody UserCheckSubscriptionCmd cmd);

  /**
   * 获取用户订阅关系.
   */
  @GetMapping("/getBySubscription")
  ResultResponse<UserSubscriptionDTO> getBySubscription(@RequestParam("userId") Long userId,
      @RequestParam("subscriptionUserId") Long subscriptionUserId);

  /**
   * 添加.
   */
  @PostMapping("/notExistsAdd")
  ResultResponse<Boolean> notExistsAdd(@RequestParam("userId") Long userId,
      @RequestParam("subscriptionUserId") Long subscriptionUserId);

  @GetMapping("/listThisWeekTop")
  ResultResponse<List<WeekFriendshipCardCountDTO>> listThisWeekTop(
      @RequestParam("sysOrigin") String sysOrigin, @RequestParam("size") Integer size);

  @GetMapping("/parseUserIdPair")
  ResultResponse<ImmutableTriple<Long, Long, String>> parseUserIdPair(
      @RequestParam("id") String id);
}
