//设置封面 func (this *PhotoController) Cover() { id, _ := this.GetInt("id") photo := models.Photo{Id: id} if photo.Read() == nil { photo.Delete() } this.Redirect("/admin/photo/list", 302) }
//删除照片 func (this *PhotoController) Delete() { id, _ := this.GetInt64("id") albumid := this.GetString("albumid") photo := models.Photo{Id: id} if photo.Read() == nil { photo.Delete() } this.Redirect("/admin/photo/list?albumid="+albumid, 302) }