You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2022/10/27 02:54:49 UTC
[incubator-eventmesh] branch master updated: save event-catalog info-title data
This is an automated email from the ASF dual-hosted git repository.
mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new 14136ff3 save event-catalog info-title data
new 96ceed53 Merge pull request #1941 from walterlife/optimize-catalog-logic
14136ff3 is described below
commit 14136ff38040317735a06c264ea94398dc3388ce
Author: yuweizhu <yu...@tencent.com>
AuthorDate: Wed Oct 26 23:27:47 2022 +0800
save event-catalog info-title data
---
eventmesh-catalog-go/api/catalog.go | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/eventmesh-catalog-go/api/catalog.go b/eventmesh-catalog-go/api/catalog.go
index b6451915..8a642a25 100644
--- a/eventmesh-catalog-go/api/catalog.go
+++ b/eventmesh-catalog-go/api/catalog.go
@@ -57,7 +57,7 @@ func (c *catalogImpl) Registry(ctx context.Context, request *proto.RegistryReque
var handlers []func() error
for _, channel := range doc.Channels() {
for _, operation := range channel.Operations() {
- var record = c.buildEventCatalog(request.FileName, channel, operation)
+ var record = c.buildEventCatalog(doc.Info().Title(), request.FileName, channel, operation)
handlers = append(handlers, func() error {
return c.catalogDAL.Insert(context.Background(), tx, record)
})
@@ -81,15 +81,16 @@ func (c *catalogImpl) QueryOperations(ctx context.Context, in *proto.QueryOperat
if err != nil {
return rsp, err
}
- if err = gconv.Structs(rsp.Operations, &res); err != nil {
+ if err = gconv.Structs(res, &rsp.Operations); err != nil {
return nil, err
}
return rsp, nil
}
-func (c *catalogImpl) buildEventCatalog(fileName string, channel asyncapi.Channel,
+func (c *catalogImpl) buildEventCatalog(serviceName string, fileName string, channel asyncapi.Channel,
operation asyncapi.Operation) *model.EventCatalog {
var record model.EventCatalog
+ record.ServiceName = serviceName
record.OperationID = fmt.Sprintf("file://%s#%s", fileName, operation.ID())
record.ChannelName = channel.ID()
record.Type = string(operation.Type())
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org