| 569 |
rajveer |
1 |
package in.shop2020.serving.controllers;
|
|
|
2 |
|
|
|
3 |
import java.util.List;
|
|
|
4 |
import java.util.Map;
|
|
|
5 |
|
|
|
6 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
|
|
7 |
import in.shop2020.serving.controllers.BaseController;
|
|
|
8 |
import in.shop2020.thrift.clients.HelperServiceClient;
|
|
|
9 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
|
|
10 |
import in.shop2020.utils.Mail;
|
|
|
11 |
|
|
|
12 |
import org.apache.juli.logging.Log;
|
|
|
13 |
import org.apache.juli.logging.LogFactory;
|
|
|
14 |
import org.apache.struts2.rest.DefaultHttpHeaders;
|
|
|
15 |
import org.apache.struts2.rest.HttpHeaders;
|
|
|
16 |
|
| 583 |
rajveer |
17 |
|
| 569 |
rajveer |
18 |
public class ForgotPasswordController extends BaseController{
|
|
|
19 |
|
|
|
20 |
private static final long serialVersionUID = 1L;
|
|
|
21 |
private static Log log = LogFactory.getLog(ForgotPasswordController.class);
|
|
|
22 |
|
|
|
23 |
public ForgotPasswordController(){
|
|
|
24 |
super();
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
// GET /Forgot password page
|
|
|
28 |
public HttpHeaders index() {
|
|
|
29 |
return new DefaultHttpHeaders("index").disableCaching();
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
// POST /Forgot password
|
|
|
33 |
public String create() {
|
|
|
34 |
log.info("ForgotPasswordController.create");
|
|
|
35 |
String emailId = request.getParameter("emailId");
|
|
|
36 |
if(emailId != null){
|
|
|
37 |
UserContextServiceClient userContextServiceClient;
|
|
|
38 |
try {
|
|
|
39 |
userContextServiceClient = new UserContextServiceClient();
|
|
|
40 |
Client client = userContextServiceClient.getClient();
|
| 583 |
rajveer |
41 |
client.forgotPassword(emailId);
|
| 569 |
rajveer |
42 |
} catch (Exception e) {
|
|
|
43 |
// TODO Auto-generated catch block
|
|
|
44 |
e.printStackTrace();
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
}
|
| 583 |
rajveer |
49 |
|
| 569 |
rajveer |
50 |
return "success";
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
}
|