36 lines
743 B
Go
36 lines
743 B
Go
package authentication
|
|
|
|
import (
|
|
"Yimaru-Backend/internal/ports"
|
|
"Yimaru-Backend/internal/services/user"
|
|
)
|
|
|
|
// type EmailPhone struct {
|
|
// Email ValidString
|
|
// PhoneNumber ValidString
|
|
// Password ValidString
|
|
// }
|
|
type ValidString struct {
|
|
Value string
|
|
Valid bool
|
|
}
|
|
type Tokens struct {
|
|
AccessToken string
|
|
RefreshToken string
|
|
}
|
|
type Service struct {
|
|
userStore ports.UserStore
|
|
UserSvc user.Service
|
|
tokenStore ports.TokenStore
|
|
RefreshExpiry int
|
|
}
|
|
|
|
func NewService(userStore ports.UserStore, userSvc user.Service, tokenStore ports.TokenStore, RefreshExpiry int) *Service {
|
|
return &Service{
|
|
userStore: userStore,
|
|
UserSvc: userSvc,
|
|
tokenStore: tokenStore,
|
|
RefreshExpiry: RefreshExpiry,
|
|
}
|
|
}
|