Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21934 amit.gupta 1
package in.shop2020.serving.controllers;
2
 
3
import in.shop2020.model.v1.user.Counter;
21935 amit.gupta 4
import in.shop2020.model.v1.user.CounterVerificationType;
21934 amit.gupta 5
import in.shop2020.thrift.clients.UserClient;
6
 
21935 amit.gupta 7
import java.util.Date;
8
 
21934 amit.gupta 9
import com.google.gson.Gson;
10
 
11
public class VerifyDocController extends BaseController {
12
 
13
	String gstIn;
14
	long userId;
15
	private String response;
16
 
17
 
18
	public String index() throws Exception {
19
		UserClient userServiceClient = new UserClient();
20
        in.shop2020.model.v1.user.UserContextService.Client userClient = userServiceClient.getClient();
21
        Counter counter = new Counter();
21935 amit.gupta 22
        long currentTime = new Date().getTime();
21934 amit.gupta 23
        counter.setGstIn(gstIn);
21935 amit.gupta 24
        counter.setAddedOn(currentTime);
25
        counter.setVerifiedOn(currentTime);
26
        counter.setVerificationType(CounterVerificationType.OFFLINE);
27
        counter.setDocumentVerified(true);
21934 amit.gupta 28
        this.response = new Gson().toJson(userClient.registerCounter(counter, userId));
29
        return "index";
30
	}
31
 
32
 
33
	public String getResponse() {
34
		return response;
35
	}
36
 
37
	public String getGstIn() {
38
		return gstIn;
39
	}
40
 
41
	public void setGstIn(String gstIn) {
42
		this.gstIn = gstIn;
43
	}
44
 
45
 
46
 
47
	public long getUserId() {
48
		return userId;
49
	}
50
 
51
 
52
	public void setUserId(long userId) {
53
		this.userId = userId;
54
	}
55
 
56
 
57
 
58
 
59
 
60
 
61
}