package restriction

import (
	"fmt"
	"testing"

	"github.com/gogf/gf/v2/crypto/gaes"
	"github.com/gogf/gf/v2/encoding/gbase64"
	"github.com/gogf/gf/v2/encoding/gjson"
)

//{"ips":["111.19.40.26","2409:8a70:262:94e0:14b7:101d:306f:85c6"],"deviceId":"477227580586b58776c969ba9bf30767","deviceModel":"Windows PC","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"}

func TestControllerV1_UserInfoCollection(t *testing.T) {
	text := "Ak3k2wzuXfh6XLj9y+5d2kddetnGdTVWLeZIgt34RFF52zoKw6ckFzdyscTRTJauAbbzumgzyTMQ9AwIOmp/6y2yhxoKgxhkweoDgPzXnDMm1AE+te30Nv4vhlaoLS8wJEGoIkBsupzV3oZlYJRRyQOsQ8mD1z+3JThYwCR2MoSszzZwsI16YJ0W64i+bVFs2JdTjrNGio4LWUbgpJ7BJMfogqk894xAzaoM797eOtQhtxTuoOXpCGqvUb3DW9aIY5tb3H5RGpwsA3f4Wh6tqZYtWELCkJqbYD7BeaDi0s17GoLBxz4sfHHPBsCdp7uyhXHZqtT+b4SNzTkVsfe89XWHZx15NReTC5jc+VUo8qp0IIx7DQSNvHPqUWG/4EVlQ7VBpVLDQzoKZnULWvkr9XVEwH1s2EuPHCh9cJ2Zhic="
	//base64 解密
	result, _ := gaes.DecryptCBC(gbase64.MustDecodeString(text), []byte("veuiyigemima1231"), []byte("1234567890123456"))
	r := responseWithSign{}
	gjson.DecodeTo(result, &r)
	fmt.Println("签名结果", r.Sign, r.GetSign())
}
