sqlx: optimize initial logic for data service

r/paopao-ce-plus paopao-ce-plus/v0.5.0-alpha.1
Michael Li 1 year ago
parent f293c573c3
commit 283770104b
No known key found for this signature in database

@ -50,11 +50,9 @@ 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) tms := NewTweetMetricServentA(_db)
cis := cache.NewEventCacheIndexSrv(tms) cis := cache.NewEventCacheIndexSrv(tms)
ds := &dataSrv{ ds := &dataSrv{
TweetMetricServantA: tms, TweetMetricServantA: tms,
WalletService: newWalletService(_db), WalletService: newWalletService(_db),
@ -71,7 +69,7 @@ func NewDataService() (core.DataService, core.VersionInfo) {
SecurityService: newSecurityService(_db, pvs), SecurityService: newSecurityService(_db, pvs),
AttachmentCheckService: security.NewAttachmentCheckService(), AttachmentCheckService: security.NewAttachmentCheckService(),
} }
return ds, ds return cache.NewCacheDataService(ds), ds
} }
func NewWebDataServantA() (core.WebDataServantA, core.VersionInfo) { func NewWebDataServantA() (core.WebDataServantA, core.VersionInfo) {

Loading…
Cancel
Save