package tiktok_api

import (
	"fmt"
	"git.rosy.net.cn/baseapi/utils"
	"git.rosy.net.cn/jx-callback/globals"
	"testing"
)

// 京西速食(蔬菜)
var token1 = `{"access_token":"f0f8a7d0-8484-482b-8c3e-39da6a415c27","expires_in":1704307911,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"8648acb6-35d1-4568-ba49-4f3295129845","authority_id":""}`

// 美好菜市
//var token1 = `{"access_token":"9a315a03-c737-4a82-ae52-c9a6ce827007","expires_in":1699490747,"scope":"SCOPE","shop_id":68032645,"shop_name":"美好菜市","refresh_token":"8334c006-5301-4d25-911b-4d8cc7b70ebb","authority_id":""}`

// 京西到家(商超)
//var token2 = `{"access_token":"7e3853fa-24d4-4649-938b-46947da04c92","expires_in":1698887957,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"1dd634e9-9f9e-459b-a770-341fb64e4f88","authority_id":""}`
var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token1)

// 查询售后单详情
func TestAfsOrder(t *testing.T) {
	data, err := a.QueryAfsOrderDetail("146223529123133957", false)
	globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false))
	globals.SugarLogger.Debugf("data=%s", err)
}
func TestAfsOrder2(t *testing.T) {
	data, err := a.QueryAfsOrderDetail("146223488418888073", false)
	globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false))
	globals.SugarLogger.Debugf("data=%s", err)
}

// 同意/拒绝售后单
func TestAggreOrNotAggreAfs(t *testing.T) {
	err := a.AfterSaleOperate(int32(201), "7293455053833322752", "1", 64270123)
	fmt.Println(err)
}

func TestGetSkuDetailLocalID(t *testing.T) {
	data, err := a.GetSkuDetailLocalID("", "6094828")
	globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false))
	globals.SugarLogger.Debugf("data=%s", err)
}
