api_test.go
742 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package pushdata
import (
"encoding/json"
"testing"
"time"
)
func TestToken(t *testing.T) {
c := NewClient()
h := c.useHeader()
t.Logf("%v", h)
}
func TestField(t *testing.T) {
item := StaffAssessItem{}
fields := item.AppTableField()
bt, _ := json.Marshal(fields)
t.Log(string(bt))
}
func TestPushData(t *testing.T) {
nowTime := time.Unix(1688572800, 0)
c := NewClient()
c.Host = "https://character-library-metadata-bastion.sumifcc.com"
c.AppKey = "7q9Kd8ktoB"
c.AppSecret = "pQSoBj44Wk"
entry := StaffAssessItem{}
data, err := entry.DataForAppend(nowTime)
if err != nil {
t.Logf("获取每日评估的数据 %s", err)
}
err = c.AppendData(data)
if err != nil {
t.Logf("获取每日评估的数据 %s", err)
}
}