Refactoring (#3)

Reviewed-on: #3
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-11-27 01:59:25 +00:00
committed by phoenix
parent e28e5c6755
commit 9516f1a052
5 changed files with 14 additions and 11 deletions
+7 -4
View File
@@ -5,9 +5,9 @@ import (
"fmt"
"time"
"git.kundeng.us/phoenix/textsender-models/pkg/config"
"git.kundeng.us/phoenix/textsender-models/pkg/contact"
"git.kundeng.us/phoenix/textsender-models/pkg/message"
"git.kundeng.us/phoenix/textsender-models/tx0/config"
"git.kundeng.us/phoenix/textsender-models/tx0/contact"
"git.kundeng.us/phoenix/textsender-models/tx0/message"
"github.com/twilio/twilio-go"
twilioApi "github.com/twilio/twilio-go/rest/api/v2010"
@@ -15,10 +15,13 @@ import (
)
type MessageSender struct {
Config config.TwiloConfig
Config *config.TwiloConfig
}
func (m *MessageSender) Send(msg message.Message, number contact.Contact, sendTime *time.Time) (*types.TwilioResult, error) {
if m.Config == nil {
return nil, fmt.Errorf("Config has not been initialized")
}
now := time.Now()
client := twilio.NewRestClientWithParams(twilio.ClientParams{
Username: m.Config.AccountSID,