f
This commit is contained in:
@@ -69,7 +69,6 @@ func ProcessQYGLJ1U9Request(ctx context.Context, params []byte, deps *processors
|
|||||||
// 企业股权结构全景(QYGLJ0Q1)
|
// 企业股权结构全景(QYGLJ0Q1)
|
||||||
call("equityPanorama", map[string]interface{}{
|
call("equityPanorama", map[string]interface{}{
|
||||||
"ent_name": p.EntName,
|
"ent_name": p.EntName,
|
||||||
"ent_code": p.EntCode,
|
|
||||||
}, ProcessQYGLJ0Q1Request)
|
}, ProcessQYGLJ0Q1Request)
|
||||||
|
|
||||||
// 企业司法涉诉V2(QYGL5S1I)
|
// 企业司法涉诉V2(QYGL5S1I)
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package qygl
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"tyapi-server/internal/domains/api/dto"
|
||||||
|
sharedvalidator "tyapi-server/internal/shared/validator"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TestQYGLJ1U9Req_ValidateParams 仅验证 QYGLJ1U9 入参的校验规则(特别是 validUSCI)。
|
||||||
|
func TestQYGLJ1U9Req_ValidateParams(t *testing.T) {
|
||||||
|
// 使用全局业务校验器
|
||||||
|
bv := sharedvalidator.NewBusinessValidator()
|
||||||
|
|
||||||
|
t.Run("invalid_usci_should_fail", func(t *testing.T) {
|
||||||
|
req := dto.QYGLJ1U9Req{
|
||||||
|
EntName: "测试企业有限公司",
|
||||||
|
EntCode: "123", // 明显不符合 validUSCI
|
||||||
|
}
|
||||||
|
if err := bv.ValidateStruct(req); err == nil {
|
||||||
|
t.Fatalf("expected validation error for invalid ent_code, got nil")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("valid_usci_should_pass", func(t *testing.T) {
|
||||||
|
req := dto.QYGLJ1U9Req{
|
||||||
|
EntName: "杭州娃哈哈集团有限公司",
|
||||||
|
EntCode: "91330000142916567N", // 符合 validUSCI 正则的示例
|
||||||
|
}
|
||||||
|
if err := bv.ValidateStruct(req); err != nil {
|
||||||
|
t.Fatalf("expected no validation error for valid ent_code, got: %v", err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user