api_test.go 742 字节
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)
	}
}