package com.slodon.b2b2c.model.live;

import com.slodon.b2b2c.core.response.PagerInfo;
import com.slodon.b2b2c.dao.write.live.LiveBroadWriteMapper;
import com.slodon.b2b2c.live.dto.LiveBroadcastDto;
import com.slodon.b2b2c.live.example.LiveBroadcastExample;
import com.slodon.b2b2c.live.pojo.LiveBroadcast;
import com.slodon.b2b2c.live.vo.LivesVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class LiveJobModel {

    @Autowired
    private LiveBroadWriteMapper liveBroadWriteMapper;

    /**
     * 查找需要更新状态的直播间起始位置  起始房间，0表示从第1个房间开始拉取
     * @return
     * @param roomId
     */
    public Integer getLivesNum(Integer roomId) {
        return liveBroadWriteMapper.getLivesNum(roomId);
    }


    public void updateLivesType(List<LivesVO> livesVOS) {
        liveBroadWriteMapper.updateLivesType(livesVOS);
    }

    /**
     * 获取总数
     * @return
     */
    public Integer getLiveCount() {
        return liveBroadWriteMapper.countByExample(new LiveBroadcastExample());
    }

    public Integer getLiveRoomId() {
        return liveBroadWriteMapper.getLiveRoomId();
    }
}
