| Line 9... |
Line 9... |
| 9 |
import java.util.HashSet;
|
9 |
import java.util.HashSet;
|
| 10 |
import java.util.List;
|
10 |
import java.util.List;
|
| 11 |
import java.util.Map;
|
11 |
import java.util.Map;
|
| 12 |
import java.util.Set;
|
12 |
import java.util.Set;
|
| 13 |
import java.util.TreeSet;
|
13 |
import java.util.TreeSet;
|
| - |
|
14 |
import java.util.regex.Matcher;
|
| - |
|
15 |
import java.util.regex.Pattern;
|
| 14 |
|
16 |
|
| 15 |
import javax.mail.Multipart;
|
17 |
import javax.mail.Multipart;
|
| 16 |
import javax.mail.internet.InternetAddress;
|
18 |
import javax.mail.internet.InternetAddress;
|
| 17 |
import javax.mail.internet.MimeBodyPart;
|
19 |
import javax.mail.internet.MimeBodyPart;
|
| 18 |
import javax.mail.internet.MimeMessage;
|
20 |
import javax.mail.internet.MimeMessage;
|
| Line 43... |
Line 45... |
| 43 |
import in.shop2020.model.v1.inventory.StateInfo;
|
45 |
import in.shop2020.model.v1.inventory.StateInfo;
|
| 44 |
import in.shop2020.model.v1.inventory.Warehouse;
|
46 |
import in.shop2020.model.v1.inventory.Warehouse;
|
| 45 |
import in.shop2020.model.v1.order.OrderStatusGroups;
|
47 |
import in.shop2020.model.v1.order.OrderStatusGroups;
|
| 46 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
48 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
| 47 |
import in.shop2020.model.v1.order.RechargePlan;
|
49 |
import in.shop2020.model.v1.order.RechargePlan;
|
| 48 |
import in.shop2020.model.v1.order.RechargeType;
|
- |
|
| 49 |
import in.shop2020.model.v1.order.SellerInfo;
|
50 |
import in.shop2020.model.v1.order.SellerInfo;
|
| 50 |
import in.shop2020.model.v1.order.WarehouseAddress;
|
51 |
import in.shop2020.model.v1.order.WarehouseAddress;
|
| 51 |
import in.shop2020.model.v1.user.Sex;
|
52 |
import in.shop2020.model.v1.user.Sex;
|
| 52 |
import in.shop2020.model.v1.user.User;
|
53 |
import in.shop2020.model.v1.user.User;
|
| 53 |
import in.shop2020.model.v1.user.UserContextException;
|
54 |
import in.shop2020.model.v1.user.UserContextException;
|
| Line 70... |
Line 71... |
| 70 |
public static Map<RechargeOrderStatus, String> rechargeStatusMap = new HashMap<>();
|
71 |
public static Map<RechargeOrderStatus, String> rechargeStatusMap = new HashMap<>();
|
| 71 |
public static OrderStatusGroups ORDER_STATUS_GROUPS = new OrderStatusGroups();
|
72 |
public static OrderStatusGroups ORDER_STATUS_GROUPS = new OrderStatusGroups();
|
| 72 |
public static final String SYSTEM_PARTNER = "testpxps@gmail.com";
|
73 |
public static final String SYSTEM_PARTNER = "testpxps@gmail.com";
|
| 73 |
public static final int SYSTEM_PARTNER_ID = 175120474;
|
74 |
public static final int SYSTEM_PARTNER_ID = 175120474;
|
| 74 |
private static final RestClient rc = new RestClient();
|
75 |
private static final RestClient rc = new RestClient();
|
| - |
|
76 |
private static final String regex = "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$";
|
| - |
|
77 |
//Compile regular expression to get the pattern
|
| - |
|
78 |
private static final Pattern pattern = Pattern.compile(regex);
|
| 75 |
|
79 |
|
| 76 |
public static SellerInfo getSellerInfoBySellerId(int sellerId) throws Exception {
|
80 |
public static SellerInfo getSellerInfoBySellerId(int sellerId) throws Exception {
|
| 77 |
TransactionClient tcl = new TransactionClient();
|
81 |
TransactionClient tcl = new TransactionClient();
|
| 78 |
return tcl.getClient().getSellerInfo((long) sellerId);
|
82 |
return tcl.getClient().getSellerInfo((long) sellerId);
|
| 79 |
}
|
83 |
}
|
| - |
|
84 |
|
| - |
|
85 |
|
| - |
|
86 |
public static boolean validateEmail(String email) {
|
| - |
|
87 |
if(email== null) {
|
| - |
|
88 |
return false;
|
| - |
|
89 |
}
|
| - |
|
90 |
Matcher matcher = pattern.matcher(email);
|
| - |
|
91 |
return matcher.matches();
|
| - |
|
92 |
}
|
| 80 |
|
93 |
|
| 81 |
@SuppressWarnings("serial")
|
94 |
@SuppressWarnings("serial")
|
| 82 |
public static final Map<String, String> MIME_TYPE = Collections.unmodifiableMap(new HashMap<String, String>() {
|
95 |
public static final Map<String, String> MIME_TYPE = Collections.unmodifiableMap(new HashMap<String, String>() {
|
| 83 |
{
|
96 |
{
|
| 84 |
put("image/png", "png");
|
97 |
put("image/png", "png");
|