Beispiel #1
0
func (this *ObjectController) Get() {
	objectId := this.Ctx.Input.Param[":objectId"]
	if objectId != "" {
		ob, err := models.GetOne(objectId)
		if err != nil {
			this.Data["json"] = err
		} else {
			this.Data["json"] = ob
		}
	} else {
		obs := models.GetAll()
		this.Data["json"] = obs
	}
	this.ServeJson()
}
Beispiel #2
0
func (o *ObjectController) Get() {
	objectId := o.Ctx.Input.Params[":objectId"]
	if objectId != "" {
		ob, err := models.GetOne(objectId)
		if err != nil {
			o.Data["json"] = err
		} else {
			o.Data["json"] = ob
		}
	} else {
		obs := models.GetAll()
		o.Data["json"] = obs
	}
	o.ServeJson()
}