浏览代码

feat:站内信标题读取活动名称

zhangxinlei1996 3 年之前
父节点
当前提交
22cfba8cb1
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      public/entity/appointment.go
  2. 2 2
      public/entity/push.go
  3. 2 2
      rpc/timetask/timetask.go

+ 1 - 1
public/entity/appointment.go

@@ -94,7 +94,7 @@ func (this *AppointmentStruct) Add() (int64, error) {
 		starttime := time.Unix(activityTime, 0).Format(date.Date_Full_Layout)
 		Push(Pushcfg.StationMailHref, Pushcfg.StationMailAction,
 			this.UserId, fmt.Sprintf(Pushcfg.ContentAppointment, activityName, starttime),
-			pcLandingPage, appLandingPage, wxLandingPage)
+			pcLandingPage, appLandingPage, wxLandingPage, activityName)
 
 		return 1, nil
 	}

+ 2 - 2
public/entity/push.go

@@ -13,12 +13,12 @@ import (
 )
 
 //站内信推送
-func Push(href, action, userid, content, pcLandingPage, appLandingPage, wxLandingPage string) {
+func Push(href, action, userid, content, pcLandingPage, appLandingPage, wxLandingPage, title string) {
 	param := url.Values{
 		"_action":    []string{action},
 		"userIds":    []string{userid},
 		"msgType":    []string{"1"},
-		"title":      []string{"消息提醒"},
+		"title":      []string{title},
 		"content":    []string{content},
 		"link":       []string{pcLandingPage},
 		"sendMode":   []string{"2"},

+ 2 - 2
rpc/timetask/timetask.go

@@ -105,8 +105,8 @@ func formatUserId(useridArr []string) (userids string) {
 
 //站内信推送
 func stationMailPush(userid, activityName, pcLandingPage, wxLandingPage, appLandingPage string, idArr []int64) {
-	href := fmt.Sprintf("%s?_action=%s&userIds=%s&msgType=1&title=消息提醒&content=%s&link=%s&sendMode=2&sendTime=%s&androidUrl=%s&iosUrl=%s&weChatUrl=%s&_token=12311",
-		Pushcfg.StationMailHref, Pushcfg.StationMailAction, userid, fmt.Sprintf(Pushcfg.Content, activityName), pcLandingPage, date.NowFormat(date.Date_Short_Layout), appLandingPage, appLandingPage, wxLandingPage)
+	href := fmt.Sprintf("%s?_action=%s&userIds=%s&msgType=1&title=%s&content=%s&link=%s&sendMode=2&sendTime=%s&androidUrl=%s&iosUrl=%s&weChatUrl=%s&_token=12311&reqSource=1",
+		Pushcfg.StationMailHref, Pushcfg.StationMailAction, userid, activityName, fmt.Sprintf(Pushcfg.Content, activityName), pcLandingPage, date.NowFormat(date.Date_Short_Layout), appLandingPage, appLandingPage, wxLandingPage)
 	log.Println(href)
 	resp, err := http.Get(href)
 	if err != nil {