changed param logic & add more routes

This commit is contained in:
2026-09-04 18:08:20 +08:00
parent 86cde9bb97
commit a28c1dec9b
14 changed files with 269 additions and 12 deletions

View File

@@ -52,3 +52,14 @@ func Encode(message string, data map[string]any) ([]byte, error) {
return proto.Marshal(msg)
}
func ToMap(msg proto.Message) (map[string]any, error) {
jsonBytes, err := protojson.Marshal(msg)
if err != nil {
return nil, err
}
var result map[string]any
json.Unmarshal(jsonBytes, &result)
return result, nil
}