m
This commit is contained in:
@@ -93,11 +93,13 @@ func main() {
|
||||
return true
|
||||
}
|
||||
codes := u.Codes(true)
|
||||
stk := fund.NewFundArg(codes...)
|
||||
for _, code := range codes {
|
||||
stk := fund.NewFundArg(code)
|
||||
err = wxgzh.Send(u.OpenID(), stk)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
if err != nil {
|
||||
@@ -160,7 +162,8 @@ func main() {
|
||||
return true
|
||||
}
|
||||
codes := u.Codes(false)
|
||||
stk, err := stock.GetStocks(codes...)
|
||||
for _, code := range codes {
|
||||
stk, err := stock.GetStocks(code)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
} else {
|
||||
@@ -169,6 +172,8 @@ func main() {
|
||||
logx.Error(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
127
stock/stock.go
127
stock/stock.go
@@ -390,67 +390,66 @@ const msgTemplate = `%s
|
||||
前五总买单:%s 前五总卖单:%s
|
||||
`
|
||||
|
||||
//
|
||||
//func (s *stock) Arg(openId string) map[string]interface{} {
|
||||
//
|
||||
// arg := map[string]interface{}{
|
||||
// "touser": openId,
|
||||
// "template_id": "L7fOGJURj-1HF4cIpFizCOOiAMqER3PG-pfgn37Dalw",
|
||||
//
|
||||
// "data": map[string]interface{}{
|
||||
// "first": map[string]interface{}{
|
||||
// "value": s.values[0],
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword1": map[string]interface{}{
|
||||
// "value": fmt.Sprintf("%s %s", s.values[30], s.values[31]),
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword2": map[string]interface{}{
|
||||
// "value": s.values[2],
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword3": map[string]interface{}{
|
||||
// "value": s.values[1],
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword4": map[string]interface{}{
|
||||
// "value": s.values[3],
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword5": map[string]interface{}{
|
||||
// "value": s.rise(),
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword6": map[string]interface{}{
|
||||
// "value": s.values[4],
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword7": map[string]interface{}{
|
||||
// "value": s.values[5],
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword8": map[string]interface{}{
|
||||
// "value": s.tradingVolume(),
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword9": map[string]interface{}{
|
||||
// "value": numFormat(s.values[9]),
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword10": map[string]interface{}{
|
||||
// "value": s.buyCount(),
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "keyword11": map[string]interface{}{
|
||||
// "value": s.sellCount(),
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// "remark": map[string]interface{}{
|
||||
// "value": "欢迎再次购买!",
|
||||
// "color": "#173177",
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
// return arg
|
||||
//}
|
||||
func (s *stock) Arg(openId string) map[string]interface{} {
|
||||
|
||||
arg := map[string]interface{}{
|
||||
"touser": openId,
|
||||
"template_id": "L7fOGJURj-1HF4cIpFizCOOiAMqER3PG-pfgn37Dalw",
|
||||
|
||||
"data": map[string]interface{}{
|
||||
"first": map[string]interface{}{
|
||||
"value": s.values[0],
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword1": map[string]interface{}{
|
||||
"value": fmt.Sprintf("%s %s", s.values[30], s.values[31]),
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword2": map[string]interface{}{
|
||||
"value": s.values[2],
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword3": map[string]interface{}{
|
||||
"value": s.values[1],
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword4": map[string]interface{}{
|
||||
"value": s.values[3],
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword5": map[string]interface{}{
|
||||
"value": s.rise(),
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword6": map[string]interface{}{
|
||||
"value": s.values[4],
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword7": map[string]interface{}{
|
||||
"value": s.values[5],
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword8": map[string]interface{}{
|
||||
"value": s.tradingVolume(),
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword9": map[string]interface{}{
|
||||
"value": numFormat(s.values[9]),
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword10": map[string]interface{}{
|
||||
"value": s.buyCount(),
|
||||
"color": "#173177",
|
||||
},
|
||||
"keyword11": map[string]interface{}{
|
||||
"value": s.sellCount(),
|
||||
"color": "#173177",
|
||||
},
|
||||
"remark": map[string]interface{}{
|
||||
"value": "欢迎再次购买!",
|
||||
"color": "#173177",
|
||||
},
|
||||
},
|
||||
}
|
||||
return arg
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ func send(openID string, arg IArg, recall bool) error {
|
||||
|
||||
msg := arg.Arg(openID)
|
||||
if msg == nil {
|
||||
return errcode.New(1, "arg == nil")
|
||||
return nil
|
||||
}
|
||||
resp := &Resp{}
|
||||
err = httpc.RequestWithInterface(httpc.POST, url, httpc.JSON, msg, nil, resp)
|
||||
|
||||
Reference in New Issue
Block a user