Bladeren bron

feat:发消息

wangchuanjin 1 jaar geleden
bovenliggende
commit
74d63a2166
3 gewijzigde bestanden met toevoegingen van 36 en 9 verwijderingen
  1. 14 0
      config/config.go
  2. 13 1
      etc/push.json
  3. 9 8
      rpc/message.go

+ 14 - 0
config/config.go

@@ -39,6 +39,17 @@ type config struct {
 	}
 }
 
+type msgConf struct {
+	Title      string
+	Content    string
+	MsgType    int64
+	Link       string
+	Appid      string
+	AppPushUrl string
+	WxPushUrl  string
+	IosPushUrl string
+}
+
 var (
 	PushConfig *pushConfig
 )
@@ -66,6 +77,9 @@ type pushConfig struct {
 	Subvip      string `json:"subvip"`
 	Points      string `json:"points"`
 	FullReduce  string `json:"fullReduce"`
+	Messages    struct {
+		NewUser *msgConf
+	}
 }
 
 type OrderMonitorConfig struct {

+ 13 - 1
etc/push.json

@@ -33,5 +33,17 @@
   "delayedTime": 5,
   "subvip": "天超级订阅",
   "points": "剑鱼币",
-  "fullReduce": "元满减劵"
+  "fullReduce": "元满减劵",
+  "messages":{
+	"newUser":{
+		"title":"做任务赚好礼",
+		"content":"7天内完成新手任务,额外赠送超级订阅7天体验。获取更多采购项目信息,快速对接项目联系人!",
+		"msgType":1,
+		"link":"/home/work-bench/app/points/earn,/jy_mobile/points/earn,/jy_mobile/points/earn",
+		"appid":"10000",
+		"appPushUrl":"/jy_mobile/points/earn",
+		"wxPushUrl":"/jy_mobile/points/earn",
+		"iosPushUrl":"/jy_mobile/points/earn"
+	}
+  }
 }

+ 9 - 8
rpc/message.go

@@ -7,6 +7,7 @@ import (
 	"app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
 	"app.yhyue.com/moapp/MessageCenter/rpc/type/message"
 	"app.yhyue.com/moapp/jybase/go-logger/logger"
+	. "app.yhyue.com/moapp/message/config"
 	"github.com/gogf/gf/v2/os/gcfg"
 	"github.com/gogf/gf/v2/os/gctx"
 	"github.com/zeromicro/go-zero/core/discov"
@@ -32,14 +33,14 @@ func init() {
 func SendNewUserMsg(userId string) error {
 	req := &message.MultipleSaveMsgReq{
 		UserIds:    userId,
-		Title:      "做任务赚好礼",
-		Content:    "7天内完成新手任务,额外赠送超级订阅7天体验。获取更多采购项目信息,快速对接项目联系人!",
-		MsgType:    1,
-		Link:       "/home/work-bench/app/points/earn,/jy_mobile/points/earn,/jy_mobile/points/earn",
-		Appid:      "10000",
-		AppPushUrl: "/jy_mobile/points/earn",
-		WxPushUrl:  "/jy_mobile/points/earn",
-		IosPushUrl: "/jy_mobile/points/earn",
+		Title:      PushConfig.Messages.NewUser.Title,
+		Content:    PushConfig.Messages.NewUser.Content,
+		MsgType:    PushConfig.Messages.NewUser.MsgType,
+		Link:       PushConfig.Messages.NewUser.Link,
+		Appid:      PushConfig.Messages.NewUser.Appid,
+		AppPushUrl: PushConfig.Messages.NewUser.AppPushUrl,
+		WxPushUrl:  PushConfig.Messages.NewUser.WxPushUrl,
+		IosPushUrl: PushConfig.Messages.NewUser.IosPushUrl,
 	}
 	resp, err := messageclient.NewMessage(messageClient).MultipleSaveMsg(gctx.New(), req)
 	if err != nil {