示例#1
0
//获取所有
func (this *ApplicationController) GetAll() {
	app := models.NewApplication()
	queryVal := make(map[string]string)
	limitNum, _ := this.ParseLimitParm()
	apps, err := app.GetAll(queryVal, limitNum, 0)
	if err != nil {
		fmt.Println(err.Error())
	}
	this.Data["json"] = apps
	this.ServeJson()
}
示例#2
0
//获取Token
func (this *ApplicationController) GetToken() {
	AppName := this.GetString("app")
	app := models.NewApplication()

	appRes := app.FindByName(AppName)
	if appRes == nil || appRes.Code == mymysql.ErrNotFound {
		appRes = app.Insert(AppName)
	}
	this.Data["json"] = appRes
	this.ServeJson()
}