54 lines
1.1 KiB
Go
54 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"backend/Type"
|
|
"backend/controller"
|
|
"backend/feishu"
|
|
"backend/util"
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestXxx1(t *testing.T) {
|
|
d := Type.NotifyClientData{
|
|
Log: "测试",
|
|
DeviceModel: "测试",
|
|
StackTrace: "测试",
|
|
OperatingSystem: "测试",
|
|
DeviceUniqueIdentifier: "测试",
|
|
AlarmTime: "测试",
|
|
}
|
|
feishu.SendNotifyClientMsg(&d)
|
|
}
|
|
func TestXxx(t *testing.T) {
|
|
controller.FeishuSendInfo(nil)
|
|
// util.GetOrderData(3)
|
|
}
|
|
|
|
func TestFeishu(t *testing.T) {
|
|
data := struct {
|
|
Title string
|
|
Subtitle string
|
|
Elements string
|
|
}{
|
|
Title: "模拟测试",
|
|
Subtitle: "模拟测试副标题",
|
|
Elements: "",
|
|
}
|
|
s := util.ParseTmpl("./template/card.tmpl", data)
|
|
fmt.Println(s)
|
|
}
|
|
|
|
func TestEncrypt(t *testing.T) {
|
|
str := "Z4rf7eZZe500dxa"
|
|
enc, _ := util.Encrypt(str)
|
|
fmt.Println(enc)
|
|
}
|
|
|
|
func TestDecrypt(t *testing.T) {
|
|
str := "-pUf9tft9GOPjV1z855Jf2DpB5NUpGEc_"
|
|
enc, _ := util.Encrypt(str)
|
|
dec, _ := util.Decrypt("-pUf9tft9GOPjV1z855Jf2DpB5NUpGEc_")
|
|
fmt.Printf("enc:%s\ndec:%s\n", enc, dec)
|
|
}
|