34 lines
976 B
Go
34 lines
976 B
Go
package authsvc
|
|
|
|
import (
|
|
staffrepository "github.com/ardeman/project-legalgo-go/internal/accessor/staff"
|
|
subscriberepository "github.com/ardeman/project-legalgo-go/internal/accessor/subscribe"
|
|
userrepository "github.com/ardeman/project-legalgo-go/internal/accessor/user_repository"
|
|
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth"
|
|
)
|
|
|
|
type AuthSvc struct {
|
|
staffRepo staffrepository.StaffIntf
|
|
userRepo userrepository.UserIntf
|
|
subsRepo subscriberepository.SubsIntf
|
|
}
|
|
|
|
type AuthIntf interface {
|
|
LoginAsStaff(authdomain.LoginReq) (string, error)
|
|
LoginAsUser(authdomain.LoginReq) (string, error)
|
|
RegisterUser(authdomain.RegisterUserReq) (string, error)
|
|
RegisterStaff(authdomain.RegisterStaffReq) (string, error)
|
|
}
|
|
|
|
func New(
|
|
staffRepo staffrepository.StaffIntf,
|
|
userRepo userrepository.UserIntf,
|
|
subsRepo subscriberepository.SubsIntf,
|
|
) AuthIntf {
|
|
return &AuthSvc{
|
|
staffRepo: staffRepo,
|
|
userRepo: userRepo,
|
|
subsRepo: subsRepo,
|
|
}
|
|
}
|