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.UserCheckInLogQryCmd;
import com.red.circle.other.inner.model.dto.user.ActiveUserCountryCodeDTO;
import com.red.circle.other.inner.model.dto.user.UserCheckInLogDTO;
import com.red.circle.other.inner.model.dto.user.UserExpandDTO;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.Set;
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/13
 */
public interface UserExpandClientApi {

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

  /**
   * 是否购买过内购.
   *
   * @param userId 用户id
   * @return true 存在，false 不存在
   */
  @GetMapping("/checkPurchasing")
  ResultResponse<Boolean> checkPurchasing(@RequestParam("userId") Long userId);

  /**
   * 修改购买状态=true.
   *
   * @param userId 用户id
   */
  @GetMapping("/updatePurchasingToTrue")
  ResultResponse<Void> updatePurchasingToTrue(@RequestParam("userId") Long userId);

  /**
   * 最新两小时在线用户分布国家.
   *
   * @param lastActiveTime ignore
   * @return list
   */
  @GetMapping("/findLatestActiveUserCountryCode")
  ResultResponse<List<ActiveUserCountryCodeDTO>> findLatestActiveUserCountryCode(
      @RequestParam("lastActiveTime") LocalDateTime lastActiveTime);

  /**
   * @param userIds
   * @return
   */
  @PostMapping("/mapUserExpand")
  ResultResponse<Map<Long, UserExpandDTO>> mapUserExpand(@RequestBody Set<Long> userIds);

  /**
   * 获取用户签到日志
   */
  @PostMapping("/getCheckInLog")
  ResultResponse<PageResult<UserCheckInLogDTO>> getCheckInLog(@RequestBody UserCheckInLogQryCmd query);

  /**
   * 获取用户拓展信息
   */
  @GetMapping("/getByUserId")
  ResultResponse<UserExpandDTO> getByUserId(@RequestParam("userId") Long userId);
}
