From a7817882dea6ca0d5becd0c51fe926ada538aa77 Mon Sep 17 00:00:00 2001 From: Tory Date: Fri, 13 Nov 2026 19:48:17 +0800 Subject: [PATCH] =?UTF-8?q?S1-B=20=E6=94=B6=E5=8F=A3#4:=20audit=5Fmode=3D2?= =?UTF-8?q?=20=E6=96=87=E6=A1=88=E6=A0=A1=E5=87=86=E2=80=94=E2=80=94accoun?= =?UTF-8?q?t.SetAuditMode=20=E6=B3=A8=E9=87=8A/=E6=A0=A1=E9=AA=8C=E6=96=87?= =?UTF-8?q?=E6=A1=88=E4=B8=8E=20openapi.yaml=20=E7=94=B1=E3=80=8C2?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8B=92=E7=BB=9D=E3=80=8D=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E3=80=8C2=E8=87=AA=E5=8A=A8=E5=AE=A1=E6=A0=B8(=E9=BB=91?= =?UTF-8?q?=E8=AF=8D=E5=91=BD=E4=B8=AD=E6=8B=92/=E6=9C=AA=E5=91=BD?= =?UTF-8?q?=E4=B8=AD=E8=BF=87)=E3=80=8D=E5=AF=B9=E9=BD=90=20audit.ModeAuto?= =?UTF-8?q?=20=E5=AE=9E=E4=B9=89=E4=B8=8E=E5=89=8D=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E5=BE=84;review=5Ftest=20=E6=8E=AA=E8=BE=9E=E5=90=8C=E6=AD=A5;?= =?UTF-8?q?account/audit=20-race=20=E5=A4=8D=E9=AA=8C=E7=BB=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/openapi.yaml | 2 +- internal/service/account/config_service.go | 4 ++-- internal/service/audit/review_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index df9fb5b3..5fc6afb4 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -101,7 +101,7 @@ paths: /accounts/{id}/audit-mode: put: tags: [accounts] - summary: 审核模式(0 免审/1 手动/2 自动拒绝) + summary: 审核模式(0 免审/1 手动/2 自动审核——黑词命中拒/未命中过) parameters: [{name: id, in: path, required: true, schema: {type: integer}}] requestBody: {content: {application/json: {schema: {type: object, required: [business, mode], properties: {business: {type: string}, mode: {type: integer, enum: [0, 1, 2]}}}}}} responses: {"200": {description: ok}} diff --git a/internal/service/account/config_service.go b/internal/service/account/config_service.go index 6998d621..ce77294a 100644 --- a/internal/service/account/config_service.go +++ b/internal/service/account/config_service.go @@ -85,10 +85,10 @@ func IPAllowed(ipBindJSON, clientIP string) bool { // ---- 审核模式 ---- -// SetAuditMode 设置审核模式(0免审/1手动/2自动拒绝)。 +// SetAuditMode 设置审核模式(0免审/1手动/2自动审核——黑词命中拒/未命中过,对齐 audit.ModeAuto 口径)。 func (s *Service) SetAuditMode(ctx context.Context, accountID int64, business string, mode int) error { if mode < 0 || mode > 2 { - return errs.InvalidParam.WithMsg(fmt.Sprintf("非法审核模式 %d(0免审/1手动/2自动拒绝)", mode)) + return errs.InvalidParam.WithMsg(fmt.Sprintf("非法审核模式 %d(0免审/1手动/2自动审核·黑词)", mode)) } result := s.config.DB().WithContext(ctx).Model(&entity.AccountConfig{}). Where("account_id = ? AND business = ?", accountID, business). diff --git a/internal/service/audit/review_test.go b/internal/service/audit/review_test.go index 4c3a03b6..3c0c3b26 100644 --- a/internal/service/audit/review_test.go +++ b/internal/service/audit/review_test.go @@ -107,7 +107,7 @@ func TestRouteModes(t *testing.T) { t4 := mkTask(t, db, 3, "低价代开发票") task, rec, err = s.Route(ctx, t4.ID) if err != nil || task.AuditStatus != AuditRejected || rec == nil { - t.Fatalf("自动拒绝 got status=%d err=%v", task.AuditStatus, err) + t.Fatalf("自动档黑词拒绝 got status=%d err=%v", task.AuditStatus, err) } if rec.Reason != "命中敏感词: 发票" { t.Fatalf("拒绝留痕应含命中词, got %q", rec.Reason)