上传前端工具

This commit is contained in:
liwei1dao 2022-06-24 19:22:48 +08:00
parent d3f34de5b8
commit 4cd4b89be6
26 changed files with 1050 additions and 12689 deletions

11
package-lock.json generated
View File

@ -10,6 +10,7 @@
"dependencies": {
"@mdi/font": "5.9.55",
"core-js": "^3.8.3",
"google-protobuf": "^3.20.1",
"protobufjs": "^6.11.3",
"roboto-fontface": "*",
"vue": "^3.2.13",
@ -6808,6 +6809,11 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/google-protobuf": {
"version": "3.20.1",
"resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.20.1.tgz",
"integrity": "sha512-XMf1+O32FjYIV3CYu6Tuh5PNbfNEU5Xu22X+Xkdb/DUexFlCzhvv7d5Iirm4AOwn8lv4al1YvIhzGrg2j9Zfzw=="
},
"node_modules/graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.10.tgz",
@ -17377,6 +17383,11 @@
"slash": "^3.0.0"
}
},
"google-protobuf": {
"version": "3.20.1",
"resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.20.1.tgz",
"integrity": "sha512-XMf1+O32FjYIV3CYu6Tuh5PNbfNEU5Xu22X+Xkdb/DUexFlCzhvv7d5Iirm4AOwn8lv4al1YvIhzGrg2j9Zfzw=="
},
"graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.10.tgz",

View File

@ -10,6 +10,7 @@
"dependencies": {
"@mdi/font": "5.9.55",
"core-js": "^3.8.3",
"google-protobuf": "^3.20.1",
"protobufjs": "^6.11.3",
"roboto-fontface": "*",
"vue": "^3.2.13",

14
pb.bat
View File

@ -7,11 +7,13 @@ set PROJECT_ROOT=.
set SRC=%PROJECT_ROOT%\src\pb\proto
set TAR=%PROJECT_ROOT%\src\pb\js
protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\*.proto
protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\notify\*.proto
protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\user\*.proto
protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\friend\*.proto
protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\pack\*.proto
protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\mail\*.proto
@REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\*.proto
@REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\notify\*.proto
@REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\user\*.proto
@REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\friend\*.proto
@REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\pack\*.proto
@REM protoc --proto_path=%SRC% --js_out=import_style=commonjs,binary:%TAR%\. %SRC%\mail\*.proto
npx pbjs -t json-module -w commonjs -o src/pb/proto.js %SRC%\*.proto
pause

File diff suppressed because it is too large Load Diff

View File

@ -1,55 +0,0 @@
// source: errorcode.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
goog.exportSymbol('proto.ErrorCode', null, global);
/**
* @enum {number}
*/
proto.ErrorCode = {
SUCCESS: 0,
NOFINDSERVICE: 10,
NOFINDSERVICEHANDLEFUNC: 11,
RPCFUNCEXECUTIONERROR: 12,
CACHEREADERROR: 13,
SQLEXECUTIONERROR: 14,
REQPARAMETERERROR: 15,
SIGNERROR: 16,
INSUFFICIENTPERMISSIONS: 17,
NOLOGIN: 18,
USERSESSIONNOBEING: 19,
STATEINVALID: 20,
DBERROR: 21,
SYSTEMERROR: 22,
EXCEPTION: 100,
SECKEYINVALID: 1000,
SECKEY: 1001,
BINDUSER: 1002,
FRIENDNOTSELF: 1100,
FRIENDSELFMAX: 1101,
FRIENDTARGETMAX: 1102,
FRIENDSELFNODATA: 1103,
FRIENDTARGETNODATA: 1104,
FRIENDYET: 1105,
FRIENDAPPLYYET: 1106,
FRIENDSELFBLACKYET: 1107,
FRIENDTARGETBLACKYET: 1108,
FRIENDAPPLYERROR: 1109,
FRIENDBLACKMAX: 1110,
FRIENDSEARCHNAMEEMPTY: 1111
};
goog.object.extend(exports, proto);

View File

@ -1,324 +0,0 @@
// source: friend/friend_db.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
goog.exportSymbol('proto.DB_FriendData', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.DB_FriendData = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.DB_FriendData.repeatedFields_, null);
};
goog.inherits(proto.DB_FriendData, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.DB_FriendData.displayName = 'proto.DB_FriendData';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.DB_FriendData.repeatedFields_ = [2,3,4];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.DB_FriendData.prototype.toObject = function(opt_includeInstance) {
return proto.DB_FriendData.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.DB_FriendData} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.DB_FriendData.toObject = function(includeInstance, msg) {
var f, obj = {
uid: jspb.Message.getFieldWithDefault(msg, 1, ""),
friendidsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f,
applyidsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
blackidsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.DB_FriendData}
*/
proto.DB_FriendData.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.DB_FriendData;
return proto.DB_FriendData.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.DB_FriendData} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.DB_FriendData}
*/
proto.DB_FriendData.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setUid(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.addFriendids(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.addApplyids(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.addBlackids(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.DB_FriendData.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.DB_FriendData.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.DB_FriendData} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.DB_FriendData.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getUid();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getFriendidsList();
if (f.length > 0) {
writer.writeRepeatedString(
2,
f
);
}
f = message.getApplyidsList();
if (f.length > 0) {
writer.writeRepeatedString(
3,
f
);
}
f = message.getBlackidsList();
if (f.length > 0) {
writer.writeRepeatedString(
4,
f
);
}
};
/**
* optional string uId = 1;
* @return {string}
*/
proto.DB_FriendData.prototype.getUid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.setUid = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* repeated string friendIds = 2;
* @return {!Array<string>}
*/
proto.DB_FriendData.prototype.getFriendidsList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
};
/**
* @param {!Array<string>} value
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.setFriendidsList = function(value) {
return jspb.Message.setField(this, 2, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.addFriendids = function(value, opt_index) {
return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.clearFriendidsList = function() {
return this.setFriendidsList([]);
};
/**
* repeated string applyIds = 3;
* @return {!Array<string>}
*/
proto.DB_FriendData.prototype.getApplyidsList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
};
/**
* @param {!Array<string>} value
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.setApplyidsList = function(value) {
return jspb.Message.setField(this, 3, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.addApplyids = function(value, opt_index) {
return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.clearApplyidsList = function() {
return this.setApplyidsList([]);
};
/**
* repeated string blackIds = 4;
* @return {!Array<string>}
*/
proto.DB_FriendData.prototype.getBlackidsList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 4));
};
/**
* @param {!Array<string>} value
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.setBlackidsList = function(value) {
return jspb.Message.setField(this, 4, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.addBlackids = function(value, opt_index) {
return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.DB_FriendData} returns this
*/
proto.DB_FriendData.prototype.clearBlackidsList = function() {
return this.setBlackidsList([]);
};
goog.object.extend(exports, proto);

