Prechádzať zdrojové kódy

update: 消息通知

zoie 1 rok pred
rodič
commit
e050912293
4 zmenil súbory, kde vykonal 15 pridanie a 4 odobranie
  1. 5 0
      conf/app.conf
  2. 6 0
      conf/config.go
  3. 2 2
      controllers/Leave.go
  4. 2 2
      controllers/Overtime.go

+ 5 - 0
conf/app.conf

@@ -27,4 +27,9 @@ Redis_dbNum = "1"
 FilterExcludeURL =
 FilterOnlyLoginCheckURL =
 
+LeaveApprovalNewsUrl = "/leave"
+MyLeaveNewsUrl = "/myLeave"
+OvertimeApprovalNewsUrl = "/overtime"
+MyOvertimeNewsUrl = "/myOvertime"
+
 

+ 6 - 0
conf/config.go

@@ -23,3 +23,9 @@ var Redis_dbNum, _ = beego.AppConfig.String("Redis_dbNum")
 
 var FilterExcludeURL, _ = beego.AppConfig.String("FilterExcludeURL")
 var FilterOnlyLoginCheckURL, _ = beego.AppConfig.String("FilterOnlyLoginCheckURL")
+
+// 消息通知
+var LeaveApprovalNewsUrl, _ = beego.AppConfig.String("LeaveApprovalNewsUrl")
+var MyLeaveNewsUrl, _ = beego.AppConfig.String("MyLeaveNewsUrl")
+var OvertimeApprovalNewsUrl, _ = beego.AppConfig.String("OvertimeApprovalNewsUrl")
+var MyOvertimeNewsUrl, _ = beego.AppConfig.String("MyOvertimeNewsUrl")

+ 2 - 2
controllers/Leave.go

@@ -156,7 +156,7 @@ func (c *LeaveController) Leave_Add() {
 	}
 
 	NatsServer.AddUserLogs(c.User.T_uuid, "我的请假", "添加", var_)
-	NatsServer.AddNews(T_approver, fmt.Sprintf("您有一条【%s】的请假审批待处理", c.User.T_name), "/leave")
+	NatsServer.AddNews(T_approver, fmt.Sprintf("您有一条【%s】的请假审批待处理", c.User.T_name), conf.LeaveApprovalNewsUrl)
 
 	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: Id}
 	c.ServeJSON()
@@ -316,7 +316,7 @@ func (c *LeaveController) Leave_Approval() {
 	}
 
 	NatsServer.AddUserLogs(c.User.T_uuid, "我的请假", "审批", leave)
-	NatsServer.AddNews(leave.T_uid, "您的请假申请已通过", "/myOvertime")
+	NatsServer.AddNews(leave.T_uid, "您的请假申请已通过", conf.MyLeaveNewsUrl)
 
 	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: id}
 	c.ServeJSON()

+ 2 - 2
controllers/Overtime.go

@@ -113,7 +113,7 @@ func (c *OvertimeController) Overtime_Add() {
 	}
 
 	NatsServer.AddUserLogs(c.User.T_uuid, "我的加班", "添加", var_)
-	NatsServer.AddNews(T_approver, fmt.Sprintf("您有一条【%s】的加班审批待处理", c.User.T_name), "/overtime")
+	NatsServer.AddNews(T_approver, fmt.Sprintf("您有一条【%s】的加班审批待处理", c.User.T_name), conf.OvertimeApprovalNewsUrl)
 
 	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: var_.Id}
 	c.ServeJSON()
@@ -228,7 +228,7 @@ func (c *OvertimeController) Overtime_Approval() {
 	}
 
 	NatsServer.AddUserLogs(c.User.T_uuid, "加班审批", "审批", leave)
-	NatsServer.AddNews(leave.T_uid, "您的加班申请已通过", "/myOvertime")
+	NatsServer.AddNews(leave.T_uid, "您的加班申请已通过", conf.MyOvertimeNewsUrl)
 
 	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: id}
 	c.ServeJSON()