|
|
@@ -2,6 +2,7 @@ package mvc |
|
|
|
|
|
|
|
import ( |
|
|
|
"github.com/astaxie/beego" |
|
|
|
"golib.gaore.com/GaoreGo/beegoinit/response" |
|
|
|
"strings" |
|
|
|
) |
|
|
|
|
|
|
@@ -24,7 +25,12 @@ func (this *BaseController) Prepare() { |
|
|
|
} |
|
|
|
|
|
|
|
func (this *BaseController) RespJson(status bool, code int, msg string, data interface{}) { |
|
|
|
this.Data["json"] = &map[string]interface{}{"status": status, "code": code, "msg": msg, "data": data} |
|
|
|
this.Data["json"] = &response.Json{ |
|
|
|
Code: code, |
|
|
|
Data: data, |
|
|
|
Msg: msg, |
|
|
|
Status: status, |
|
|
|
} |
|
|
|
this.ServeJSON() |
|
|
|
} |
|
|
|
|
|
|
|