Esempio n. 1
0
func (this *ReplyController) Add() {
	id := this.Input().Get("id")
	nickname := this.Input().Get("nickname")
	content := this.Input().Get("content")
	err := models.AddReply(id, nickname, content)
	if err != nil {
		beego.Error(err)
	}
	this.Redirect("/topic/view/"+id, 302)
}
Esempio n. 2
0
func (this *ReplyController) Add() {
	tid := this.Input().Get("tid")
	err := models.AddReply(tid,
		this.Input().Get("nickname"), this.Input().Get("content"))
	if err != nil {
		beego.Error(err)
	}

	this.Redirect("/topic/view/"+tid, 302)
}
Esempio n. 3
0
func (this *TopicController) Post() {

	err := models.AddReply(this.Input().Get("title"), this.Input().Get("content"), this.Input().Get("nickname"), this.Input().Get("tid"))

	if err != nil {
		beego.Error(err)
	}

	this.Redirect("/topic/view?id="+this.Input().Get("tid"), 301)
	return
}