34 lines
976 B
Go
Raw Normal View History

2025-02-24 16:48:20 +08:00
package authsvc
2025-02-24 16:48:20 +08:00
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"
)
2025-02-24 16:48:20 +08:00
type AuthSvc struct {
staffRepo staffrepository.StaffIntf
userRepo userrepository.UserIntf
subsRepo subscriberepository.SubsIntf
}
2025-02-24 16:48:20 +08:00
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(
2025-02-24 16:48:20 +08:00
staffRepo staffrepository.StaffIntf,
userRepo userrepository.UserIntf,
subsRepo subscriberepository.SubsIntf,
) AuthIntf {
return &AuthSvc{
staffRepo: staffRepo,
userRepo: userRepo,
subsRepo: subsRepo,
}
}