package tempop

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"testing"

	"git.rosy.net.cn/jx-callback/globals/api2"
	"git.rosy.net.cn/jx-callback/globals/testinit"

	_ "git.rosy.net.cn/jx-callback/business/partner/purchase/ebai"
	_ "git.rosy.net.cn/jx-callback/business/partner/purchase/elm"
	_ "git.rosy.net.cn/jx-callback/business/partner/purchase/jd"
	_ "git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
	_ "git.rosy.net.cn/jx-callback/business/partner/purchase/weimob/wsc"
)

func init() {
	testinit.Init()
	api2.Init()
}

func TestJdStoreInfo1125(t *testing.T) {
	_, err := JdStoreInfo1125()
	if err != nil {
		t.Fatal(err)
	}
}

func Testaa(t *testing.T) {
	request, _ := http.NewRequest(http.MethodGet, "https://stores.shop.jd.com/stores/updateStoreStatus?storeId=24332466&storeStatus=1", nil)
	c := &http.Cookie{
		Name:  "thor",
		Value: "80FAF09E9A09B6E618A68057BDFCFCB8C86E8252DC9F7D3B34572625904FBA0AB6BF053A5325612EC0407791BB05F5301356E71E8B282C40C06D0B5DF3439DEECB102A78FAFF7AC0FC4E2D1FA8DD8BBAE1A011E50B5C74F1870AD982D7BF453F470F31F2241B73AC4C25485025C2ABEBC8A538AF7257824D2FAEE300A1435175B0B451FB5C19B78D729FC83152CA3BAF",
	}
	request.AddCookie(c)
	client := &http.Client{}
	fmt.Println("test1", request.URL)
	response, _ := client.Do(request)
	defer response.Body.Close()
	bodyData, _ := ioutil.ReadAll(response.Body)
	fmt.Println("test1", string(bodyData))
}
