log_sms.go
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package domain
import "time"
//记录 发送的短信消息
type LogSms struct {
Id int
Phone string
TemplateId int
Template string
Value map[string]string
Result string
Status SmsStatus
From string //业务来源
Index int //业务数据索引
ExecuteAt time.Time
CreatedAt time.Time
}
type SmsStatus string
const (
SmsWait SmsStatus = "wait" //等待执行
SmsInit SmsStatus = "init" //正在执行
SmsSuccess SmsStatus = "success" //执行成功
SmsFailed SmsStatus = "failed" //执行失败
SmsIgnore SmsStatus = "ignore" //忽略执行
)
// 每日自评 短信消息提醒
func (sms *LogSms) SummaryEvaluationMessage(phone string, name string) {
*sms = LogSms{
Id: 0,
Phone: phone,
TemplateId: 5475050,
Template: "您好,#name#,百忙之中不要忘记填写今天的绩效自评反馈哦",
Value: map[string]string{
"name": name,
},
CreatedAt: time.Now(),
}
}
type LogSmsRepository interface {
Insert(param *LogSms) error
Save(param *LogSms) error
Find(queryOptions map[string]interface{}) (int, []*LogSms, error)
}