klesh commented on code in PR #3753:
URL: 
https://github.com/apache/incubator-devlake/pull/3753#discussion_r1028721981


##########
plugins/jira/api/scope.go:
##########
@@ -0,0 +1,138 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package api
+
+import (
+       "net/http"
+       "net/url"
+       "strconv"
+
+       "github.com/apache/incubator-devlake/errors"
+       "github.com/apache/incubator-devlake/plugins/core"
+       "github.com/apache/incubator-devlake/plugins/core/dal"
+       "github.com/apache/incubator-devlake/plugins/jira/models"
+       "github.com/mitchellh/mapstructure"
+)
+
+type putBoardRequest struct {
+       ConnectionId uint64 `json:"connectionId"`
+       BoardId      uint64 `json:"boardId"`
+       ProjectId    uint   `json:"projectId"`
+       Name         string `json:"name"`
+       Self         string `json:"self"`
+       Type         string `json:"type"`
+}
+
+// PutScope create or update jira board
+// @Summary create or update jira board
+// @Description Create or update Jira board
+// @Tags plugins/jira
+// @Accept application/json
+// @Param scope body putBoardRequest true "json"
+// @Success 200  {object} core.ApiResourceOutput
+// @Failure 400  {object} shared.ApiBody "Bad Request"
+// @Failure 500  {object} shared.ApiBody "Internal Error"
+// @Router /plugins/jira/scopes [PUT]
+func PutScope(input *core.ApiResourceInput) (*core.ApiResourceOutput, 
errors.Error) {
+       // update from request and save to database
+       var req putBoardRequest
+       err := mapstructure.Decode(input.Body, &req)
+       if err != nil {
+               return nil, errors.Default.Wrap(err, "error decoding map into 
putBoardRequest")
+       }
+       board := &models.JiraBoard{

Review Comment:
   Ok, let's keep it simple.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to