add user routes

This commit is contained in:
2026-09-04 23:03:50 +08:00
parent fe8ba74c5f
commit 4688c10585
12 changed files with 579 additions and 11 deletions

View File

@@ -23,7 +23,7 @@ func fullName(message string) protoreflect.FullName {
return protoreflect.FullName(fmt.Sprintf("%sdori.proto.ce.%s", server, message))
}
func Decode(message string, data []byte) (proto.Message, error) {
func Decode(message string, data []byte) (map[string]any, error) {
mt, err := protoregistry.GlobalTypes.FindMessageByName(fullName(message))
if err != nil {
return nil, fmt.Errorf("message %s not found", message)
@@ -34,7 +34,7 @@ func Decode(message string, data []byte) (proto.Message, error) {
return nil, err
}
return msg, nil
return ToMap(msg)
}
func Encode(message string, data map[string]any) ([]byte, error) {