Skip to content
Snippets Groups Projects
Commit 97f17918 authored by ko_oler's avatar ko_oler
Browse files

правки в EntryToPB и EntryFromPB

parent 3dd4cdb8
No related branches found
No related tags found
No related merge requests found
......@@ -81,8 +81,6 @@ func EntryFromPB(request *pb.LogEntry) *Entry {
Category: request.Category,
Component: request.Component,
Event: request.Event,
Attr: request.Attr, // todo: как с этим работать?
Tags: request.Tags,
}
if request.ObjectId != "" {
......@@ -91,6 +89,12 @@ func EntryFromPB(request *pb.LogEntry) *Entry {
if request.CallerId != "" {
logEntry.CallerID, _ = id.Parse(request.CallerId)
}
if request.Attr != nil {
logEntry.Attr = request.Attr // todo: как с этим работать?
}
if request.Tags != nil {
logEntry.Tags = request.Tags
}
return logEntry
}
......@@ -104,8 +108,12 @@ func (e *Entry) ToMap() map[string]any {
"category": e.Category,
"component": e.Component,
"event": e.Event,
"object_id": e.ObjectID.String(),
"caller_id": e.CallerID.String(),
}
if e.ObjectID != nil {
res["object_id"] = e.ObjectID.String()
}
if e.CallerID != nil {
res["caller_id"] = e.CallerID.String()
}
if e.Attr != nil {
res["attr"] = e.Attr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment