| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.service;
|
1 |
package com.spice.profitmandi.service;
|
| 2 |
|
2 |
|
| - |
|
3 |
import java.time.LocalDateTime;
|
| - |
|
4 |
import java.util.ArrayList;
|
| - |
|
5 |
import java.util.Arrays;
|
| - |
|
6 |
import java.util.HashMap;
|
| - |
|
7 |
import java.util.HashSet;
|
| - |
|
8 |
import java.util.List;
|
| - |
|
9 |
import java.util.Map;
|
| - |
|
10 |
import java.util.Set;
|
| - |
|
11 |
import java.util.stream.Collectors;
|
| - |
|
12 |
|
| - |
|
13 |
import org.apache.logging.log4j.LogManager;
|
| - |
|
14 |
import org.apache.logging.log4j.Logger;
|
| - |
|
15 |
import org.json.JSONObject;
|
| - |
|
16 |
import org.springframework.beans.factory.annotation.Autowired;
|
| - |
|
17 |
import org.springframework.beans.factory.annotation.Value;
|
| - |
|
18 |
import org.springframework.stereotype.Component;
|
| - |
|
19 |
|
| 3 |
import com.google.gson.Gson;
|
20 |
import com.google.gson.Gson;
|
| 4 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
21 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
| 5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
22 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 6 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
23 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 7 |
import com.spice.profitmandi.common.model.SendNotificationModel;
|
24 |
import com.spice.profitmandi.common.model.SendNotificationModel;
|
| 8 |
import com.spice.profitmandi.common.web.client.RestClient;
|
25 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| 9 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
26 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| - |
|
27 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
| - |
|
28 |
import com.spice.profitmandi.dao.entity.dtr.Optin;
|
| - |
|
29 |
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
|
| 10 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
30 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| - |
|
31 |
import com.spice.profitmandi.dao.entity.dtr.UserCampaign;
|
| 11 |
import com.spice.profitmandi.dao.entity.user.Device;
|
32 |
import com.spice.profitmandi.dao.entity.user.Device;
|
| 12 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
33 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
| 13 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
34 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
| 14 |
import com.spice.profitmandi.dao.repository.catalog.DeviceRepository;
|
35 |
import com.spice.profitmandi.dao.repository.catalog.DeviceRepository;
|
| 15 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
36 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| - |
|
37 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| - |
|
38 |
import com.spice.profitmandi.dao.repository.dtr.NotificationCampaignRepository;
|
| - |
|
39 |
import com.spice.profitmandi.dao.repository.dtr.OptinRepository;
|
| - |
|
40 |
import com.spice.profitmandi.dao.repository.dtr.PushNotificationRepository;
|
| - |
|
41 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| - |
|
42 |
import com.spice.profitmandi.dao.repository.dtr.UserCampaignRepository;
|
| 16 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
43 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| 17 |
import com.spice.profitmandi.service.user.RetailerService;
|
44 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 18 |
import org.apache.logging.log4j.LogManager;
|
- |
|
| 19 |
import org.apache.logging.log4j.Logger;
|
- |
|
| 20 |
import org.springframework.beans.factory.annotation.Autowired;
|
- |
|
| 21 |
import org.springframework.beans.factory.annotation.Value;
|
- |
|
| 22 |
import org.springframework.stereotype.Component;
|
- |
|
| 23 |
|
- |
|
| 24 |
import java.time.LocalDateTime;
|
- |
|
| 25 |
import java.util.*;
|
- |
|
| 26 |
import java.util.stream.Collectors;
|
- |
|
| 27 |
|
45 |
|
| 28 |
@Component
|
46 |
@Component
|
| 29 |
public class NotificationServiceImpl implements NotificationService {
|
47 |
public class NotificationServiceImpl implements NotificationService {
|
| 30 |
|
48 |
|
| 31 |
private static final Logger LOGGER = LogManager.getLogger(NotificationService.class);
|
49 |
private static final Logger LOGGER = LogManager.getLogger(NotificationService.class);
|
| Line 250... |
Line 268... |
| 250 |
String response =
|
268 |
String response =
|
| 251 |
restClient.post("https://media.smsgupshup.com/GatewayAPI/rest",
|
269 |
restClient.post("https://media.smsgupshup.com/GatewayAPI/rest",
|
| 252 |
requestParams,
|
270 |
requestParams,
|
| 253 |
requestheaders);
|
271 |
requestheaders);
|
| 254 |
LOGGER.info("response" + response);
|
272 |
LOGGER.info("response" + response);
|
| - |
|
273 |
|
| - |
|
274 |
JSONObject jsonObject = new JSONObject(response);
|
| - |
|
275 |
|
| - |
|
276 |
LOGGER.info("jsonObject" + jsonObject);
|
| 255 |
}
|
277 |
}
|
| 256 |
|
278 |
|
| 257 |
}
|
279 |
}
|
| 258 |
|
280 |
|
| 259 |
|
281 |
|