同步协议代码

This commit is contained in:
liwei1dao 2022-07-01 10:08:18 +08:00
parent 0c3cf4b7a1
commit f10707b45d
14 changed files with 570 additions and 451 deletions

BIN
dist.rar Normal file

Binary file not shown.

52
package-lock.json generated
View File

@ -16,7 +16,9 @@
"protobufjs": "^6.11.3", "protobufjs": "^6.11.3",
"roboto-fontface": "*", "roboto-fontface": "*",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-json-editor": "^1.4.3",
"vue-router": "^4.0.3", "vue-router": "^4.0.3",
"vue3-json-editor": "^1.1.5",
"vuetify": "npm:@vuetify/nightly@next", "vuetify": "npm:@vuetify/nightly@next",
"vuex": "^4.0.0", "vuex": "^4.0.0",
"vuex-persistedstate": "^4.1.0", "vuex-persistedstate": "^4.1.0",
@ -11645,6 +11647,23 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/vue-json-editor": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/vue-json-editor/-/vue-json-editor-1.4.3.tgz",
"integrity": "sha512-st9HdXBgCnyEmmfWrZQiKzp4KuYXzmYVUNDn5h6Fa18MrrGS1amnyUFyv7hQFsNBDW27B7BKkdGOqszYT1srAg==",
"dependencies": {
"vue": "^2.2.6"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
}
},
"node_modules/vue-json-editor/node_modules/vue": {
"version": "2.6.14",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz",
"integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ=="
},
"node_modules/vue-loader": { "node_modules/vue-loader": {
"version": "17.0.0", "version": "17.0.0",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-17.0.0.tgz", "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-17.0.0.tgz",
@ -11791,6 +11810,15 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/vue3-json-editor": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/vue3-json-editor/-/vue3-json-editor-1.1.5.tgz",
"integrity": "sha512-p+hbl5SdMifA9brPt9TsG2HYB7Xy7xy98b61zcIusVpwhGtS5a0IwWPKM7BXcj9poIdc/bPs4AFchQOHIBq++w==",
"dependencies": {
"core-js": "^3.21.1",
"vue": "^3.2.31"
}
},
"node_modules/vuetify": { "node_modules/vuetify": {
"name": "@vuetify/nightly", "name": "@vuetify/nightly",
"version": "3.0.0-next-20220621.0", "version": "3.0.0-next-20220621.0",
@ -20694,6 +20722,21 @@
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true "dev": true
}, },
"vue-json-editor": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/vue-json-editor/-/vue-json-editor-1.4.3.tgz",
"integrity": "sha512-st9HdXBgCnyEmmfWrZQiKzp4KuYXzmYVUNDn5h6Fa18MrrGS1amnyUFyv7hQFsNBDW27B7BKkdGOqszYT1srAg==",
"requires": {
"vue": "^2.2.6"
},
"dependencies": {
"vue": {
"version": "2.6.14",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz",
"integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ=="
}
}
},
"vue-loader": { "vue-loader": {
"version": "17.0.0", "version": "17.0.0",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-17.0.0.tgz", "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-17.0.0.tgz",
@ -20799,6 +20842,15 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true "dev": true
}, },
"vue3-json-editor": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/vue3-json-editor/-/vue3-json-editor-1.1.5.tgz",
"integrity": "sha512-p+hbl5SdMifA9brPt9TsG2HYB7Xy7xy98b61zcIusVpwhGtS5a0IwWPKM7BXcj9poIdc/bPs4AFchQOHIBq++w==",
"requires": {
"core-js": "^3.21.1",
"vue": "^3.2.31"
}
},
"vuetify": { "vuetify": {
"version": "npm:@vuetify/nightly@3.0.0-next-20220621.0", "version": "npm:@vuetify/nightly@3.0.0-next-20220621.0",
"resolved": "https://registry.npmmirror.com/@vuetify/nightly/-/nightly-3.0.0-next-20220621.0.tgz", "resolved": "https://registry.npmmirror.com/@vuetify/nightly/-/nightly-3.0.0-next-20220621.0.tgz",

View File

@ -16,7 +16,9 @@
"protobufjs": "^6.11.3", "protobufjs": "^6.11.3",
"roboto-fontface": "*", "roboto-fontface": "*",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-json-editor": "^1.4.3",
"vue-router": "^4.0.3", "vue-router": "^4.0.3",
"vue3-json-editor": "^1.1.5",
"vuetify": "npm:@vuetify/nightly@next", "vuetify": "npm:@vuetify/nightly@next",
"vuex": "^4.0.0", "vuex": "^4.0.0",
"vuex-persistedstate": "^4.1.0", "vuex-persistedstate": "^4.1.0",

View File

@ -364,7 +364,13 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
}, },
EquipmentEquipResp: { EquipmentEquipResp: {
fields: {} fields: {
Equipments: {
rule: "repeated",
type: "DB_Equipment",
id: 1
}
}
}, },
EquipmentUpgradeReq: { EquipmentUpgradeReq: {
fields: { fields: {
@ -375,7 +381,17 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
}, },
EquipmentUpgradeResp: { EquipmentUpgradeResp: {
fields: {} fields: {
IsSucc: {
type: "bool",
id: 1
},
Equipment: {
rule: "repeated",
type: "DB_Equipment",
id: 2
}
}
}, },
DBFriend: { DBFriend: {
fields: { fields: {
@ -658,373 +674,371 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
} }
} }
}, },
pb: { SkillData: {
nested: { fields: {
SkillData: { skillID: {
fields: { type: "int32",
skillID: { id: 1
type: "int32",
id: 1
},
skillLv: {
type: "int32",
id: 2
}
}
}, },
DBHero: { skillLv: {
fields: { type: "int32",
id: { id: 2
type: "string", }
id: 1 }
}, },
uid: { DBHero: {
type: "string", fields: {
id: 2 id: {
}, type: "string",
heroID: { id: 1
type: "int32",
id: 3
},
star: {
type: "int32",
id: 4
},
lv: {
type: "int32",
id: 5
},
exp: {
type: "int32",
id: 6
},
juexingLv: {
type: "int32",
id: 7
},
captainSkill: {
type: "int32",
id: 8
},
normalSkill: {
rule: "repeated",
type: "SkillData",
id: 9
},
property: {
keyType: "int32",
type: "int32",
id: 10
},
addProperty: {
keyType: "int32",
type: "int32",
id: 11
},
formation: {
type: "int32",
id: 12
},
cardType: {
type: "int32",
id: 13
},
curSkin: {
type: "int32",
id: 14
},
skins: {
rule: "repeated",
type: "int32",
id: 15
},
block: {
type: "bool",
id: 16
},
equipID: {
rule: "repeated",
type: "string",
id: 17
},
resonateNum: {
type: "int32",
id: 18
},
distributionResonate: {
type: "int32",
id: 19
},
energy: {
keyType: "int32",
type: "int32",
id: 20
},
sameCount: {
type: "int32",
id: 21
},
suiteId: {
type: "int32",
id: 22
},
suiteExtId: {
type: "int32",
id: 23
},
isOverlying: {
type: "bool",
id: 24
}
}
}, },
HeroInfoReq: { uid: {
fields: { type: "string",
heroId: { id: 2
type: "string",
id: 1
}
}
}, },
HeroInfoRsp: { heroID: {
fields: { type: "int32",
base: { id: 3
type: "DBHero",
id: 1
}
}
}, },
HeroListReq: { star: {
fields: {} type: "int32",
id: 4
}, },
HeroListRsp: { lv: {
fields: { type: "int32",
list: { id: 5
rule: "repeated",
type: "DBHero",
id: 1
}
}
}, },
ItemData: { exp: {
fields: { type: "int32",
itemId: { id: 6
type: "int32",
id: 2
},
amount: {
type: "int32",
id: 3
}
}
}, },
HeroStrengthenUplvReq: { juexingLv: {
fields: { type: "int32",
heroObjID: { id: 7
type: "string",
id: 1
},
expCardID: {
type: "string",
id: 2
},
amount: {
type: "int32",
id: 3
}
}
}, },
HeroStrengthenUplvResp: { captainSkill: {
fields: { type: "int32",
hero: { id: 8
type: "DBHero",
id: 1
}
}
}, },
CostCardData: { normalSkill: {
fields: { rule: "repeated",
costCardObj: { type: "SkillData",
type: "string", id: 9
id: 1
},
amount: {
type: "int32",
id: 2
}
}
}, },
HeroStrengthenUpStarReq: { property: {
fields: { keyType: "string",
heroObjID: { type: "int32",
type: "string", id: 10
id: 1
},
hero: {
rule: "repeated",
type: "CostCardData",
id: 2
},
heroRace: {
rule: "repeated",
type: "CostCardData",
id: 3
}
}
}, },
HeroStrengthenUpStarResp: { addProperty: {
fields: { keyType: "string",
hero: { type: "int32",
type: "DBHero", id: 11
id: 1
}
}
}, },
HeroStrengthenUpSkillReq: { formation: {
fields: { type: "int32",
heroObjID: { id: 12
type: "string",
id: 1
},
costCardObj: {
type: "string",
id: 2
}
}
}, },
HeroStrengthenUpSkillResp: { cardType: {
fields: { type: "int32",
hero: { id: 13
type: "DBHero",
id: 1
}
}
}, },
HeroResonanceReq: { curSkin: {
fields: { type: "int32",
heroObjID: { id: 14
type: "string",
id: 1
},
costObjID: {
type: "string",
id: 2
},
amount: {
type: "int32",
id: 3
}
}
}, },
HeroResonanceResp: { skins: {
fields: { rule: "repeated",
hero: { type: "int32",
type: "DBHero", id: 15
id: 1
},
energy: {
type: "int32",
id: 2
},
upStarCard: {
type: "DBHero",
id: 3
}
}
}, },
HeroResonanceResetReq: { block: {
fields: { type: "bool",
heroObjID: { id: 16
type: "string",
id: 1
}
}
}, },
HeroResonanceResetResp: { equipID: {
fields: { rule: "repeated",
hero: { type: "string",
type: "DBHero", id: 17
id: 1
},
energy: {
type: "int32",
id: 2
}
}
}, },
HeroResonanceUseEnergyReq: { resonateNum: {
fields: { type: "int32",
heroObjID: { id: 18
type: "string",
id: 1
},
useEnergy: {
type: "int32",
id: 2
},
useType: {
type: "int32",
id: 3
}
}
}, },
HeroResonanceUseEnergyResp: { distributionResonate: {
fields: { type: "int32",
hero: { id: 19
type: "DBHero",
id: 1
}
}
}, },
HeroJuexingReq: { energy: {
fields: { keyType: "int32",
heroObjID: { type: "int32",
type: "string", id: 20
id: 1
},
costItmes: {
type: "ItemData",
id: 2
}
}
}, },
HeroJuexingResp: { sameCount: {
fields: { type: "int32",
hero: { id: 21
type: "DBHero",
id: 1
}
}
}, },
HeroChoukaReq: { suiteId: {
fields: {} type: "int32",
id: 22
}, },
HeroChoukaResp: { suiteExtId: {
fields: { type: "int32",
heroes: { id: 23
rule: "repeated",
type: "DBHero",
id: 1
}
}
}, },
HeroProperty: { isOverlying: {
fields: { type: "bool",
heroId: { id: 24
type: "string", }
id: 1 }
}, },
property: { HeroInfoReq: {
keyType: "int32", fields: {
type: "int32", heroId: {
id: 2 type: "string",
}, id: 1
addProperty: { }
keyType: "int32", }
type: "int32", },
id: 3 HeroInfoRsp: {
} fields: {
} base: {
type: "DBHero",
id: 1
}
}
},
HeroListReq: {
fields: {}
},
HeroListRsp: {
fields: {
list: {
rule: "repeated",
type: "DBHero",
id: 1
}
}
},
ItemData: {
fields: {
itemId: {
type: "int32",
id: 2
},
amount: {
type: "int32",
id: 3
}
}
},
HeroStrengthenUplvReq: {
fields: {
heroObjID: {
type: "string",
id: 1
},
expCardID: {
type: "string",
id: 2
},
amount: {
type: "int32",
id: 3
}
}
},
HeroStrengthenUplvResp: {
fields: {
hero: {
type: "DBHero",
id: 1
}
}
},
CostCardData: {
fields: {
costCardObj: {
type: "string",
id: 1
},
amount: {
type: "int32",
id: 2
}
}
},
HeroStrengthenUpStarReq: {
fields: {
heroObjID: {
type: "string",
id: 1
},
hero: {
rule: "repeated",
type: "CostCardData",
id: 2
},
heroRace: {
rule: "repeated",
type: "CostCardData",
id: 3
}
}
},
HeroStrengthenUpStarResp: {
fields: {
hero: {
type: "DBHero",
id: 1
}
}
},
HeroStrengthenUpSkillReq: {
fields: {
heroObjID: {
type: "string",
id: 1
},
costCardObj: {
type: "string",
id: 2
}
}
},
HeroStrengthenUpSkillResp: {
fields: {
hero: {
type: "DBHero",
id: 1
}
}
},
HeroResonanceReq: {
fields: {
heroObjID: {
type: "string",
id: 1
},
costObjID: {
type: "string",
id: 2
},
amount: {
type: "int32",
id: 3
}
}
},
HeroResonanceResp: {
fields: {
hero: {
type: "DBHero",
id: 1
},
energy: {
type: "int32",
id: 2
},
upStarCard: {
type: "DBHero",
id: 3
}
}
},
HeroResonanceResetReq: {
fields: {
heroObjID: {
type: "string",
id: 1
}
}
},
HeroResonanceResetResp: {
fields: {
hero: {
type: "DBHero",
id: 1
},
energy: {
type: "int32",
id: 2
}
}
},
HeroResonanceUseEnergyReq: {
fields: {
heroObjID: {
type: "string",
id: 1
},
useEnergy: {
type: "int32",
id: 2
},
useType: {
type: "int32",
id: 3
}
}
},
HeroResonanceUseEnergyResp: {
fields: {
hero: {
type: "DBHero",
id: 1
}
}
},
HeroAwakenReq: {
fields: {
heroObjID: {
type: "string",
id: 1
}
}
},
HeroAwakenResp: {
fields: {
hero: {
type: "DBHero",
id: 1
}
}
},
HeroChoukaReq: {
fields: {
heroIds: {
rule: "repeated",
type: "int32",
id: 1
}
}
},
HeroChoukaResp: {
fields: {
heroes: {
rule: "repeated",
type: "DBHero",
id: 1
}
}
},
HeroProperty: {
fields: {
heroId: {
type: "string",
id: 1
},
property: {
keyType: "string",
type: "int32",
id: 2
},
addProperty: {
keyType: "string",
type: "int32",
id: 3
} }
} }
}, },
@ -1038,28 +1052,28 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
type: "string", type: "string",
id: 2 id: 2
}, },
isEmpty: {
type: "bool",
id: 3
},
itemId: { itemId: {
type: "int32", type: "int32",
id: 4 id: 3
}, },
amount: { amount: {
type: "uint32", type: "uint32",
id: 5 id: 4
}, },
cTime: { cTime: {
type: "int64", type: "int64",
id: 6 id: 5
}, },
eTime: { eTime: {
type: "int64", type: "int64",
id: 7 id: 6
}, },
isNewItem: { isNewItem: {
type: "bool", type: "bool",
id: 7
},
lastopt: {
type: "int64",
id: 8 id: 8
} }
} }
@ -1330,6 +1344,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
exp: { exp: {
type: "int32", type: "int32",
id: 14 id: 14
},
created: {
type: "bool",
id: 15
} }
} }
}, },
@ -1395,6 +1413,30 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}, },
UserCreateRsp: { UserCreateRsp: {
fields: {} fields: {}
},
UserAddResReq: {
fields: {
resType: {
type: "string",
id: 1
},
count: {
type: "int32",
id: 2
}
}
},
UserAddResResp: {
fields: {
resType: {
type: "string",
id: 1
},
count: {
type: "int32",
id: 2
}
}
} }
}); });

