mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-19 18:16:12 +00:00
test[protocol]: generate protobuf test
This commit is contained in:
1 parent
884a74da31
commit
1bd6914abb
3 files changed
+6
-20
No files matched your search
@@ -15,6 +15,7 @@ package com.zfoo.protocol.jprotobuf;
|
|||||||
|
|
||||||
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
|
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
|
||||||
import com.zfoo.protocol.IPacket;
|
import com.zfoo.protocol.IPacket;
|
||||||
|
import com.zfoo.protocol.registration.anno.Protocol;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -25,9 +26,9 @@ import java.util.Map;
|
|||||||
* @author godotg
|
* @author godotg
|
||||||
* @version 3.0
|
* @version 3.0
|
||||||
*/
|
*/
|
||||||
|
@Protocol(id = 102)
|
||||||
public class ObjectA implements IPacket {
|
public class ObjectA implements IPacket {
|
||||||
|
|
||||||
public static final transient short PROTOCOL_ID = 102;
|
|
||||||
|
|
||||||
// int类型,在protobuf中叫int32
|
// int类型,在protobuf中叫int32
|
||||||
@Protobuf(order = 1)
|
@Protobuf(order = 1)
|
||||||
@@ -44,9 +45,4 @@ public class ObjectA implements IPacket {
|
|||||||
@Protobuf(order = 3)
|
@Protobuf(order = 3)
|
||||||
public ObjectB objectB;
|
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.baidu.bjf.remoting.protobuf.annotation.Protobuf;
|
||||||
import com.zfoo.protocol.IPacket;
|
import com.zfoo.protocol.IPacket;
|
||||||
|
import com.zfoo.protocol.registration.anno.Protocol;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author godotg
|
* @author godotg
|
||||||
* @version 3.0
|
* @version 3.0
|
||||||
*/
|
*/
|
||||||
|
@Protocol(id = 103)
|
||||||
public class ObjectB implements IPacket {
|
public class ObjectB implements IPacket {
|
||||||
|
|
||||||
public static final transient short PROTOCOL_ID = 103;
|
|
||||||
|
|
||||||
@Protobuf(order = 1)
|
@Protobuf(order = 1)
|
||||||
public boolean flag;
|
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.baidu.bjf.remoting.protobuf.annotation.Protobuf;
|
||||||
import com.zfoo.protocol.IPacket;
|
import com.zfoo.protocol.IPacket;
|
||||||
|
import com.zfoo.protocol.registration.anno.Protocol;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -24,10 +25,9 @@ import java.util.Map;
|
|||||||
* @author godotg
|
* @author godotg
|
||||||
* @version 3.0
|
* @version 3.0
|
||||||
*/
|
*/
|
||||||
|
@Protocol(id = 104)
|
||||||
public class ObjectC implements IPacket {
|
public class ObjectC implements IPacket {
|
||||||
|
|
||||||
public static final transient short PROTOCOL_ID = 104;
|
|
||||||
|
|
||||||
// int类型,在protobuf中叫int32
|
// int类型,在protobuf中叫int32
|
||||||
@Protobuf(order = 1)
|
@Protobuf(order = 1)
|
||||||
public int a;
|
public int a;
|
||||||
@@ -43,9 +43,4 @@ public class ObjectC implements IPacket {
|
|||||||
@Protobuf(order = 3)
|
@Protobuf(order = 3)
|
||||||
public ObjectB objectB;
|
public ObjectB objectB;
|
||||||
|
|
||||||
@Override
|
|
||||||
public short protocolId() {
|
|
||||||
return PROTOCOL_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user