mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-05-23 08:26:05 +00:00
test[protocol]: generate protobuf test
This commit is contained in:
@@ -15,6 +15,7 @@ package com.zfoo.protocol.jprotobuf;
|
||||
|
||||
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
import com.zfoo.protocol.registration.anno.Protocol;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -25,9 +26,9 @@ import java.util.Map;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Protocol(id = 102)
|
||||
public class ObjectA implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 102;
|
||||
|
||||
// int类型,在protobuf中叫int32
|
||||
@Protobuf(order = 1)
|
||||
@@ -44,9 +45,4 @@ public class ObjectA implements IPacket {
|
||||
@Protobuf(order = 3)
|
||||
public ObjectB objectB;
|
||||
|
||||
@Override
|
||||
public short protocolId() {
|
||||
return PROTOCOL_ID;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,22 +15,17 @@ package com.zfoo.protocol.jprotobuf;
|
||||
|
||||
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
import com.zfoo.protocol.registration.anno.Protocol;
|
||||
|
||||
/**
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Protocol(id = 103)
|
||||
public class ObjectB implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 103;
|
||||
|
||||
@Protobuf(order = 1)
|
||||
public boolean flag;
|
||||
|
||||
@Override
|
||||
public short protocolId() {
|
||||
return PROTOCOL_ID;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ package com.zfoo.protocol.jprotobuf;
|
||||
|
||||
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
import com.zfoo.protocol.registration.anno.Protocol;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -24,10 +25,9 @@ import java.util.Map;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@Protocol(id = 104)
|
||||
public class ObjectC implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 104;
|
||||
|
||||
// int类型,在protobuf中叫int32
|
||||
@Protobuf(order = 1)
|
||||
public int a;
|
||||
@@ -43,9 +43,4 @@ public class ObjectC implements IPacket {
|
||||
@Protobuf(order = 3)
|
||||
public ObjectB objectB;
|
||||
|
||||
@Override
|
||||
public short protocolId() {
|
||||
return PROTOCOL_ID;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user