From 9b5710f23d6cbda9f2b0e650cf8916e7707d5588 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期一, 29 六月 2020 19:27:14 +0800
Subject: [PATCH] addPlateNo and findMyPlateNos

---
 service/msgPush.go |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/service/msgPush.go b/service/msgPush.go
index 2a29457..a1c29e0 100644
--- a/service/msgPush.go
+++ b/service/msgPush.go
@@ -80,6 +80,18 @@
 				"url": "http://baidu.com",
 			},
 		},
+		"push_channel": map[string]map[string]map[string]map[string]string {
+			"android": {
+				"ups": {
+					"notification": {
+						"title": title,
+						"body": msg,
+						"click_type": "url",
+						"url": "http://baidu.com",
+					},
+				},
+			},
+		},
 	}
 	header := map[string]string {
 		"token": token,
@@ -114,14 +126,10 @@
 }
 
 func RefreshToken() (*TokenResult,error) {
-	//appId := beego.AppConfig.String("pushAppId")
-	//appKey := beego.AppConfig.String("pushAppKey")
-	//masterSecret := beego.AppConfig.String("pushMasterSecret")
-	//baseUrl := beego.AppConfig.String("pushBaseUrl") + appId
-	appId := "WU8KzZBaTwADIjTwaMSzW5"
-	appKey := "9JLs4B1ZVkAVh93JXX3MP4"
-	masterSecret := "IbSAe83ZoZAczhKSA3Bwj9"
-	baseUrl := "https://restapi.getui.com/v2/"+appId
+	appId := beego.AppConfig.String("pushAppId")
+	appKey := beego.AppConfig.String("pushAppKey")
+	masterSecret := beego.AppConfig.String("pushMasterSecret")
+	baseUrl := beego.AppConfig.String("pushBaseUrl") + appId
 	url := baseUrl +"/auth"
 	timestamp := fmt.Sprintf("%v", time.Now().UnixNano() / 1e6)
 	sign := util.Sha256(appKey + timestamp + masterSecret)

--
Gitblit v1.8.0