Browse Source

加入响应占位函数

yjp 1 year ago
parent
commit
434abcd13f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      http_binding/response/response.go

+ 6 - 0
http_binding/response/response.go

@@ -9,6 +9,10 @@ import (
 	"net/http"
 	"net/http"
 )
 )
 
 
+func NoResponse(_ *binding_context.Context, _ int, _ any, _ error) {
+	return
+}
+
 func SendMsgResponse(c *binding_context.Context, statusCode int, _ any, err error) {
 func SendMsgResponse(c *binding_context.Context, statusCode int, _ any, err error) {
 	msgResp := formMsgResponse(err)
 	msgResp := formMsgResponse(err)
 	c.JSON(statusCode, msgResp)
 	c.JSON(statusCode, msgResp)
@@ -158,6 +162,8 @@ func WriteBytes(c *binding_context.Context, statusCode int, bytes []byte, err er
 		c.AbortWithStatus(statusCode)
 		c.AbortWithStatus(statusCode)
 		return
 		return
 	}
 	}
+
+	c.Writer.Flush()
 }
 }
 
 
 func SendMapXMLResponseIgnoreError(c *binding_context.Context, statusCode int, data map[string]any, _ error) {
 func SendMapXMLResponseIgnoreError(c *binding_context.Context, statusCode int, data map[string]any, _ error) {