仓库中添加内置的demo

This commit is contained in:
gongxh
2025-07-28 14:26:19 +08:00
parent 43446f031d
commit 65be0498cc
414 changed files with 14456 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
import * as $protobuf from "protobufjs";
import Long = require("long");
export namespace com {
namespace kunpo {
namespace proto {
interface ICommonMessage {
cmdCode?: (number|null);
protocolId?: (number|null);
data?: (Uint8Array|null);
responseStatus?: (number|null);
msg?: (string|null);
msgId?: (number|null);
}
class CommonMessage implements ICommonMessage {
constructor(p?: com.kunpo.proto.ICommonMessage);
public cmdCode: number;
public protocolId: number;
public data: Uint8Array;
public responseStatus: number;
public msg: string;
public msgId: number;
public static encode(m: com.kunpo.proto.ICommonMessage, w?: $protobuf.Writer): $protobuf.Writer;
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): com.kunpo.proto.CommonMessage;
}
namespace test {
interface IUserInfo {
userId?: (number|null);
userName?: (string|null);
nickName?: (string|null);
level?: (number|null);
createTime?: (number|null);
}
class UserInfo implements IUserInfo {
constructor(p?: com.kunpo.proto.test.IUserInfo);
public userId: number;
public userName: string;
public nickName: string;
public level: number;
public createTime: number;
public static encode(m: com.kunpo.proto.test.IUserInfo, w?: $protobuf.Writer): $protobuf.Writer;
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): com.kunpo.proto.test.UserInfo;
}
}
}
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "1508669b-41ae-40e9-b24e-c4af0f01120d",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1 @@
"use strict";var $protobuf=protobuf;var $Reader=$protobuf.Reader,$Writer=$protobuf.Writer,$util=$protobuf.util;var $root=$protobuf.roots["default"]||($protobuf.roots["default"]={});$root.com=function(){var com={};com.kunpo=function(){var kunpo={};kunpo.proto=function(){var proto={};proto.CommonMessage=function(){function CommonMessage(p){if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)this[ks[i]]=p[ks[i]]}CommonMessage.prototype.cmdCode=0;CommonMessage.prototype.protocolId=0;CommonMessage.prototype.data=$util.newBuffer([]);CommonMessage.prototype.responseStatus=0;CommonMessage.prototype.msg="";CommonMessage.prototype.msgId=0;CommonMessage.encode=function encode(m,w){if(!w)w=$Writer.create();if(m.cmdCode!=null&&Object.hasOwnProperty.call(m,"cmdCode"))w.uint32(8).int32(m.cmdCode);if(m.protocolId!=null&&Object.hasOwnProperty.call(m,"protocolId"))w.uint32(16).int32(m.protocolId);if(m.data!=null&&Object.hasOwnProperty.call(m,"data"))w.uint32(26).bytes(m.data);if(m.responseStatus!=null&&Object.hasOwnProperty.call(m,"responseStatus"))w.uint32(32).sint32(m.responseStatus);if(m.msg!=null&&Object.hasOwnProperty.call(m,"msg"))w.uint32(42).string(m.msg);if(m.msgId!=null&&Object.hasOwnProperty.call(m,"msgId"))w.uint32(48).int32(m.msgId);return w};CommonMessage.decode=function decode(r,l){if(!(r instanceof $Reader))r=$Reader.create(r);var c=l===undefined?r.len:r.pos+l,m=new $root.com.kunpo.proto.CommonMessage;while(r.pos<c){var t=r.uint32();switch(t>>>3){case 1:{m.cmdCode=r.int32();break}case 2:{m.protocolId=r.int32();break}case 3:{m.data=r.bytes();break}case 4:{m.responseStatus=r.sint32();break}case 5:{m.msg=r.string();break}case 6:{m.msgId=r.int32();break}default:r.skipType(t&7);break}}return m};return CommonMessage}();proto.test=function(){var test={};test.UserInfo=function(){function UserInfo(p){if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)this[ks[i]]=p[ks[i]]}UserInfo.prototype.userId=0;UserInfo.prototype.userName="";UserInfo.prototype.nickName="";UserInfo.prototype.level=0;UserInfo.prototype.createTime=$util.Long?$util.Long.fromBits(0,0,false):0;UserInfo.encode=function encode(m,w){if(!w)w=$Writer.create();if(m.userId!=null&&Object.hasOwnProperty.call(m,"userId"))w.uint32(8).int32(m.userId);if(m.userName!=null&&Object.hasOwnProperty.call(m,"userName"))w.uint32(18).string(m.userName);if(m.nickName!=null&&Object.hasOwnProperty.call(m,"nickName"))w.uint32(26).string(m.nickName);if(m.level!=null&&Object.hasOwnProperty.call(m,"level"))w.uint32(32).int32(m.level);if(m.createTime!=null&&Object.hasOwnProperty.call(m,"createTime"))w.uint32(40).int64(m.createTime);return w};UserInfo.decode=function decode(r,l){if(!(r instanceof $Reader))r=$Reader.create(r);var c=l===undefined?r.len:r.pos+l,m=new $root.com.kunpo.proto.test.UserInfo;while(r.pos<c){var t=r.uint32();switch(t>>>3){case 1:{m.userId=r.int32();break}case 2:{m.userName=r.string();break}case 3:{m.nickName=r.string();break}case 4:{m.level=r.int32();break}case 5:{m.createTime=r.int64();break}default:r.skipType(t&7);break}}return m};return UserInfo}();return test}();return proto}();return kunpo}();return com}();module.exports=$root;

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "javascript",
"imported": true,
"uuid": "e777207e-c569-4375-838f-aeb51ff06a30",
"files": [],
"subMetas": {},
"userData": {}
}