更新处理器

This commit is contained in:
2026-06-10 20:32:24 +08:00
parent a29265f901
commit 45ae6cf36e
293 changed files with 2028 additions and 23462 deletions

View File

@@ -0,0 +1,18 @@
package tianyuanapi
import (
"errors"
"testing"
)
func TestMapBusinessError(t *testing.T) {
if err := mapBusinessError(0, ""); err != nil {
t.Fatalf("code 0 should be nil, got %v", err)
}
if !errors.Is(mapBusinessError(1000, "查无"), ErrNotFound) {
t.Fatal("expected ErrNotFound for 1000")
}
if !errors.Is(mapBusinessError(2001, "业务失败"), ErrDatasource) {
t.Fatal("expected ErrDatasource for 2001")
}
}