File diff suppressed because it is too large Load Diff

View File

@ -1,622 +0,0 @@
// source: mail/mail_db.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
goog.exportSymbol('proto.DB_MailData', null, global);
goog.exportSymbol('proto.MailAttachment', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.MailAttachment = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.MailAttachment, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.MailAttachment.displayName = 'proto.MailAttachment';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.DB_MailData = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.DB_MailData.repeatedFields_, null);
};
goog.inherits(proto.DB_MailData, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.DB_MailData.displayName = 'proto.DB_MailData';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.MailAttachment.prototype.toObject = function(opt_includeInstance) {
return proto.MailAttachment.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.MailAttachment} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MailAttachment.toObject = function(includeInstance, msg) {
var f, obj = {
itemid: jspb.Message.getFieldWithDefault(msg, 1, 0),
itemcount: jspb.Message.getFieldWithDefault(msg, 2, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.MailAttachment}
*/
proto.MailAttachment.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.MailAttachment;
return proto.MailAttachment.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.MailAttachment} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.MailAttachment}
*/
proto.MailAttachment.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readUint32());
msg.setItemid(value);
break;
case 2:
var value = /** @type {number} */ (reader.readUint32());
msg.setItemcount(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.MailAttachment.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.MailAttachment.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.MailAttachment} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MailAttachment.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getItemid();
if (f !== 0) {
writer.writeUint32(
1,
f
);
}
f = message.getItemcount();
if (f !== 0) {
writer.writeUint32(
2,
f
);
}
};
/**
* optional uint32 ItemId = 1;
* @return {number}
*/
proto.MailAttachment.prototype.getItemid = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.MailAttachment} returns this
*/
proto.MailAttachment.prototype.setItemid = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional uint32 ItemCount = 2;
* @return {number}
*/
proto.MailAttachment.prototype.getItemcount = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.MailAttachment} returns this
*/
proto.MailAttachment.prototype.setItemcount = function(value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.DB_MailData.repeatedFields_ = [9];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.DB_MailData.prototype.toObject = function(opt_includeInstance) {
return proto.DB_MailData.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.DB_MailData} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.DB_MailData.toObject = function(includeInstance, msg) {
var f, obj = {
objid: jspb.Message.getFieldWithDefault(msg, 1, ""),
uid: jspb.Message.getFieldWithDefault(msg, 2, ""),
title: jspb.Message.getFieldWithDefault(msg, 3, ""),
contex: jspb.Message.getFieldWithDefault(msg, 4, ""),
createtime: jspb.Message.getFieldWithDefault(msg, 5, 0),
duetime: jspb.Message.getFieldWithDefault(msg, 6, 0),
check: jspb.Message.getBooleanFieldWithDefault(msg, 7, false),
reward: jspb.Message.getBooleanFieldWithDefault(msg, 8, false),
itemsList: jspb.Message.toObjectList(msg.getItemsList(),
proto.MailAttachment.toObject, includeInstance)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.DB_MailData}
*/
proto.DB_MailData.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.DB_MailData;
return proto.DB_MailData.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.DB_MailData} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.DB_MailData}
*/
proto.DB_MailData.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setObjid(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setUid(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setTitle(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setContex(value);
break;
case 5:
var value = /** @type {number} */ (reader.readUint64());
msg.setCreatetime(value);
break;
case 6:
var value = /** @type {number} */ (reader.readUint64());
msg.setDuetime(value);
break;
case 7:
var value = /** @type {boolean} */ (reader.readBool());
msg.setCheck(value);
break;
case 8:
var value = /** @type {boolean} */ (reader.readBool());
msg.setReward(value);
break;
case 9:
var value = new proto.MailAttachment;
reader.readMessage(value,proto.MailAttachment.deserializeBinaryFromReader);
msg.addItems(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.DB_MailData.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.DB_MailData.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.DB_MailData} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.DB_MailData.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getObjid();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getUid();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getTitle();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getContex();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getCreatetime();
if (f !== 0) {
writer.writeUint64(
5,
f
);
}
f = message.getDuetime();
if (f !== 0) {
writer.writeUint64(
6,
f
);
}
f = message.getCheck();
if (f) {
writer.writeBool(
7,
f
);
}
f = message.getReward();
if (f) {
writer.writeBool(
8,
f
);
}
f = message.getItemsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
9,
f,
proto.MailAttachment.serializeBinaryToWriter
);
}
};
/**
* optional string ObjId = 1;
* @return {string}
*/
proto.DB_MailData.prototype.getObjid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.setObjid = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string Uid = 2;
* @return {string}
*/
proto.DB_MailData.prototype.getUid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.setUid = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string Title = 3;
* @return {string}
*/
proto.DB_MailData.prototype.getTitle = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.setTitle = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string Contex = 4;
* @return {string}
*/
proto.DB_MailData.prototype.getContex = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.setContex = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional uint64 CreateTime = 5;
* @return {number}
*/
proto.DB_MailData.prototype.getCreatetime = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.setCreatetime = function(value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
/**
* optional uint64 DueTime = 6;
* @return {number}
*/
proto.DB_MailData.prototype.getDuetime = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/**
* @param {number} value
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.setDuetime = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};
/**
* optional bool Check = 7;
* @return {boolean}
*/
proto.DB_MailData.prototype.getCheck = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false));
};
/**
* @param {boolean} value
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.setCheck = function(value) {
return jspb.Message.setProto3BooleanField(this, 7, value);
};
/**
* optional bool Reward = 8;
* @return {boolean}
*/
proto.DB_MailData.prototype.getReward = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false));
};
/**
* @param {boolean} value
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.setReward = function(value) {
return jspb.Message.setProto3BooleanField(this, 8, value);
};
/**
* repeated MailAttachment Items = 9;
* @return {!Array<!proto.MailAttachment>}
*/
proto.DB_MailData.prototype.getItemsList = function() {
return /** @type{!Array<!proto.MailAttachment>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.MailAttachment, 9));
};
/**
* @param {!Array<!proto.MailAttachment>} value
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.setItemsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 9, value);
};
/**
* @param {!proto.MailAttachment=} opt_value
* @param {number=} opt_index
* @return {!proto.MailAttachment}
*/
proto.DB_MailData.prototype.addItems = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.MailAttachment, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.DB_MailData} returns this
*/
proto.DB_MailData.prototype.clearItemsList = function() {
return this.setItemsList([]);
};
goog.object.extend(exports, proto);

