| | |
| | | package com.yeshi.buwan.controller.parser; |
| | | |
| | | import java.io.PrintWriter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.Config; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.recommend.FloatAD; |
| | | import com.yeshi.buwan.log.LogHelper; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.service.inter.ad.FloatADService; |
| | | import com.yeshi.buwan.util.IPUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | |
| | | private ConfigService configService; |
| | | @Resource |
| | | private SystemService systemService; |
| | | |
| | | @Resource |
| | | private FloatADService floatADService; |
| | | |
| | | public String getAdShowType(String key, String channel, int version, Map<String, String> map) { |
| | | String splash = map.get(key); |
| | |
| | | out.print(JsonUtil.loadTrueJson(data.toString())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取首页配置信息 |
| | | * |
| | | * @param acceptData |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | public void getHomeConfig(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | List<FloatAD> adList = floatADService.listShowAD(1, 1); |
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); |
| | | JSONObject data = new JSONObject(); |
| | | if (adList != null && adList.size() > 0) { |
| | | FloatAD ad = adList.get(0); |
| | | data.put("floatAD", gson.toJson(ad)); |
| | | } |
| | | |
| | | out.print(JsonUtil.loadTrueJson(data.toString())); |
| | | } |
| | | |
| | | class ADConfig { |
| | | int version; |
| | | String type; |