feat(quality-owner): 增加优质号主、极品专区与无忧租号保险
- 支持保证金余额支付、在线支付开通及后台手动设置审计 - 新增极品专区发布权限、赔付方案与保险结算费率快照 - 优化首页、商品卡和个人中心的优质号主身份展示
This commit is contained in:
@@ -19,12 +19,19 @@ type MohongOrderConfirmer interface {
|
||||
NotifyNewConversation(conversationID uint64)
|
||||
}
|
||||
|
||||
// QualityOwnerPaymentAdapter 由优质号主模块实现,避免 payment 与 qualityowner 直接耦合。
|
||||
type QualityOwnerPaymentAdapter interface {
|
||||
PaymentAmount(ctx context.Context, userID uint64) (amountCent int64, active bool, err error)
|
||||
ConfirmQualityOwnerDepositPaidTx(tx *gorm.DB, userID uint64, amountCent int64, paymentNo string) error
|
||||
}
|
||||
|
||||
type Repository struct {
|
||||
db *gorm.DB
|
||||
configRepo *paymentconfig.Repository
|
||||
orderRepo *order.Repository
|
||||
mohongRepo MohongOrderConfirmer
|
||||
logger *zap.Logger
|
||||
db *gorm.DB
|
||||
configRepo *paymentconfig.Repository
|
||||
orderRepo *order.Repository
|
||||
mohongRepo MohongOrderConfirmer
|
||||
qualityOwnerRepo QualityOwnerPaymentAdapter
|
||||
logger *zap.Logger
|
||||
}
|
||||
|
||||
type runtimePaymentConfig struct {
|
||||
@@ -96,6 +103,13 @@ func WithMohongRepo(repo MohongOrderConfirmer) RepositoryOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithQualityOwnerRepo 注入优质号主保证金支付适配器。
|
||||
func WithQualityOwnerRepo(repo QualityOwnerPaymentAdapter) RepositoryOption {
|
||||
return func(r *Repository) {
|
||||
r.qualityOwnerRepo = repo
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Repository) log() *zap.Logger {
|
||||
if r == nil || r.logger == nil {
|
||||
return zap.NewNop()
|
||||
|
||||
Reference in New Issue
Block a user