Documentation
¶
Overview ¶
Package wallet implements the user-facing wallet subdomain of the billing module: commission withdrawal, balance/commission statements and the affiliate earnings overview. Only the module facade may reach it.
Index ¶
- func GetAuthMethod(l *QueryUserAffiliateListLogic, item *user.User) user.AuthMethods
- type AffiliateReader
- type AuthMethodReader
- type CommissionWithdrawLogic
- type Deps
- type QueryUserAffiliateListLogic
- type QueryUserAffiliateLogic
- type QueryUserBalanceLogLogic
- type QueryUserCommissionLogLogic
- type QueryWithdrawalLogLogic
- type Service
- func (s *Service) CommissionWithdraw(ctx context.Context, req *dto.CommissionWithdrawRequest) (*dto.WithdrawalLog, error)
- func (s *Service) QueryUserAffiliate(ctx context.Context) (*dto.QueryUserAffiliateCountResponse, error)
- func (s *Service) QueryUserAffiliateList(ctx context.Context, req *dto.QueryUserAffiliateListRequest) (*dto.QueryUserAffiliateListResponse, error)
- func (s *Service) QueryUserBalanceLog(ctx context.Context) (*dto.QueryUserBalanceLogListResponse, error)
- func (s *Service) QueryUserCommissionLog(ctx context.Context, req *dto.QueryUserCommissionLogListRequest) (*dto.QueryUserCommissionLogListResponse, error)
- func (s *Service) QueryWithdrawalLog(ctx context.Context, req *dto.QueryWithdrawalLogListRequest) (*dto.QueryWithdrawalLogListResponse, error)
- type Transactor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthMethod ¶
func GetAuthMethod(l *QueryUserAffiliateListLogic, item *user.User) user.AuthMethods
Types ¶
type AffiliateReader ¶
type AffiliateReader interface {
CountAffiliates(ctx context.Context, refererId int64) (int64, error)
QueryAffiliateList(ctx context.Context, refererId int64, page, size int) ([]*user.User, int64, error)
}
AffiliateReader is the read-only port onto the identity domain's referral relations; the legacy user repository satisfies it structurally. The commission amounts belong to billing, the referral tree stays with identity.
type AuthMethodReader ¶
type AuthMethodReader interface {
FindUserAuthMethods(ctx context.Context, userId int64) ([]*user.AuthMethods, error)
}
AuthMethodReader is the read-only identity port used to render an affiliate's masked login identifier.
type CommissionWithdrawLogic ¶
func (*CommissionWithdrawLogic) CommissionWithdraw ¶
func (l *CommissionWithdrawLogic) CommissionWithdraw(req *dto.CommissionWithdrawRequest) (resp *dto.WithdrawalLog, err error)
type Deps ¶
type Deps struct {
Logs repository.LogRepo
Cache repository.UserCacheRepo
Affiliates AffiliateReader
AuthMethods AuthMethodReader
Tx Transactor
}
Deps declares the subdomain's dependencies; the module facade forwards them from the composition root.
type QueryUserAffiliateListLogic ¶
func (*QueryUserAffiliateListLogic) QueryUserAffiliateList ¶
func (l *QueryUserAffiliateListLogic) QueryUserAffiliateList(req *dto.QueryUserAffiliateListRequest) (resp *dto.QueryUserAffiliateListResponse, err error)
type QueryUserAffiliateLogic ¶
func (*QueryUserAffiliateLogic) QueryUserAffiliate ¶
func (l *QueryUserAffiliateLogic) QueryUserAffiliate() (resp *dto.QueryUserAffiliateCountResponse, err error)
type QueryUserBalanceLogLogic ¶
func (*QueryUserBalanceLogLogic) QueryUserBalanceLog ¶
func (l *QueryUserBalanceLogLogic) QueryUserBalanceLog() (resp *dto.QueryUserBalanceLogListResponse, err error)
type QueryUserCommissionLogLogic ¶
func (*QueryUserCommissionLogLogic) QueryUserCommissionLog ¶
func (l *QueryUserCommissionLogLogic) QueryUserCommissionLog(req *dto.QueryUserCommissionLogListRequest) (resp *dto.QueryUserCommissionLogListResponse, err error)
type QueryWithdrawalLogLogic ¶
func (*QueryWithdrawalLogLogic) QueryWithdrawalLog ¶
func (l *QueryWithdrawalLogLogic) QueryWithdrawalLog(req *dto.QueryWithdrawalLogListRequest) (resp *dto.QueryWithdrawalLogListResponse, err error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the wallet subdomain entry point used by the billing facade.
func NewService ¶
func (*Service) CommissionWithdraw ¶
func (s *Service) CommissionWithdraw(ctx context.Context, req *dto.CommissionWithdrawRequest) (*dto.WithdrawalLog, error)
func (*Service) QueryUserAffiliate ¶
func (*Service) QueryUserAffiliateList ¶
func (s *Service) QueryUserAffiliateList(ctx context.Context, req *dto.QueryUserAffiliateListRequest) (*dto.QueryUserAffiliateListResponse, error)
func (*Service) QueryUserBalanceLog ¶
func (*Service) QueryUserCommissionLog ¶
func (s *Service) QueryUserCommissionLog(ctx context.Context, req *dto.QueryUserCommissionLogListRequest) (*dto.QueryUserCommissionLogListResponse, error)
func (*Service) QueryWithdrawalLog ¶
func (s *Service) QueryWithdrawalLog(ctx context.Context, req *dto.QueryWithdrawalLogListRequest) (*dto.QueryWithdrawalLogListResponse, error)
type Transactor ¶
type Transactor interface {
InBillingTx(ctx context.Context, fn func(repository.BillingStore) error) error
}
Transactor mirrors the facade's billing-scoped transaction port.