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

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.user.FriendshipCardQryCmd;
import com.red.circle.other.inner.model.cmd.user.SysUserFriendshipCardConfigCmd;
import com.red.circle.other.inner.model.cmd.user.SysUserFriendshipCardConfigQryCmd;
import com.red.circle.other.inner.model.dto.user.FriendshipCardDTO;
import com.red.circle.other.inner.model.dto.user.SysUserFriendshipCardConfigDTO;
import java.util.List;
import org.springframework.validation.annotation.Validated;
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/10/17
 */
public interface FriendshipCardClientApi {

  String API_PREFIX = "/friendship-card/client";

  /**
   * 根据条件获得卡片
   *
   * @param sendUserId   用户
   * @param acceptUserId 用户
   * @return 卡片
   */
  @GetMapping("/listByCondition")
  ResultResponse<List<FriendshipCardDTO>> listByCondition(
      @RequestParam("sendUserId") Long sendUserId,
      @RequestParam("acceptUserId") Long acceptUserId
  );

  /**
   * 根据条件获得卡片
   *
   * @return 卡片
   */
  @PostMapping("/listByCondition/list")
  ResultResponse<List<FriendshipCardDTO>> listByCondition(
      @RequestBody @Validated FriendshipCardQryCmd qryCmd);


  /**
   * 批量修改.
   */
  @PostMapping("/updateBatchById")
  ResultResponse<Void> updateBatchById(@RequestBody List<FriendshipCardDTO> dto);

  /**
   * 分页查询关系卡配置
   */
  @PostMapping("/pageConfig")
  ResultResponse<PageResult<SysUserFriendshipCardConfigDTO>> pageConfig(
      @RequestBody SysUserFriendshipCardConfigQryCmd query);

  /**
   * 修改关系卡配置
   */
  @PostMapping("/updateConfig")
  ResultResponse<Void> updateConfig(@RequestBody SysUserFriendshipCardConfigCmd param);

  /**
   * 新增配置
   */
  @PostMapping("/addConfig")
  ResultResponse<Void> addConfig(@RequestBody SysUserFriendshipCardConfigCmd param);
}
