This commit is contained in:
aozhiwei 2020-10-30 13:54:25 +08:00
parent e21d2e3b5d
commit 877ac12ec2

View File

@ -46,12 +46,16 @@ func Request(r *http.Request, name string) *XValue {
return NewXString("") return NewXString("")
} }
func ResponseOk(w http.ResponseWriter) { func Response(w* http.ResponseWriter, data string) {
w.Write([]byte(`{"errcode":0, "errmsg":""}`)) (*w).Write([]byte(data))
} }
func ResponseInt32Ok(w http.ResponseWriter, key string, val int32) { func ResponseOk(w* http.ResponseWriter) {
w.Write([]byte(fmt.Sprintf(`{"errcode":0, "errmsg":"", "%s":%d}`, key, val))) (*w).Write([]byte(`{"errcode":0, "errmsg":""}`))
}
func ResponseInt32Ok(w* http.ResponseWriter, key string, val int32) {
(*w).Write([]byte(fmt.Sprintf(`{"errcode":0, "errmsg":"", "%s":%d}`, key, val)))
} }
func GetPostBody(r *http.Request) *XValue { func GetPostBody(r *http.Request) *XValue {