Sfoglia il codice sorgente

加入响应占位函数

yjp 1 anno fa
parent
commit
434abcd13f
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      http_binding/response/response.go

+ 6 - 0
http_binding/response/response.go

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