|
@@ -5,6 +5,7 @@ import (
|
|
|
"log"
|
|
|
"qfw/push/bid"
|
|
|
"qfw/push/dopush"
|
|
|
+ "qfw/util"
|
|
|
qrpc "qfw/util/rpc"
|
|
|
"time"
|
|
|
)
|
|
@@ -15,22 +16,24 @@ type PushInfo struct {
|
|
|
var PushInfoScopeDays int
|
|
|
|
|
|
func (p *PushInfo) PushMsg(data *qrpc.PushData, Reply *int) error {
|
|
|
- log.Println("dddddddd", data)
|
|
|
- for k, v := range data.PushType {
|
|
|
- //昨天到今天的数据
|
|
|
- pj := dopush.Pjob{
|
|
|
- MaxPushSize: bid.MaxPushSize,
|
|
|
- Stype: k,
|
|
|
- StypeName: v,
|
|
|
+ log.Println("rpc_data", data)
|
|
|
+ util.Try(func() {
|
|
|
+ for k, v := range data.PushType {
|
|
|
+ //昨天到今天的数据
|
|
|
+ pj := dopush.Pjob{
|
|
|
+ MaxPushSize: bid.MaxPushSize,
|
|
|
+ Stype: k,
|
|
|
+ StypeName: v,
|
|
|
+ }
|
|
|
+ now := time.Now()
|
|
|
+ tom := time.Date(now.Year(), now.Month(), now.Day()-PushInfoScopeDays, 0, 0, 0, 0, time.Local)
|
|
|
+ b := pj.DoPush(data.Mopenid, fmt.Sprintf("%d days", PushInfoScopeDays), 2, tom.Unix())
|
|
|
+ if b {
|
|
|
+ *Reply = 1
|
|
|
+ } else {
|
|
|
+ *Reply = 0
|
|
|
+ }
|
|
|
}
|
|
|
- now := time.Now()
|
|
|
- tom := time.Date(now.Year(), now.Month(), now.Day()-PushInfoScopeDays, 0, 0, 0, 0, time.Local)
|
|
|
- b := pj.DoPush(data.Mopenid, fmt.Sprintf("%d days", PushInfoScopeDays), 2, tom.Unix())
|
|
|
- if b {
|
|
|
- *Reply = 1
|
|
|
- } else {
|
|
|
- *Reply = 0
|
|
|
- }
|
|
|
- }
|
|
|
+ }, func(e interface{}) {})
|
|
|
return nil
|
|
|
}
|