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
+2 -2
View File
@@ -22,7 +22,7 @@ func (r *otherSettingsFake) Save(_ context.Context, value OtherSettings) (*Other
func TestOtherSettingsOnlySuperAdminAndDefaults(t *testing.T) {
r := &otherSettingsFake{}
uc := NewOtherSettingsUsecase(r)
uc := NewOtherSettingsUsecase(r, nil)
for _, ctx := range []context.Context{context.Background(), accountContext(7, 901), accountContext(8, 902), accountContext(9, 903)} {
if _, err := uc.Get(ctx); err == nil {
t.Fatal("非超管不能读取设置")
@@ -48,7 +48,7 @@ func TestOtherSettingsOnlySuperAdminAndDefaults(t *testing.T) {
}
func TestOtherSettingsRejectInvalidRange(t *testing.T) {
uc := NewOtherSettingsUsecase(&otherSettingsFake{})
uc := NewOtherSettingsUsecase(&otherSettingsFake{}, nil)
for _, value := range []OtherSettings{{Amount: -1, Days: 30}, {Amount: 3000, Days: 0}, {Amount: MaxSettingsInteger + 1, Days: 30}, {Amount: 3000, Days: MaxSettingsInteger + 1}} {
if _, err := uc.Save(accountContext(1, 888), value); err != ErrOtherSettingsInput {
t.Fatalf("不应保存非法值: %+v %v", value, err)