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

import com.red.circle.framework.dto.ResultResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 抽奖券Client API.
 *
 * @author system
 * @since 2025-10-18
 */
public interface LotteryTicketClientApi {

  String API_PREFIX = "/lottery-ticket/client";

  /**
   * 获取用户抽奖券总数.
   */
  @GetMapping("/getUserTicketCount")
  ResultResponse<Integer> getUserTicketCount(@RequestParam("userId") Long userId);

  /**
   * 扣减用户抽奖券.
   */
  @PostMapping("/deductTicket")
  ResultResponse<Boolean> deductTicket(
      @RequestParam("userId") Long userId,
      @RequestParam("count") Integer count
  );

  /**
   * 增加用户抽奖券.
   */
  @PostMapping("/addTicket")
  ResultResponse<Long> addTicket(
      @RequestParam("userId") Long userId,
      @RequestParam("count") Integer count,
      @RequestParam(value = "source", required = false) String source,
      @RequestParam(value = "sourceId", required = false) String sourceId
  );

}
