审查视图

pkg/domain/log_sms.go 1.3 KB
tangxvhui authored
1 2 3 4 5 6 7
package domain

import "time"

//记录 发送的短信消息

type LogSms struct {
tangxvhui authored
8 9 10 11 12 13 14 15 16 17 18
	Id         int               `json:"id"`
	Phone      string            `json:"phone"`
	TemplateId int               `json:"templateId"`
	Template   string            `json:"template"`
	Value      map[string]string `json:"value"`
	Result     string            `json:"result"`
	Status     SmsStatus         `json:"status"`
	From       string            `json:"from"`  //业务来源
	Index      int               `json:"index"` //业务数据索引
	ExecuteAt  time.Time         `json:"executeAt"`
	CreatedAt  time.Time         `json:"createdAt"`
tangxvhui authored
19 20
}
21 22 23 24 25 26 27 28
type SmsStatus string

const (
	SmsWait    SmsStatus = "wait"    //等待执行
	SmsSuccess SmsStatus = "success" //执行成功
	SmsIgnore  SmsStatus = "ignore"  //忽略执行
)
tangxvhui authored
29
// 每日自评 短信消息提醒
tangxvhui authored
30 31 32 33
func (sms *LogSms) SummaryEvaluationMessage(phone string, name string) {
	*sms = LogSms{
		Id:         0,
		Phone:      phone,
tangxvhui authored
34
		TemplateId: 5475050,
tangxvhui authored
35 36 37 38 39 40 41
		Template:   "您好,#name#,百忙之中不要忘记填写今天的绩效自评反馈哦",
		Value: map[string]string{
			"name": name,
		},
		CreatedAt: time.Now(),
	}
}
tangxvhui authored
42 43

type LogSmsRepository interface {
tangxvhui authored
44 45
	Save(param *LogSms) error
	Find(queryOptions map[string]interface{}) (int, []*LogSms, error)
tangxvhui authored
46
}