Bladeren bron

短信api

master
huangjiajun 1 jaar geleden
bovenliggende
commit
d5387a7b9f
1 gewijzigde bestanden met toevoegingen van 7 en 4 verwijderingen
  1. +7
    -4
      sms/api.go

+ 7
- 4
sms/api.go Bestand weergeven

@@ -70,7 +70,7 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error {
where = map[string]interface{}{
"appkey": args["smsmsg_key"],
"zone": args["zone"],
"phone": args["phone"],
"phone": args["mobile"],
"templateCode": args["templateCode"],
}
send, err = SmsMobApiSend(where)
@@ -122,9 +122,12 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error {
SmsType: args["sms_type"].(string),
}
engine.InsertOne(&record)
sql := `UPDATE sms_num_list set num=num-%d WHERE uid=%s and type=%s;`
sql := `UPDATE sms_num_list set num=num-%d WHERE uid=%s and type='%s';`
sql = fmt.Sprintf(sql, count*int(contentLen), args["uid"], args["sms_type"])
db.QueryNativeString(engine, sql)
fmt.Println(sql)
nativeString, err := db.QueryNativeString(engine, sql)
fmt.Println(nativeString)
fmt.Println(err)
return nil
}

@@ -154,7 +157,7 @@ func SmsApiSend(engine *xorm.Engine, method string, args map[string]interface{})
}
func SmsMobApiSend(args map[string]interface{}) (string, error) {
thisUrl := "https://webapi.sms.mob.com/sms/sendmsg"
post, err := zhios_third_party_utils.CurlPost(thisUrl, zhios_third_party_utils.SerializeStr(args), nil)
post, err := zhios_third_party_utils.CurlPost(thisUrl, args, nil)
fmt.Println(string(post))
fmt.Println(err)
return string(post), err


Laden…
Annuleren
Opslaan