feat: 完善小组绩效与有效端统计并修复审查问题

This commit is contained in:
Yvan
2026-11-05 01:10:03 +08:00
parent ca9ce99b66
commit dc97690eb1
75 changed files with 5033 additions and 296 deletions
+16 -8
View File
@@ -41,6 +41,7 @@ type Channel struct {
GameCount, PlayerCount *int64
TotalPayAmount *string
CreatedUnix, LastLoginUnix *int64
QualifiedAt *int64
}
func (c *Channel) BusinessDisplayName() string {
@@ -70,6 +71,7 @@ func (c *Channel) IncludesStat(other *Channel, includeSub bool) bool {
}
type ChannelFilter struct {
Effective *bool
Sources []string
BusierUserID *uint
BusierAccount, Keyword string
@@ -133,16 +135,17 @@ type ChannelWriteRepo interface {
}
type PlatformPasswordEncoder interface{ Encode(string) (string, error) }
type ChannelUsecase struct {
repo ChannelRepo
writer ChannelWriteRepo
accounts *AccountUsecase
preferences *UserPreferenceUsecase
passwords PlatformPasswordEncoder
now func() time.Time
repo ChannelRepo
writer ChannelWriteRepo
accounts *AccountUsecase
preferences *UserPreferenceUsecase
passwords PlatformPasswordEncoder
effectiveness *EffectivenessUsecase
now func() time.Time
}
func NewChannelUsecase(repo ChannelRepo, writer ChannelWriteRepo, accounts *AccountUsecase, preferences *UserPreferenceUsecase, passwords PlatformPasswordEncoder) *ChannelUsecase {
return &ChannelUsecase{repo: repo, writer: writer, accounts: accounts, preferences: preferences, passwords: passwords, now: time.Now}
func NewChannelUsecase(repo ChannelRepo, writer ChannelWriteRepo, accounts *AccountUsecase, preferences *UserPreferenceUsecase, passwords PlatformPasswordEncoder, effectiveness *EffectivenessUsecase) *ChannelUsecase {
return &ChannelUsecase{repo: repo, writer: writer, accounts: accounts, preferences: preferences, passwords: passwords, now: time.Now, effectiveness: effectiveness}
}
func (uc *ChannelUsecase) scope(ctx context.Context) (UserScope, error) {
actor, a, err := uc.accounts.actor(ctx)
@@ -170,6 +173,11 @@ func (uc *ChannelUsecase) List(ctx context.Context, filter ChannelFilter, option
if err != nil {
return nil, err
}
if uc.effectiveness != nil {
if err := uc.effectiveness.Ensure(ctx); err != nil {
return nil, err
}
}
page, err := uc.repo.List(ctx, scope, filter, options...)
if err != nil || len(page.Rows) == 0 {
return page, err