Skip to content

Commit

Permalink
add: request tags
Browse files Browse the repository at this point in the history
  • Loading branch information
cyz-home committed Apr 15, 2024
1 parent d82ceac commit 8136c3b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion type_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ func (req *Request) Handler(entry *logrus.Entry) (*entries, []tag) {
uriPath = uriPath[0:uriPathIndex]
}

retTags := []tag{{Tag: uriPath, EntryUuid: uuId}}
tags, ok := entry.Data["tags"]
if ok {
for _, t := range tags.([]string) {
retTags = append(retTags, tag{
EntryUuid: uuId,
Tag: t,
})
}
}

return &entries{
Uuid: uuId,
BatchId: NewtelescopeHook().TelescopeUUID(),
Expand All @@ -101,5 +112,5 @@ func (req *Request) Handler(entry *logrus.Entry) (*entries, []tag) {
Type: b.BindType(),
Content: ToContent(b),
CreatedAt: time.Now().Format("2006-01-02 15:04:05"),
}, []tag{{Tag: uriPath, EntryUuid: uuId}}
}, retTags
}

0 comments on commit 8136c3b

Please sign in to comment.