yujian
2019-07-11 1180be99c94b80d5fe9fea2877558fb29aa97427
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package com.yeshi.fanli.controller.client.v2;
 
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
 
import javax.annotation.Resource;
 
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
 
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
 
import net.sf.json.JSONObject;
 
/**
 * 热销榜
 * 
 * @author Administrator
 *
 */
@Controller
@RequestMapping("api/v2/jd")
public class JinDongControllerV2 {
 
    @Resource
    private HongBaoManageService hongBaoManageService;
 
    @Resource
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
 
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
 
    @Resource
    private DaTaoKeGoodsService daTaoKeGoodsService;
    
    @Resource
    private SwiperPictureService swiperPictureService;
 
    
    /**
     * 京东专题分类
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getClass")
    public void getJDClass(AcceptData acceptData, PrintWriter out) {
        List<GoodsClass> list = new ArrayList<GoodsClass>();
        list.add(new GoodsClass(1L, "精选"));
        list.add(new GoodsClass(2L, "女装"));
        list.add(new GoodsClass(3L, "男装"));
        list.add(new GoodsClass(4L, "美妆"));
        list.add(new GoodsClass(5L, "美食"));
        list.add(new GoodsClass(6L, "居家"));
        JSONObject root = new JSONObject();
        root.put("list", list);
        out.print(JsonUtil.loadTrueResult(root));
    }
    
    
    /**
     * 京东专题
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getGoodsInfo")
    public void getGoodsInfo(AcceptData acceptData, Integer cid, Integer page, PrintWriter out) {
        JSONObject root = new JSONObject();
        if (cid == 1 && page == 1) {
            List<SwiperPicture> topPicList = swiperPictureService.getByBannerCard("jd_top");
            if (topPicList == null) {
                topPicList = new ArrayList<SwiperPicture>();
            }
            root.put("listPic", JsonUtil.getApiCommonGson().toJson(topPicList));
        }
        
        // TODO
        
        
        out.print(JsonUtil.loadTrueResult(root));
    }
    
    
 
}