Browse Source

feat: task迁移

zhangxinlei1996 1 năm trước cách đây
mục cha
commit
c51d199a43
5 tập tin đã thay đổi với 30 bổ sung373 xóa
  1. 9 0
      config/config.go
  2. 2 4
      etc/push.json
  3. 7 1
      go.mod
  4. 3 364
      go.sum
  5. 9 4
      rpc/message.go

+ 9 - 0
config/config.go

@@ -39,6 +39,15 @@ type config struct {
 	}
 }
 
+type msgConf struct {
+	Title     string
+	Content   string
+	MsgType   int64
+	Appid     string
+	PcUrl     string
+	MobileUrl string
+}
+
 var (
 	PushConfig *pushConfig
 	TaskConf   *taskConf

+ 2 - 4
etc/push.json

@@ -39,11 +39,9 @@
 		"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"
+		"pcUrl":"/home/work-bench/app/points/earn",
+		"mobileUrl":"/jy_mobile/points/earn"
 	}
   }
 }

+ 7 - 1
go.mod

@@ -7,9 +7,15 @@ require (
 	app.yhyue.com/moapp/jyPoints v1.1.2-0.20231020023521-1a4b1bbf9736
 	app.yhyue.com/moapp/jy_docs v1.1.1-0.20231024064228-a0ce3483eaf1
 	app.yhyue.com/moapp/jybase v0.0.0-20231025021840-2f91c944ecdd
-	app.yhyue.com/moapp/jypkg v0.0.0-20231024062045-5c364be1561d
+	bp.jydev.jianyu360.cn/BaseService/pushpkg v0.0.0-20230911091604-2faa31032743
+	github.com/fsnotify/fsnotify v1.6.0 // indirect
 	github.com/gogf/gf/v2 v2.0.6
+	github.com/gomodule/redigo v2.0.0+incompatible // indirect
 	github.com/nsqio/go-nsq v1.1.0
 	github.com/zeromicro/go-zero v1.5.6
+	go.opentelemetry.io/otel/exporters/jaeger v1.15.1 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.15.1 // indirect
+	go.opentelemetry.io/otel/exporters/zipkin v1.15.1 // indirect
 	golang.org/x/net v0.17.0 // indirect
 )

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3 - 364
go.sum


+ 9 - 4
rpc/message.go

@@ -3,11 +3,14 @@ package rpc
 import (
 	"fmt"
 	"log"
+	"strconv"
+	"time"
 
 	"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"
+	. "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
 	"github.com/gogf/gf/v2/os/gcfg"
 	"github.com/gogf/gf/v2/os/gctx"
 	"github.com/zeromicro/go-zero/core/discov"
@@ -31,16 +34,18 @@ func init() {
 
 //新用户注册,发送增送剑鱼币消息
 func SendNewUserMsg(userId string) error {
+	wxUrl := "/front/sess/" + Se.EncodeString(userId+",_id,identityKeep,") + "__" + Se.EncodeString(PushConfig.Messages.NewUser.MobileUrl)
+	appUrl := "/jyapp/free/sess/" + Se.EncodeString(userId+",_id,"+strconv.Itoa(int(time.Now().Unix()))+",") + "__" + Se.EncodeString(PushConfig.Messages.NewUser.MobileUrl)
 	req := &message.MultipleSaveMsgReq{
 		UserIds:    userId,
 		Title:      PushConfig.Messages.NewUser.Title,
 		Content:    PushConfig.Messages.NewUser.Content,
 		MsgType:    PushConfig.Messages.NewUser.MsgType,
-		Link:       PushConfig.Messages.NewUser.Link,
+		Link:       PushConfig.Messages.NewUser.PcUrl + "," + PushConfig.Messages.NewUser.MobileUrl + "," + PushConfig.Messages.NewUser.MobileUrl,
 		Appid:      PushConfig.Messages.NewUser.Appid,
-		AppPushUrl: PushConfig.Messages.NewUser.AppPushUrl,
-		WxPushUrl:  PushConfig.Messages.NewUser.WxPushUrl,
-		IosPushUrl: PushConfig.Messages.NewUser.IosPushUrl,
+		AppPushUrl: appUrl,
+		WxPushUrl:  PushConfig.Webdomain + wxUrl,
+		IosPushUrl: appUrl,
 	}
 	resp, err := messageclient.NewMessage(messageClient).MultipleSaveMsg(gctx.New(), req)
 	if err != nil {

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác