feat: 迁移商务旗下渠道查询和抽屉

This commit is contained in:
Yvan
2026-11-03 19:20:42 +08:00
parent 8048dfb514
commit cd42a1d3f0
29 changed files with 409 additions and 20 deletions
+36
View File
@@ -0,0 +1,36 @@
package business
import "context"
type BusinessPromote struct {
ID uint64
Account, SourceDB string
BusierID uint64
}
type BusinessPromoteFilter struct {
UserID uint
SourceDB string
BusierID uint64
}
type BusinessPromotePage struct {
Rows []*BusinessPromote
Total int64
Available bool
}
type BusinessPromoteRepo interface {
ListDirect(context.Context, BusinessPromoteFilter, ...ListOption) (*BusinessPromotePage, error)
}
type BusinessPromoteUsecase struct {
repo BusinessPromoteRepo
accounts *AccountUsecase
}
func NewBusinessPromoteUsecase(repo BusinessPromoteRepo, accounts *AccountUsecase) *BusinessPromoteUsecase {
return &BusinessPromoteUsecase{repo: repo, accounts: accounts}
}
func (uc *BusinessPromoteUsecase) List(ctx context.Context, filter BusinessPromoteFilter, options ...ListOption) (*BusinessPromotePage, error) {
if _, err := uc.accounts.Find(ctx, filter.UserID); err != nil {
return nil, err
}
return uc.repo.ListDirect(ctx, filter, options...)
}