package com.sjyt.icom.asst.context.handle.room;

import com.sjyt.icom.asst.common.model.message.VerifyClaims;
import com.sjyt.icom.asst.common.model.room.ExtraInfo;
import com.sjyt.icom.asst.common.model.room.Room;
import com.sjyt.icom.asst.common.model.room.SrsUrlObj;
import com.sjyt.icom.asst.context.handle.BaseHandle;
import com.sjyt.icom.asst.service.impl.RoomManageService;
import com.sjyt.icom.asst.service.impl.StreamUrlServiceService;
import lombok.AllArgsConstructor;

/**
 * @author: Tab
 * @date: 2022-06-26 17:17
 * @since 1.0.0
 */
@AllArgsConstructor
public abstract class RoomFactoryHandle extends BaseHandle<RoomFactoryHandleEvent, Room> {
    protected final RoomManageService roomManage;
    private final StreamUrlServiceService urlService;

    public ExtraInfo initRoomData(VerifyClaims claims){
        //初始化权限码
        SrsUrlObj url = urlService.init(claims);
        //ExtraInfo
        return ExtraInfo.builder().uid(claims.getFrom()).urlObj(url).build();
    }

}
