本文整理汇总了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
}
}
}