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

Method ResponseJson

controllers/HomeControllers/BaseController.go:134–146  ·  view source on GitHub ↗

响应json

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

Source from the content-addressed store, hash-verified

132
133//响应json
134func (this *BaseController) ResponseJson(isSuccess bool, msg string, data ...interface{}) {
135 status := 0
136 if isSuccess {
137 status = 1
138 }
139 ret := map[string]interface{}{"status": status, "msg": msg}
140 if len(data) > 0 {
141 ret["data"] = data[0]
142 }
143 this.Data["json"] = ret
144 this.ServeJSON()
145 this.StopRun()
146}
147
148//单页
149func (this *BaseController) Pages() {

Callers 15

DocExistMethod · 0.95
CoinMethod · 0.45
CollectMethod · 0.45
LoginMethod · 0.45
LogoutMethod · 0.45
RegMethod · 0.45
SendMailMethod · 0.45
SignMethod · 0.45
CheckLoginMethod · 0.45
CreateCollectFolderMethod · 0.45
FindPwdMethod · 0.45
DocDelMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected