From a7351afd2db3f06c5f5e015a8017cdfa74d50f58 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Fri, 29 May 2026 14:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index c82a542..f75ce8f 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,35 @@ ```bash $ go get -u gitea.cdlsxd.cn/self-tools/l_short_url ``` +```bash +func TestBatchCreate(t *testing.T) { +in := &ShortUrlBatchCreate{ +BatchName: "test_query_" + time.Now().Format("20060102150405"), +Urls: []string{ +"https://www.baidu.com", +"https://github.com/trending", +"https://www.sojson.com/", +}, +StartTimeStr: time.Now().Format(time.DateOnly), +EndTimeStr: time.Now().AddDate(0, 0, 2).Format(time.DateOnly), +WithBatchMap: true, +} +res, err := NewClient(WithAuth(access)).BatchCreate(in) +t.Log(res, err) +} +``` +```bash +func TestBatchQuery(t *testing.T) { +// 查询批次 +queryIn := &BatchQueryReq{ +BatchNo: 4233953069, +} + queryRes, err := NewClient(WithAuth(access)).BatchQuery(queryIn) + if err != nil { + t.Errorf("BatchQuery failed: %v", err) + } + + t.Logf("Query Response: %+v", queryRes) +} +``` \ No newline at end of file