Subversion Repositories SmartDukaan

Rev

Rev 398 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 398 Rev 399
Line 4... Line 4...
4
import org.apache.struts2.rest.HttpHeaders;
4
import org.apache.struts2.rest.HttpHeaders;
5
import org.apache.thrift.TException;
5
import org.apache.thrift.TException;
6
 
6
 
7
import in.shop2020.model.v1.user.AuthenticationException;
7
import in.shop2020.model.v1.user.AuthenticationException;
8
import in.shop2020.model.v1.user.UserContextService.Client;
8
import in.shop2020.model.v1.user.UserContextService.Client;
9
import in.shop2020.serving.rest.Auth;
-
 
10
import in.shop2020.thrift.clients.UserContextServiceClient;
9
import in.shop2020.thrift.clients.UserContextServiceClient;
11
import in.shop2020.thrift.clients.UserProfileClient;
10
import in.shop2020.thrift.clients.UserProfileClient;
12
 
11
 
13
import com.opensymphony.xwork2.ModelDriven;
12
import com.opensymphony.xwork2.ModelDriven;
14
 
13
 
Line 31... Line 30...
31
		}
30
		}
32
	}
31
	}
33
	
32
	
34
	@Override
33
	@Override
35
	public Object getModel() {
34
	public Object getModel() {
36
		return auth;
35
		return this.auth;
37
	}
36
	}
38
	
37
	
39
	public HttpHeaders create(){
38
	public HttpHeaders create(){
40
		System.out.println(auth);
39
		System.out.println(auth);
41
		return new DefaultHttpHeaders("lsuccess");
40
		return new DefaultHttpHeaders("lsuccess");
42
		//AUTH service to be invoked from here
41
		//AUTH service to be invoked from here
-
 
42
		/*
43
		Client c = client.getClient();
43
		Client c = client.getClient();
44
		try {
44
		try {
45
			
45
			
46
			if (c.authenticateUser(auth.getUserName(), auth.getPassword(), true)){
46
			if (c.authenticateUser(auth.getUserName(), auth.getPassword(), true)){
47
				return new DefaultHttpHeaders("lsuccess");
47
				return new DefaultHttpHeaders("lsuccess");
Line 55... Line 55...
55
			// TODO Auto-generated catch block
55
			// TODO Auto-generated catch block
56
			errorCode = -1;
56
			errorCode = -1;
57
			e.printStackTrace();
57
			e.printStackTrace();
58
		}
58
		}
59
		return new DefaultHttpHeaders("lfail");
59
		return new DefaultHttpHeaders("lfail");
-
 
60
		*/
60
	}
61
	}
61
 
62
 
62
	public int getErrorCode() {
63
	public int getErrorCode() {
63
		return errorCode;
64
		return errorCode;
64
	}
65
	}
Line 69... Line 70...
69
	
70
	
70
	public String getId(){
71
	public String getId(){
71
		return id;
72
		return id;
72
	}
73
	}
73
	
74
	
74
	public String setId(){
75
	public void setId(String id){
75
		this.id = id;
76
		this.id = id;
76
	}
77
	}
77
}
78
}