yujian
2019-06-26 900c0ff1cf220b47921264748ac1f1e1aa28c6f5
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
package com.yeshi.fanli.controller.client.v1;
 
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.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
 
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
 
import net.sf.json.JSONObject;
 
@Controller
@RequestMapping("api/v1/navbar")
public class HomeNavbarController<E> {
 
    @Resource
    private HomeNavbarService homeNavbarService;
 
 
    /**
     * 获取导航栏内容
     * 
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "gethomenavbar", method = RequestMethod.POST)
    public void gethomenavbar(AcceptData acceptData, PrintWriter out) {
        List<HomeNavbar> listNavbar = homeNavbarService.listQueryDefaultNavbar(0);
        if (listNavbar == null) {
            listNavbar = new ArrayList<HomeNavbar>();
        }
        
        JSONObject data = new JSONObject();
        data.put("count", listNavbar.size());
        data.put("listNavbar", JsonUtil.getApiCommonGson().toJson(listNavbar));
        
        out.print(JsonUtil.loadTrueResult(data));
    }
    
}