diff --git a/generate/entities.go b/generate/entities.go index cae43cc..d5201f8 100644 --- a/generate/entities.go +++ b/generate/entities.go @@ -9,6 +9,14 @@ var protoMapTypes = map[string]reflect.Kind{ "*string": reflect.String, "int": reflect.Int32, "*int": reflect.Int32, + "int8": reflect.Int32, + "*int8": reflect.Int32, + "uint8": reflect.Int32, + "*uint8": reflect.Int32, + "int16": reflect.Int32, + "*int16": reflect.Int32, + "uint16": reflect.Int32, + "*uint16": reflect.Int32, "int32": reflect.Int32, "*int32": reflect.Int32, "uint32": reflect.Uint32, diff --git a/generate/parser.go b/generate/parser.go index bb95fb3..900869e 100644 --- a/generate/parser.go +++ b/generate/parser.go @@ -35,7 +35,6 @@ func renderReplyAsDefinition(types []spec.Type) []protoMessage { //首字母小写 if len(messageM.Name) > 0 { - messageM.Name = strings.TrimLeft(messageM.Name, "*") messageM.Name = strings.ToLower(string(messageM.Name[0])) + messageM.Name[1:] } @@ -133,6 +132,8 @@ func schemaOfField(member spec.Member) messageMember { item.Name = tag.Name } + item.Type = strings.TrimLeft(item.Type, "*") + return item }