mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-26 08:14:43 +08:00
Merge branch 'master' of https://github.com/duanhf2012/origin
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
package sysservice
|
package sysservice
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"Server/common"
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/duanhf2012/origin/sysmodule"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
@@ -141,3 +144,16 @@ func (slf *HttpServerService) SetHttps(certfile string, keyfile string) bool {
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//序列化后写入Respone
|
||||||
|
func (slf *HttpRespone) WriteRespne(v interface{}) error {
|
||||||
|
StrRet, retErr := json.Marshal(v)
|
||||||
|
if retErr != nil {
|
||||||
|
slf.Respone = []byte(`{"Code": 2,"Message":"service error"}`)
|
||||||
|
common.LogPrintf(sysmodule.LEVER_ERROR, "Json Marshal Error")
|
||||||
|
} else {
|
||||||
|
slf.Respone = StrRet
|
||||||
|
}
|
||||||
|
|
||||||
|
return retErr
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user