mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 00:12:11 +08:00
code refactor
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
"github.com/mayswind/ezbookkeeping/pkg/core"
|
||||
"github.com/mayswind/ezbookkeeping/pkg/datastore"
|
||||
"github.com/mayswind/ezbookkeeping/pkg/errs"
|
||||
"github.com/mayswind/ezbookkeeping/pkg/mail"
|
||||
"github.com/mayswind/ezbookkeeping/pkg/settings"
|
||||
"github.com/mayswind/ezbookkeeping/pkg/storage"
|
||||
@@ -61,7 +60,7 @@ type ServiceUsingConfig struct {
|
||||
|
||||
// CurrentConfig returns the current config
|
||||
func (s *ServiceUsingConfig) CurrentConfig() *settings.Config {
|
||||
return s.container.Current
|
||||
return s.container.GetCurrentConfig()
|
||||
}
|
||||
|
||||
// ServiceUsingMailer represents a service that need to use mailer
|
||||
@@ -71,11 +70,7 @@ type ServiceUsingMailer struct {
|
||||
|
||||
// SendMail sends an email according to argument
|
||||
func (s *ServiceUsingMailer) SendMail(message *mail.MailMessage) error {
|
||||
if s.container.Current == nil {
|
||||
return errs.ErrSMTPServerNotEnabled
|
||||
}
|
||||
|
||||
return s.container.Current.SendMail(message)
|
||||
return s.container.SendMail(message)
|
||||
}
|
||||
|
||||
// ServiceUsingUuid represents a service that need to use uuid
|
||||
|
||||
Reference in New Issue
Block a user