Closed ghost closed 7 years ago
Sorry, I do not speak Chinese.
I change the answer to English
@mengxiang1 enum values are always returned as strings. You have to convert them to numeric values manually.
I change the src code in my local PC. I am ok;
I get enum by proto file::
enum ERequestTypes{ ELoginCmd=0; }
message RequestMessage { ERequestTypes Type = 1 [default = ELoginCmd]; }
var obj = {Type: 'ELoginCmd' }; var ser = protoParse.serialize(obj, 'RequestMessage'); var parse = protoParse.parse(ser, 'RequestMessage');
I by the above step get the result:: parse.Type ==>"ELoginCmd" but I want get "parse.Type ==>0 " How I should do what??