File diff suppressed because it is too large Load Diff

View File

@ -1,292 +0,0 @@
// source: notify/notify_msg.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var errorcode_pb = require('../errorcode_pb.js');
goog.object.extend(proto, errorcode_pb);
goog.exportSymbol('proto.ErrorNotify', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.ErrorNotify = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.ErrorNotify, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ErrorNotify.displayName = 'proto.ErrorNotify';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.ErrorNotify.prototype.toObject = function(opt_includeInstance) {
return proto.ErrorNotify.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.ErrorNotify} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ErrorNotify.toObject = function(includeInstance, msg) {
var f, obj = {
reqmaintype: jspb.Message.getFieldWithDefault(msg, 1, ""),
reqsubtype: jspb.Message.getFieldWithDefault(msg, 2, ""),
code: jspb.Message.getFieldWithDefault(msg, 3, 0),
message: jspb.Message.getFieldWithDefault(msg, 4, ""),
data: jspb.Message.getFieldWithDefault(msg, 6, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.ErrorNotify}
*/
proto.ErrorNotify.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.ErrorNotify;
return proto.ErrorNotify.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.ErrorNotify} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.ErrorNotify}
*/
proto.ErrorNotify.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setReqmaintype(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setReqsubtype(value);
break;
case 3:
var value = /** @type {!proto.ErrorCode} */ (reader.readEnum());
msg.setCode(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setMessage(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setData(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.ErrorNotify.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.ErrorNotify.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.ErrorNotify} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ErrorNotify.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getReqmaintype();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReqsubtype();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getCode();
if (f !== 0.0) {
writer.writeEnum(
3,
f
);
}
f = message.getMessage();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getData();
if (f.length > 0) {
writer.writeString(
6,
f
);
}
};
/**
* optional string ReqMainType = 1;
* @return {string}
*/
proto.ErrorNotify.prototype.getReqmaintype = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.ErrorNotify} returns this
*/
proto.ErrorNotify.prototype.setReqmaintype = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string ReqSubType = 2;
* @return {string}
*/
proto.ErrorNotify.prototype.getReqsubtype = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.ErrorNotify} returns this
*/
proto.ErrorNotify.prototype.setReqsubtype = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional ErrorCode Code = 3;
* @return {!proto.ErrorCode}
*/
proto.ErrorNotify.prototype.getCode = function() {
return /** @type {!proto.ErrorCode} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {!proto.ErrorCode} value
* @return {!proto.ErrorNotify} returns this
*/
proto.ErrorNotify.prototype.setCode = function(value) {
return jspb.Message.setProto3EnumField(this, 3, value);
};
/**
* optional string Message = 4;
* @return {string}
*/
proto.ErrorNotify.prototype.getMessage = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.ErrorNotify} returns this
*/
proto.ErrorNotify.prototype.setMessage = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional string Data = 6;
* @return {string}
*/
proto.ErrorNotify.prototype.getData = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
};
/**
* @param {string} value
* @return {!proto.ErrorNotify} returns this
*/
proto.ErrorNotify.prototype.setData = function(value) {
return jspb.Message.setProto3StringField(this, 6, value);
};
goog.object.extend(exports, proto);

View File

