message_dto.go
903 字节
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
package dto
import (
"math/rand"
"time"
)
type MessageDto struct {
MsgId int `json:"msgId"`
MsgContent string `json:"msgContent"`
MsgTime int64 `json:"msgTime"`
MsgType int `json:"msgType"`
MsgIcon string `json:"msgIcon"`
Read int `json:"read"`
DynamicId int `json:"dynamicId"`
}
func NewMessageDto() *MessageDto {
return &MessageDto{
MsgId: rand.Intn(10000),
MsgContent: "消息",
MsgTime: time.Now().Unix() * 1000,
MsgType: 1,
Read: 1,
}
}
func (m *MessageDto) LoadMsgType(module string, action string) int {
switch module {
case "module01":
switch action {
case "action01_01", "action01_02":
return 1001 //跳转共创申请列表页面
case "action01_03":
return 1002 //跳转共创企业列表页面
case "action01_04", "action01_05", "action01_06":
return 1003
}
}
return 1 // 系统注册消息
}