Example #1
0
// @router /config/update/ [get]
func (this *ConfigController) Update() {
	channel := this.GetString("channel")
	key := this.GetString("key")
	value := this.GetString("value")
	if channel == "" || key == "" {
		this.Ctx.WriteString("params is invalid")
		return
	}
	config := models.Config{ChannelCode: channel, Key: key, Value: value}
	err := config.UpdateValue()
	if err != nil {
		this.Ctx.WriteString(err.Error())
	} else {
		this.Ctx.WriteString("sucess")
	}
}