NotifyType enum
This commit is contained in:
@@ -56,7 +56,7 @@ func (self *NotifyTplController) AjaxSave() {
|
|||||||
notifyTpl.Content = strings.TrimSpace(self.GetString("content"))
|
notifyTpl.Content = strings.TrimSpace(self.GetString("content"))
|
||||||
notifyTpl.CreateId = self.userId
|
notifyTpl.CreateId = self.userId
|
||||||
notifyTpl.CreateTime = time.Now().Unix()
|
notifyTpl.CreateTime = time.Now().Unix()
|
||||||
notifyTpl.Type = "default"
|
notifyTpl.Type = models.NotifyTplTypeDefault
|
||||||
notifyTpl.Status, _ = self.GetInt("status")
|
notifyTpl.Status, _ = self.GetInt("status")
|
||||||
|
|
||||||
if notifyTpl.TplType == 1 {
|
if notifyTpl.TplType == 1 {
|
||||||
@@ -93,7 +93,7 @@ func (self *NotifyTplController) AjaxSave() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if notifyTpl.Type == "system" {
|
if notifyTpl.Type == models.NotifyTplTypeSystem {
|
||||||
self.ajaxMsg("系统模板禁止更新", MSG_ERR)
|
self.ajaxMsg("系统模板禁止更新", MSG_ERR)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ func (self *NotifyTplController) AjaxDel() {
|
|||||||
id, _ := self.GetInt("id")
|
id, _ := self.GetInt("id")
|
||||||
notifyTpl, _ := models.NotifyTplGetById(id)
|
notifyTpl, _ := models.NotifyTplGetById(id)
|
||||||
|
|
||||||
if notifyTpl.Type == "system" {
|
if notifyTpl.Type == models.NotifyTplTypeSystem {
|
||||||
self.ajaxMsg("系统模板禁止删除", MSG_ERR)
|
self.ajaxMsg("系统模板禁止删除", MSG_ERR)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ func (j *Job) Run() {
|
|||||||
var content = ""
|
var content = ""
|
||||||
notifyTpl, err := models.NotifyTplGetById(j.task.NotifyTplId)
|
notifyTpl, err := models.NotifyTplGetById(j.task.NotifyTplId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
notifyTpl, err := models.NotifyTplGetByTplType(j.task.NotifyType, "system")
|
notifyTpl, err := models.NotifyTplGetByTplType(j.task.NotifyType, models.NotifyTplTypeSystem)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
title = notifyTpl.Title
|
title = notifyTpl.Title
|
||||||
content = notifyTpl.Content
|
content = notifyTpl.Content
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
NotifyTplTypeSystem = "system"
|
||||||
|
NotifyTplTypeDefault = "default"
|
||||||
|
)
|
||||||
|
|
||||||
type NotifyTpl struct {
|
type NotifyTpl struct {
|
||||||
Id int
|
Id int
|
||||||
Type string
|
Type string
|
||||||
|
|||||||
Reference in New Issue
Block a user