2025-02-27 18:59:58 +08:00

42 lines
1.2 KiB
Go

package authsvc
import (
staffrepository "legalgo-BE-go/internal/accessor/staff"
subscriberepository "legalgo-BE-go/internal/accessor/subscribe"
subscribeplanrepository "legalgo-BE-go/internal/accessor/subscribeplan"
userrepository "legalgo-BE-go/internal/accessor/user_repository"
authdomain "legalgo-BE-go/internal/domain/auth"
)
type AuthSvc struct {
staffRepo staffrepository.StaffIntf
userRepo userrepository.UserIntf
subsRepo subscriberepository.SubsIntf
subsPlanRepo subscribeplanrepository.SubsPlanIntf
}
type AuthIntf interface {
LoginAsStaff(authdomain.LoginReq) (string, error)
RegisterUser(authdomain.RegisterUserReq) (string, error)
GetUserProfile(string) (*authdomain.UserProfile, error)
LoginAsUser(authdomain.LoginReq) (string, error)
RegisterStaff(authdomain.RegisterStaffReq) (string, error)
UpdateStaff(authdomain.Staff) error
GetStaffProfile(string) (*authdomain.StaffProfile, error)
}
func New(
staffRepo staffrepository.StaffIntf,
userRepo userrepository.UserIntf,
subsRepo subscriberepository.SubsIntf,
subsPlanRepo subscribeplanrepository.SubsPlanIntf,
) AuthIntf {
return &AuthSvc{
staffRepo: staffRepo,
userRepo: userRepo,
subsRepo: subsRepo,
subsPlanRepo: subsPlanRepo,
}
}