From commits-return-19053-archive-asf-public=cust-asf.ponee.io@servicecomb.apache.org Wed Jan 22 08:53:21 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id E449918064C for ; Wed, 22 Jan 2020 09:53:20 +0100 (CET) Received: (qmail 68704 invoked by uid 500); 22 Jan 2020 08:53:20 -0000 Mailing-List: contact commits-help@servicecomb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@servicecomb.apache.org Delivered-To: mailing list commits@servicecomb.apache.org Received: (qmail 68689 invoked by uid 99); 22 Jan 2020 08:53:20 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jan 2020 08:53:20 +0000 From: GitBox To: commits@servicecomb.apache.org Subject: [GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #72: [issue #67] add interface to add alias Message-ID: <157968320024.21845.16041468762515509830.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Wed, 22 Jan 2020 08:53:20 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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