package com.red.circle.other.inner.endpoint.material.props.api;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.dto.material.RoomBadgeBackpackDTO;
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/6/3
 */
public interface RoomBadgeClientApi {

  String API_PREFIX = "/room-badge/client";

  /**
   * 获取徽章背包.
   *
   * @param roomId 房间id
   * @return ignore
   */
  @GetMapping("/listBadgeBackpackByRoomId")
  ResultResponse<List<RoomBadgeBackpackDTO>> listBadgeBackpackByRoomId(
      @RequestParam("roomId") Long roomId);

  /**
   * 获取徽章背包.
   *
   * @param roomIds 房间ids
   * @return ignore
   */
  @PostMapping("/mapByRoomIds")
  ResultResponse<Map<Long, List<RoomBadgeBackpackDTO>>> mapByRoomIds(
      @RequestBody Set<Long> roomIds);

  /**
   * 获取徽章背包.
   *
   * @param roomIds 房间ids
   * @return ignore
   */
  @PostMapping("/listByRoomIds")
  ResultResponse<List<RoomBadgeBackpackDTO>> listByRoomIds(@RequestBody Set<Long> roomIds);

  /**
   * 激活-永久徽章.
   *
   * @param roomId  房间id
   * @param userId  用户id
   * @param badgeId 徽章id
   * @return true 激活成功 ,false 激活失败
   */
  @GetMapping("/activationPermanent")
  ResultResponse<Boolean> activationPermanent(
      @RequestParam("roomId") Long roomId,
      @RequestParam("userId") Long userId,
      @RequestParam("badgeId") Long badgeId
  );

  /**
   * 激活-临时徽章.
   *
   * @param roomId  房间id
   * @param userId  用户id
   * @param badgeId 徽章id
   * @param days    天数
   * @return true 激活成功 ,false 激活失败
   */
  @GetMapping("/activationTemporary")
  ResultResponse<Boolean> activationTemporary(
      @RequestParam("roomId") Long roomId,
      @RequestParam("userId") Long userId,
      @RequestParam("badgeId") Long badgeId,
      @RequestParam("days") Integer days
  );

}
