|
|
@ -8,7 +8,6 @@ import (
|
|
|
|
"sync"
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/Masterminds/semver/v3"
|
|
|
|
"github.com/Masterminds/semver/v3"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/conf"
|
|
|
|
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/dao/cache"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/dao/cache"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/dao/security"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/dao/security"
|
|
|
@ -35,10 +34,12 @@ type dataSrv struct {
|
|
|
|
core.CommentManageService
|
|
|
|
core.CommentManageService
|
|
|
|
core.UserManageService
|
|
|
|
core.UserManageService
|
|
|
|
core.ContactManageService
|
|
|
|
core.ContactManageService
|
|
|
|
|
|
|
|
core.UserRelationService
|
|
|
|
core.FollowingManageService
|
|
|
|
core.FollowingManageService
|
|
|
|
core.SecurityService
|
|
|
|
core.SecurityService
|
|
|
|
core.AttachmentCheckService
|
|
|
|
core.AttachmentCheckService
|
|
|
|
core.TweetMetricServantA
|
|
|
|
core.TweetMetricServantA
|
|
|
|
|
|
|
|
core.CommentMetricServantA
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type webDataSrvA struct {
|
|
|
|
type webDataSrvA struct {
|
|
|
@ -51,10 +52,12 @@ type webDataSrvA struct {
|
|
|
|
func NewDataService() (core.DataService, core.VersionInfo) {
|
|
|
|
func NewDataService() (core.DataService, core.VersionInfo) {
|
|
|
|
lazyInitial()
|
|
|
|
lazyInitial()
|
|
|
|
pvs := security.NewPhoneVerifyService()
|
|
|
|
pvs := security.NewPhoneVerifyService()
|
|
|
|
tms := NewTweetMetricServentA(_db)
|
|
|
|
cms := newCommentMetricServentA(_db)
|
|
|
|
|
|
|
|
tms := newTweetMetricServentA(_db)
|
|
|
|
cis := cache.NewEventCacheIndexSrv(tms)
|
|
|
|
cis := cache.NewEventCacheIndexSrv(tms)
|
|
|
|
ds := &dataSrv{
|
|
|
|
ds := &dataSrv{
|
|
|
|
TweetMetricServantA: tms,
|
|
|
|
TweetMetricServantA: tms,
|
|
|
|
|
|
|
|
CommentMetricServantA: cms,
|
|
|
|
WalletService: newWalletService(_db),
|
|
|
|
WalletService: newWalletService(_db),
|
|
|
|
MessageService: newMessageService(_db),
|
|
|
|
MessageService: newMessageService(_db),
|
|
|
|
TopicService: newTopicService(_db),
|
|
|
|
TopicService: newTopicService(_db),
|
|
|
@ -65,6 +68,7 @@ func NewDataService() (core.DataService, core.VersionInfo) {
|
|
|
|
CommentManageService: newCommentManageService(_db),
|
|
|
|
CommentManageService: newCommentManageService(_db),
|
|
|
|
UserManageService: newUserManageService(_db),
|
|
|
|
UserManageService: newUserManageService(_db),
|
|
|
|
ContactManageService: newContactManageService(_db),
|
|
|
|
ContactManageService: newContactManageService(_db),
|
|
|
|
|
|
|
|
UserRelationService: newUserRelationService(_db),
|
|
|
|
FollowingManageService: newFollowingManageService(_db),
|
|
|
|
FollowingManageService: newFollowingManageService(_db),
|
|
|
|
SecurityService: newSecurityService(_db, pvs),
|
|
|
|
SecurityService: newSecurityService(_db, pvs),
|
|
|
|
AttachmentCheckService: security.NewAttachmentCheckService(),
|
|
|
|
AttachmentCheckService: security.NewAttachmentCheckService(),
|
|
|
@ -74,16 +78,13 @@ func NewDataService() (core.DataService, core.VersionInfo) {
|
|
|
|
|
|
|
|
|
|
|
|
func NewWebDataServantA() (core.WebDataServantA, core.VersionInfo) {
|
|
|
|
func NewWebDataServantA() (core.WebDataServantA, core.VersionInfo) {
|
|
|
|
lazyInitial()
|
|
|
|
lazyInitial()
|
|
|
|
|
|
|
|
tms := newTweetMetricServentA(_db)
|
|
|
|
tms := NewTweetMetricServentA(_db)
|
|
|
|
|
|
|
|
cis := cache.NewEventCacheIndexSrv(tms)
|
|
|
|
cis := cache.NewEventCacheIndexSrv(tms)
|
|
|
|
|
|
|
|
|
|
|
|
db := conf.MustSqlxDB()
|
|
|
|
|
|
|
|
ds := &webDataSrvA{
|
|
|
|
ds := &webDataSrvA{
|
|
|
|
TopicServantA: newTopicServantA(db),
|
|
|
|
TopicServantA: newTopicServantA(_db),
|
|
|
|
TweetServantA: newTweetServantA(db),
|
|
|
|
TweetServantA: newTweetServantA(_db),
|
|
|
|
TweetManageServantA: newTweetManageServantA(db, cis),
|
|
|
|
TweetManageServantA: newTweetManageServantA(_db, cis),
|
|
|
|
TweetHelpServantA: newTweetHelpServantA(db),
|
|
|
|
TweetHelpServantA: newTweetHelpServantA(_db),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ds, ds
|
|
|
|
return ds, ds
|
|
|
|
}
|
|
|
|
}
|
|
|
|