MCPcopy Index your code
hub / github.com/TruthHun/DocHub / ResponseJson

Method ResponseJson

controllers/AdminControllers/BaseController.go:144–156  ·  view source on GitHub ↗

响应json

(isSuccess bool, msg string, data ...interface{})

Source from the content-addressed store, hash-verified

142
143//响应json
144func (this *BaseController) ResponseJson(isSuccess bool, msg string, data ...interface{}) {
145 status := 0
146 if isSuccess {
147 status = 1
148 }
149 ret := map[string]interface{}{"status": status, "msg": msg}
150 if len(data) > 0 {
151 ret["data"] = data[0]
152 }
153 this.Data["json"] = ret
154 this.ServeJSON()
155 this.StopRun()
156}
157
158//响应json
159func (this *BaseController) Response(data map[string]interface{}) {

Callers 15

LoginMethod · 0.45
UpdatePwdMethod · 0.45
UpdateAdminMethod · 0.45
UpdateSitemapMethod · 0.45
EditMethod · 0.45
DelMethod · 0.45
GetMethod · 0.45
GetMethod · 0.45
SetCloudStoreMethod · 0.45
AddChanelMethod · 0.45
GetCateByCidMethod · 0.45
AddCateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected