Compare commits

..
Author SHA1 Message Date
phoenixandphoenix 245ff35e58 tsk-14: User improvements (#20)
Closes #14

Reviewed-on: phoenix/textsender-models#20
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-12-16 02:38:30 +00:00
phoenixandphoenix c4d195df4b tsk-13: Fix typo in TwilioConfig (#19)
Closes #13

Reviewed-on: phoenix/textsender-models#19
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-12-16 02:16:38 +00:00
3 changed files with 21 additions and 14 deletions
+7 -6
View File
@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
) )
type TwiloConfig struct { type TwilioConfig struct {
AccountSID string `json:"auth_sid"` AccountSID string `json:"auth_sid"`
ServiceSID string `json:"service_sid"` ServiceSID string `json:"service_sid"`
URI string `json:"uri"` URI string `json:"uri"`
@@ -12,10 +12,11 @@ type TwiloConfig struct {
Number string `json:"phone_number"` Number string `json:"phone_number"`
} }
func (config *TwiloConfig) PrintConfig() { func (config *TwilioConfig) PrintConfig() {
fmt.Printf("Account SID: %s\n", config.AccountSID) fmt.Println("Twilio config")
fmt.Printf("Service SID: %s\n", config.ServiceSID) fmt.Println("Account SID:", config.AccountSID)
fmt.Println("Service SID:", config.ServiceSID)
fmt.Println("URI:", config.URI) fmt.Println("URI:", config.URI)
fmt.Printf("Auth Token: %s\n", config.AuthToken) fmt.Println("Auth Token:", config.AuthToken)
fmt.Printf("Number: %s\n", config.Number) fmt.Println("Number:", config.Number)
} }
+4 -4
View File
@@ -7,8 +7,8 @@ import (
) )
type ServiceUser struct { type ServiceUser struct {
Id uuid.UUID `json:"id"` Id uuid.UUID `json:"id"`
Username string `json:"username,omitempty"` Username string `json:"username,omitempty"`
Passphrase string `json:"passphrase,omitempty"` Passphrase string `json:"passphrase,omitempty"`
Created *time.Time `json:"date_created,omitempty"` Created time.Time `json:"date_created"`
} }
+10 -4
View File
@@ -1,12 +1,18 @@
package user package user
import ( import (
"time"
"github.com/google/uuid" "github.com/google/uuid"
) )
type User struct { type User struct {
Id uuid.UUID `json:"id"` Id uuid.UUID `json:"id"`
PhoneNumber string `json:"phone_number"` PhoneNumber string `json:"phone_number"`
Username string `json:"username"` Username string `json:"username"`
Password string `json:"password"` Password string `json:"password"`
Firstname *string `json:"first_name,omitempty"`
Lastname *string `json:"last_name,omitempty"`
Created time.Time `json:"date_created"`
LastLogin *time.Time `json:"last_login,omitempty"`
} }