Skip to content

Commit c489d8d

Browse files
committed
Merge branch 'feature/log_sms_data'
2 parents c560ee4 + dea92f1 commit c489d8d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

myconext-server/src/main/java/myconext/sms/SMSServiceImpl.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package myconext.sms;
22

33
import lombok.SneakyThrows;
4+
import myconext.tiqr.TiqrController;
45
import org.apache.commons.io.IOUtils;
6+
import org.apache.commons.logging.Log;
7+
import org.apache.commons.logging.LogFactory;
58
import org.springframework.core.io.ClassPathResource;
69
import org.springframework.http.HttpHeaders;
710
import org.springframework.http.HttpMethod;
@@ -19,13 +22,16 @@
1922
@SuppressWarnings("unchecked")
2023
public class SMSServiceImpl implements SMSService {
2124

25+
private static final Log LOG = LogFactory.getLog(SMSServiceImpl.class);
26+
2227
private final String url;
2328
public final String route;
2429
private final String templateNl;
2530
private final String templateEn;
2631
private final RestTemplate restTemplate = new RestTemplate();
2732
private final MultiValueMap<String, String> headers = new HttpHeaders();
2833

34+
2935
@SneakyThrows
3036
public SMSServiceImpl(String url, String bearer, String route) {
3137
this.url = url;
@@ -53,7 +59,11 @@ public String send(String mobile, String code, Locale locale) {
5359
"recipients", List.of(mobile)
5460
);
5561

56-
RequestEntity<?> requestEntity = new RequestEntity(body, headers, HttpMethod.POST, URI.create(url));
62+
RequestEntity<?> requestEntity = new RequestEntity<>(body, headers, HttpMethod.POST, URI.create(url));
63+
LOG.info(String.format("Sending SMS with url : %s, route : %s body: %s",
64+
url,
65+
route,
66+
body));
5767
restTemplate.exchange(requestEntity, Void.class);
5868
return format;
5969
}

0 commit comments

Comments
 (0)