Subversion Repositories SmartDukaan

Rev

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

Rev 1962 Rev 2027
Line 1... Line 1...
1
package in.shop2020.catalog.dashboard.server;
1
package in.shop2020.catalog.dashboard.server;
2
 
2
 
3
import in.shop2020.catalog.dashboard.client.LoginService;
3
import in.shop2020.catalog.dashboard.client.LoginService;
4
import in.shop2020.thrift.clients.HelperServiceClient;
4
import in.shop2020.thrift.clients.HelperServiceClient;
-
 
5
import in.shop2020.utils.CatalogDashboardUser;
5
 
6
 
6
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
7
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
7
 
8
 
8
public class LoginServiceImpl extends RemoteServiceServlet implements LoginService {
9
public class LoginServiceImpl extends RemoteServiceServlet implements LoginService {
9
 
10
 
10
    @Override
11
    @Override
11
    public long authenticateUser(String username, String password) {
12
    public String authenticateUser(String username, String password) {
12
        long warehouseId = -1;
-
 
13
        try {
13
        try {
14
            HelperServiceClient hsc = new HelperServiceClient();
14
            HelperServiceClient hsc = new HelperServiceClient();
15
            in.shop2020.utils.HelperService.Client hClient = hsc.getClient();
15
            in.shop2020.utils.HelperService.Client hClient = hsc.getClient();
16
            warehouseId = hClient.authenticateUser(username, password);
16
            CatalogDashboardUser catalogUser = hClient.authenticateCatalogUser(username, password);
-
 
17
            return catalogUser.getUsername();
17
        } catch (Exception ex) {
18
        } catch (Exception ex) {
18
            ex.printStackTrace();
19
            ex.printStackTrace();
19
        }
20
        }
20
        return warehouseId;
21
        return null;
21
    }
22
    }
22
 
23
 
23
}
24
}