| | |
| | | package com.yeshi.fanli.controller.apph5;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | /**
|
| | | * 动态
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/apph5/v1/swiper")
|
| | | public class AppH5SwiperPictureController {
|
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | | @RequestMapping(value = "getpicture")
|
| | | public void getDetail(String callback, String card, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(card)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("唯一标识为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | List<SwiperPicture> list = swiperPictureService.getByBannerCard(card);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | for (SwiperPicture swiperPicture: list) {
|
| | | swiperPicture.setBannerId(null);
|
| | | swiperPicture.setCreatetime(null);
|
| | | swiperPicture.setUpdatetime(null);
|
| | | swiperPicture.setState(null);
|
| | | swiperPicture.setRemark(null);
|
| | | }
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.create();
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("result_list", gson.toJson(list));
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | | package com.yeshi.fanli.controller.apph5; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.vo.homemodule.BannerVO; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.yeshi.utils.JsonUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.PrintWriter; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 动态 |
| | | * |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | @Controller |
| | | @RequestMapping("api/apph5/v1/swiper") |
| | | public class AppH5SwiperPictureController { |
| | | |
| | | @Resource |
| | | private SwiperPictureService swiperPictureService; |
| | | |
| | | @RequestMapping(value = "getpicture") |
| | | public void getDetail(AcceptData acceptData, String callback, String card, PrintWriter out) { |
| | | |
| | | if (StringUtil.isNullOrEmpty(card)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("唯一标识为空")); |
| | | return; |
| | | } |
| | | |
| | | |
| | | List<BannerVO> list = swiperPictureService.getByBannerCard(card, acceptData.getSystem()); |
| | | if (list == null || list.size() == 0) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据")); |
| | | return; |
| | | } |
| | | |
| | | for (BannerVO swiperPicture: list) { |
| | | swiperPicture.setBannerId(null); |
| | | swiperPicture.setCreatetime(null); |
| | | swiperPicture.setUpdatetime(null); |
| | | swiperPicture.setState(null); |
| | | swiperPicture.setRemark(null); |
| | | } |
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder(); |
| | | gsonBuilder.serializeNulls(); |
| | | Gson gson = gsonBuilder.create(); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("result_list", gson.toJson(list)); |
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | } |
| | | |
| | | } |