Subversion Repositories SmartDukaan

Rev

Rev 2359 | Rev 3129 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package in.shop2020.catalog.dashboard.server;

import in.shop2020.catalog.dashboard.client.LoginService;
import in.shop2020.thrift.clients.HelperServiceClient;
import in.shop2020.utils.CatalogDashboardUser;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

@SuppressWarnings("serial")
public class LoginServiceImpl extends RemoteServiceServlet implements LoginService {

    @Override
    public String authenticateUser(String username, String password, int role) {
        try {
            HelperServiceClient hsc = new HelperServiceClient();
            in.shop2020.utils.HelperService.Client hClient = hsc.getClient();
            CatalogDashboardUser catalogUser = hClient.authenticateCatalogUser(username, password, role);
            return catalogUser.getUsername();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }

}