@ -1,380 +0,0 @@
// source: pack/pack_db.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
goog.exportSymbol('proto.DB_UserItemData', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.DB_UserItemData = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.DB_UserItemData, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.DB_UserItemData.displayName = 'proto.DB_UserItemData';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.DB_UserItemData.prototype.toObject = function(opt_includeInstance) {
return proto.DB_UserItemData.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.DB_UserItemData} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.DB_UserItemData.toObject = function(includeInstance, msg) {
var f, obj = {
gridid: jspb.Message.getFieldWithDefault(msg, 1, ""),
uid: jspb.Message.getFieldWithDefault(msg, 2, ""),
isempty: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
itemid: jspb.Message.getFieldWithDefault(msg, 4, 0),
amount: jspb.Message.getFieldWithDefault(msg, 5, 0),
ctime: jspb.Message.getFieldWithDefault(msg, 6, 0),
etime: jspb.Message.getFieldWithDefault(msg, 7, 0),
isnewitem: jspb.Message.getBooleanFieldWithDefault(msg, 8, false)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.DB_UserItemData}
*/
proto.DB_UserItemData.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.DB_UserItemData;
return proto.DB_UserItemData.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.DB_UserItemData} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.DB_UserItemData}
*/
proto.DB_UserItemData.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setGridid(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setUid(value);
break;
case 3:
var value = /** @type {boolean} */ (reader.readBool());
msg.setIsempty(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt32());
msg.setItemid(value);
break;
case 5:
var value = /** @type {number} */ (reader.readUint32());
msg.setAmount(value);
break;
case 6:
var value = /** @type {number} */ (reader.readInt64());
msg.setCtime(value);
break;
case 7:
var value = /** @type {number} */ (reader.readInt64());
msg.setEtime(value);
break;
case 8:
var value = /** @type {boolean} */ (reader.readBool());
msg.setIsnewitem(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.DB_UserItemData.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.DB_UserItemData.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.DB_UserItemData} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.DB_UserItemData.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getGridid();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getUid();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getIsempty();
if (f) {
writer.writeBool(
3,
f
);
}
f = message.getItemid();
if (f !== 0) {
writer.writeInt32(
4,
f
);
}
f = message.getAmount();
if (f !== 0) {
writer.writeUint32(
5,
f
);
}
f = message.getCtime();
if (f !== 0) {
writer.writeInt64(
6,
f
);
}
f = message.getEtime();
if (f !== 0) {
writer.writeInt64(
7,
f
);
}
f = message.getIsnewitem();
if (f) {
writer.writeBool(
8,
f
);
}
};
/**
* optional string gridId = 1;
* @return {string}
*/
proto.DB_UserItemData.prototype.getGridid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.DB_UserItemData} returns this
*/
proto.DB_UserItemData.prototype.setGridid = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string uId = 2;
* @return {string}
*/
proto.DB_UserItemData.prototype.getUid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.DB_UserItemData} returns this
*/
proto.DB_UserItemData.prototype.setUid = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional bool isEmpty = 3;
* @return {boolean}
*/
proto.DB_UserItemData.prototype.getIsempty = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
};
/**
* @param {boolean} value
* @return {!proto.DB_UserItemData} returns this
*/
proto.DB_UserItemData.prototype.setIsempty = function(value) {
return jspb.Message.setProto3BooleanField(this, 3, value);
};
/**
* optional int32 itemId = 4;
* @return {number}
*/
proto.DB_UserItemData.prototype.getItemid = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/**
* @param {number} value
* @return {!proto.DB_UserItemData} returns this
*/
proto.DB_UserItemData.prototype.setItemid = function(value) {
return jspb.Message.setProto3IntField(this, 4, value);
};
/**
* optional uint32 amount = 5;
* @return {number}
*/
proto.DB_UserItemData.prototype.getAmount = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.DB_UserItemData} returns this
*/
proto.DB_UserItemData.prototype.setAmount = function(value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
/**
* optional int64 cTime = 6;
* @return {number}
*/
proto.DB_UserItemData.prototype.getCtime = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/**
* @param {number} value
* @return {!proto.DB_UserItemData} returns this
*/
proto.DB_UserItemData.prototype.setCtime = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};
/**
* optional int64 eTime = 7;
* @return {number}
*/
proto.DB_UserItemData.prototype.getEtime = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
};
/**
* @param {number} value
* @return {!proto.DB_UserItemData} returns this
*/
proto.DB_UserItemData.prototype.setEtime = function(value) {
return jspb.Message.setProto3IntField(this, 7, value);
};
/**
* optional bool isNewItem = 8;
* @return {boolean}
*/
proto.DB_UserItemData.prototype.getIsnewitem = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false));
};
/**
* @param {boolean} value
* @return {!proto.DB_UserItemData} returns this
*/
proto.DB_UserItemData.prototype.setIsnewitem = function(value) {
return jspb.Message.setProto3BooleanField(this, 8, value);
};
goog.object.extend(exports, proto);

File diff suppressed because it is too large Load Diff

View File

