2024-01-28 21:39:32 +00:00
|
|
|
package initial
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/adapter/redis"
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/config"
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/repository/mysql"
|
|
|
|
adminvalidator "git.gocasts.ir/ebhomengo/niki/validator/admin/admin"
|
2024-07-01 17:13:28 +00:00
|
|
|
adminkindboxvalidator "git.gocasts.ir/ebhomengo/niki/validator/admin/kind_box"
|
2024-01-28 21:39:32 +00:00
|
|
|
adminkindboxreqvalidator "git.gocasts.ir/ebhomengo/niki/validator/admin/kind_box_req"
|
|
|
|
benefactoraddressvalidator "git.gocasts.ir/ebhomengo/niki/validator/benefactor/address"
|
|
|
|
benefactorvalidator "git.gocasts.ir/ebhomengo/niki/validator/benefactor/benefactor"
|
2024-06-25 21:58:11 +00:00
|
|
|
benefactorkindboxvalidator "git.gocasts.ir/ebhomengo/niki/validator/benefactor/kind_box"
|
2024-01-28 21:39:32 +00:00
|
|
|
benefactorkindboxreqvalidator "git.gocasts.ir/ebhomengo/niki/validator/benefactor/kind_box_req"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Validators struct {
|
|
|
|
BenefactorVld benefactorvalidator.Validator
|
|
|
|
BenefactorKindBoxReqVld benefactorkindboxreqvalidator.Validator
|
|
|
|
BenefactorAddressVld benefactoraddressvalidator.Validator
|
2024-06-25 21:58:11 +00:00
|
|
|
BenefactorKindBoxVld benefactorkindboxvalidator.Validator
|
2024-01-28 21:39:32 +00:00
|
|
|
AdminKindBoxReqVld adminkindboxreqvalidator.Validator
|
|
|
|
AdminVld adminvalidator.Validator
|
2024-07-01 17:13:28 +00:00
|
|
|
AdminKindBoxVld adminkindboxvalidator.Validator
|
2024-01-28 21:39:32 +00:00
|
|
|
}
|
|
|
|
|
2024-05-17 20:16:28 +00:00
|
|
|
func InitAdminKindBoxReqValidator(db *mysql.DB, cfg config.Config) adminkindboxreqvalidator.Validator {
|
2024-07-10 01:21:03 +00:00
|
|
|
return adminkindboxreqvalidator.New(InitBenefactorKindBoxReqDB(db), InitAdminService(cfg, db), InitBenefactorForAdminService(db), InitAdminReferTimeService(db), InitBenefactorAddressService(db))
|
2024-01-28 21:39:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func InitAdminValidator(db *mysql.DB) adminvalidator.Validator {
|
|
|
|
return adminvalidator.New(InitAdminMysql(db))
|
|
|
|
}
|
|
|
|
|
|
|
|
func InitBenefactorValidator() benefactorvalidator.Validator {
|
|
|
|
return benefactorvalidator.New()
|
|
|
|
}
|
|
|
|
|
|
|
|
func InitBenefactorKindBoxReqValidator(cfg config.Config, redisAdapter redis.Adapter, db *mysql.DB) benefactorkindboxreqvalidator.Validator {
|
|
|
|
return benefactorkindboxreqvalidator.New(
|
|
|
|
InitBenefactorService(cfg, redisAdapter, db),
|
|
|
|
InitBenefactorAddressService(db),
|
2024-05-31 12:36:48 +00:00
|
|
|
InitAdminReferTimeService(db),
|
2024-05-31 14:49:04 +00:00
|
|
|
InitBenefactorKindBoxReqDB(db),
|
2024-01-28 21:39:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func InitBenefactorAddressValidator(cfg config.Config, redisAdapter redis.Adapter, db *mysql.DB) benefactoraddressvalidator.Validator {
|
|
|
|
return benefactoraddressvalidator.New(
|
|
|
|
InitBenefactorService(cfg, redisAdapter, db),
|
|
|
|
InitBenefactorAddressDB(db),
|
|
|
|
)
|
|
|
|
}
|
2024-06-25 21:58:11 +00:00
|
|
|
|
2024-07-02 20:17:40 +00:00
|
|
|
func InitAdminKindBoxValidator(db *mysql.DB, cfg config.Config) adminkindboxvalidator.Validator {
|
|
|
|
return adminkindboxvalidator.New(InitKindBoxRepo(db), InitAdminService(cfg, db))
|
2024-07-01 17:13:28 +00:00
|
|
|
}
|
|
|
|
|
2024-06-25 21:58:11 +00:00
|
|
|
func InitBenefactorKindBoxValidator(cfg config.Config, redisAdapter redis.Adapter, db *mysql.DB) benefactorkindboxvalidator.Validator {
|
|
|
|
return benefactorkindboxvalidator.New(
|
|
|
|
InitKindBoxRepo(db),
|
|
|
|
InitBenefactorService(cfg, redisAdapter, db),
|
|
|
|
InitBenefactorAddressService(db),
|
|
|
|
InitAdminReferTimeService(db),
|
|
|
|
)
|
|
|
|
}
|