package com.red.circle.other.app.inner.endpoint.live;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.live.RoomMikeTypeClientService;
import com.red.circle.other.inner.endpoint.live.api.RoomMikeTypeClientApi;
import com.red.circle.other.inner.model.cmd.live.MikeTypePropsQryCmd;
import com.red.circle.other.inner.model.dto.live.RoomMikeTypeDTO;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 房间贡献余额.
 *
 * @author pengliang on 2023/7/24
 */
@Validated
@RestController
@RequestMapping(value = RoomMikeTypeClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class RoomMikeTypeClientEndpoint implements RoomMikeTypeClientApi {

  private final RoomMikeTypeClientService roomMikeTypeClientService;

  @Override
  public ResultResponse<PageResult<RoomMikeTypeDTO>> pageRoomMikeTypeList(
      MikeTypePropsQryCmd query) {
    return ResultResponse.success(roomMikeTypeClientService.pageRoomMikeTypeList(query));
  }

  @Override
  public ResultResponse<Map<String, String>> getMikeTypeByType(String sysOrigin) {
    return ResultResponse.success(roomMikeTypeClientService.getMikeTypeByType(sysOrigin));
  }

}