@ -1,712 +0,0 @@
// source: user/user_db.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
goog.exportSymbol('proto.Cache_UserData', null, global);
goog.exportSymbol('proto.DB_UserData', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.Cache_UserData = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.Cache_UserData, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.Cache_UserData.displayName = 'proto.Cache_UserData';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.DB_UserData = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.DB_UserData, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.DB_UserData.displayName = 'proto.DB_UserData';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.Cache_UserData.prototype.toObject = function(opt_includeInstance) {
return proto.Cache_UserData.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.Cache_UserData} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.Cache_UserData.toObject = function(includeInstance, msg) {
var f, obj = {
uid: jspb.Message.getFieldWithDefault(msg, 1, ""),
sessionid: jspb.Message.getFieldWithDefault(msg, 2, ""),
gatewayserviceid: jspb.Message.getFieldWithDefault(msg, 3, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.Cache_UserData}
*/
proto.Cache_UserData.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.Cache_UserData;
return proto.Cache_UserData.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.Cache_UserData} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.Cache_UserData}
*/
proto.Cache_UserData.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setUid(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setSessionid(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setGatewayserviceid(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.Cache_UserData.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.Cache_UserData.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.Cache_UserData} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.Cache_UserData.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getUid();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getSessionid();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getGatewayserviceid();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
};
/**
* optional string uid = 1;
* @return {string}
*/
proto.Cache_UserData.prototype.getUid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.Cache_UserData} returns this
*/
proto.Cache_UserData.prototype.setUid = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string SessionId = 2;
* @return {string}
*/
proto.Cache_UserData.prototype.getSessionid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.Cache_UserData} returns this
*/
proto.Cache_UserData.prototype.setSessionid = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string GatewayServiceId = 3;
* @return {string}
*/
proto.Cache_UserData.prototype.getGatewayserviceid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.Cache_UserData} returns this
*/
proto.Cache_UserData.prototype.setGatewayserviceid = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.DB_UserData.prototype.toObject = function(opt_includeInstance) {
return proto.DB_UserData.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.DB_UserData} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.DB_UserData.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
uid: jspb.Message.getFieldWithDefault(msg, 2, ""),
uuid: jspb.Message.getFieldWithDefault(msg, 3, ""),
binduid: jspb.Message.getFieldWithDefault(msg, 4, ""),
name: jspb.Message.getFieldWithDefault(msg, 5, ""),
sid: jspb.Message.getFieldWithDefault(msg, 6, 0),
createip: jspb.Message.getFieldWithDefault(msg, 7, ""),
lastloginip: jspb.Message.getFieldWithDefault(msg, 8, ""),
ctime: jspb.Message.getFieldWithDefault(msg, 9, 0),
logintime: jspb.Message.getFieldWithDefault(msg, 10, 0),
friendpoint: jspb.Message.getFieldWithDefault(msg, 11, 0),
avatar: jspb.Message.getFieldWithDefault(msg, 12, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.DB_UserData}
*/
proto.DB_UserData.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.DB_UserData;
return proto.DB_UserData.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.DB_UserData} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.DB_UserData}
*/
proto.DB_UserData.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setUid(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setUuid(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setBinduid(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 6:
var value = /** @type {number} */ (reader.readInt32());
msg.setSid(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setCreateip(value);
break;
case 8:
var value = /** @type {string} */ (reader.readString());
msg.setLastloginip(value);
break;
case 9:
var value = /** @type {number} */ (reader.readInt64());
msg.setCtime(value);
break;
case 10:
var value = /** @type {number} */ (reader.readInt64());
msg.setLogintime(value);
break;
case 11:
var value = /** @type {number} */ (reader.readInt32());
msg.setFriendpoint(value);
break;
case 12:
var value = /** @type {number} */ (reader.readInt32());
msg.setAvatar(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.DB_UserData.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.DB_UserData.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.DB_UserData} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.DB_UserData.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getUid();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getUuid();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getBinduid();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getName();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = message.getSid();
if (f !== 0) {
writer.writeInt32(
6,
f
);
}
f = message.getCreateip();
if (f.length > 0) {
writer.writeString(
7,
f
);
}
f = message.getLastloginip();
if (f.length > 0) {
writer.writeString(
8,
f
);
}
f = message.getCtime();
if (f !== 0) {
writer.writeInt64(
9,
f
);
}
f = message.getLogintime();
if (f !== 0) {
writer.writeInt64(
10,
f
);
}
f = message.getFriendpoint();
if (f !== 0) {
writer.writeInt32(
11,
f
);
}
f = message.getAvatar();
if (f !== 0) {
writer.writeInt32(
12,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.DB_UserData.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string uid = 2;
* @return {string}
*/
proto.DB_UserData.prototype.getUid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setUid = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string uuid = 3;
* @return {string}
*/
proto.DB_UserData.prototype.getUuid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setUuid = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string binduid = 4;
* @return {string}
*/
proto.DB_UserData.prototype.getBinduid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setBinduid = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional string name = 5;
* @return {string}
*/
proto.DB_UserData.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* @param {string} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setName = function(value) {
return jspb.Message.setProto3StringField(this, 5, value);
};
/**
* optional int32 sid = 6;
* @return {number}
*/
proto.DB_UserData.prototype.getSid = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/**
* @param {number} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setSid = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};
/**
* optional string createip = 7;
* @return {string}
*/
proto.DB_UserData.prototype.getCreateip = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
};
/**
* @param {string} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setCreateip = function(value) {
return jspb.Message.setProto3StringField(this, 7, value);
};
/**
* optional string lastloginip = 8;
* @return {string}
*/
proto.DB_UserData.prototype.getLastloginip = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
};
/**
* @param {string} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setLastloginip = function(value) {
return jspb.Message.setProto3StringField(this, 8, value);
};
/**
* optional int64 ctime = 9;
* @return {number}
*/
proto.DB_UserData.prototype.getCtime = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0));
};
/**
* @param {number} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setCtime = function(value) {
return jspb.Message.setProto3IntField(this, 9, value);
};
/**
* optional int64 logintime = 10;
* @return {number}
*/
proto.DB_UserData.prototype.getLogintime = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
};
/**
* @param {number} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setLogintime = function(value) {
return jspb.Message.setProto3IntField(this, 10, value);
};
/**
* optional int32 friendPoint = 11;
* @return {number}
*/
proto.DB_UserData.prototype.getFriendpoint = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0));
};
/**
* @param {number} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setFriendpoint = function(value) {
return jspb.Message.setProto3IntField(this, 11, value);
};
/**
* optional int32 avatar = 12;
* @return {number}
*/
proto.DB_UserData.prototype.getAvatar = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0));
};
/**
* @param {number} value
* @return {!proto.DB_UserData} returns this
*/
proto.DB_UserData.prototype.setAvatar = function(value) {
return jspb.Message.setProto3IntField(this, 12, value);
};
goog.object.extend(exports, proto);

File diff suppressed because it is too large Load Diff

861
src/pb/proto.js Normal file
View File

