package com.red.circle.console.adapter.app.user;


import com.red.circle.console.app.dto.clienobject.user.GiftGiveRunningWaterCO;
import com.red.circle.console.app.service.app.user.RunningWaterLogService;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.inner.model.cmd.gift.GiftGiveRunningWaterBackQryCmd;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户赠送礼物流水 前端控制器
 * </p>
 *
 * @author houyong
 * @since 2020-06-09
 */
@RestController
@RequestMapping("/running-water-log")
@RequiredArgsConstructor
public class GiftRunningWaterRestController extends BaseController {

  private final RunningWaterLogService runningWaterLogService;

  /**
   * 查询礼物流水记录.
   */
  @GetMapping("/gift-give")
  public List<GiftGiveRunningWaterCO> listGiftGiveRunningWater(
      GiftGiveRunningWaterBackQryCmd query) {
    return runningWaterLogService.listGiftGiveRunningWater(query);
  }

  /**
   * 用户房间流水.
   */
  @GetMapping("/gift-give-room")
  public List<GiftGiveRunningWaterCO> listUserRoomGiftGiveRunningWater(
      @RequestParam Long userId, Long lastId) {
    return runningWaterLogService.listUserRoomGiftGiveRunningWater(userId, lastId);
  }

  /**
   * 赠送总额统计.
   */
  @GetMapping("/total-count")
  public String totalCount(GiftGiveRunningWaterBackQryCmd query) {
    return runningWaterLogService.getGiftGiveRunningWaterCount(query);
  }

  /**
   * 接收礼物数量.
   */
  @GetMapping("/accept-gift-quantity")
  public String acceptGiftQuantity(GiftGiveRunningWaterBackQryCmd query) {
    return runningWaterLogService.getAcceptGiftQuantity(query);
  }

}
