feat: 完善小组绩效与有效端统计并修复审查问题
This commit is contained in:
@@ -35,10 +35,13 @@ type OtherSettingsRepo interface {
|
||||
Save(context.Context, OtherSettings) (*OtherSettings, error)
|
||||
}
|
||||
|
||||
type OtherSettingsUsecase struct{ repo OtherSettingsRepo }
|
||||
type OtherSettingsUsecase struct {
|
||||
repo OtherSettingsRepo
|
||||
effectiveness *EffectivenessUsecase
|
||||
}
|
||||
|
||||
func NewOtherSettingsUsecase(repo OtherSettingsRepo) *OtherSettingsUsecase {
|
||||
return &OtherSettingsUsecase{repo: repo}
|
||||
func NewOtherSettingsUsecase(repo OtherSettingsRepo, effectiveness *EffectivenessUsecase) *OtherSettingsUsecase {
|
||||
return &OtherSettingsUsecase{repo: repo, effectiveness: effectiveness}
|
||||
}
|
||||
|
||||
func requireSettingsAdmin(ctx context.Context) error {
|
||||
@@ -74,5 +77,8 @@ func (uc *OtherSettingsUsecase) Save(ctx context.Context, value OtherSettings) (
|
||||
if err := ValidateOtherSettings(value); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if uc.effectiveness != nil {
|
||||
return uc.effectiveness.Reconfigure(ctx, value)
|
||||
}
|
||||
return uc.repo.Save(ctx, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user