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
 
21964 amit.gupta 13
	String gstin;
21934 amit.gupta 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();
21964 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
	}
21964 amit.gupta 31
 
21934 amit.gupta 32
 
33
	public String getResponse() {
34
		return response;
35
	}
36
 
21964 amit.gupta 37
 
38
	public String getGstin() {
39
		return gstin;
21934 amit.gupta 40
	}
41
 
21964 amit.gupta 42
	public void setGstin(String gstin) {
43
		this.gstin = gstin;
21934 amit.gupta 44
	}
45
 
46
 
47
 
48
	public long getUserId() {
49
		return userId;
50
	}
51
 
52
 
53
	public void setUserId(long userId) {
54
		this.userId = userId;
55
	}
56
 
57
 
58
 
59
 
60
 
61
 
62
}