为直播间弹幕推送有关的事件设计接口以方便编程

This commit is contained in:
czp 2018-02-24 18:32:46 +08:00
parent f83edb1a96
commit 166559f2cf
16 changed files with 32 additions and 16 deletions

View File

@ -1,7 +1,5 @@
package com.hiczp.bilibili.api.live.socket.entity;
public interface RoomStatusEntity {
String getCmd();
public interface RoomStatusEntity extends DataEntity {
String getRoomId();
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.ActivityEventEntity;
public class ActivityEventPackageEvent extends ReceivePackageEvent<ActivityEventEntity> {
public class ActivityEventPackageEvent extends ReceiveDataPackageEvent<ActivityEventEntity> {
public ActivityEventPackageEvent(Object source, ActivityEventEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.DanMuMsgEntity;
public class DanMuMsgPackageEvent extends ReceivePackageEvent<DanMuMsgEntity> {
public class DanMuMsgPackageEvent extends ReceiveDataPackageEvent<DanMuMsgEntity> {
public DanMuMsgPackageEvent(Object source, DanMuMsgEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.GuardMsgEntity;
public class GuardMsgPackageEvent extends ReceivePackageEvent<GuardMsgEntity> {
public class GuardMsgPackageEvent extends ReceiveDataPackageEvent<GuardMsgEntity> {
public GuardMsgPackageEvent(Object source, GuardMsgEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.LiveEntity;
public class LivePackageEvent extends ReceivePackageEvent<LiveEntity> {
public class LivePackageEvent extends ReceiveRoomStatusPackageEvent<LiveEntity> {
public LivePackageEvent(Object source, LiveEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.PreparingEntity;
public class PreparingPackageEvent extends ReceivePackageEvent<PreparingEntity> {
public class PreparingPackageEvent extends ReceiveRoomStatusPackageEvent<PreparingEntity> {
public PreparingPackageEvent(Object source, PreparingEntity entity) {
super(source, entity);
}

View File

@ -0,0 +1,9 @@
package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.DataEntity;
public abstract class ReceiveDataPackageEvent<T extends DataEntity> extends ReceivePackageEvent<T> {
public ReceiveDataPackageEvent(Object source, T entity) {
super(source, entity);
}
}

View File

@ -0,0 +1,9 @@
package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.RoomStatusEntity;
public class ReceiveRoomStatusPackageEvent<T extends RoomStatusEntity> extends ReceiveDataPackageEvent<T> {
public ReceiveRoomStatusPackageEvent(Object source, T entity) {
super(source, entity);
}
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.RoomBlockMsgEntity;
public class RoomBlockMsgPackageEvent extends ReceivePackageEvent<RoomBlockMsgEntity> {
public class RoomBlockMsgPackageEvent extends ReceiveDataPackageEvent<RoomBlockMsgEntity> {
public RoomBlockMsgPackageEvent(Object source, RoomBlockMsgEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.RoomSilentOffEntity;
public class RoomSilentOffPackageEvent extends ReceivePackageEvent<RoomSilentOffEntity> {
public class RoomSilentOffPackageEvent extends ReceiveDataPackageEvent<RoomSilentOffEntity> {
public RoomSilentOffPackageEvent(Object source, RoomSilentOffEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.SendGiftEntity;
public class SendGiftPackageEvent extends ReceivePackageEvent<SendGiftEntity> {
public class SendGiftPackageEvent extends ReceiveDataPackageEvent<SendGiftEntity> {
public SendGiftPackageEvent(Object source, SendGiftEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.SysGiftEntity;
public class SysGiftPackageEvent extends ReceivePackageEvent<SysGiftEntity> {
public class SysGiftPackageEvent extends ReceiveDataPackageEvent<SysGiftEntity> {
public SysGiftPackageEvent(Object source, SysGiftEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.SysMsgEntity;
public class SysMsgPackageEvent extends ReceivePackageEvent<SysMsgEntity> {
public class SysMsgPackageEvent extends ReceiveDataPackageEvent<SysMsgEntity> {
public SysMsgPackageEvent(Object source, SysMsgEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.WelcomeGuardEntity;
public class WelcomeGuardPackageEvent extends ReceivePackageEvent<WelcomeGuardEntity> {
public class WelcomeGuardPackageEvent extends ReceiveDataPackageEvent<WelcomeGuardEntity> {
public WelcomeGuardPackageEvent(Object source, WelcomeGuardEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.WelcomeEntity;
public class WelcomePackageEvent extends ReceivePackageEvent<WelcomeEntity> {
public class WelcomePackageEvent extends ReceiveDataPackageEvent<WelcomeEntity> {
public WelcomePackageEvent(Object source, WelcomeEntity entity) {
super(source, entity);
}

View File

@ -2,7 +2,7 @@ package com.hiczp.bilibili.api.live.socket.event;
import com.hiczp.bilibili.api.live.socket.entity.WishBottleEntity;
public class WishBottlePackageEvent extends ReceivePackageEvent<WishBottleEntity> {
public class WishBottlePackageEvent extends ReceiveDataPackageEvent<WishBottleEntity> {
public WishBottlePackageEvent(Object source, WishBottleEntity entity) {
super(source, entity);
}