forked from juggleim/im-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstarter.go
83 lines (78 loc) · 3.53 KB
/
starter.go
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package historymsg
import (
"fmt"
"im-server/commons/bases"
"im-server/commons/gmicro"
"im-server/commons/gmicro/actorsystem"
"im-server/services/historymsg/actors"
)
var serviceName string = "historymsg"
type HistoryMsgManager struct{}
func (manager *HistoryMsgManager) RegisterActors(register gmicro.IActorRegister) {
register.RegisterActor("add_hismsg", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.AddHisMsgActor{}, serviceName)
})
register.RegisterMultiMethodActor([]string{"del_msg", "del_hismsg"}, func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.DelMsgActor{}, serviceName)
})
register.RegisterActor("upd_stream", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.UpdStreamActor{}, serviceName)
})
register.RegisterActor("qry_latest_hismsg", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.QryLatestMsgActor{}, serviceName)
})
register.RegisterActor("qry_hismsgs", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.QryHistoryMsgsActor{}, serviceName)
})
register.RegisterActor("qry_first_unread_msg", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.QryFirstUnreadMsgActor{}, serviceName)
})
register.RegisterActor("qry_hismsg_by_ids", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.QryHistoryMsgByIdsActor{}, serviceName)
})
register.RegisterActor("clean_hismsg", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.CleanHisMsgActor{}, serviceName)
})
register.RegisterActor("recall_msg", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.RecallMsgActor{}, serviceName)
})
register.RegisterActor("modify_msg", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.ModifyMsgActor{}, serviceName)
})
register.RegisterActor("mark_read", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.MarkReadActor{}, serviceName)
})
register.RegisterActor("mark_grp_msg_read", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.MarkGrpMsgReadActor{}, serviceName)
})
register.RegisterActor("qry_read_infos", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.QryReadInfosActor{}, serviceName)
})
register.RegisterActor("qry_read_detail", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.QryReadDetailActor{}, serviceName)
})
register.RegisterActor("merge_msgs", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.MergeMsgActor{}, serviceName)
})
register.RegisterActor("qry_merged_msgs", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.QryMergedMsgsActor{}, serviceName)
})
register.RegisterActor("msg_ext", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.SetMsgExtActor{}, serviceName)
})
register.RegisterActor("del_msg_ext", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.DelMsgExtActor{}, serviceName)
})
register.RegisterActor("msg_exset", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.AddMsgExSetActor{}, serviceName)
})
register.RegisterActor("del_msg_exset", func() actorsystem.IUntypedActor {
return bases.BaseProcessActor(&actors.DelMsgExSetActor{}, serviceName)
})
}
func (manager *HistoryMsgManager) Startup(args map[string]interface{}) {
fmt.Println("Startup historymsg.")
}
func (manager *HistoryMsgManager) Shutdown() {
fmt.Println("Shutdown historymsg.")
}