Subversion Repositories SmartDukaan

Rev

Rev 4361 | Rev 4603 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4361 Rev 4363
Line 1... Line 1...
1
package in.shop2020.hotspot.dashbaord.server.handler;
1
package in.shop2020.hotspot.dashbaord.server.handler;
2
 
2
 
-
 
3
import java.util.Map;
-
 
4
 
3
import org.apache.thrift.TException;
5
import org.apache.thrift.TException;
4
 
6
 
5
import in.shop2020.hotspot.dashbaord.shared.actions.AuthRequest;
7
import in.shop2020.hotspot.dashbaord.shared.actions.AuthRequest;
6
import in.shop2020.hotspot.dashbaord.shared.actions.AuthResponse;
8
import in.shop2020.hotspot.dashbaord.shared.actions.AuthResponse;
7
import in.shop2020.hotspot.dashbaord.shared.actions.AuthResponse.NEXT;
9
import in.shop2020.hotspot.dashbaord.shared.actions.AuthResponse.NEXT;
8
import in.shop2020.hotspot.dashbaord.shared.actions.BillingType;
10
import in.shop2020.hotspot.dashbaord.shared.actions.BillingType;
9
import in.shop2020.hotspot.dashbaord.shared.actions.UserType;
11
import in.shop2020.hotspot.dashbaord.shared.actions.UserType;
-
 
12
import in.shop2020.hotspot.dashbaord.server.CatalogUtils;
10
import in.shop2020.model.v1.catalog.Warehouse;
13
import in.shop2020.model.v1.catalog.Warehouse;
11
import in.shop2020.thrift.clients.CatalogClient;
14
import in.shop2020.thrift.clients.CatalogClient;
12
import in.shop2020.thrift.clients.HelperClient;
15
import in.shop2020.thrift.clients.HelperClient;
13
import in.shop2020.utils.DashboardUser;
16
import in.shop2020.utils.DashboardUser;
14
import in.shop2020.utils.HelperService.Client;
17
import in.shop2020.utils.HelperService.Client;
Line 26... Line 29...
26
		
29
		
27
		boolean status = false;
30
		boolean status = false;
28
		long warehouseId = -1;
31
		long warehouseId = -1;
29
		UserType userType = UserType.WAREHOUSE_EXECUTIVE;
32
		UserType userType = UserType.WAREHOUSE_EXECUTIVE;
30
		BillingType billingType = BillingType.EXTERNAL;
33
		BillingType billingType = BillingType.EXTERNAL;
31
 
-
 
-
 
34
		Map<Long, String> vendors = null;
32
		NEXT nextScreen = null;
35
		NEXT nextScreen = null;
33
		String message = null;
36
		String message = null;
34
		
37
		
35
		try {
38
		try {
36
            HelperClient hsc = new HelperClient();
39
            HelperClient hsc = new HelperClient();
Line 62... Line 65...
62
			    break;
65
			    break;
63
			default:
66
			default:
64
			    billingType = BillingType.EXTERNAL;
67
			    billingType = BillingType.EXTERNAL;
65
			}
68
			}
66
 
69
 
-
 
70
			vendors = CatalogUtils.getVendorsForWarehouse(warehouseId);
-
 
71
            
67
			message = "You are charming, loving and affectionate";
72
			message = "You are charming, loving and affectionate";
68
		} catch (HelperServiceException e) {
73
		} catch (HelperServiceException e) {
69
			e.printStackTrace();
74
			e.printStackTrace();
70
		} catch (TException e) {
75
		} catch (TException e) {
71
			e.printStackTrace();
76
			e.printStackTrace();
72
		} catch (Exception e) {
77
		} catch (Exception e) {
73
			e.printStackTrace();
78
			e.printStackTrace();
74
		}
79
		}
75
		return new AuthResponse(userName, status, message, nextScreen, warehouseId, userType, billingType);
80
		return new AuthResponse(userName, status, message, nextScreen, warehouseId, userType, billingType, vendors);
76
	}
81
	}
77
 
82
 
78
	@Override
83
	@Override
79
	public Class<AuthRequest> getActionType() {		
84
	public Class<AuthRequest> getActionType() {		
80
		return AuthRequest.class;
85
		return AuthRequest.class;