64 lines
1.2 KiB
Go
64 lines
1.2 KiB
Go
package main
|
|
|
|
import (
|
|
"backend/Type"
|
|
"backend/feishu"
|
|
"backend/model"
|
|
"backend/util"
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestXxx1(t *testing.T) {
|
|
//util.Statistics(0)
|
|
//feishu.SendOperationMsg2(0)
|
|
}
|
|
func TestXxx(t *testing.T) {
|
|
statistics := model.Statistics{}
|
|
statistics.AppId = 1
|
|
statistics.Emit = []string{"A"}
|
|
statistics.StatisticsOrder()
|
|
//controller.FeishuSendInfo2(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 TestFeishu2(t *testing.T) {
|
|
r := Type.NotifyData{}
|
|
err := feishu.SendNotifyMsg(&r)
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
}
|
|
|
|
func TestLogin(t *testing.T) {
|
|
ServerId, Host := util.GetUserInfo(1, 156, "test", "test")
|
|
fmt.Printf("ServerId:%d, Host:%s\n", ServerId, Host)
|
|
}
|
|
|
|
func TestEncrypt(t *testing.T) {
|
|
str := "Z4rf7eZZe500dxa"
|
|
enc, _ := util.Encrypt(str)
|
|
fmt.Println(enc)
|
|
}
|
|
|
|
func TestDecrypt(t *testing.T) {
|
|
str := "`NS?VGg@7]~F3}p"
|
|
enc, _ := util.Encrypt(str)
|
|
dec, _ := util.Decrypt("pUf9tft9GOPjV1z855Jf2DpB5NUpGEc_")
|
|
fmt.Printf("enc:%s\ndec:%s\n", enc, dec)
|
|
}
|