<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # PlayJavaCode 這個是一個二開示例的代碼庫,會長期維護更新 一個綜合java工具類代碼和示例的倉庫 有需求或者錯誤的可以在項目上提issue #### gitHub https://github.com/stivepeimm/PlayJavaCode #### gitee https://gitee.com/stivepeim/PlayJavaCode # springbootDemo 一個基礎的Springboot項目示例 # springbootAliSDK 一個準備綜合ali常用SDK的項目示例 # 阿里短信使用示例 ## 使用方法 申請對應的短信模版 如示例中alisms.request對象類死,根據申請的模版變量創建自己的request對象 如:crmeb 您有${order}的待支付訂單,請在${time}時間內支付,過期將自動關閉 request內容應該為 ~~~ private String order; private String time; ~~~ ## 實際指定的發送短信方法,這里默認使用批量發送的方式,一條多條都能發。 ~~~ /** * 根據短信模版Code 發送短信 * @param smsTempCode 模板Code * @param aliSmsRequests 自定義組裝對象 這個集合對象中的pramObj就是你的參數對象,和code是對應的,自行根據ali云申請的模板自己創建 * @throws Exception 異常信息 */ public static void SendAliSms(String smsTempCode,List<AliSmsRequest> aliSmsRequests) { if(null == aliSmsRequests) return; if (aliSmsRequests.size() == 0) return; // 根據業務參數拆分成API可用數據參數 List<String> phones = new ArrayList<>(); List<String> signNames = new ArrayList<>(); List<Object> pramObj = new ArrayList<>(); for (AliSmsRequest aliSmsRequest : aliSmsRequests) { phones.add(aliSmsRequest.getPhone()); signNames.add(aliSmsRequest.getSignName()); pramObj.add(aliSmsRequest.getSmsPramObj()); } SendBatchSmsRequest sendBatchSmsRequest = new SendBatchSmsRequest() .setPhoneNumberJson(JSON.toJSONString(phones)) .setSignNameJson(JSON.toJSONString(signNames)) .setTemplateCode(smsTempCode) .setTemplateParamJson(JSON.toJSONString(pramObj)); com.aliyun.dysmsapi20170525.Client client = null; try { client = createClient(AK, AS); SendBatchSmsResponse sendBatchSmsResponse = client.sendBatchSms(sendBatchSmsRequest); logger.info("Send aliSms success",sendBatchSmsResponse); } catch (Exception exception) { logger.error("Send Ali Sms Error:",exception.getMessage()); } } ~~~ ## 怎么調用呢? ~~~ // 組裝郵寄短信參數 AliSmsPostRequest aliSmsPostRequest = new AliSmsPostRequest(time, orderInfoVo.getInfo().getProductInfo().getStoreName(),orderInfoVo.getInfo().getCartNum()+""); aliSmsRequest.setPhone(storeOrder.getUserPhone()); aliSmsRequest.setSignName(AliSmsUtils.ALiSmsTempSign); aliSmsRequest.setSmsPramObj(aliSmsPostRequest); pramList.add(aliSmsRequest); logger.info("即將發短信的參數:"+JSON.toJSONString(pramList)); AliSmsUtils.SendAliSms(AliSmsUtils.AliSmsTempCodeSendPost,pramList); ~~~ ## 怎么樣,在業務中使用簡單吧!
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看