Skip to content

Commit

Permalink
Merge pull request #45 from samagra-comms/release-v2.0.0
Browse files Browse the repository at this point in the history
Pull Request for merge release-v2.0.0 in Development
  • Loading branch information
pankajjangid05 authored Apr 27, 2023
2 parents f4cc54b + 86056c6 commit cda8e1f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@

import javax.xml.bind.JAXBException;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.function.Consumer;

@Slf4j
@CrossOrigin
@RestController
@RequestMapping(value = "/campaign")
public class Campaign {
public class CampaignController {
@Value("${campaign}")
private String campaign;

Expand All @@ -52,9 +54,16 @@ public class Campaign {
String topicFailure;

@RequestMapping(value = "/start", method = RequestMethod.GET)
public ResponseEntity<String> startCampaign(@RequestParam("campaignId") String campaignId) throws JsonProcessingException, JAXBException {
public ResponseEntity<String> startCampaign(@RequestParam("campaignId") String campaignId, @RequestParam(value = "page", required = false) String page) throws JsonProcessingException, JAXBException {
Map<String, String> meta;
if(page != null && !page.isEmpty()){
meta = new HashMap<>();
meta.put("page", page);
} else {
meta = null;
}
botService.getBotNodeFromId(campaignId).subscribe(data -> {
SenderReceiverInfo from = new SenderReceiverInfo().builder().userID("9876543210").deviceType(DeviceType.PHONE).build();
SenderReceiverInfo from = new SenderReceiverInfo().builder().userID("9876543210").deviceType(DeviceType.PHONE).meta(meta).build();
SenderReceiverInfo to = new SenderReceiverInfo().builder().userID("admin").build();
MessageId msgId = new MessageId().builder().channelMessageId(UUID.randomUUID().toString()).replyId("7597185708").build();
XMessagePayload payload = new XMessagePayload().builder().text(BotUtil.getBotNodeData(data, "startingMessage")).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ public Object apply(Slice<XMessageDAO> xMessageDAOS) {
List<Map<String, Object>> xMessageDAOListNew = filterConversationHistory(xMessageDAOS.getContent());
result.put("total", xMessageDAOListNew.size());
result.put("records", xMessageDAOListNew);
log.info("Response :" + result);
if(xMessageDAOListNew.size() < 5){
log.info("Response :" + result);
} else {
log.info("Response :" + xMessageDAOListNew.size());
}
response.setResult(result);
return response;
}
Expand Down
10 changes: 9 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,12 @@ sunbird.cloud.media.storage.url=${SUNBIRD_CLOUD_MEDIA_STORAGE_URL:#{""}}
sunbird.cloud.media.storage.container=${SUNBIRD_CLOUD_MEDIA_STORAGE_CONTAINER:#{""}}

spring.servlet.multipart.max-file-size=16MB
spring.servlet.multipart.max-request-size=16MB
spring.servlet.multipart.max-request-size=16MB


# Email Config
spring.mail.host=${EMAIL_HOST:#{""}}
spring.mail.port=${EMAIL_PORT:#{"587"}}
spring.mail.username=${EMAIL_USERNAME:#{""}}
spring.mail.password=${EMAIL_PASSWORD:#{""}}
spring.mail.recipient=${RECIPIENT_EMAILS:#{""}}

0 comments on commit cda8e1f

Please sign in to comment.