tianxiaoliang commented on a change in pull request #14: SCB-1325 Refactoring 
the delete function
URL: https://github.com/apache/servicecomb-kie/pull/14#discussion_r298783278
 
 

 ##########
 File path: server/resource/v1/kv_resource.go
 ##########
 @@ -163,20 +162,20 @@ func (r *KVResource) Delete(context *restful.Context) {
        if domain == nil {
                WriteErrResponse(context, http.StatusInternalServerError, 
MsgDomainMustNotBeEmpty)
        }
-       ids := context.ReadPathParameter("ids")
-       if ids == "" {
-               WriteErrResponse(context, http.StatusBadRequest, 
ErrIDMustNotEmpty)
+       kvID := context.ReadQueryParameter("kvID")
+       if kvID == "" {
+               WriteErrResponse(context, http.StatusBadRequest, 
ErrKvIDMustNotEmpty)
                return
        }
-       idArray := strings.Split(ids, ",")
+       labelID := context.ReadQueryParameter("labelID")
        s, err := dao.NewKVService()
        if err != nil {
                WriteErrResponse(context, http.StatusInternalServerError, 
err.Error())
                return
        }
-       err = s.Delete(idArray, domain.(string))
+       err = s.Delete(kvID, labelID, domain.(string))
        if err != nil {
-               openlogging.Error(fmt.Sprintf("delete ids=%s,err=%s", ids, 
err.Error()))
+               openlogging.Error(fmt.Sprintf("delete 
kvID=%s,labelID=%s,error=%s", kvID, labelID, err.Error()))
 
 Review comment:
   from now use structured logging, refer to som of my log code call "WithTag"

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to