Browse Source

消息提送增加额外参数

master v0.1.5
lijianbin 3 years ago
parent
commit
cb14bbf9c7
2 changed files with 6 additions and 3 deletions
  1. +4
    -2
      client.go
  2. +2
    -1
      common.go

+ 4
- 2
client.go View File

@ -71,7 +71,8 @@ func SendMsg(site_id, dbname, business_id, domainname, msg_type, order_sn, memo
} }
func SendNotcie(site_id, dbname, manager_id, thumb string, template_Data map[string]string, url ...string) (bool, error) {
// target_type:目标类型,商品或文章 target_id:目标ID
func SendNotcie(site_id, dbname, manager_id, target_type, target_id string, template_Data map[string]string, url ...string) (bool, error) {
if dbname == "" || dbname == "" || manager_id == "" { if dbname == "" || dbname == "" || manager_id == "" {
return false, errors.New("参数错误") return false, errors.New("参数错误")
} }
@ -87,7 +88,8 @@ func SendNotcie(site_id, dbname, manager_id, thumb string, template_Data map[str
arg.SiteId = site_id arg.SiteId = site_id
arg.Dbname = dbname arg.Dbname = dbname
arg.ManagerId = manager_id arg.ManagerId = manager_id
arg.Thumb = thumb
arg.TargetType = target_type
arg.TargetId = target_id
arg.TemplateData = template_Data arg.TemplateData = template_Data
data_json, err := json.Marshal(arg) data_json, err := json.Marshal(arg)


+ 2
- 1
common.go View File

@ -25,7 +25,8 @@ type MsgSend struct {
type NoticeSend struct { type NoticeSend struct {
Req Req
ManagerId string ManagerId string
Thumb string
TargetType string
TargetId string
TemplateData map[string]string TemplateData map[string]string
} }


Loading…
Cancel
Save