本文整理匯總了Golang中github.com/deepzz0/goblog/helper.Response.Tips方法的典型用法代碼示例。如果您正苦於以下問題:Golang Response.Tips方法的具體用法?Golang Response.Tips怎麽用?Golang Response.Tips使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/deepzz0/goblog/helper.Response
的用法示例。
在下文中一共展示了Response.Tips方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: updateSitemap
func (this *SysconfigController) updateSitemap(resp *helper.Response) {
content := this.GetString("content")
if content == "" {
resp.Status = RS.RS_params_error
resp.Tips(helper.WARNING, RS.RS_params_error)
return
}
_, err := os.Stat(models.SiteFile)
if err != nil && !strings.Contains(err.Error(), "no such file") {
log.Error(err)
return
} else {
os.Remove(models.SiteFile)
}
f, err := os.Create(models.SiteFile)
if err != nil {
log.Error(err)
return
}
defer f.Close()
_, err = f.WriteString(content)
if err != nil {
resp.Status = RS.RS_failed
resp.Err = helper.Error{Level: helper.WARNING, Msg: "錯誤|" + err.Error()}
}
}
示例2: deleteVerify
func (this *SysconfigController) deleteVerify(resp *helper.Response) {
name := this.GetString("name")
if name == "" {
resp.Status = RS.RS_params_error
resp.Tips(helper.WARNING, RS.RS_params_error)
return
}
models.ManageConf.DelVerification(name)
}
示例3: doDelete
func (this *TrashController) doDelete(resp *helper.Response) {
id, err := this.GetInt32("id")
if err != nil {
resp.Status = RS.RS_failed
resp.Tips(helper.WARNING, RS.RS_params_error)
return
}
if topic := models.TMgr.GetWaitDelTopic(id); topic == nil {
resp.Status = RS.RS_not_found
resp.Tips(helper.WARNING, RS.RS_not_found)
} else {
if err := models.TMgr.ImmeDelTopic(topic); err != nil {
resp.Status = RS.RS_failed
resp.Err = helper.Error{Level: helper.WARNING, Msg: "錯誤|" + err.Error()}
return
}
}
}
示例4: addVerify
func (this *SysconfigController) addVerify(resp *helper.Response) {
name := this.GetString("name")
content := this.GetString("content")
if name == "" || content == "" {
resp.Status = RS.RS_params_error
resp.Tips(helper.WARNING, RS.RS_params_error)
return
}
verify := models.ManageConf.GetVerification(name)
if verify != nil {
resp.Status = RS.RS_duplicate_add
resp.Tips(helper.WARNING, RS.RS_duplicate_add)
return
}
verify = models.NewVerify()
verify.Name = name
verify.Content = content
models.ManageConf.AddVerification(verify)
}
示例5: doRestore
func (this *TrashController) doRestore(resp *helper.Response) {
id, err := this.GetInt32("id")
if err != nil {
resp.Status = RS.RS_failed
resp.Tips(helper.WARNING, RS.RS_params_error)
return
}
if topic := models.TMgr.GetWaitDelTopic(id); topic == nil {
resp.Status = RS.RS_not_found
resp.Tips(helper.WARNING, RS.RS_not_found)
return
} else {
if code := models.TMgr.RestoreTopic(topic); code != RS.RS_success {
resp.Status = code
resp.Tips(helper.WARNING, code)
return
}
}
}