| 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.HelperClient;
|
| 5 |
import in.shop2020.utils.CatalogDashboardUser;
|
5 |
import in.shop2020.utils.CatalogDashboardUser;
|
| 6 |
|
6 |
|
| 7 |
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
7 |
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
| 8 |
|
8 |
|
| 9 |
@SuppressWarnings("serial")
|
9 |
@SuppressWarnings("serial")
|
| 10 |
public class LoginServiceImpl extends RemoteServiceServlet implements LoginService {
|
10 |
public class LoginServiceImpl extends RemoteServiceServlet implements LoginService {
|
| 11 |
|
11 |
|
| 12 |
@Override
|
12 |
@Override
|
| 13 |
public String authenticateUser(String username, String password, int role) {
|
13 |
public String authenticateUser(String username, String password, int role) {
|
| 14 |
try {
|
14 |
try {
|
| 15 |
HelperServiceClient hsc = new HelperServiceClient();
|
15 |
HelperClient hsc = new HelperClient();
|
| 16 |
in.shop2020.utils.HelperService.Client hClient = hsc.getClient();
|
16 |
in.shop2020.utils.HelperService.Client hClient = hsc.getClient();
|
| 17 |
CatalogDashboardUser catalogUser = hClient.authenticateCatalogUser(username, password, role);
|
17 |
CatalogDashboardUser catalogUser = hClient.authenticateCatalogUser(username, password, role);
|
| 18 |
return catalogUser.getUsername();
|
18 |
return catalogUser.getUsername();
|
| 19 |
} catch (Exception ex) {
|
19 |
} catch (Exception ex) {
|
| 20 |
ex.printStackTrace();
|
20 |
ex.printStackTrace();
|