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.UserActivityRewardReceiveRecordCmd;
import com.red.circle.other.inner.model.cmd.user.UserActivityRewardReceiveRecordQryCmd;
import com.red.circle.other.inner.model.dto.user.UserActivityRewardReceiveRecordDTO;
import java.util.Map;
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 UserActivityClientApi {

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

  /**
   * 当月是否存在指定的活动id.
   *
   * @param activityId 活动id
   * @return true 存在 ， false 不存在
   */
  @GetMapping("/existsThisMonth")
  ResultResponse<Boolean> existsThisMonth(@RequestParam("userId") Long userId,
      @RequestParam("activityId") Long activityId);

  /**
   * 获取本月领取奖励信息.
   *
   * @param userId 用户id
   * @return ignore
   */
  @GetMapping("/mapByThisMonth")
  ResultResponse<Map<Long, UserActivityRewardReceiveRecordDTO>> mapByThisMonth(
      @RequestParam("userId") Long userId);

  /**
   * 保存本月奖励领取记录
   */
  @PostMapping("/saveThisMonth")
  ResultResponse<Void> saveThisMonth(@RequestBody UserActivityRewardReceiveRecordCmd cmd);

  /**
   * 分页查询用户活动月度领取记录
   */
  @PostMapping("/pageUserActivityRewardReceiveRecord")
  ResultResponse<PageResult<UserActivityRewardReceiveRecordDTO>> pageUserActivityRewardReceiveRecord(
      @RequestBody UserActivityRewardReceiveRecordQryCmd query);
}
