servicecomb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #72: [issue #67] add interface to add alias
Date Wed, 22 Jan 2020 08:53:20 GMT
tianxiaoliang commented on a change in pull request #72: [issue #67] add interface to add alias
URL: https://github.com/apache/servicecomb-kie/pull/72#discussion_r369432726
 
 

 ##########
 File path: server/service/mongo/label/label_service.go
 ##########
 @@ -0,0 +1,16 @@
+package label
+
+import (
+	"context"
+	"github.com/apache/servicecomb-kie/pkg/model"
+)
+
+type Service struct {
+}
+
+func (s *Service) CreateOrUpdate(ctx context.Context, label *model.LabelDoc) (*model.LabelDoc,
error) {
+	if label.ID != "" {
+		return UpdateLabel(ctx, label)
+	}
+	return CreateLabel(ctx, label.Domain, label.Labels, label.Project)
 
 Review comment:
   create label时应当能支持alias,直接把方法入参改成label吧

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message