Browse Source

update

master v0.1.8
lijianbin 3 years ago
parent
commit
3d843c41e7
2 changed files with 20 additions and 3 deletions
  1. +3
    -3
      client.go
  2. +17
    -0
      client_test.go

+ 3
- 3
client.go View File

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


+ 17
- 0
client_test.go View File

@ -20,3 +20,20 @@ func Test_SendMsg(t *testing.T) {
t.Log(ret)
t.Log(err)
}
func Test_SendNotcie(t *testing.T) {
site_id := "1058278"
dbname := "shop_v2_org"
domain := "http://dev6.tetele.net"
user_id := "2"
manager_id := "28"
target_type := "product"
target_id := "10"
template_data := map[string]string{"order_name": "商品订单名1", "score_get": "10"}
ret, err := SendNotcie(site_id, dbname, domain,user_id,manager_id,target_type,target_id,template_data)
t.Log(ret)
t.Log(err)
}

Loading…
Cancel
Save