package service

import (
	"fmt"
	"sec-cycle-scan/model"
	"sec-cycle-scan/utils"
	"testing"
	"time"
)

func TestFeiShu(t *testing.T) {

	webhookURL := "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxx"

	var res []model.SecretResult
	a := model.SecretResult{ID: 111, Author: "Tst1", Email: "qqq.qq"}
	res = append(res, a)
	// 构建 interactive 消息
	message, err := GenerateSecretKeyReports(res)
	hc := &utils.HConfig{
		Timeout: 10 * time.Second,
	}
	httpClient := hc.NewHTTPClient()
	post, err := httpClient.Post(webhookURL, nil, message)
	fmt.Println(post)
	fmt.Println(err)

}
