Subversion Repositories SmartDukaan

Rev

Rev 14364 | Rev 14385 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14364 Rev 14374
Line 2... Line 2...
2
 
2
 
3
import java.util.List;
3
import java.util.List;
4
 
4
 
5
import org.apache.log4j.Logger;
5
import org.apache.log4j.Logger;
6
 
6
 
7
import in.shop2020.model.v1.catalog.Item;
-
 
8
import in.shop2020.model.v1.catalog.LivePricing;
-
 
9
import in.shop2020.model.v1.catalog.CatalogService.Client;
7
import in.shop2020.model.v1.dtr.DtrService.Client;
10
import in.shop2020.thrift.clients.CatalogClient;
8
import in.shop2020.thrift.clients.DtrClient;
11
 
9
 
12
import com.google.gson.Gson;
10
import com.google.gson.Gson;
-
 
11
import com.mongodb.util.JSON;
13
 
12
 
14
 
13
 
15
public class LivePricingController extends BaseController{
14
public class LivePricingController extends BaseController{
16
    private static Logger log = Logger.getLogger(Class.class);
15
    private static Logger log = Logger.getLogger(Class.class);
17
    private static final long serialVersionUID = 1L;
16
    private static final long serialVersionUID = 1L;
Line 24... Line 23...
24
        this.source_id = source_id;
23
        this.source_id = source_id;
25
    }
24
    }
26
 
25
 
27
 
26
 
28
    private String source_id;
27
    private String source_id;
29
    
28
 
30
    
29
 
31
    public String index(){
30
    public String index(){
32
        log.info("Inside index");
-
 
33
        log.info("id "+id);
-
 
34
        log.info("source_id "+source_id);
-
 
35
        Gson gs = new Gson();
31
        Gson gs = new Gson();
36
        Client cc = null;
32
        Client dc = null;
37
        try {
33
        try {
38
            cc = new CatalogClient().getClient();
34
            dc = new DtrClient().getClient();
39
            log.info("Insode try");
35
            log.info("Insode try");
40
            List<LivePricing> pricingObj = cc.getLatestPricing(Long.valueOf(id), Long.valueOf(source_id));
36
            List<in.shop2020.model.v1.dtr.LivePricing> pricingObj = dc.getLatestPricing(Long.valueOf(id), Long.valueOf(source_id));
41
            for (LivePricing obj:pricingObj)
37
            setResultJson(JSON.parse(gs.toJson(pricingObj)).toString());
42
                System.out.println(obj);
-
 
43
        } catch (Exception e) {
38
        } catch (Exception e) {
44
            log.info(e);
39
            log.info(e);
45
        }
40
        }
46
        return "index";
41
        return "index";
47
    }
42
    }
48
    
43
 
49
    public void setId(String id) {
44
    public void setId(String id) {
50
        this.id = id;
45
        this.id = id;
51
    }
46
    }
52
   
-
 
53
    public String getId(){
-
 
54
	return id;
-
 
55
}
-
 
56
 
47
 
57
 
48
 
58
    
49
 
59
}
50
}