@ -0,0 +1,861 @@
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";
var $protobuf = require("protobufjs/light");
var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $protobuf.Root()))
.setOptions({
go_package: ".;pb"
})
.addJSON({
UserMessage: {
fields: {
MainType: {
type: "string",
id: 1
},
SubType: {
type: "string",
id: 2
},
data: {
type: "google.protobuf.Any",
id: 3
},
sec: {
type: "string",
id: 4
}
}
},
AgentMessage: {
fields: {
Ip: {
type: "string",
id: 1
},
UserSessionId: {
type: "string",
id: 2
},
UserId: {
type: "string",
id: 3
},
GatewayServiceId: {
type: "string",
id: 4
},
Method: {
type: "string",
id: 5
},
Message: {
type: "google.protobuf.Any",
id: 6
}
}
},
RPCMessageReply: {
fields: {
Code: {
type: "ErrorCode",
id: 1
},
Message: {
type: "string",
id: 2
},
Data: {
type: "string",
id: 3
}
}
},
AgentBuildReq: {
fields: {
UserSessionId: {
type: "string",
id: 1
},
UserId: {
type: "string",
id: 2
},
WorkerId: {
type: "string",
id: 3
}
}
},
AgentUnBuildReq: {
fields: {
UserSessionId: {
type: "string",
id: 1
}
}
},
AgentSendMessageReq: {
fields: {
UserSessionId: {
type: "string",
id: 1
},
MainType: {
type: "string",
id: 2
},
SubType: {
type: "string",
id: 3
},
Data: {
type: "google.protobuf.Any",
id: 4
}
}
},
BatchMessageReq: {
fields: {
UserSessionIds: {
rule: "repeated",
type: "string",
id: 1
},
MainType: {
type: "string",
id: 2
},
SubType: {
type: "string",
id: 3
},
Data: {
type: "google.protobuf.Any",
id: 4
}
}
},
BroadCastMessageReq: {
fields: {
MainType: {
type: "string",
id: 1
},
SubType: {
type: "string",
id: 2
},
Data: {
type: "google.protobuf.Any",
id: 3
}
}
},
AgentCloseeReq: {
fields: {
UserSessionId: {
type: "string",
id: 1
}
}
},
ErrorCode: {
values: {
Success: 0,
NoFindService: 10,
NoFindServiceHandleFunc: 11,
RpcFuncExecutionError: 12,
CacheReadError: 13,
SqlExecutionError: 14,
ReqParameterError: 15,
SignError: 16,
InsufficientPermissions: 17,
NoLogin: 18,
UserSessionNobeing: 19,
StateInvalid: 20,
DBError: 21,
SystemError: 22,
Exception: 100,
SecKeyInvalid: 1000,
SecKey: 1001,
BindUser: 1002,
FriendNotSelf: 1100,
FriendSelfMax: 1101,
FriendTargetMax: 1102,
FriendSelfNoData: 1103,
FriendTargetNoData: 1104,
FriendYet: 1105,
FriendApplyYet: 1106,
FriendSelfBlackYet: 1107,
FriendTargetBlackYet: 1108,
FriendApplyError: 1109,
FriendBlackMax: 1110,
FriendSearchNameEmpty: 1111
}
},
google: {
nested: {
protobuf: {
nested: {
Any: {
fields: {
type_url: {
type: "string",
id: 1
},
value: {
type: "bytes",
id: 2
}
}
}
}
}
}
},
DB_FriendData: {
fields: {
uId: {
type: "string",
id: 1
},
friendIds: {
rule: "repeated",
type: "string",
id: 2
},
applyIds: {
rule: "repeated",
type: "string",
id: 3
},
blackIds: {
rule: "repeated",
type: "string",
id: 4
}
}
},
FriendBase: {
fields: {
userId: {
type: "string",
id: 1
},
NickName: {
type: "string",
id: 2
},
level: {
type: "int32",
id: 3
},
avatar: {
type: "int32",
id: 4
},
strength: {
type: "int64",
id: 5
},
serverId: {
type: "int32",
id: 6
},
offlineTime: {
type: "int64",
id: 7
}
}
},
Friend_List_Req: {
fields: {}
},
Friend_List_Rsp: {
fields: {
list: {
rule: "repeated",
type: "FriendBase",
id: 1
}
}
},
Friend_Apply_Req: {
fields: {
friendId: {
type: "string",
id: 1
}
}
},
Friend_Apply_Rsp: {
fields: {
userId: {
type: "string",
id: 1
},
friendId: {
type: "string",
id: 2
}
}
},
Friend_Del_Req: {
fields: {
friendId: {
type: "string",
id: 1
}
}
},
Friend_Del_Rsp: {
fields: {
friendId: {
type: "string",
id: 1
},
userId: {
type: "string",
id: 2
}
}
},
Friend_Agree_Req: {
fields: {
friendIds: {
rule: "repeated",
type: "string",
id: 1
}
}
},
Friend_Agree_Rsp: {
fields: {
Num: {
type: "int32",
id: 1
}
}
},
Friend_Refuse_Req: {
fields: {
friendIds: {
rule: "repeated",
type: "string",
id: 1
}
}
},
Friend_Refuse_Rsp: {
fields: {
Num: {
type: "int32",
id: 1
}
}
},
Friend_ApplyList_Req: {
fields: {}
},
Friend_ApplyList_Rsp: {
fields: {
list: {
rule: "repeated",
type: "FriendBase",
id: 1
}
}
},
Friend_Search_Req: {
fields: {
nickName: {
type: "string",
id: 1
}
}
},
Friend_Search_Rsp: {
fields: {
friend: {
type: "FriendBase",
id: 1
}
}
},
Friend_BlackList_Req: {
fields: {}
},
Friend_BlackList_Rsp: {
fields: {
friends: {
rule: "repeated",
type: "FriendBase",
id: 1
}
}
},
Friend_BlackAdd_Req: {
fields: {
friendId: {
type: "string",
id: 1
}
}
},
Friend_BlackAdd_Rsp: {
fields: {
friendId: {
type: "string",
id: 1
},
userId: {
type: "string",
id: 2
}
}
},
Friend_DelBlack_Req: {
fields: {
friendId: {
type: "string",
id: 1
}
}
},
Friend_DelBlack_Rsp: {
fields: {
friendId: {
type: "string",
id: 1
},
userId: {
type: "string",
id: 2
}
}
},
Friend_Receive_Req: {
fields: {
friendId: {
type: "string",
id: 1
}
}
},
Friend_Receive_Rsp: {
fields: {
friendId: {
type: "string",
id: 1
},
userId: {
type: "string",
id: 2
}
}
},
Friend_Give_Req: {
fields: {
friendId: {
type: "string",
id: 1
}
}
},
Friend_Give_Rsp: {
fields: {
friendId: {
type: "string",
id: 1
},
userId: {
type: "string",
id: 2
}
}
},
Friend_Total_Req: {
fields: {
friendId: {
type: "string",
id: 1
}
}
},
Friend_Total_Rsp: {
fields: {
friendId: {
type: "string",
id: 1
},
total: {
type: "int32",
id: 2
}
}
},
MailAttachment: {
fields: {
ItemId: {
type: "uint32",
id: 1
},
ItemCount: {
type: "uint32",
id: 2
}
}
},
DB_MailData: {
fields: {
ObjId: {
type: "string",
id: 1
},
Uid: {
type: "string",
id: 2
},
Title: {
type: "string",
id: 3
},
Contex: {
type: "string",
id: 4
},
CreateTime: {
type: "uint64",
id: 5
},
DueTime: {
type: "uint64",
id: 6
},
Check: {
type: "bool",
id: 7
},
Reward: {
type: "bool",
id: 8
},
Items: {
rule: "repeated",
type: "MailAttachment",
id: 9
}
}
},
Mail_GetList_Req: {
fields: {}
},
Mail_GetList_Resp: {
fields: {
Mails: {
rule: "repeated",
type: "DB_MailData",
id: 1
}
}
},
Mail_ReadMail_Req: {
fields: {
ObjID: {
type: "string",
id: 1
}
}
},
Mail_ReadMail_Resp: {
fields: {
Mail: {
type: "DB_MailData",
id: 1
}
}
},
Mail_GetUserMailAttachment_Req: {
fields: {
ObjID: {
type: "string",
id: 1
}
}
},
Mail_GetUserMailAttachment_Resp: {
fields: {
Mail: {
type: "DB_MailData",
id: 1
}
}
},
Mail_DelMail_Req: {
fields: {
ObjID: {
type: "string",
id: 1
}
}
},
Mail_DelMail_Resp: {
fields: {
Mail: {
rule: "repeated",
type: "DB_MailData",
id: 1
}
}
},
ErrorNotify: {
fields: {
ReqMainType: {
type: "string",
id: 1
},
ReqSubType: {
type: "string",
id: 2
},
Code: {
type: "ErrorCode",
id: 3
},
Message: {
type: "string",
id: 4
},
Data: {
type: "string",
id: 6
}
}
},
DB_UserItemData: {
fields: {
gridId: {
type: "string",
id: 1
},
uId: {
type: "string",
id: 2
},
isEmpty: {
type: "bool",
id: 3
},
itemId: {
type: "int32",
id: 4
},
amount: {
type: "uint32",
id: 5
},
cTime: {
type: "int64",
id: 6
},
eTime: {
type: "int64",
id: 7
},
isNewItem: {
type: "bool",
id: 8
}
}
},
Pack_Getlist_Req: {
fields: {
IType: {
type: "int32",
id: 1
}
}
},
Pack_Getlist_Resp: {
fields: {
Grids: {
rule: "repeated",
type: "DB_UserItemData",
id: 1
}
}
},
Pack_UseItem_Req: {
fields: {
GridId: {
type: "int32",
id: 1
},
ItemId: {
type: "int32",
id: 2
},
Amount: {
type: "uint32",
id: 3
}
}
},
Pack_UseItem_Resp: {
fields: {}
},
Pack_SellItem_Req: {
fields: {
GridId: {
type: "int32",
id: 1
},
ItemId: {
type: "int32",
id: 2
},
Amount: {
type: "uint32",
id: 3
}
}
},
Pack_SellItem_Resp: {
fields: {}
},
Cache_UserData: {
fields: {
uid: {
type: "string",
id: 1
},
SessionId: {
type: "string",
id: 2
},
GatewayServiceId: {
type: "string",
id: 3
}
}
},
DB_UserData: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
uuid: {
type: "string",
id: 3
},
binduid: {
type: "string",
id: 4
},
name: {
type: "string",
id: 5
},
sid: {
type: "int32",
id: 6
},
createip: {
type: "string",
id: 7
},
lastloginip: {
type: "string",
id: 8
},
ctime: {
type: "int64",
id: 9
},
logintime: {
type: "int64",
id: 10
},
friendPoint: {
type: "int32",
id: 11
},
avatar: {
type: "int32",
id: 12
}
}
},
UserLoginReq: {
fields: {
account: {
type: "string",
id: 1
},
sid: {
type: "int32",
id: 2
}
}
},
UserLoginResp: {
fields: {
data: {
type: "DB_UserData",
id: 1
}
}
},
UserRegisterReq: {
fields: {
account: {
type: "string",
id: 1
},
sid: {
type: "int32",
id: 2
}
}
},
UserRegisterRsp: {
fields: {
Code: {
type: "ErrorCode",
id: 1
},
account: {
type: "string",
id: 2
}
}
},
UserLoadRsp: {
fields: {
data: {
type: "Cache_UserData",
id: 1
}
}
},
UserCreateReq: {
fields: {
NickName: {
type: "string",
id: 1
}
}
},
UserCreateRsp: {
fields: {}
}
});
module.exports = $root;

