// @router /channel/update/ [get] func (this *ChannelController) Update() { name := this.GetString("name") code := this.GetString("code") if name == "" || code == "" { this.Ctx.WriteString("params is't empty") } channel := models.Channel{Name: name, Code: code} err := channel.Update() if err != nil { this.Ctx.WriteString(err.Error()) } else { this.Ctx.WriteString("success") } }