审查视图

pkg/application/notify/run.go 866 字节
tangxvhui authored
1 2 3 4
package notify

import "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
tangxvhui authored
5
// 执行定时任务检查是否发送短信通知
tangxvhui authored
6
var taskSmsNotify *notifySms
tangxvhui authored
7
tangxvhui authored
8
// 检查并发送短信通知
tangxvhui authored
9
func RunTaskSmsNotify() {
tangxvhui authored
10 11 12 13 14
	taskSmsNotify = &notifySms{}
	taskSmsNotify.init()
	taskSmsNotify.regist(notifyStaffAssess{})
	taskSmsNotify.regist(notifySummaryEvaluation{})
	taskSmsNotify.runTask()
tangxvhui authored
15 16 17 18 19 20
}

// 每日自评短信通知 ,预创建待发送的短信消息
func AddNotifyStaffAssess(param *domain.StaffAssess) {
	newNotify := notifyStaffAssess{}
	newSms := newNotify.makeNotify(param)
tangxvhui authored
21
	taskSmsNotify.addTask(newSms)
tangxvhui authored
22 23 24 25 26 27
}

// 周期自评短信通知 ,预创建待发送的短信消息
func AddNotifySummaryEvaluation(param *domain.SummaryEvaluation) {
	newNotify := notifySummaryEvaluation{}
	newSms := newNotify.makeNotify(param)
tangxvhui authored
28
	taskSmsNotify.addTask(newSms)
tangxvhui authored
29
}