View File

@ -1,6 +1,6 @@
syntax = "proto3";
option go_package = ".;pb";
import "mail/mail_db.proto";
import "mail_db.proto";
message Mail_GetList_Req {

View File

@ -1,6 +1,6 @@
syntax = "proto3";
option go_package = ".;pb";
import "pack/pack_db.proto";
import "pack_db.proto";
//
message Pack_Getlist_Req {

View File

@ -1,7 +1,7 @@
syntax = "proto3";
option go_package = ".;pb";
import "errorcode.proto";
import "user/user_db.proto";
import "user_db.proto";
//
message UserLoginReq {

View File

@ -1,6 +1,3 @@
// 在Vue中使用不需要可以去除以下引用
import Vue from 'vue'
import storage from 'store'
// 导出socket对象
export {
@ -34,60 +31,14 @@ var socket = {
/**
* 初始化连接
*/
init: () => {
if (!("WebSocket" in window)) {
console.log('浏览器不支持WebSocket')
return null
}
// 已经创建过连接不再重复创建
if (socket.websock) {
return socket.websock
}
socket.websock = new WebSocket(socket.ws_url)
socket.websock.onmessage = function (e) {
socket.receive(e)
}
// 关闭连接
socket.websock.onclose = function (e) {
console.log('连接已断开')
console.log('connection closed (' + e.code + ')')
clearInterval(socket.hearbeat_interval)
socket.socket_open = false
// 需要重新连接
if (socket.is_reonnect) {
socket.reconnect_timer = setTimeout(() => {
// 超过重连次数
if (socket.reconnect_current > socket.reconnect_count) {
clearTimeout(socket.reconnect_timer)
return
}
// 记录重连次数
socket.reconnect_current++
socket.reconnect()
}, socket.reconnect_interval)
}
}
// 连接成功
socket.websock.onopen = function () {
console.log('连接成功')
socket.socket_open = true
socket.is_reonnect = true
// 开启心跳
socket.heartbeat()
}
// 连接发生错误
socket.websock.onerror = function () {
console.log('WebSocket连接发生错误')
}
init: (ws_url) => {
socket.ws_url = ws_url ? ws_url : socket.ws_url
return new Promise(socket.connect)
},
/**
* 发送消息
* @param {*} data 发送数据
@ -214,15 +165,63 @@ var socket = {
},
/**
* 重新连接
* 连接
*/
reconnect: () => {
console.log('发起重新连接', socket.reconnect_current)
connect: (resolve, reject) => {
console.log('连接服务器 连接次数', socket.reconnect_current)
if (socket.websock && socket.socket_open) {
socket.websock.close()
if (!("WebSocket" in window)) {
console.log('浏览器不支持WebSocket')
return reject("浏览器不支持WebSocket")
}
// 已经创建过连接不再重复创建
if (socket.websock) {
return resolve(socket.websock)
}
socket.websock = new WebSocket(socket.ws_url)
socket.websock.onmessage = function (e) {
socket.receive(e)
}
// 关闭连接
socket.websock.onclose = function (e) {
console.log('连接已断开')
console.log('connection closed (' + e.code + ')')
clearInterval(socket.hearbeat_interval)
socket.socket_open = false
socket.websock = null
// 需要重新连接
if (socket.is_reonnect) {
socket.reconnect_timer = setTimeout(() => {
// 超过重连次数
if (socket.reconnect_current > socket.reconnect_count) {
clearTimeout(socket.reconnect_timer)
return reject("超过重连次数")
}
// 记录重连次数
socket.reconnect_current++
return socket.connect(resolve, reject)
}, socket.reconnect_interval)
}
}
socket.init()
// 连接成功
socket.websock.onopen = function () {
console.log('连接成功')
socket.reconnect_current = 0
socket.socket_open = true
socket.is_reonnect = true
// 开启心跳
socket.heartbeat()
resolve(socket.websock)
}
// 连接发生错误
socket.websock.onerror = function () {
socket.websock = null
console.log('WebSocket连接发生错误')
// reject("WebSocket连接发生错误")
}
},
}

View File

@ -1,16 +1,119 @@
<template>
<v-container>
<v-card-title>
协议测试
</v-card-title>
<v-card>
<v-card-title>
协议测试
</v-card-title>
<v-card-text>
<v-row justify="start">
<v-col cols="6">
<v-text-field v-model="ws_url"
label="服务端连接地址"
variant="outlined"
clearable
:error="error"
:error-messages="error_message"
:disabled="isconnect || connecting"
clear-icon="mdi-cancel"></v-text-field>
</v-col>
<v-col cols="3">
<v-btn flat
:loading="connecting"
@click="isconnect ? disconnect():connect()"
color="secondary">
{{isconnect ? '断开':'连接'}}
</v-btn>
</v-col>
</v-row>
<v-divider inset></v-divider>
<v-row class="mt-5">
<v-col cols="4">
<v-select :items="proto_models"
label="选择测试模块"></v-select>
</v-col>
<v-col cols="4">
<v-select :items="proto_models"
label="选择子协议"></v-select>
</v-col>
</v-row>
</v-card-text>
</v-card>
<v-snackbar v-model="error">
{{ error_message }}
<template v-slot:actions>
<v-btn color="pink"
variant="text"
@click="error = false">
Close
</v-btn>
</template>
</v-snackbar>
</v-container>
</template>
<script>
import { reactive } from 'vue'
import proto from '@/pb/proto'
import { socket } from '@/utils/socket'
import { defineComponent } from 'vue'
export default defineComponent({
name: 'Protocol',
components: {},
data() {
return {
ws_url: 'ws://localhost:7891/gateway',
isconnect: false,
connecting: false,
error: false,
error_message: '',
protodata: {},
proto_models: [],
}
},
setup() {
const protodata = reactive([])
const proto_models = reactive([])
for (const v of Object.keys(proto)) {
let arr = v.split('_')
if (arr.length == 3) {
console.log(v)
var value = proto[v]
protodata[arr[0]] = value
console.log(value)
proto_models.push(arr[0])
}
}
return { protodata, proto_models }
},
onBeforeUnmount() {
//
socket.close()
},
methods: {
connect() {
//
this.connecting = true
socket
.init(this.ws_url)
.then((value) => {
this.error = false
this.error_message = ''
this.isconnect = true
this.connecting = false
})
.catch((error) => {
this.error = true
this.error_message = error
this.isconnect = false
this.connecting = false
})
},
disconnect() {
socket.close()
this.isconnect = false
},
loginreq() {},
},
})
</script>