View File

@ -3,31 +3,31 @@ option go_package = ".;pb";
import "equipment_db.proto"; import "equipment_db.proto";
// //
message EquipmentGetListReq { message EquipmentGetListReq {}
}
// //
message EquipmentGetListResp { message EquipmentGetListResp {
repeated DB_Equipment Equipments = 1; // repeated DB_Equipment Equipments = 1; //
} }
// //
message EquipmentEquipReq{ message EquipmentEquipReq {
string HeroCardId = 1; //Id string HeroCardId = 1; //Id
repeated string EquipmentId = 2; //Id 0-5 repeated string EquipmentId = 2; //Id 0-5
} }
// //
message EquipmentEquipResp{ message EquipmentEquipResp {
repeated DB_Equipment Equipments = 1; //
} }
// //
message EquipmentUpgradeReq{ message EquipmentUpgradeReq {
string EquipmentId = 1; //Id string EquipmentId = 1; //Id
} }
// //
message EquipmentUpgradeResp{ message EquipmentUpgradeResp {
bool IsSucc = 1;
repeated DB_Equipment Equipment =
2; //
} }

View File

@ -1,6 +1,5 @@
syntax = "proto3"; syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
package pb;
message SkillData { message SkillData {
int32 skillID = 1; int32 skillID = 1;
@ -17,8 +16,8 @@ message DBHero {
int32 juexingLv = 7; //@go_tags(`bson:"juexingLv"`) int32 juexingLv = 7; //@go_tags(`bson:"juexingLv"`)
int32 captainSkill = 8; //@go_tags(`bson:"captainSkill"`) int32 captainSkill = 8; //@go_tags(`bson:"captainSkill"`)
repeated SkillData normalSkill = 9; //@go_tags(`bson:"normalSkill"`) repeated SkillData normalSkill = 9; //@go_tags(`bson:"normalSkill"`)
map<int32, int32> property = 10; // map<string, int32> property = 10; //
map<int32, int32> addProperty = map<string, int32> addProperty =
11; //@go_tags(`bson:"addProperty"`) 11; //@go_tags(`bson:"addProperty"`)
int32 formation = 12; // int32 formation = 12; //
int32 cardType = int32 cardType =

View File

@ -1,6 +1,5 @@
syntax = "proto3"; syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
package pb;
import "hero_db.proto"; import "hero_db.proto";
// //
@ -66,7 +65,7 @@ message HeroStrengthenUpSkillResp {
message HeroResonanceReq { message HeroResonanceReq {
string heroObjID = 1; // ID string heroObjID = 1; // ID
string costObjID = 2; // string costObjID = 2; //
int32 amount = 3;// int32 amount = 3; //
} }
message HeroResonanceResp { message HeroResonanceResp {
@ -97,24 +96,23 @@ message HeroResonanceUseEnergyResp {
} }
// //
message HeroJuexingReq { message HeroAwakenReq {
string heroObjID = 1; // ID string heroObjID = 1; // ID
ItemData costItmes = 2; //
} }
// //
message HeroJuexingResp { message HeroAwakenResp {
DBHero hero = 1; // DBHero hero = 1; //
} }
// //
message HeroChoukaReq {} message HeroChoukaReq { repeated int32 heroIds = 1; }
message HeroChoukaResp { repeated DBHero heroes = 1; } message HeroChoukaResp { repeated DBHero heroes = 1; }
// //
message HeroProperty { message HeroProperty {
string heroId = 1; //ID string heroId = 1; //ID
map<int32, int32> property = 2; // map<string, int32> property = 2; //
map<int32, int32> addProperty = 3; // map<string, int32> addProperty = 3; //
} }

View File

@ -6,10 +6,10 @@ option go_package = ".;pb";
message DB_UserItemData { message DB_UserItemData {
string gridId = 1; //@go_tags(`bson:"_id"`) Id string gridId = 1; //@go_tags(`bson:"_id"`) Id
string uId = 2; //@go_tags(`bson:"uid"`) id string uId = 2; //@go_tags(`bson:"uid"`) id
bool isEmpty = 3; //@go_tags(`bson:"isEmpty"`) int32 itemId = 3; //@go_tags(`bson:"itemId"`) Id
int32 itemId = 4; //@go_tags(`bson:"itemId"`) Id uint32 amount = 4; //@go_tags(`bson:"amount"`)
uint32 amount = 5; //@go_tags(`bson:"amount"`) int64 cTime = 5; //@go_tags(`bson:"cTime"`)
int64 cTime = 6; //@go_tags(`bson:"cTime"`) int64 eTime = 6; //@go_tags(`bson:"eTime"`)
int64 eTime = 7; //@go_tags(`bson:"eTime"`) bool isNewItem = 7; //@go_tags(`bson:"isNewItem"`)
bool isNewItem = 8; //@go_tags(`bson:"isNewItem"`) int64 lastopt = 8; //@go_tags(`bson:"lastopt"`)
} }

View File

@ -4,34 +4,30 @@ import "items_db.proto";
// //
message ItemsGetlistReq { message ItemsGetlistReq {
int32 IType = 1; // int32 IType = 1; //
} }
// //
message ItemsGetlistResp { message ItemsGetlistResp {
repeated DB_UserItemData Grids = 1; // repeated DB_UserItemData Grids = 1; //
} }
//使 //使
message ItemsUseItemReq { message ItemsUseItemReq {
int32 GridId = 1; //Id int32 GridId = 1; //Id
int32 ItemId = 2; //Id int32 ItemId = 2; //Id
uint32 Amount = 3; //使 uint32 Amount = 3; //使
} }
//使 //使
message ItemsUseItemResp { message ItemsUseItemResp {}
}
//sailitem //sailitem
message ItemsSellItemReq { message ItemsSellItemReq {
int32 GridId = 1; //Id int32 GridId = 1; //Id
int32 ItemId = 2; //Id int32 ItemId = 2; //Id
uint32 Amount = 3; //使 uint32 Amount = 3; //使
} }
// //
message ItemsSellItemResp { message ItemsSellItemResp {}
}

View File

@ -2,38 +2,22 @@ syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
import "mail_db.proto"; import "mail_db.proto";
message MailGetListReq { message MailGetListReq {}
}
// //
message MailGetListResp { message MailGetListResp { repeated DBMailData Mails = 1; }
repeated DBMailData Mails = 1;
}
// //
message MailReadMailReq { message MailReadMailReq { string ObjID = 1; }
string ObjID = 1;
}
message MailReadMailResp { message MailReadMailResp { DBMailData Mail = 1; }
DBMailData Mail = 1;
}
// //
message MailGetUserMailAttachmentReq { message MailGetUserMailAttachmentReq { string ObjID = 1; }
string ObjID = 1;
}
message MailGetUserMailAttachmentResp { message MailGetUserMailAttachmentResp { DBMailData Mail = 1; }
DBMailData Mail = 1;
}
// //
message MailDelMailReq { message MailDelMailReq { string ObjID = 1; }
string ObjID = 1;
}
message MailDelMailResp { message MailDelMailResp { repeated DBMailData Mail = 1; }
repeated DBMailData Mail = 1;
}

View File

@ -2,12 +2,11 @@ syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
import "errorcode.proto"; import "errorcode.proto";
// //
message NotifyErrorNotifyPush { message NotifyErrorNotifyPush {
string ReqMainType = 1; // :user user的模块 string ReqMainType =1; // :user user的模块
string ReqSubType = 2; // :login user的模块中 string ReqSubType = 2; // :login user的模块中 api_login
// api_login ErrorCode Code = 3; // errorcode.proto
ErrorCode Code = 3; // errorcode.proto string Message = 4; //
string Message = 4; // string Data = 6; //
string Data = 6; //
} }

View File

@ -23,4 +23,5 @@ message DBUser {
int32 avatar = 12; //@go_tags(`bson:"avatar"`) int32 avatar = 12; //@go_tags(`bson:"avatar"`)
int32 gold = 13; //@go_tags(`bson:"gold"`) int32 gold = 13; //@go_tags(`bson:"gold"`)
int32 exp = 14; //@go_tags(`bson:"exp"`) int32 exp = 14; //@go_tags(`bson:"exp"`)
bool created = 15; //@go_tags(`bson:"created"`)
} }

View File

@ -28,4 +28,15 @@ message UserCreateReq {
string NickName = 1; // string NickName = 1; //
} }
message UserCreateRsp {} message UserCreateRsp {}
//
message UserAddResReq {
string resType = 1; //
int32 count = 2; //
}
message UserAddResResp {
string resType = 1; //
int32 count = 2; //
}

View File

@ -56,14 +56,30 @@
<v-col v-for="item in reqproto" <v-col v-for="item in reqproto"
:key="item.FieldName" :key="item.FieldName"
cols="4"> cols="4">
<v-text-field color="tertiary"
v-model="item.FieldValue" <v-card>
:label="item.FieldName" <v-card-title>{{item.FieldName}}</v-card-title>
:type="item.FieldType" <v-card-text>
:hint="item.FieldType" <v-text-field v-if="item.FieldType != 'Object'"
:disabled="!isconnect" color="tertiary"
outlined v-model="item.FieldValue"
clearable></v-text-field> :label="item.FieldName"
:type="item.FieldType"
:hint="item.FieldType"
:disabled="!isconnect"
outlined
clearable></v-text-field>
<Vue3JsonEditor v-else
v-model="item.FieldValue"
@json-change="(v)=>{item.FieldValue = v}"
:showBtns="false"
:mode="'code'"
lang="zh"
:expandedOnStart="false"></Vue3JsonEditor>
</v-card-text>
</v-card>
</v-col> </v-col>
</v-row> </v-row>
<v-row class="mt-5"> <v-row class="mt-5">
@ -145,11 +161,12 @@ import md5 from 'js-md5'
import { reactive } from 'vue' import { reactive } from 'vue'
import proto from '@/pb/proto' import proto from '@/pb/proto'
import { socket } from '@/utils/socket' import { socket } from '@/utils/socket'
import { Vue3JsonEditor } from 'vue3-json-editor'
import { defineComponent } from 'vue' import { defineComponent } from 'vue'
export default defineComponent({ export default defineComponent({
name: 'Protocol', name: 'Protocol',
components: {}, components: { Vue3JsonEditor },
data() { data() {
return { return {
ws_url: 'ws://localhost:7891/gateway', ws_url: 'ws://localhost:7891/gateway',
@ -168,6 +185,7 @@ export default defineComponent({
logs: [], logs: [],
isshow: true, isshow: true,
showdata: { name: 'liwei1dao', aog: 123 }, showdata: { name: 'liwei1dao', aog: 123 },
resultInfo: { li: 123 },
} }
}, },
computed: {}, computed: {},
@ -183,8 +201,8 @@ export default defineComponent({
]) ])
for (const v of Object.keys(proto)) { for (const v of Object.keys(proto)) {
for (const v1 of proto_models) { for (const v1 of proto_models) {
// console.log('protoName', v)
let protoName = v.toLowerCase() let protoName = v.toLowerCase()
// console.log('protoName', protoName)
// //
let index = protoName.indexOf(v1.mainType) let index = protoName.indexOf(v1.mainType)
if (index == 0) { if (index == 0) {
@ -208,7 +226,7 @@ export default defineComponent({
subType: sub, subType: sub,
reqproto: proto[v], reqproto: proto[v],
}) })
console.log(sub + 'Req') // console.log(sub + 'Req')
} }
} }
if (respindex != -1) { if (respindex != -1) {
@ -229,7 +247,7 @@ export default defineComponent({
subType: sub, subType: sub,
respproto: proto[v], respproto: proto[v],
}) })
console.log(sub + 'Resp') // console.log(sub + 'Resp')
} }
} }
if (pushindex != -1) { if (pushindex != -1) {
@ -250,7 +268,7 @@ export default defineComponent({
subType: sub, subType: sub,
pushproto: proto[v], pushproto: proto[v],
}) })
console.log(sub + 'Resp') // console.log(sub + 'Resp')
} }
} }
} }
@ -300,11 +318,11 @@ export default defineComponent({
this.reqproto = [] this.reqproto = []
}, },
subSelectUpdate(v) { subSelectUpdate(v) {
console.log(v)
this.reqproto = [] this.reqproto = []
let keys = Object.keys(this.subSelect.reqproto.fields) let keys = Object.keys(this.subSelect.reqproto.fields)
for (const v of keys) { for (const v of keys) {
let ftype = this.subSelect.reqproto.fields[v].type let ftype = this.subSelect.reqproto.fields[v].type
console.log('ftype', ftype)
let fvalue = null let fvalue = null
switch (this.subSelect.reqproto.fields[v].type) { switch (this.subSelect.reqproto.fields[v].type) {
case 'int32': case 'int32':
@ -316,9 +334,14 @@ export default defineComponent({
ftype = 'number' ftype = 'number'
fvalue = 0 fvalue = 0
break break
default: case 'string':
ftype = 'text' ftype = 'text'
fvalue = '' fvalue = ''
break
default:
ftype = 'Object'
fvalue = {}
break
} }
this.reqproto.push({ this.reqproto.push({
@ -372,11 +395,19 @@ export default defineComponent({
.decode(message.data.value) .decode(message.data.value)
messageobj = proto.lookup(v1.pushName).toObject(protoobj) messageobj = proto.lookup(v1.pushName).toObject(protoobj)
} }
this.pushlog( if (v1.pushName && v1.pushName == 'NotifyErrorNotifyPush') {
'success', this.pushlog(
`收到回应消息: ${mainType}-${subType}-resp`, 'error',
messageobj `错误信息通知: ${mainType}-${subType}-resp`,
) messageobj
)
} else {
this.pushlog(
'success',
`收到回应消息: ${mainType}-${subType}-resp`,
messageobj
)
}
} }
} }
} }
@ -449,6 +480,10 @@ export default defineComponent({
isshow: false, isshow: false,
}) })
}, },
onJsonChange(value) {
console.log('value:', value)
},
}, },
}) })
</script> </script>