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

import com.red.circle.common.business.core.enums.SysOriginPlatformEnum;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.sys.GiftQryCmd;
import com.red.circle.other.inner.model.dto.gift.UserGiftWallDTO;
import com.red.circle.other.inner.model.dto.material.GiftConfigDTO;
import java.sql.Timestamp;
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/5/23
 */
public interface GiftConfigClientApi {

  String API_PREFIX = "/gift-config/client";

  /**
   * 获取一个指定到礼物配置信息.
   */
  @GetMapping("/getById")
  ResultResponse<GiftConfigDTO> getById(@RequestParam("id") Long id);

  /**
   * 获取一批指定礼物信息.
   *
   * @param ids 编号id
   * @return ignore
   */
  @PostMapping("/mapByIds")
  ResultResponse<Map<Long, GiftConfigDTO>> mapByIds(@RequestBody Set<Long> ids);

  /**
   * 获取一组自定的礼物配置.
   */
  @PostMapping("/listByIds")
  ResultResponse<List<GiftConfigDTO>> listByIds(@RequestBody Set<Long> ids);

  /**
   * 获取cp礼物.
   */
  @GetMapping("/getPairCpGive")
  ResultResponse<GiftConfigDTO> getPairCpGive(
      @RequestParam("sysOrigin") SysOriginPlatformEnum sysOrigin);

  /**
   * 获取指定平台礼物信息.
   */
  @GetMapping("/listBySysOrigin")
  ResultResponse<List<GiftConfigDTO>> listBySysOrigin(@RequestParam("sysOrigin") String sysOrigin);

  /**
   * 获取礼物信息.
   */
  @PostMapping("/page/gifts")
  ResultResponse<PageResult<GiftConfigDTO>> pageGiftInfo(@RequestBody GiftQryCmd giftQryCmd);

  /**
   * 修改礼物.
   */
  @PostMapping("/updateGift")
  ResultResponse<Boolean> updateGift(@RequestBody GiftConfigDTO giftConfigDTO);

  /**
   * 移除礼物缓存.
   */
  @GetMapping("/removeGiftCache")
  ResultResponse<Void> removeGiftCache();

  /**
   * 移除幸运礼物缓存.
   */
  @GetMapping("/removeRemainingInventory")
  ResultResponse<Void> removeRemainingInventory(@RequestParam("id") Long id,
      @RequestParam("standardId") Long standardId);

  /**
   * 新增礼物.
   */
  @PostMapping("/saveGift")
  ResultResponse<Boolean> saveGift(@RequestBody GiftConfigDTO giftConfig);

  /**
   * 上下架礼物.
   */
  @GetMapping("/switchDelStatus")
  ResultResponse<Boolean> switchDelStatus(@RequestParam("id") Long id,
      @RequestParam("status") Boolean status);

  /**
   * 批量追加当前平台所有礼物区域.
   */
  @PostMapping("/addAllGiftRegion")
  ResultResponse<Boolean> addAllGiftRegion(@RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("regionId") String regionId);

  /**
   * 礼物列表.
   */
  @GetMapping("/listByTab")
  ResultResponse<List<GiftConfigDTO>> listByTab(@RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("giftTab") String giftTab);

  /**
   * 礼物列表.
   */
  @GetMapping("/listByTabV2")
  ResultResponse<List<GiftConfigDTO>> listByTabV2(@RequestBody GiftQryCmd giftQryCmd);

  /**
   * 获取赠送Cp组合礼物ID.
   */
  @GetMapping("/getPairCpGiveGiftId")
  ResultResponse<String> getPairCpGiveGiftId(@RequestParam("sysOrigin") String sysOrigin);

  /**
   * 保存赠送Cp组合礼物ID.
   */
  @GetMapping("/pushPairCpGiveGiftId")
  ResultResponse<Void> pushPairCpGiveGiftId(@RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("giftId") Long giftId);

  @GetMapping("/listGiftWallByUser")
  ResultResponse<List<UserGiftWallDTO>> listGiftWallByUser(@RequestParam("userId") Long userId);

  @GetMapping("/listByExpiredTime")
  ResultResponse<List<GiftConfigDTO>> listByExpiredTime(@RequestParam("now")Timestamp now);
}
