Subversion Repositories SmartDukaan

Rev

Rev 7255 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7255 Rev 7386
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.model.v1.order.HotspotStore;
3
import in.shop2020.model.v1.order.HotspotStore;
4
import in.shop2020.model.v1.order.RechargeDenomination;
4
import in.shop2020.model.v1.order.RechargeDenomination;
5
import in.shop2020.model.v1.order.RechargePlan;
5
import in.shop2020.model.v1.order.RechargePlan;
-
 
6
import in.shop2020.thrift.clients.TransactionClient;
6
 
7
 
7
import java.util.HashMap;
8
import java.util.HashMap;
8
import java.util.List;
9
import java.util.List;
9
import java.util.Map;
10
import java.util.Map;
10
 
11
 
Line 35... Line 36...
35
 
36
 
36
    private Long storeId;
37
    private Long storeId;
37
    private static Logger log = Logger.getLogger(Class.class);
38
    private static Logger log = Logger.getLogger(Class.class);
38
    private static Map<Long, String> mobileProvidersMap;
39
    private static Map<Long, String> mobileProvidersMap;
39
    private static Map<Long, String> dthProvidersMap;
40
    private static Map<Long, String> dthProvidersMap;
40
    private static Map<Long, List<RechargePlan>> operatorPlanMap;
-
 
41
    public static Map<Long, HotspotStore> hotspotStores = new HashMap<Long, HotspotStore>();
-
 
42
    private String errorMsg = "";
41
    private String errorMsg = "";
43
    private String redirectUrl;
42
    private String redirectUrl;
44
    
43
    
45
    
44
    
46
    public String index() {
45
    public String index() {
-
 
46
        String loginStatus = (String) request.getSession().getAttribute("LOGGED_IN");
-
 
47
        if(loginStatus != null && loginStatus.equals("TRUE")){
-
 
48
            storeId = Long.parseLong((String) request.getSession().getAttribute("STORE_ID"));
-
 
49
            if(!hotspotStores.containsKey(storeId)){
-
 
50
                try{
-
 
51
                    HotspotStore hotSpotStore = (new TransactionClient()).getClient().getHotspotStore(storeId, "");
-
 
52
                    hotspotStores.put(storeId, hotSpotStore);
-
 
53
                } catch (Exception e) {
-
 
54
                    log.error("Unable to get store", e);
-
 
55
                }
-
 
56
            }
47
        return "index";
57
            return "index";
-
 
58
        }
-
 
59
        return "authfail";
48
    }
60
    }
49
    
61
    
50
    public void setDeviceType(String incomingdeviceType) {
62
    public void setDeviceType(String incomingdeviceType) {
51
        deviceType = incomingdeviceType;
63
        deviceType = incomingdeviceType;
52
    }
64
    }