package com.ym.mec.web.controller;

import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomDetailVo;
import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomMemberVo;
import com.ym.mec.biz.service.ImLiveBroadcastRoomMemberService;
import com.ym.mec.common.controller.BaseController;
import com.ym.mec.common.entity.HttpResponseResult;
import com.ym.mec.common.page.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
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;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 直播间人员关系表(ImLiveBroadcastRoomMember)表控制层
 *
 * @author hgw
 * @since 2022-02-21 14:26:58
 */
@Api(tags = "直播间人员关系表")
@RestController
@RequestMapping("/imLiveBroadcastRoomMember")
public class ImLiveBroadcastRoomMemberController extends BaseController {
    /**
     * 服务对象
     */
    @Resource
    private ImLiveBroadcastRoomMemberService imLiveBroadcastRoomMemberService;

    @ApiImplicitParams({
            @ApiImplicitParam(name = "roomUid", dataType = "String", value = "房间uid")
    })
    @ApiOperation("直播间详情")
    @PostMapping("/queryRoomDetail")
    public HttpResponseResult<ImLiveBroadcastRoomDetailVo> queryRoomDetail(@RequestBody Map<String, Object> param) {
        return succeed(imLiveBroadcastRoomMemberService.queryRoomDetail(param));
    }

    @ApiImplicitParams({
            @ApiImplicitParam(name = "search", dataType = "String", value = "模糊搜索 学员编号姓名"),
            @ApiImplicitParam(name = "roomUid", dataType = "String", value = "房间uid"),
            @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
            @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
    })
    @ApiOperation("分页查询直播间人员列表")
    @PostMapping("/queryRoomMember")
    public HttpResponseResult<PageInfo<ImLiveBroadcastRoomMemberVo>> queryRoomMember(@RequestBody Map<String, Object> param) {
        return succeed(imLiveBroadcastRoomMemberService.queryRoomMember(param));
    }

}

