Commit a2bd91b1 by giaogiao

封装webrtc响应实体

parent b50bfc64
package com.wecloud.rtc;
import java.io.Serializable;
public class RtcSubCmd implements Serializable {
/**
* subCmd子类型指令码
*/
public static final String SUB_CMD = "subCmd";
}
package com.wecloud.rtc;
import java.io.Serializable;
public class SubCmd implements Serializable {
/**
* subCmd子类型指令码
*/
public static final String SUB_CMD = "subCmd";
/**
* 创建频道
*/
public static final String CREATE = "create";
/**
* 加入频道
*/
public static final String JOIN = "join";
/**
* 拒绝加入频道
*/
public static final String REJECT = "reject";
/**
* 主动挂断(离开频道)
*/
public static final String LEAVE = "leave";
// --- 服务端响应
/**
* 接收到RTC邀请
*/
public static final String RTC_CALL = "rtcCall";
/**
* 用户状态更新事件(用户加入,用户退出,用户拒接邀请)
*/
public static final String CLIENT_EVENT = "clientEvent";
/**
* 流状态更新(切换音频 切换视频)
*/
public static final String TYPE_EVENT = "typeEvent";
/**
* 状态更新(网络断开,挂断)
*/
public static final String STATUS_EVENT = "statusEvent";
/**
* SDP数据转发
*/
public static final String SDP = "SDP";
/**
* 忙线
*/
public static final String BUSY = "busy";
}
...@@ -12,8 +12,8 @@ import java.io.Serializable; ...@@ -12,8 +12,8 @@ import java.io.Serializable;
public class RtcChannelInfo implements Serializable { public class RtcChannelInfo implements Serializable {
@ApiModelProperty("当前房主") @ApiModelProperty("当前房主")
String owner; private String owner;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
Long createTimestamp; private Long createTimestamp;
} }
...@@ -12,11 +12,12 @@ import java.io.Serializable; ...@@ -12,11 +12,12 @@ import java.io.Serializable;
public class RtcJoinUser implements Serializable { public class RtcJoinUser implements Serializable {
@ApiModelProperty("客户端") @ApiModelProperty("客户端")
String clientId; private String clientId;
@ApiModelProperty("加入时间") @ApiModelProperty("加入时间")
Long createTimestamp; private Long createTimestamp;
String sdp; @ApiModelProperty("sdp")
private String sdp;
} }
package com.wecloud.rtc.entity.response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Data
public class RtcCallResponse extends RtcSubDataBase implements Serializable {
private String type;
private Long toConversation;
}
package com.wecloud.rtc.entity.response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Data
public class RtcCandidateForwardResponse extends RtcSubDataBase implements Serializable {
/**
* 转发的候选者数据
*/
private String candidateData;
}
package com.wecloud.rtc.entity.response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Data
public class RtcClientJoinResponse extends RtcSubDataBase implements Serializable {
}
package com.wecloud.rtc.entity.response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Data
public class RtcClientLeaveResponse extends RtcSubDataBase implements Serializable {
}
package com.wecloud.rtc.entity.response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Data
public class RtcClientRejectResponse extends RtcSubDataBase implements Serializable {
}
package com.wecloud.rtc.entity.response;
import lombok.Data;
import java.io.Serializable;
/**
* webRtc websocket下发数据封装类
*
* @param <T>
*/
@Data
public class RtcResponseBase<T> implements Serializable {
/**
* 子指令
*/
private Integer subCmd;
/**
* 根据不同子指令 不同的实体
*/
private T subData;
/**
* 自定义拓展字段
*/
private String attrs;
}
package com.wecloud.rtc.entity.response;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Data
public class RtcSdpForwardResponse extends RtcSubDataBase implements Serializable {
/**
* channelId : 1234263457652
* clientId : 7657567
* sdpData : xxxxxxxxxxxxxxxx
* sdpType : Offer/Answer
*/
private String sdpData;
private String sdpType;
}
package com.wecloud.rtc.entity.response;
import lombok.Data;
import java.io.Serializable;
@Data
public class RtcSubDataBase implements Serializable {
private Long channelId;
private String clientId;
private Long timestamp;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment