示例#1
0
func (this *ArtilcecategoryController) Delete() {
	var ajaxResult models.AjaxResult
	id := this.Ctx.Input.Param(":id")
	categoryId, err := strconv.Atoi(id)
	if err != nil {
		ajaxResult = models.AjaxResult{Success: false}
		ajaxResult.Error = err.Error()
	} else {
		category := new(models.Articlecategory)
		ajaxResult = category.Delete(categoryId)
	}

	this.Data["json"] = ajaxResult
	this.ServeJson()
}