This commit is contained in:
2021-12-20 19:17:24 +08:00
parent 179c6a3afa
commit 0df3603ef2
11 changed files with 470 additions and 27 deletions

View File

@@ -60,3 +60,6 @@ func Send(text string) error {

View File

@@ -13,21 +13,21 @@
package msg
import (
"github.com/jageros/hawox/httpc"
"stock/stock"
xml2 "encoding/xml"
"fmt"
"testing"
"time"
)
func Test_Post(t *testing.T) {
url := ""
stk, err := stock.NewStocks(600905)
if err != nil {
t.Error(err)
return
}
stk.ForEachStock(func(stk stock.IArg) {
arg := stk.Arg("o-KDV6NbRaanYz55fJuSgyR0qxxU")
httpc.RequestWithInterface(httpc.POST, url, httpc.JSON, arg, nil)
})
wMsg := &xml{
ToUserName: "rMsg.FromUserName",
FromUserName: "rMsg.ToUserName",
CreateTime: int(time.Now().Unix()),
MsgType: "text",
Content: "收到,谢谢!",
}
bty, _ := xml2.Marshal(wMsg)
fmt.Println(string(bty))
}