[feat] 优化 support/response, 并新增 NewHttpStatusResponse
This commit is contained in:
parent
58511825d3
commit
dae5b130bb
@ -35,12 +35,17 @@ var wsUpgrader = websocket.Upgrader{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this HttpStatusResponse) Get(path ...string) req.GlobalParams {
|
func (this HttpStatusResponse) Get(path ...string) req.GlobalParams {
|
||||||
|
if this.body == nil {
|
||||||
|
return req.NewGlobalParam("", nil)
|
||||||
|
}
|
||||||
return this.body.Get(path...)
|
return this.body.Get(path...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this HttpStatusResponse) Send(w http.ResponseWriter, r *http.Request) {
|
func (this HttpStatusResponse) Send(w http.ResponseWriter, r *http.Request) {
|
||||||
w.WriteHeader(this.status)
|
w.WriteHeader(this.status)
|
||||||
|
if this.body != nil {
|
||||||
this.body.Send(w, r)
|
this.body.Send(w, r)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this RawResponse) Get(path ...string) req.GlobalParams {
|
func (this RawResponse) Get(path ...string) req.GlobalParams {
|
||||||
|
Loading…
Reference in New Issue
Block a user