diff --git a/rpc_server/api/v1/get_support_entrypoint.go b/rpc_server/api/v1/get_support_entrypoint.go index 40200590..c6d686e4 100644 --- a/rpc_server/api/v1/get_support_entrypoint.go +++ b/rpc_server/api/v1/get_support_entrypoint.go @@ -23,10 +23,12 @@ func GetSupportEntrypoint(c *gin.Context) { if err := c.ShouldBindJSON(&request); err != nil { errStr := fmt.Sprintf("Request Error [%v]", err) response.SetHttpCode(http.StatusBadRequest).FailCode(c, http.StatusBadRequest, errStr) + return } if err := request.Validate(); err != nil { errStr := fmt.Sprintf("Request Error [%v]", err) response.SetHttpCode(http.StatusBadRequest).FailCode(c, http.StatusBadRequest, errStr) + return } //2. recall service @@ -34,6 +36,7 @@ func GetSupportEntrypoint(c *gin.Context) { if err != nil { errStr := fmt.Sprintf("%v", err) response.SetHttpCode(http.StatusInternalServerError).FailCode(c, http.StatusInternalServerError, errStr) + return } response.WithData(result).Success(c) diff --git a/rpc_server/api/v1/get_support_strategy.go b/rpc_server/api/v1/get_support_strategy.go index 3f0bab8c..243b5b9a 100644 --- a/rpc_server/api/v1/get_support_strategy.go +++ b/rpc_server/api/v1/get_support_strategy.go @@ -25,15 +25,18 @@ func GetSupportStrategy(c *gin.Context) { if err := c.ShouldBindJSON(&request); err != nil { errStr := fmt.Sprintf("Request Error [%v]", err) response.SetHttpCode(http.StatusBadRequest).FailCode(c, http.StatusBadRequest, errStr) + return } if err := request.Validate(); err != nil { errStr := fmt.Sprintf("Request Error [%v]", err) response.SetHttpCode(http.StatusBadRequest).FailCode(c, http.StatusBadRequest, errStr) + return } result, err := operator.GetSupportStrategyExecute(request) if err != nil { errStr := fmt.Sprintf("%v", err) response.SetHttpCode(http.StatusInternalServerError).FailCode(c, http.StatusInternalServerError, errStr) + return } response.WithData(result).Success(c) } diff --git a/rpc_server/api/v1/try_pay_user_operation.go b/rpc_server/api/v1/try_pay_user_operation.go index ecca7ed3..ce5c1edd 100644 --- a/rpc_server/api/v1/try_pay_user_operation.go +++ b/rpc_server/api/v1/try_pay_user_operation.go @@ -24,17 +24,20 @@ func TryPayUserOperation(c *gin.Context) { if err := c.ShouldBindJSON(&request); err != nil { errStr := fmt.Sprintf("Request Error [%v]", err) response.SetHttpCode(http.StatusBadRequest).FailCode(c, http.StatusBadRequest, errStr) + return } if err := request.Validate(); err != nil { errStr := fmt.Sprintf("Request Error [%v]", err) response.SetHttpCode(http.StatusBadRequest).FailCode(c, http.StatusBadRequest, errStr) + return } //2. recall service result, err := operator.TryPayUserOpExecute(request) if err != nil { errStr := fmt.Sprintf("TryPayUserOpExecute ERROR [%v]", err) response.SetHttpCode(http.StatusInternalServerError).FailCode(c, http.StatusInternalServerError, errStr) + return } response.WithData(result).Success(c) }