[ 
https://issues.apache.org/jira/browse/SCB-622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493357#comment-16493357
 ] 

ASF GitHub Bot commented on SCB-622:
------------------------------------

little-cui closed pull request #359: SCB-622 Change the type of query parameter 
'force' to bool in Delete service API
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/359
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/integration/apis.go b/integration/apis.go
index 2466015a..d4ee813b 100644
--- a/integration/apis.go
+++ b/integration/apis.go
@@ -26,7 +26,7 @@ var GETALLSERVICE = "/v4/default/registry/microservices"
 var GETSERVICEBYID = "/v4/default/registry/microservices/:serviceId"
 var REGISTERMICROSERVICE = "/v4/default/registry/microservices"
 var UPDATEMICROSERVICE = 
"/v4/default/registry/microservices/:serviceId/properties"
-var UNREGISTERMICROSERVICE = 
"/v4/default/registry/microservices/:serviceId?force=1"
+var UNREGISTERMICROSERVICE = 
"/v4/default/registry/microservices/:serviceId?force=true"
 var GETSCHEMABYID = 
"/v4/default/registry/microservices/:serviceId/schemas/:schemaId"
 var UPDATESCHEMA = 
"/v4/default/registry/microservices/:serviceId/schemas/:schemaId"
 var GETSCHEMAS = "/v4/default/registry/microservices/:serviceId/schemas"
diff --git a/server/core/swagger/v3.yaml b/server/core/swagger/v3.yaml
index 2e644b20..91d145c1 100644
--- a/server/core/swagger/v3.yaml
+++ b/server/core/swagger/v3.yaml
@@ -118,7 +118,7 @@ paths:
           type: string
         - name: force
           in: query
-          description: 不传即默认为false。 强制删除,则与该服务相关的信息删除,非强制删除: 
如果作为该被依赖(作为provider,提供服务,且不是只存在自依赖)或者存在实例,则不能删除,其它均删除。
+          description: 
不传即默认为0。1表示强制删除与该服务相关的信息删除,0表示非强制删除:如果作为该被依赖(作为provider,提供服务,且不是只存在自依赖)或者存在实例,则不能删除,其它均删除。
           type: string
       tags:
         - microservices
diff --git a/server/core/swagger/v4.yaml b/server/core/swagger/v4.yaml
index 43cbf62f..7547b322 100644
--- a/server/core/swagger/v4.yaml
+++ b/server/core/swagger/v4.yaml
@@ -143,7 +143,7 @@ paths:
           type: string
         - name: force
           in: query
-          description: 不传即默认为false。 强制删除,则与该服务相关的信息删除,非强制删除: 
如果作为该被依赖(作为provider,提供服务,且不是只存在自依赖)或者存在实例,则不能删除,其它均删除。
+          description: 
不传即默认为false。true表示强制删除,则与该服务相关的信息删除,false表示非强制删除:如果作为该被依赖(作为provider,提供服务,且不是只存在自依赖)或者存在实例,则不能删除,其它均删除。
           type: string
       tags:
         - microservices
diff --git a/server/rest/controller/v4/microservice_controller.go 
b/server/rest/controller/v4/microservice_controller.go
index 795c72c8..5efe78a7 100644
--- a/server/rest/controller/v4/microservice_controller.go
+++ b/server/rest/controller/v4/microservice_controller.go
@@ -88,13 +88,13 @@ func (this *MicroServiceService) Update(w 
http.ResponseWriter, r *http.Request)
 func (this *MicroServiceService) Unregister(w http.ResponseWriter, r 
*http.Request) {
        force := r.URL.Query().Get("force")
        serviceId := r.URL.Query().Get(":serviceId")
-       if force != "0" && force != "1" && strings.TrimSpace(force) != "" {
-               controller.WriteError(w, scerr.ErrInvalidParams, "parameter 
force must be 1 or 0")
+       if force != "false" && force != "true" && strings.TrimSpace(force) != 
"" {
+               controller.WriteError(w, scerr.ErrInvalidParams, "parameter 
force must be false or true")
                return
        }
        request := &pb.DeleteServiceRequest{
                ServiceId: serviceId,
-               Force:     force == "1",
+               Force:     force == "true",
        }
        resp, _ := core.ServiceAPI.Delete(r.Context(), request)
        controller.WriteResponse(w, resp.Response, nil)


 

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


> Change the type of query parameter 'force' to bool in Delete service API
> ------------------------------------------------------------------------
>
>                 Key: SCB-622
>                 URL: https://issues.apache.org/jira/browse/SCB-622
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Service-Center
>            Reporter: little-cui
>            Assignee: little-cui
>            Priority: Major
>             Fix For: service-center-1.0.0-m2
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to