github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/routers/root/RDeleteReply.go (about)

     1  package root
     2  
     3  import (
     4  	"fmt"
     5  	"github.com/insionng/makross"
     6  	
     7  	"strconv"
     8  	"time"
     9  	"github.com/insionng/yougam/models"
    10  )
    11  
    12  func GetRDeleteReplyHandler(self *makross.Context) error {
    13  	
    14  
    15  	if rid := self.Param("rid").MustInt64(); rid > 0 {
    16  
    17  		if e := models.DelReply(rid); e != nil {
    18  			self.Flash.Error("删除 Reply id:" + strconv.FormatInt(rid, 10) + "出现错误 " + fmt.Sprintf("%s", e) + "!")
    19  			return e
    20  		} else {
    21  			self.Flash.Success("删除 Reply id:" + strconv.FormatInt(rid, 10) + "成功!")
    22  			return self.Redirect("/root/read/reply/")
    23  
    24  		}
    25  	}
    26  
    27  	return self.Redirect("/root/dashboard/?version=" + strconv.FormatInt(time.Now().Unix(), 10))
    28  
    29  }