Beispiel #1
0
func (this *TalkController) Publish() {
	talk := models.Talk{}
	//发布话题
	status, _ := this.GetInt("status")
	if status == 0 {
		//判断传过来的status,如果为0则是单独的话题
		talk.Nickname = "" //发布人昵称
		talk.Talk = ""     //用户创建专题
		talk.Pid = 0       //分类级别专题和单独的话题最高级别pid为0
	} else {
		//判断传过来的status,如果不为0则是专题下的话题
		id, _ := this.GetInt("id")
		talk.Nickname = "" //发布人昵称
		talk.Talk = ""     //用户创建专题
		talk.Pid = id      //分类级别专题和单独的话题最高级别pid为0
	}
}
Beispiel #2
0
func (this *TalkController) BuildTopic() {
	//创建专题
	talk := models.Talk{}
	talk.Nickname = "" //创建人昵称
	talk.Topic = ""    //用户创建专题
	talk.Short = ""    //话题简介
	talk.Pid = 0       //分类级别专题和单独的话题最高级别pid为0

}