Subversion Repositories SmartDukaan

Rev

Rev 6111 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6111 anupam.sin 1
package in.shop2020.serving.controllers;
2
 
3
import in.shop2020.model.v1.order.RechargeOrder;
6461 rajveer 4
import in.shop2020.model.v1.order.TransactionService.Client;
6111 anupam.sin 5
import in.shop2020.thrift.clients.TransactionClient;
6
import java.util.List;
7
 
8
import org.apache.log4j.Logger;
9
 
10
/**
11
 * @author vikas
12
 *
13
 */
14
@SuppressWarnings("serial")
15
public class RechargeOrdersController extends BaseController {
16
    private static Logger log = Logger.getLogger(Class.class);
17
    private long userId;
18
    private List<RechargeOrder> rechargeOrders;
6461 rajveer 19
    private long walletAmount;
6111 anupam.sin 20
 
21
    public String index() throws Exception {
22
        TransactionClient transactionServiceClient = new TransactionClient();
6461 rajveer 23
        Client tclient = transactionServiceClient.getClient();
24
        setRechargeOrders(tclient.getRechargeOrders(userId));
25
        setWalletAmount(tclient.getUserWallet(userId).getAmount());
6111 anupam.sin 26
        return INDEX;
27
    }
28
 
29
    public void setUserId(String userId) {
30
        try {
31
            this.userId = Long.parseLong(userId);
32
        }
33
        catch (NumberFormatException e) {
34
            log.error(e);
35
        }
36
    }
37
 
38
    public Long getUserId() {
39
        return userId;
40
    }
41
 
42
    public void setRechargeOrders(List<RechargeOrder> rechargeOrders) {
43
        this.rechargeOrders = rechargeOrders;
44
    }
45
 
46
    public List<RechargeOrder> getRechargeOrders() {
47
        return rechargeOrders;
48
    }
6461 rajveer 49
 
50
	public void setWalletAmount(long walletAmount) {
51
		this.walletAmount = walletAmount;
52
	}
53
 
54
	public long getWalletAmount() {
55
		return walletAmount;
56
	}
6111 anupam.sin 57
 
58
}