[feat] 优化 support/response, 并新增 NewHttpStatusResponse

This commit is contained in:
what 2024-10-24 15:34:47 +08:00
parent 58511825d3
commit dae5b130bb

View File

@ -35,12 +35,17 @@ var wsUpgrader = websocket.Upgrader{
}
func (this HttpStatusResponse) Get(path ...string) req.GlobalParams {
if this.body == nil {
return req.NewGlobalParam("", nil)
}
return this.body.Get(path...)
}
func (this HttpStatusResponse) Send(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(this.status)
this.body.Send(w, r)
if this.body != nil {
this.body.Send(w, r)
}
}
func (this RawResponse) Get(path ...string) req.GlobalParams {