| | |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.mail.javamail.JavaMailSenderImpl; |
| | | import org.springframework.mail.javamail.MimeMessageHelper; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.mail.internet.MimeMessage; |
| | | import javax.xml.ws.Response; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | HttpEntity<String> stringHttpEntity = new HttpEntity<>(Base64Utils.encodeToString(objectMapper.writeValueAsBytes(mac)), httpHeaders); |
| | | |
| | | SendRes sendRes = objectMapper.readValue(restTemplate.postForEntity(url, stringHttpEntity, String.class).getBody(), SendRes.class); |
| | | ResponseEntity<String> response = restTemplate.postForEntity(url + "/sms/submit", sendReq, String.class); |
| | | SendRes sendRes = objectMapper.readValue(response.getBody(), SendRes.class); |
| | | if (sendRes.getRspcod().equals("success")) { |
| | | return 2; |
| | | } else { |