yjp 1 жил өмнө
parent
commit
33cc10b225

+ 11 - 2
http_binding/response/response.go

@@ -166,6 +166,15 @@ func WriteBytes(c *binding_context.Context, statusCode int, bytes []byte, err er
 	c.Writer.Flush()
 }
 
-func SendMapXMLResponseIgnoreError(c *binding_context.Context, statusCode int, data map[string]any, _ error) {
-	c.XML(statusCode, data)
+func SendWXOrderResponse(c *binding_context.Context, statusCode int, _ any, err error) {
+	if err == nil {
+		c.XML(statusCode, map[string]any{
+			"return_code": "FAIL",
+			"return_msg":  err.Error(),
+		})
+	}
+
+	c.XML(statusCode, map[string]any{
+		"return_code": "SUCCESS",
+	})
 }