当前位置: 首页>>代码示例>>Java>>正文


Java SMSReportResponse类代码示例

本文整理汇总了Java中infobip.api.model.sms.mt.reports.SMSReportResponse的典型用法代码示例。如果您正苦于以下问题:Java SMSReportResponse类的具体用法?Java SMSReportResponse怎么用?Java SMSReportResponse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SMSReportResponse类属于infobip.api.model.sms.mt.reports包,在下文中一共展示了SMSReportResponse类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateDeliveryStatus

import infobip.api.model.sms.mt.reports.SMSReportResponse; //导入依赖的package包/类
@RequestMapping(value = "/report/{messageId}", method = RequestMethod.POST, consumes = {"application/json"}, produces = {"application/json"})
public ResponseEntity<Void> updateDeliveryStatus(@PathVariable("messageId") final Long messageId, @RequestBody final SMSReportResponse payload) {
	SMSMessage message = this.smsOutboundMessageRepository.findOne(messageId) ;
	if(message != null) {
		SMSReport report = payload.getResults().get(0) ;
		logger.debug("Status Callback received from InfoBip for "+messageId+" with status:"+report.getStatus());
		message.setDeliveryStatus(InfoBipStatus.smsStatus(report.getStatus().getGroupId()).getValue());
		this.smsOutboundMessageRepository.save(message) ;
	}else {
		logger.info("Message with Message id "+messageId+" Not found");
	}
   return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
 
开发者ID:openMF,项目名称:message-gateway,代码行数:14,代码来源:InfoBipApiResource.java

示例2: main

import infobip.api.model.sms.mt.reports.SMSReportResponse; //导入依赖的package包/类
public static void main(String[] args) {

        GetSentSmsDeliveryReports client = new GetSentSmsDeliveryReports(new BasicAuthConfiguration(USERNAME, PASSWORD));

        SMSReportResponse response = client.execute(null, null, 10);

        for (SMSReport result : response.getResults()) {
            System.out.println("Message ID: " + result.getMessageId());
            System.out.println("Sent at: " + result.getSentAt());
            System.out.println("Receiver: " + result.getTo());
            System.out.println("Status: " + result.getStatus().getName());
            System.out.println("Price: " + result.getPrice().getPricePerMessage() + " " + result.getPrice().getCurrency());
            System.out.println("------------------------------------------------");
        }
    }
 
开发者ID:infobip,项目名称:infobip-api-java-client,代码行数:16,代码来源:PullSentDeliveryReportsExample.java

示例3: execute

import infobip.api.model.sms.mt.reports.SMSReportResponse; //导入依赖的package包/类
public SMSReportResponse execute(String bulkId, String messageId, Integer limit) {
    RestAdapter restAdapter = new RestAdapter.Builder()
            .setEndpoint(configuration.getBaseUrl())
            .setRequestInterceptor(getRequestInterceptor())
            .setConverter(new GsonConverter(new GsonBuilder()
            						.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
            						.create()))
            .setClient(new TimeoutClientProvider(configuration))
            .build();
    GetSentSmsDeliveryReportsService service = restAdapter.create(GetSentSmsDeliveryReportsService.class);
    return service.execute(bulkId, messageId, limit);
}
 
开发者ID:infobip,项目名称:infobip-api-java-client,代码行数:13,代码来源:GetSentSmsDeliveryReports.java

示例4: main

import infobip.api.model.sms.mt.reports.SMSReportResponse; //导入依赖的package包/类
public static void main(String[] args) {

         String responseBody =
                 "{\n" +
                "  \"results\": [\n" +
                "    {\n" +
                "      \"bulkId\": \"BULK-ID-123-xyz\",\n" +
                "      \"messageId\": \"c9823180-94d4-4ea0-9bf3-ec907e7534a6\",\n" +
                "      \"to\": \"41793026731\",\n" +
                "      \"sentAt\": \"2015-06-04T13:01:52.933\",\n" +
                "      \"doneAt\": \"2015-06-04T13:02:00.134+0000\",\n" +
                "      \"smsCount\": 1,\n" +
                "      \"price\": {\n" +
                "        \"pricePerMessage\": 0.0001000000,\n" +
                "        \"currency\": \"EUR\"\n" +
                "      },\n" +
                "      \"status\": {\n" +
                "        \"groupId\": 3,\n" +
                "        \"groupName\": \"DELIVERED\",\n" +
                "        \"id\": 5,\n" +
                "        \"name\": \"DELIVERED_TO_HANDSET\",\n" +
                "        \"description\": \"Message delivered to handset\"\n" +
                "      },\n" +
                "      \"error\": {\n" +
                "        \"groupId\": 0,\n" +
                "        \"groupName\": \"OK\",\n" +
                "        \"id\": 0,\n" +
                "        \"name\": \"NO_ERROR\",\n" +
                "        \"description\": \"No Error\",\n" +
                "        \"permanent\": false\n" +
                "      }\n" +
                "    }\n" +
                "  ]\n" +
                "}";

        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss").create();
        SMSReportResponse smsReportResponse = gson.fromJson(responseBody, SMSReportResponse.class);

        for (SMSReport result : smsReportResponse.getResults()) {
            System.out.println("Message ID: " + result.getMessageId());
            System.out.println("Sent at: " + result.getSentAt());
            System.out.println("Done at: " + result.getDoneAt());
            System.out.println("Sender: " + result.getFrom());
            System.out.println("Receiver: " + result.getTo());
            System.out.println("Message text: " + result.getText());
            System.out.println("Status: " + result.getStatus().getName());
            System.out.println("Price: " + result.getPrice().getPricePerMessage() + " " + result.getPrice().getCurrency());
            System.out.println("------------------------------------------------");
        }
    }
 
开发者ID:infobip,项目名称:infobip-api-java-client,代码行数:51,代码来源:DeserializeDeliveryReportExample.java


注:本文中的infobip.api.model.sms.mt.reports.SMSReportResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。