巨辰短息介面

2021-09-01 06:19:42 字數 1387 閱讀 8891

這段**是我自己生成乙個uuid和驗證碼然後把它儲存在redis快取裡面,以確保傳送的簡訊是唯一的。

int ret = (int)((math.random()*9+1)*100000);

string uuid = uuid.randomuuid().tostring().replace("-", "");

redisutils.set(uuid,ret);

mapmap=new hashmap<>();

map.put("uuid", uuid);

map.put("ret", ret);

return map;

redis的操作型別,最基本型別是string,可以包含任何資料(和序列化的物件都可以),單個值最大上限為1gbtye;如果只使用string型別,redis可以看作加上持久化特性的memcache。

這時候不得不說一下redis的優點:效能好,也不需要優化,對資料高併發讀寫,對海量資料的高效率儲存和訪問,對資料的高擴充套件性和高可用性(沒有表結構,分布式簡單)

- 2具體實現

serviceresultresult = new serviceresult();

try catch (exception e) else

}return result;

3

public void sendsmswidthcallable(mapmap) throws exception 

if (map.get("content") == null)

pool.submit(new smsnewcall(map, template_sms));

//關閉執行緒池

pool.shutdown();

}

思想也很簡單。就是建乙個執行緒池,然後重寫裡面的方法

4接下來看重寫的方法

class smsnewcall implements callable

@override

public object call() throws exception

sender.sendnewmsm(param.get("mobile").tostring(), param.get("content").tostring());

return null;

}}

第三方介面

public void sendnewmsm(string phone,string msg) throws exception

}

Django學習筆記(三十) 短息驗證介面

這裡提供乙個互億無線的簡訊驗證碼傳送介面 介面型別 互億無線觸發簡訊介面,支援傳送驗證碼簡訊 訂單通知簡訊等。注意事項 1 除錯期間,請用預設的模板進行測試,預設模板詳見介面文件 2 請使用apiid 檢視apiid請登入使用者中心 驗證碼簡訊 產品總覽 apiid 及 apikey來呼叫介面 3 ...

短鏈結API批量生成介面

1,雨林短 網提供強技術支援,99.9 sla服務穩定安全可靠的校驗機制,提高鏈結安全性。2,福牛短鏈結 福牛短 服務可以幫助你把乙個長 縮短,方便你在社交網路和第三方平台上分享 口api服務,檢視資料統計與分析 更多功能,等你來探索!3,青梅短 單,高效,自由,穩定 的理念。不管是同行業還是使用者...