message_personal.go
1.6 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
package domain
import "time"
// MessagePersonal 个人的消息提示
type MessagePersonal struct {
Id int `json:"id"` //
Types MessageTypes `json:"types"` //消息类型
TargetUserId int `json:"targetUserId"` //消息指向的用户
ReadFlag MessageReadFlag `json:"readFlag"` //1:已读、2:未读
Title string `json:"title"` //消息的标题
Content string `json:"content"` //消息的内容
CreatedAt time.Time `json:"createdAt"` //
UpdatedAt time.Time `json:"updatedAt"` //
Payload string `json:"payload"` //消息的额外承载的数据
}
// 个人的消息提示类型
type MessageTypes string
const (
MessageTypesOther MessageTypes = "other" //综合自评开启时,消息通知
MessageTypesTaskStage MessageTypes = "task_stage" //任务里程碑未按时完成
MessageTypesTaskRecord MessageTypes = "task_record" //任务每日反馈异常
MessageTypesTaskModify MessageTypes = "task_modify" //修改任务
MessageTypesTaskStageApp MessageTypes = "task_stage-app" //任务里程碑未按时完成
MessageTypesTaskRecordApp MessageTypes = "task_record-app" //任务每日反馈异常
)
type MessageReadFlag string
const (
MessageIsRead MessageReadFlag = "read"
MessageUnread MessageReadFlag = "unread"
)
type MessagePersonalRepository interface {
Save(param *MessagePersonal) error
Find(queryOptions map[string]interface{}) (int, []*MessagePersonal, error)
}