2025-02-24 16:48:20 +08:00
|
|
|
package authsvc
|
2025-02-23 22:34:26 +08:00
|
|
|
|
2025-02-24 16:48:20 +08:00
|
|
|
import (
|
2025-02-27 07:25:25 +08:00
|
|
|
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"
|
2025-02-24 16:48:20 +08:00
|
|
|
)
|
2025-02-23 22:34:26 +08:00
|
|
|
|
2025-02-24 16:48:20 +08:00
|
|
|
type AuthSvc struct {
|
2025-02-27 01:14:16 +08:00
|
|
|
staffRepo staffrepository.StaffIntf
|
|
|
|
|
userRepo userrepository.UserIntf
|
|
|
|
|
subsRepo subscriberepository.SubsIntf
|
|
|
|
|
subsPlanRepo subscribeplanrepository.SubsPlanIntf
|
2025-02-23 22:34:26 +08:00
|
|
|
}
|
|
|
|
|
|
2025-02-24 16:48:20 +08:00
|
|
|
type AuthIntf interface {
|
|
|
|
|
LoginAsStaff(authdomain.LoginReq) (string, error)
|
|
|
|
|
RegisterUser(authdomain.RegisterUserReq) (string, error)
|
2025-02-27 18:59:58 +08:00
|
|
|
GetUserProfile(string) (*authdomain.UserProfile, error)
|
|
|
|
|
|
|
|
|
|
LoginAsUser(authdomain.LoginReq) (string, error)
|
2025-02-24 16:48:20 +08:00
|
|
|
RegisterStaff(authdomain.RegisterStaffReq) (string, error)
|
2025-02-27 18:59:58 +08:00
|
|
|
UpdateStaff(authdomain.Staff) error
|
|
|
|
|
GetStaffProfile(string) (*authdomain.StaffProfile, error)
|
2025-02-23 22:34:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func New(
|
2025-02-24 16:48:20 +08:00
|
|
|
staffRepo staffrepository.StaffIntf,
|
|
|
|
|
userRepo userrepository.UserIntf,
|
|
|
|
|
subsRepo subscriberepository.SubsIntf,
|
2025-02-27 01:14:16 +08:00
|
|
|
subsPlanRepo subscribeplanrepository.SubsPlanIntf,
|
2025-02-24 16:48:20 +08:00
|
|
|
) AuthIntf {
|
|
|
|
|
return &AuthSvc{
|
2025-02-27 01:14:16 +08:00
|
|
|
staffRepo: staffRepo,
|
|
|
|
|
userRepo: userRepo,
|
|
|
|
|
subsRepo: subsRepo,
|
|
|
|
|
subsPlanRepo: subsPlanRepo,
|
2025-02-23 22:34:26 +08:00
|
|
|
}
|
|
|
|
|
}
|