Example #1
0
// @router /config/add/ [get]
func (this *ConfigController) Add() {
	channel := this.GetString("channel")
	key := this.GetString("key")
	value := this.GetString("value")
	config := models.Config{ChannelCode: channel, Key: key, Value: value}
	err := config.Insert()
	if err != nil {
		this.Ctx.WriteString(err.Error())
	} else {
		this.Ctx.WriteString("sucess")
	}
}