package com.red.circle.other.adapter.app.room;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.clientobject.room.RoomMikeNumCO;
import com.red.circle.other.app.dto.clientobject.room.RoomMikeTypeCO;
import com.red.circle.other.app.dto.cmd.room.RoomMikeNumCmd;
import com.red.circle.other.app.dto.cmd.room.RoomMikeTypeCmd;
import com.red.circle.other.app.service.room.RoomMikeService;
import java.math.BigDecimal;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 房间麦克风.
 *
 * @author zongpubin on 2023/3/24 14:37
 * @eo.api-type http
 * @eo.groupName 直播服务.房间麦克风
 * @eo.path /room/mike
 */
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/room/mike", produces = MediaType.APPLICATION_JSON_VALUE)
public class RoomMikeRestController extends BaseController {

  private final RoomMikeService roomMikeService;

  /**
   * 金币购买房间麦数量.
   *
   * @eo.name 金币购买房间麦数量.
   * @eo.url /purchasing/num
   * @eo.method post
   * @eo.request-type json
   */
  @PostMapping("/purchasing/num")
  public BigDecimal purchasingRoomMikeNum(@RequestBody @Validated RoomMikeNumCmd cmd) {
    return roomMikeService.purchasingRoomMikeNum(cmd);
  }

  /**
   * 查询已购买的房间麦数量数据.
   *
   * @eo.name 查询已购买的房间麦数量数据.
   * @eo.url /list
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/list")
  public List<RoomMikeNumCO> mikeNumList(@Validated AppExtCommand cmd) {
    return roomMikeService.listRoomMikeNum(cmd);
  }

  /**
   * 购买活动房间麦类型.
   *
   * @eo.name 购买活动房间麦类型.
   * @eo.url /type/purchasing/num
   * @eo.method post
   * @eo.request-type json
   */
  @PostMapping("/type/purchasing/num")
  public BigDecimal purchasingRoomMike(@RequestBody @Validated RoomMikeTypeCmd cmd) {
    return roomMikeService.purchasingRoomMikeType(cmd);
  }

  /**
   * 查询已购买的活动房间麦类型数据.
   *
   * @eo.name 查询已购买的活动房间麦类型数据.
   * @eo.url /type/list
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/type/list")
  public List<RoomMikeTypeCO> mikeTypeList(@Validated AppExtCommand cmd) {
    return roomMikeService.listRoomMikeType(cmd);
  }


}
