| | |
| | | |
| | | |
| | | @Around("execution(public * com.yeshi.buwan.controller.admin.api.*.*(..))") |
| | | public Object verifyLoginState(ProceedingJoinPoint joinPoint) throws IOException { |
| | | public Object verifyLoginState(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | |
| | | ServletRequestAttributes servletContainer = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes(); |
| | | |
| | |
| | | |
| | | //签名验证 |
| | | @Around("execution(public * com.yeshi.buwan.controller.api.mugua.*.*(..))") |
| | | public Object verifySign(ProceedingJoinPoint joinPoint) throws IOException { |
| | | public Object verifySign(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | ServletRequestAttributes servletContainer = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
| | | HttpServletRequest request = servletContainer.getRequest(); |
| | | HttpServletResponse response = servletContainer.getResponse(); |
| | |
| | | return null; |
| | | } |
| | | |
| | | Object obj = null; |
| | | try { |
| | | obj = joinPoint.proceed(args); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Object obj = joinPoint.proceed(args); |
| | | return obj; |
| | | } |
| | | |
| | |
| | | |
| | | //签名验证 |
| | | @Around("execution(public * com.yeshi.buwan.controller.api.*.*(..))") |
| | | public Object verifySign(ProceedingJoinPoint joinPoint) throws IOException { |
| | | public Object verifySign(ProceedingJoinPoint joinPoint) throws Throwable { |
| | | ServletRequestAttributes servletContainer = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
| | | HttpServletRequest request = servletContainer.getRequest(); |
| | | HttpServletResponse response = servletContainer.getResponse(); |
| | |
| | | } |
| | | } |
| | | |
| | | Object obj = null; |
| | | try { |
| | | obj = joinPoint.proceed(args); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return obj; |
| | | return joinPoint.proceed(args); |
| | | } |
| | | |
| | | |
| | |
| | | private EHCacheManager ehCacheManager; |
| | | |
| | | @RequestMapping("configList") |
| | | public void configList(PrintWriter out) { |
| | | |
| | | List<DetailSystemConfig> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion()); |
| | | public void configList(Long detailSystemId, String key, PrintWriter out) { |
| | | key = StringUtil.isNullOrEmpty(key) ? "" : key.trim(); |
| | | List<DetailSystemConfig> list = configService.listConfig(detailSystemId, key); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("code", "0"); |
| | | JSONArray listJson = new JSONArray(list); |
| | | json.put("configList", listJson); |
| | | |
| | | System.out.println("Json--" + json); |
| | | System.out.println("JsonS--" + json.toString()); |
| | | |
| | | out.print(json); |
| | | |
| | | return; |
| | | } |
| | | |
| | | @RequestMapping(value = "updateConfig", method = RequestMethod.POST) |
| | | public void updateConfig(String vals, PrintWriter out) { |
| | | List<DetailSystemConfig> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion()); |
| | | public void updateConfig(String id, String value, PrintWriter out) { |
| | | DetailSystemConfig config = configService.getConfig(Integer.parseInt(id)); |
| | | JSONObject json = new JSONObject(); |
| | | |
| | | System.out.println("vals----" + vals); |
| | | JSONObject json = new JSONObject(vals); |
| | | for (DetailSystemConfig cf : list) { |
| | | String key = cf.getKey(); |
| | | cf.setValue(json.getString(key)); |
| | | // configService.updateConfig(cf); |
| | | } |
| | | boolean b = configService.updateConfigList(list); |
| | | if (b) { |
| | | out.print("yes"); |
| | | if (config == null) { |
| | | json.put("code", 1); |
| | | json.put("msg", "配置不存在"); |
| | | } else { |
| | | out.print("no"); |
| | | config.setValue(value); |
| | | configService.saveConfig(config); |
| | | json.put("code", 0); |
| | | } |
| | | |
| | | |
| | | out.print(json); |
| | | return; |
| | | } |
| | | |
New file |
| | |
| | | package com.yeshi.buwan.controller.admin.api; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.SuperHomeType; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial; |
| | | import com.yeshi.buwan.domain.recommend.SuperHomeRecommendSpecial; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.web.DetailSystemSelect; |
| | | import com.yeshi.buwan.domain.web.HomeTypeAdmin; |
| | | import com.yeshi.buwan.dto.recommend.HomeRecommendSpecialDTO; |
| | | import com.yeshi.buwan.service.imp.HomeTypeService; |
| | | import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.SystemUtil; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | | import com.yeshi.buwan.web.tag.PageEntity; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | import javax.validation.Valid; |
| | | import java.io.PrintWriter; |
| | | import java.io.Serializable; |
| | | import java.lang.reflect.Type; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/new/api/homerecommend") |
| | | public class HomeRecommendSpecialController { |
| | | |
| | | @Resource |
| | | private HomeRecommendSpecialService homeRecommendSpecialService; |
| | | |
| | | private Gson getGson() { |
| | | |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | @Override |
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) { |
| | | if (value == null) { |
| | | return new JsonPrimitive(""); |
| | | } else { |
| | | return new JsonPrimitive(TimeUtil.getGernalTime(value.getTime(), "yyyy.MM.dd HH:mm")); |
| | | } |
| | | } |
| | | }).create(); |
| | | |
| | | return gson; |
| | | } |
| | | |
| | | /** |
| | | * 获取专题列表 |
| | | * |
| | | * @param session |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "/getSpcialList", method = RequestMethod.POST) |
| | | public void getSpcialList(HttpSession session, String detailSystemId, String key, int page, PrintWriter out) { |
| | | |
| | | key = StringUtil.isNullOrEmpty(key) ? null : key.trim(); |
| | | detailSystemId = StringUtil.isNullOrEmpty(detailSystemId) ? null : detailSystemId.trim(); |
| | | |
| | | if (detailSystemId != null && detailSystemId.equalsIgnoreCase("0")) |
| | | detailSystemId = null; |
| | | |
| | | String systemId = SystemUtil.getAdminSelectedSystemId(session); |
| | | |
| | | List<HomeRecommendSpecialDTO> list = homeRecommendSpecialService.list(systemId, detailSystemId, key, page, Constant.pageCount); |
| | | if (list != null) |
| | | for (HomeRecommendSpecialDTO dto : list) { |
| | | List<DetailSystemSelect> dssList = dto.getDetailSystemSelectList(); |
| | | for (DetailSystemSelect select : dssList) { |
| | | select.getDetailSystem().setSystem(null); |
| | | select.getDetailSystem().setInfo(null); |
| | | } |
| | | |
| | | } |
| | | long count = homeRecommendSpecialService.count(systemId, detailSystemId, key); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("data", getGson().toJson(list)); |
| | | data.put("count", count); |
| | | data.put("pageEntity", new PageEntity(page, Constant.pageCount, (int) count)); |
| | | |
| | | JSONObject object = new JSONObject(); |
| | | object.put("code", 0); |
| | | object.put("data", data); |
| | | out.print(object); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/getSpecial", method = RequestMethod.POST) |
| | | public void getSpecial(String id, PrintWriter out) { |
| | | HomeRecommendSpecial special = homeRecommendSpecialService.getSpecial(id); |
| | | JSONObject object = new JSONObject(); |
| | | if (special != null) { |
| | | object.put("code", 0); |
| | | object.put("data", new Gson().toJson(special)); |
| | | } else { |
| | | object.put("code", 1); |
| | | object.put("msg", "专题不存在"); |
| | | } |
| | | |
| | | out.print(object); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/addSpecial", method = RequestMethod.POST) |
| | | public void addSpecial(String name, int weight, String bannerSizeRate, String dataKey, String detailsystemids, HttpSession session, PrintWriter out) { |
| | | HomeRecommendSpecial special = new HomeRecommendSpecial(); |
| | | special.setName(name); |
| | | special.setWeight(weight); |
| | | special.setDataKey(dataKey); |
| | | special.setBannerSizeRate(new BigDecimal(bannerSizeRate)); |
| | | special.setSystemId(SystemUtil.getAdminSelectedSystemId(session)); |
| | | JSONObject object = new JSONObject(); |
| | | try { |
| | | homeRecommendSpecialService.addSpecial(special); |
| | | |
| | | //主键 |
| | | if (!StringUtil.isNullOrEmpty(detailsystemids)) { |
| | | String[] ds = detailsystemids.split(","); |
| | | for (String d : ds) { |
| | | SuperHomeRecommendSpecial s = new SuperHomeRecommendSpecial(); |
| | | s.setSpecialId(special.getId()); |
| | | s.setSpecial(special); |
| | | s.setDetailSystemId(d); |
| | | homeRecommendSpecialService.addSuperSpecial(s); |
| | | } |
| | | } |
| | | object.put("code", 0); |
| | | } catch (Exception e) { |
| | | object.put("code", 1); |
| | | object.put("msg", e.getMessage()); |
| | | } |
| | | out.print(object); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/deleteSpcial", method = RequestMethod.POST) |
| | | public void deleteSpecial(String ids, PrintWriter out) { |
| | | String[] sts = ids.split(","); |
| | | for (String id : sts) { |
| | | homeRecommendSpecialService.deleteSpecial(id); |
| | | } |
| | | |
| | | JSONObject object = new JSONObject(); |
| | | object.put("code", 0); |
| | | object.put("msg", "操作成功"); |
| | | out.print(object); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/updateSpecial", method = RequestMethod.POST) |
| | | public void updateSpecial(String id, String name, int weight, String bannerSizeRate, HttpSession session, PrintWriter out) { |
| | | HomeRecommendSpecial special = new HomeRecommendSpecial(); |
| | | special.setId(id); |
| | | special.setName(name); |
| | | special.setWeight(weight); |
| | | special.setBannerSizeRate(new BigDecimal(bannerSizeRate)); |
| | | JSONObject object = new JSONObject(); |
| | | try { |
| | | homeRecommendSpecialService.updateSpecial(special); |
| | | object.put("code", 0); |
| | | } catch (Exception e) { |
| | | object.put("code", 1); |
| | | object.put("msg", e.getMessage()); |
| | | } |
| | | out.print(object); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/addSuperSpecial", method = RequestMethod.POST) |
| | | public void addSuperSpecial(String id, String detailSystemId, HttpSession session, PrintWriter out) { |
| | | SuperHomeRecommendSpecial superHomeRecommendSpecial = new SuperHomeRecommendSpecial(); |
| | | superHomeRecommendSpecial.setSpecialId(id); |
| | | superHomeRecommendSpecial.setDetailSystemId(detailSystemId); |
| | | JSONObject object = new JSONObject(); |
| | | try { |
| | | homeRecommendSpecialService.addSuperSpecial(superHomeRecommendSpecial); |
| | | object.put("code", 0); |
| | | } catch (Exception e) { |
| | | object.put("code", 1); |
| | | object.put("msg", e.getMessage()); |
| | | } |
| | | out.print(object); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/deleteSuperSpecial", method = RequestMethod.POST) |
| | | public void deleteSuperSpecial(String id, String detailSystemId, PrintWriter out) { |
| | | homeRecommendSpecialService.deleteSuperSpecial(id, detailSystemId); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("code", 0); |
| | | object.put("msg", "操作成功"); |
| | | out.print(object); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yeshi.buwan.controller.api; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.buwan.domain.system.SystemConfig; |
| | | import com.yeshi.buwan.domain.user.LoginUser; |
| | | import com.yeshi.buwan.domain.vip.UserVIPInfo; |
| | | import com.yeshi.buwan.domain.vip.VIPOrderRecord; |
| | |
| | | import com.yeshi.buwan.domain.vip.VIPPriceType; |
| | | import com.yeshi.buwan.exception.vip.VIPException; |
| | | import com.yeshi.buwan.service.inter.LoginUserService; |
| | | import com.yeshi.buwan.service.inter.system.SystemConfigService; |
| | | import com.yeshi.buwan.service.inter.vip.VIPPriceService; |
| | | import com.yeshi.buwan.service.inter.vip.VIPService; |
| | | import com.yeshi.buwan.util.*; |
| | |
| | | @Resource |
| | | private VIPPriceService vipPriceService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | |
| | | @RequestMapping("getVIPPriceList") |
| | | @ResponseBody |
| | |
| | | userInfoVO.setId(user.getId()); |
| | | userInfoVO.setNickName(user.getName()); |
| | | userInfoVO.setPortrait(user.getPortrait()); |
| | | if (StringUtil.isNullOrEmpty(userInfoVO.getPortrait())) { |
| | | String portrait = systemConfigService.getConfigValueByKeyCache("default_portrait"); |
| | | userInfoVO.setPortrait(portrait); |
| | | } |
| | | |
| | | if (vipInfo != null && vipInfo.getExpireDate() != null) |
| | | userInfoVO.setVipExpireTime(vipInfo.getExpireDate().getTime()); |
| | | root.put("user", new Gson().toJson(userInfoVO)); |
| | |
| | | typelist.add(vo); |
| | | } |
| | | |
| | | typelist.get(0).setDataKey("recommend"); |
| | | |
| | | HomeClassVO vo = new HomeClassVO(); |
| | | |
| | | vo.setDataType(HomeClassVO.DATA_TYPE_NOVEL); |
| | |
| | | data.put("adNew", adNew); |
| | | //PPTV免广告权益时长,暂时设置为3小时 |
| | | data.put("pptvNoAdRewardHour", 3); |
| | | //设置网页加速域名 |
| | | data.put("webSpeedUpHost",map.get("web_speed_up_host")); |
| | | |
| | | |
| | | |
| | | |
| | | out.print(JsonUtil.loadTrueJson(data.toString())); |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.jump.JumpDetail; |
| | | import com.yeshi.buwan.domain.jump.JumpTypeEnum; |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.video.VideoWatchHistory; |
| | |
| | | @Resource |
| | | private VideoWatchHistoryService videoWatchHistoryService; |
| | | |
| | | private final Logger playLogger = LoggerFactory.getLogger("videoPlay"); |
| | | private final Logger userPlayLogger = LoggerFactory.getLogger("videoPlayUser"); |
| | | |
| | | @RequireUid |
| | | public void getHomeAd(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | if (VersionUtil.isGraterThan387(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | DetailSystemConfig adContent = configService.getConfigByKey("home_banner_ad_content", acceptData.getDetailSystem(), acceptData.getVersion()); |
| | | DetailSystemConfig adPosition = configService.getConfigByKey("home_banner_ad_position", acceptData.getDetailSystem(), acceptData.getVersion()); |
| | | if (adContent != null && adPosition != null) { |
| | | HomeType.HomeTypeAd ad = new Gson().fromJson(adContent.getValue(), HomeType.HomeTypeAd.class); |
| | | int adP = Integer.parseInt(adPosition.getValue()); |
| | | if (adP < list.size()) { |
| | | HomeType homeType = new HomeType(); |
| | | homeType.setAd(ad); |
| | | list.add(adP, homeType); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (acceptData.getPlatform().equalsIgnoreCase("ios")) { |
| | |
| | | JSONArray array = new JSONArray(); |
| | | |
| | | for (HomeType ht : list) { |
| | | if (ht.getHomeVideoList() != null) |
| | | for (int i = 0; i < ht.getHomeVideoList().size(); i++) { |
| | | //改变图片 |
| | | if (JuheVideoUtil.isNeedDelete(ht.getHomeVideoList().get(i).getVideo(), detailSystem.getId())) { |
| | |
| | | object.put("data", array); |
| | | out.print(JsonUtil.loadTrueJson(object.toString())); |
| | | } |
| | | |
| | | |
| | | |
| | | public HomeType convertHomeVideoList(HomeType type) { |
| | |
| | | } |
| | | }); |
| | | |
| | | playLogger.info(VideoLogFactory.createUserVideoDetailLog(acceptData.getDevice(), loginUid, acceptData.getDetailSystem().getId(), videoId, resourceId, from)); |
| | | userPlayLogger.info(VideoLogFactory.createUserVideoDetailLog(acceptData.getDevice(), acceptData.getUtdId(), loginUid, acceptData.getDetailSystem().getId(), videoId, resourceId, from)); |
| | | |
| | | |
| | | //PPTV网页播放 |
| | |
| | | String playUrl = PPTVUtil.getPlayUrl(series, series.getSeries().get(p)); |
| | | data.put("videoId", videoId); |
| | | data.put("playUrl", playUrl); |
| | | data.put("name", series.getName()); |
| | | data.put("pptv", true); |
| | | out.print(JsonUtil.loadTrueJson(data.toString())); |
| | | return; |
| | |
| | | import com.yeshi.buwan.dto.user.LoginInfoDto; |
| | | import com.yeshi.buwan.exception.user.LoginUserException; |
| | | import com.yeshi.buwan.exception.user.RegisterUserException; |
| | | import com.yeshi.buwan.pptv.PPTVUtil; |
| | | import com.yeshi.buwan.service.imp.*; |
| | | import com.yeshi.buwan.service.manager.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.util.*; |
| | |
| | | } |
| | | |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion()); |
| | | |
| | | |
| | | String cacheMD5 = "0"; |
| | | if (resourceList != null && resourceList.size() > 0) |
| | | for (Long l : resourceList) |
| | | cacheMD5 += "#" + l; |
| | | cacheMD5 = StringUtil.Md5(cacheMD5); |
| | | |
| | | |
| | | VideoListResultVO videoListResultVO = searchService.searchNew(acceptData.getDetailSystem().getId(), request.getRemoteAddr(), |
| | | acceptData.getUid(), key, pageIndex, Integer.parseInt(type), |
| | |
| | | typeList.add(vt); |
| | | } |
| | | } |
| | | |
| | | vt = new VideoType(); |
| | | vt.setId(Constant.SEARCH_RESULT_TYPE_HIGH_DEFINITION); |
| | | vt.setName("高清"); |
| | | typeList.add(vt); |
| | | |
| | | |
| | | JSONArray array1 = new JSONArray(); |
| | | for (VideoType vt1 : typeList) |
| | | array1.add(StringUtil.outPutResultJson(vt1)); |
| | |
| | | return findList(query); |
| | | } |
| | | |
| | | public List<HomeRecommendSpecial> list(DaoQuery daoQuery) { |
| | | private Query getQuery(DaoQuery daoQuery) { |
| | | Query query = new Query(); |
| | | List<Criteria> andList = new ArrayList<>(); |
| | | |
| | | if (daoQuery.systemId != null) { |
| | | andList.add(Criteria.where("systemId").is(daoQuery.systemId)); |
| | | } |
| | | |
| | | if (daoQuery.key != null) { |
| | | andList.add(Criteria.where("name").regex(daoQuery.key)); |
| | | } |
| | | |
| | | Criteria criteria = new Criteria(); |
| | |
| | | } |
| | | |
| | | query.addCriteria(criteria); |
| | | return query; |
| | | } |
| | | |
| | | public List<HomeRecommendSpecial> list(DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | query.skip(daoQuery.start); |
| | | query.limit(daoQuery.count); |
| | | query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "weight"))); |
| | | |
| | | return findList(query); |
| | | } |
| | | |
| | | |
| | | public long count(DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | return count(query); |
| | | } |
| | | |
| | | public void updateSelective(HomeRecommendSpecial bean) { |
| | |
| | | public String systemId; |
| | | public int start; |
| | | public int count; |
| | | public String key; |
| | | } |
| | | |
| | | |
| | |
| | | public class SuperHomeRecommendSpecialDao extends MongodbBaseDao<SuperHomeRecommendSpecial> { |
| | | |
| | | |
| | | public List<SuperHomeRecommendSpecial> list(SuperHomeRecommendSpecialDao.DaoQuery daoQuery) { |
| | | private Query getQuery(SuperHomeRecommendSpecialDao.DaoQuery daoQuery) { |
| | | Query query = new Query(); |
| | | List<Criteria> andList = new ArrayList<>(); |
| | | |
| | |
| | | |
| | | if (daoQuery.detailSystemId != null) { |
| | | andList.add(Criteria.where("detailSystemId").is(daoQuery.detailSystemId)); |
| | | } |
| | | |
| | | if (daoQuery.showName != null) { |
| | | andList.add(Criteria.where("showName").regex(daoQuery.showName)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | query.addCriteria(criteria); |
| | | |
| | | return query; |
| | | |
| | | } |
| | | |
| | | public List<SuperHomeRecommendSpecial> list(SuperHomeRecommendSpecialDao.DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | query.skip(daoQuery.start); |
| | | query.limit(daoQuery.count); |
| | | query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "weight"))); |
| | | |
| | | return findList(query); |
| | | } |
| | | |
| | | |
| | | public long count(SuperHomeRecommendSpecialDao.DaoQuery daoQuery) { |
| | | Query query = getQuery(daoQuery); |
| | | return count(query); |
| | | } |
| | | |
| | | public void updateSelective(SuperHomeRecommendSpecial bean) { |
| | |
| | | public static class DaoQuery { |
| | | public String specialId; |
| | | public String detailSystemId; |
| | | public String showName; |
| | | public int start; |
| | | public int count; |
| | | } |
| | |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | |
| | | import java.math.BigInteger; |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | |
| | | return null; |
| | | } |
| | | |
| | | public List<DetailSystemConfig> list(Long systemId, String searchKey) { |
| | | return list("from DetailSystemConfig c where c.systemId=? and c.beizhu like ?", new BigInteger( systemId+""), "%" + searchKey + "%"); |
| | | } |
| | | |
| | | } |
| | |
| | | * 首页广告 |
| | | * |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | @Entity |
| | | public class HomeAd implements Serializable{ |
| | |
| | | private SystemInfo system;// 系统 |
| | | |
| | | |
| | | |
| | | public String getIntroduction() { |
| | | return introduction; |
| | | } |
| | |
| | | private int linkType; |
| | | |
| | | private int orderby; |
| | | |
| | | //专题关键字 |
| | | private String specialDataKey; |
| | | |
| | | public String getSpecialDataKey() { |
| | | return specialDataKey; |
| | | } |
| | | |
| | | public void setSpecialDataKey(String specialDataKey) { |
| | | this.specialDataKey = specialDataKey; |
| | | } |
| | | |
| | | public int getOrderby() { |
| | | return orderby; |
| | |
| | | public void setParams(String params) { |
| | | this.params = params; |
| | | } |
| | | |
| | | |
| | | |
| | | public SystemInfo getSystem() { |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.ManyToOne; |
| | | import javax.persistence.Transient; |
| | | import javax.validation.constraints.Pattern; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.jump.JumpDetail; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | /** |
| | |
| | | @Expose |
| | | private int number;// 显示多少个 |
| | | |
| | | @Expose |
| | | @Transient |
| | | private HomeTypeAd ad; |
| | | |
| | | private SystemInfo system; |
| | | |
| | | private VideoType videoType; //20170914 |
| | | |
| | | //专题关键字 |
| | | private String specialDataKey; |
| | | |
| | | public HomeTypeAd getAd() { |
| | | return ad; |
| | | } |
| | | |
| | | public void setAd(HomeTypeAd ad) { |
| | | this.ad = ad; |
| | | } |
| | | |
| | | public boolean isNeedAd() { |
| | | return needAd; |
| | |
| | | this.needAd = needAd; |
| | | } |
| | | |
| | | private SystemInfo system; |
| | | |
| | | private VideoType videoType; //20170914 |
| | | |
| | | public String getIcon() { |
| | | return icon; |
| | |
| | | public void setSystem(SystemInfo system) { |
| | | this.system = system; |
| | | } |
| | | |
| | | |
| | | public String getSpecialDataKey() { |
| | | return specialDataKey; |
| | | } |
| | | |
| | | public void setSpecialDataKey(String specialDataKey) { |
| | | this.specialDataKey = specialDataKey; |
| | | } |
| | | |
| | | public static class HomeTypeAd { |
| | | @Expose |
| | | private String picture; |
| | | @Expose |
| | | private BigDecimal pictureRate; |
| | | @Expose |
| | | private JumpDetail jumpDetail; |
| | | @Expose |
| | | private String params; |
| | | |
| | | public String getPicture() { |
| | | return picture; |
| | | } |
| | | |
| | | public void setPicture(String picture) { |
| | | this.picture = picture; |
| | | } |
| | | |
| | | public BigDecimal getPictureRate() { |
| | | return pictureRate; |
| | | } |
| | | |
| | | public void setPictureRate(BigDecimal pictureRate) { |
| | | this.pictureRate = pictureRate; |
| | | } |
| | | |
| | | public JumpDetail getJumpDetail() { |
| | | return jumpDetail; |
| | | } |
| | | |
| | | public void setJumpDetail(JumpDetail jumpDetail) { |
| | | this.jumpDetail = jumpDetail; |
| | | } |
| | | |
| | | public String getParams() { |
| | | return params; |
| | | } |
| | | |
| | | public void setParams(String params) { |
| | | this.params = params; |
| | | } |
| | | } |
| | | } |
| | |
| | | @Expose |
| | | @Field |
| | | private String controller; |
| | | @Expose |
| | | private Boolean needLogin; |
| | | |
| | | |
| | | public JumpTypeEnum getType() { |
| | |
| | | public void setController(String controller) { |
| | | this.controller = controller; |
| | | } |
| | | |
| | | public Boolean getNeedLogin() { |
| | | return needLogin; |
| | | } |
| | | |
| | | public void setNeedLogin(Boolean needLogin) { |
| | | this.needLogin = needLogin; |
| | | } |
| | | } |
| | |
| | | //banner的宽高比 |
| | | @NotNull(message = "轮播图的比例不能为空") |
| | | private BigDecimal bannerSizeRate; |
| | | |
| | | //关键词 |
| | | |
| | | private String dataKey; |
| | | //权重 |
| | | private Integer weight; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | public String getDataKey() { |
| | | return dataKey; |
| | | } |
| | | |
| | | public void setDataKey(String dataKey) { |
| | | this.dataKey = dataKey; |
| | | } |
| | | |
| | | public HomeRecommendSpecial() { |
| | | } |
| | | |
| | | public HomeRecommendSpecial(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
New file |
| | |
| | | package com.yeshi.buwan.dto.recommend; |
| | | |
| | | import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial; |
| | | import com.yeshi.buwan.domain.web.DetailSystemSelect; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class HomeRecommendSpecialDTO { |
| | | |
| | | private HomeRecommendSpecial special; |
| | | |
| | | private List<DetailSystemSelect> detailSystemSelectList; |
| | | |
| | | |
| | | public HomeRecommendSpecial getSpecial() { |
| | | return special; |
| | | } |
| | | |
| | | public void setSpecial(HomeRecommendSpecial special) { |
| | | this.special = special; |
| | | } |
| | | |
| | | public List<DetailSystemSelect> getDetailSystemSelectList() { |
| | | return detailSystemSelectList; |
| | | } |
| | | |
| | | public void setDetailSystemSelectList(List<DetailSystemSelect> detailSystemSelectList) { |
| | | this.detailSystemSelectList = detailSystemSelectList; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.buwan.pptv; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.buwan.pptv.entity.PPTVProgram; |
| | | import com.yeshi.buwan.pptv.entity.PPTVSeries; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.yeshi.utils.HttpUtil; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | |
| | | } |
| | | |
| | | public static PPTVSeries getDetail(String seriesCodes) { |
| | | Gson gson = new Gson(); |
| | | Map<String, String> params = new HashMap<>(); |
| | | params.put("seriesCodes", seriesCodes); |
| | | String result = baseRequest(params, "pptv.channel.content.detail"); |
| | | System.out.println(result); |
| | | return null; |
| | | JSONObject resultJSON = JSONObject.fromObject(result); |
| | | JSONArray array = resultJSON.optJSONObject("response").optJSONObject("body").optJSONArray("contentInfos"); |
| | | List<PPTVProgram> programList = new ArrayList<>(); |
| | | PPTVSeries pptvSeries = null; |
| | | for (int i = 0; i < array.size(); i++) { |
| | | JSONObject item = array.optJSONObject(i); |
| | | if (pptvSeries == null) |
| | | pptvSeries = gson.fromJson(item.toString(), PPTVSeries.class); |
| | | |
| | | List<String> keys = new ArrayList<>(); |
| | | for (Iterator<String> its = item.keys(); its.hasNext(); ) { |
| | | String key = its.next(); |
| | | if (!key.contains("series_")) { |
| | | keys.add(key); |
| | | } |
| | | } |
| | | |
| | | for (String key : keys) { |
| | | item.remove(key); |
| | | } |
| | | |
| | | String itemStr = item.toString().replace("series_", ""); |
| | | PPTVProgram program = gson.fromJson(itemStr, PPTVProgram.class); |
| | | programList.add(program); |
| | | } |
| | | pptvSeries.setSeries(programList); |
| | | return pptvSeries; |
| | | } |
| | | |
| | | |
| | |
| | | return configDao.listBySystemIdAndMaxVersion(systemId, version); |
| | | } |
| | | |
| | | public DetailSystemConfig getConfig(int id) { |
| | | return configDao.find(DetailSystemConfig.class, id); |
| | | } |
| | | |
| | | public void saveConfig(DetailSystemConfig config) { |
| | | configDao.save(config); |
| | | } |
| | | |
| | | public List<DetailSystemConfig> listConfig(Long systemId, String key) { |
| | | return configDao.list(systemId, key); |
| | | } |
| | | |
| | | @Cacheable(value = "configCache", key = "'getConfigAsMap-'+#system.id+'-'+#version") |
| | | public Map<String, String> getConfigAsMap(DetailSystem system, int version) { |
| | | Map<String, String> map = new HashMap<String, String>(); |
| | |
| | | import com.yeshi.buwan.domain.web.HotSearchAdmin; |
| | | import com.yeshi.buwan.dto.search.SolrResultDTO; |
| | | import com.yeshi.buwan.dto.search.SolrVideoSearchFilter; |
| | | import com.yeshi.buwan.pptv.PPTVUtil; |
| | | import com.yeshi.buwan.service.inter.video.VideoInfoExtraService; |
| | | import com.yeshi.buwan.service.manager.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.util.*; |
| | |
| | | import com.yeshi.buwan.vo.video.VideoListResultVO; |
| | | import org.hibernate.HibernateException; |
| | | import org.hibernate.Session; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.orm.hibernate4.HibernateCallback; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Service |
| | | public class SearchService { |
| | | private Logger logger= LoggerFactory.getLogger(SearchService.class); |
| | | |
| | | |
| | | @Resource |
| | | private SearchDao searchDao; |
| | | @Resource |
| | |
| | | |
| | | SolrVideoSearchFilter filter = new SolrVideoSearchFilter(); |
| | | filter.setKey(key); |
| | | if (videoType == Constant.SEARCH_RESULT_TYPE_HIGH_DEFINITION) { |
| | | filter.setResourceIds(new String[]{PPTVUtil.RESOURCE_ID + ""}); |
| | | logger.info("高清搜索# key:{}",key); |
| | | } else |
| | | filter.setVideoType(videoType == 0 ? null : videoType); |
| | | filter.setContentType(1); |
| | | |
| | |
| | | import com.yeshi.buwan.dao.recommend.SuperHomeRecommendSpecialDao; |
| | | import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial; |
| | | import com.yeshi.buwan.domain.recommend.SuperHomeRecommendSpecial; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.web.DetailSystemSelect; |
| | | import com.yeshi.buwan.dto.recommend.HomeRecommendSpecialDTO; |
| | | import com.yeshi.buwan.exception.ParamsException; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private SuperHomeRecommendSpecialDao superHomeRecommendSpecialDao; |
| | | |
| | | @Resource |
| | | private SystemService systemService; |
| | | |
| | | |
| | | @Override |
| | | public List<HomeRecommendSpecialDTO> list(String systemId, String detailSystemId, String key, int page, int pageSize) { |
| | | List<HomeRecommendSpecialDTO> dtoList = new ArrayList<>(); |
| | | List<DetailSystem> detailSystemList = systemService.getDetailSystemList(systemId); |
| | | List<HomeRecommendSpecial> list = null; |
| | | if (!StringUtil.isNullOrEmpty(detailSystemId)) { |
| | | list = listSpecialByDetailSystemId(detailSystemId, key, page, pageSize); |
| | | } else { |
| | | list = listSpecialBySystemId(systemId, key, page, pageSize); |
| | | } |
| | | |
| | | for (HomeRecommendSpecial special : list) { |
| | | |
| | | List<DetailSystemSelect> selects = new ArrayList<>(); |
| | | HomeRecommendSpecialDTO dto = new HomeRecommendSpecialDTO(); |
| | | //查询super |
| | | List<SuperHomeRecommendSpecial> superHomeRecommendSpecialList = listSuperSpecialBySpecialId(special.getId()); |
| | | for (DetailSystem detailSystem : detailSystemList) { |
| | | detailSystem.setInfo(null); |
| | | DetailSystemSelect select = new DetailSystemSelect(); |
| | | select.setDetailSystem(detailSystem); |
| | | for (SuperHomeRecommendSpecial s : superHomeRecommendSpecialList) { |
| | | if (s.getDetailSystemId().equalsIgnoreCase(detailSystem.getId())) { |
| | | select.setSelected(true); |
| | | break; |
| | | } |
| | | } |
| | | selects.add(select); |
| | | } |
| | | |
| | | dto.setDetailSystemSelectList(selects); |
| | | dto.setSpecial(special); |
| | | dtoList.add(dto); |
| | | } |
| | | return dtoList; |
| | | } |
| | | |
| | | @Override |
| | | public long count(String systemId, String detailSystemId, String key) { |
| | | if (!StringUtil.isNullOrEmpty(detailSystemId)) { |
| | | return countSpecialByDetailSystemId(detailSystemId, key); |
| | | } else { |
| | | return countSpecialBySystemId(systemId, key); |
| | | } |
| | | } |
| | | |
| | | @Validated |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<HomeRecommendSpecial> listSpecialBySystemId(String systemId) { |
| | | public HomeRecommendSpecial getSpecial(String id) { |
| | | return homeRecommendSpecialDao.get(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<HomeRecommendSpecial> listSpecialBySystemId(String systemId, String key, int page, int pageSize) { |
| | | HomeRecommendSpecialDao.DaoQuery query = new HomeRecommendSpecialDao.DaoQuery(); |
| | | query.systemId = systemId; |
| | | query.count = Integer.MAX_VALUE; |
| | | query.key = key; |
| | | query.start = (page - 1) * pageSize; |
| | | query.count = pageSize; |
| | | return homeRecommendSpecialDao.list(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<HomeRecommendSpecial> listSpecialByDetailSystemId(String detailSystemId) { |
| | | public long countSpecialBySystemId(String systemId, String key) { |
| | | HomeRecommendSpecialDao.DaoQuery query = new HomeRecommendSpecialDao.DaoQuery(); |
| | | query.systemId = systemId; |
| | | query.key = key; |
| | | return homeRecommendSpecialDao.count(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<HomeRecommendSpecial> listSpecialByDetailSystemId(String detailSystemId, String key, int page, int pageSize) { |
| | | SuperHomeRecommendSpecialDao.DaoQuery query = new SuperHomeRecommendSpecialDao.DaoQuery(); |
| | | query.detailSystemId = detailSystemId; |
| | | query.count = Integer.MAX_VALUE; |
| | | query.showName = key; |
| | | query.start = (page - 1) * pageSize; |
| | | query.count = pageSize; |
| | | List<SuperHomeRecommendSpecial> list = superHomeRecommendSpecialDao.list(query); |
| | | List<String> specialIds = new ArrayList<>(); |
| | | for (SuperHomeRecommendSpecial special : list) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public long countSpecialByDetailSystemId(String detailSystemId, String key) { |
| | | SuperHomeRecommendSpecialDao.DaoQuery query = new SuperHomeRecommendSpecialDao.DaoQuery(); |
| | | query.detailSystemId = detailSystemId; |
| | | query.showName = key; |
| | | return superHomeRecommendSpecialDao.count(query); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteSpecial(String specialId) { |
| | | |
| | | List<SuperHomeRecommendSpecial> list = listSuperSpecialBySpecialId(specialId); |
| | |
| | | if (superSpecial.getWeight() == null) { |
| | | superSpecial.setWeight(special.getWeight()); |
| | | } |
| | | |
| | | if (superSpecial.getShowName() == null) { |
| | | superSpecial.setShowName(special.getName()); |
| | | } |
| | | |
| | | if (superSpecial.getCreateTime() == null) |
| | | superSpecial.setCreateTime(new Date()); |
| | | superHomeRecommendSpecialDao.save(superSpecial); |
| | |
| | | public SystemConfig getConfigByKeyCache(String key) { |
| | | return getConfigByKey(key); |
| | | } |
| | | |
| | | @Cacheable(value = "configCache", key = "'system-getConfigValueByKey'+'-'+#key") |
| | | @Override |
| | | public String getConfigValueByKeyCache(String key) { |
| | | SystemConfig config = getConfigByKeyCache(key); |
| | | if (config == null) |
| | | return null; |
| | | return config.getValue(); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial; |
| | | import com.yeshi.buwan.domain.recommend.SuperHomeRecommendSpecial; |
| | | import com.yeshi.buwan.dto.recommend.HomeRecommendSpecialDTO; |
| | | import com.yeshi.buwan.exception.ParamsException; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | public interface HomeRecommendSpecialService { |
| | | |
| | | |
| | | /** |
| | | * 列表 |
| | | * |
| | | * @param systemId |
| | | * @param detailSystemId |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public List<HomeRecommendSpecialDTO> list(String systemId, String detailSystemId, String key, int page, int pageSize); |
| | | |
| | | public long count(String systemId, String detailSystemId, String key); |
| | | |
| | | |
| | | /** |
| | | * 添加专题 |
| | |
| | | public void updateSpecial(HomeRecommendSpecial special) throws Exception; |
| | | |
| | | /** |
| | | * 获取专题 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public HomeRecommendSpecial getSpecial(String id); |
| | | |
| | | /** |
| | | * 根据系统ID检索 |
| | | * |
| | | * @param systemId |
| | | * @return |
| | | */ |
| | | public List<HomeRecommendSpecial> listSpecialBySystemId(String systemId); |
| | | public List<HomeRecommendSpecial> listSpecialBySystemId(String systemId, String key, int page, int pageSize); |
| | | |
| | | |
| | | public long countSpecialBySystemId(String systemId, String key); |
| | | |
| | | /** |
| | | * 根据子系统ID检索 |
| | |
| | | * @param detailSystemId |
| | | * @return |
| | | */ |
| | | public List<HomeRecommendSpecial> listSpecialByDetailSystemId(String detailSystemId); |
| | | public List<HomeRecommendSpecial> listSpecialByDetailSystemId(String detailSystemId, String key, int page, int pageSize); |
| | | |
| | | public long countSpecialByDetailSystemId(String detailSystemId, String key); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | public SystemConfig getConfigByKeyCache(String key); |
| | | |
| | | |
| | | /** |
| | | * 获取值 |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public String getConfigValueByKeyCache(String key); |
| | | } |
| | |
| | | //动漫 |
| | | public final static int VIDEO_TYPE_VIP_CARTOON = 100005; |
| | | |
| | | |
| | | //搜索接口返回的高清片源 |
| | | public final static int SEARCH_RESULT_TYPE_HIGH_DEFINITION = 9999; |
| | | |
| | | public final static Integer[] vipTypes = new Integer[]{ |
| | | VIDEO_TYPE_VIP, VIDEO_TYPE_VIP_MOVIE, VIDEO_TYPE_VIP_TV, VIDEO_TYPE_VIP_SHOW, VIDEO_TYPE_VIP_CARTOON |
| | | }; |
| | |
| | | else |
| | | return false; |
| | | } |
| | | |
| | | public static boolean isGraterThan387(String platform, int version) { |
| | | if ("android".equalsIgnoreCase(platform) && version >= 106) |
| | | return true; |
| | | return false; |
| | | } |
| | | } |
| | |
| | | * @param resourceId |
| | | * @return |
| | | */ |
| | | public static String createUserVideoDetailLog(String device, String loginUid, String detailSystemId, String videoId, String resourceId, String from) { |
| | | return String.format("getUserVideoDetail:%s#%s#%s#%s#%s#", device, loginUid, detailSystemId, videoId, resourceId, from); |
| | | public static String createUserVideoDetailLog(String device,String utdId, String loginUid, String detailSystemId, String videoId, String resourceId, String from) { |
| | | return String.format("getUserVideoDetail:%s#%s#%s#%s#%s#%s#", device,utdId, loginUid, detailSystemId, videoId, resourceId, from); |
| | | } |
| | | |
| | | |
| | |
| | | <property name="params" type="string"></property> |
| | | <property name="linkType" column="linktype" type="int"></property> |
| | | <property name="orderby" column="orderby" type="int"></property> |
| | | <property name="specialDataKey" column="special_data_key" type="string"></property> |
| | | <many-to-one name="tag" column="tagid"></many-to-one> |
| | | <many-to-one name="admin" column="adminid"></many-to-one> |
| | | <many-to-one name="system" column="system" lazy="false"></many-to-one> |
| | |
| | | <column name="videoid" default="1"></column> |
| | | </many-to-one> |
| | | </class> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </hibernate-mapping> |
| | |
| | | <property name="number" column="number" type="int"></property> |
| | | <many-to-one name="admin" column="adminid"></many-to-one> |
| | | <property name="icon" type="string"></property> |
| | | <property name="specialDataKey" type="string" column="special_data_key"></property> |
| | | |
| | | |
| | | <list name="homeVideoList" lazy="false" inverse="true" cascade="delete"> |
| | | <key column="videoid"></key> |
| | | <index column="id"></index> |
| | |
| | | <many-to-one name="system" column="system"> |
| | | </many-to-one> |
| | | </class> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </hibernate-mapping> |
| | |
| | | </appender> |
| | | |
| | | |
| | | <appender name="videoPlayUserAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.filePath}/video/video_play_user.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${log.filePath}/video/video_play_user.%d{yyyy-MM-dd}.log.gz</fileNamePattern> |
| | | <maxHistory>${log.maxHistory}</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>INFO</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | |
| | | <appender name="testAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.filePath}/test/test.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | |
| | | <appender-ref ref="searchAppender"></appender-ref> |
| | | </logger> |
| | | |
| | | <logger name="com.yeshi.buwan.service.imp.SearchService" level="INFO" additivity="true"> |
| | | <appender-ref ref="searchAppender"></appender-ref> |
| | | </logger> |
| | | |
| | | |
| | | <logger name="videoPlay" level="INFO" additivity="true"> |
| | | <appender-ref ref="videoPlayAppender"></appender-ref> |
| | | </logger> |
| | | |
| | | <logger name="videoPlayUser" level="INFO" additivity="true"> |
| | | <appender-ref ref="videoPlayUserAppender"></appender-ref> |
| | | </logger> |
| | | |
| | | |
| | | <logger name="com.yeshi.buwan" level="ERROR" additivity="true"> |
| | | <appender-ref ref="ERROR_FILE"></appender-ref> |
New file |
| | |
| | | <html lang="zh-cn"> |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| | | <meta name="referrer" content="never"> |
| | | <title>添加顶部标签</title> |
| | | <link href="css/bootstrap.min.css" rel="stylesheet"> |
| | | <link href="css/maincontent.css" rel="stylesheet"> |
| | | <link href="css/tablestyle.css" rel="stylesheet"> |
| | | <style> |
| | | .form-group { |
| | | margin-bottom: 30px; |
| | | } |
| | | |
| | | .checkbox input[type=checkbox] { |
| | | top: 6px; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <nav class="navbar navbar-default navbar-fixed-top"> |
| | | </nav> |
| | | <div id="mainbody"> |
| | | <div id="sidebar"> |
| | | <dl> |
| | | </dl> |
| | | </div> |
| | | <div id="neirong"> |
| | | <div class="erjidh"> |
| | | <ol class="breadcrumb"> |
| | | <li> |
| | | <a href="tuijian-home-labels.html">顶部标签</a> |
| | | </li> |
| | | <li class="active">添加内容</li> |
| | | </ol> |
| | | </div> |
| | | <form class="form-horizontal" role="form"> |
| | | <div class="form-group"> |
| | | <label for="input1" class="changdu1 control-label">名称</label> |
| | | <div class="col-sm-7"> |
| | | <input type="text" class="form-control" id="name" placeholder="必须填写"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label for="input2" class="changdu1 control-label">权重</label> |
| | | <div class="col-sm-7"> |
| | | <input type="text" class="form-control" id="weight" placeholder="必须填写"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label for="input2" class="changdu1 control-label">轮播图比例</label> |
| | | <div class="col-sm-7"> |
| | | <input type="text" class="form-control" id="bannerSizeRate" placeholder="必须填写(大比例0.56 小比例 0.4375)"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label for="input2" class="changdu1 control-label">唯一标识</label> |
| | | <div class="col-sm-7"> |
| | | <input type="text" class="form-control" id="dataKey" placeholder="必须填写"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label for="input7" class="changdu1 control-label">媒体</label> |
| | | <div class="col-sm-7 detailsystem"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="button0"> |
| | | <div class="button"> |
| | | <button type="button" class="btn btn-primary save">保存</button> |
| | | </div> |
| | | <div class="button"> |
| | | <input type="reset" class="btn btn-default" value="重置"/> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script> |
| | | <script src="js/bootstrap.min.js"></script> |
| | | <script src="js/nav.js"></script> |
| | | <script src="js/common.js"></script> |
| | | <script src="layer/layer.js"></script> |
| | | <script> |
| | | $(function () { |
| | | |
| | | $.post('api/videoType/getAllVideoType', function (data) { |
| | | if (data.code == 0) { |
| | | var list = data.list; |
| | | for (var i = 0; i < list.length; i++) { |
| | | var vt = list[i]; |
| | | var vid = vt.id; |
| | | $("#classtype").append("<option key='" + vid + "'>" + vt.name + "</option>") |
| | | } |
| | | } |
| | | |
| | | }, 'json') |
| | | |
| | | $.post('api/common/detailsystemlist', function (data) { |
| | | if (data.code == 0) { |
| | | var dsStr = ""; |
| | | data.data.forEach(function (ds) { |
| | | dsStr += "<div class='checkbox '><label>"; |
| | | dsStr += "<input type='checkbox' value=" + ds.id + ">"; |
| | | dsStr += " " + ds.name; |
| | | dsStr += "</label></div>"; |
| | | }); |
| | | $(".detailsystem").html(dsStr); |
| | | } |
| | | }, 'json'); |
| | | |
| | | $(".save").click(function () { |
| | | |
| | | var $detailsystems = $(".detailsystem input[type=checkbox]"); |
| | | var dess = ""; |
| | | for (var i = 0; i < $detailsystems.length; i++) { |
| | | if ($detailsystems.eq(i).is(":checked")) { |
| | | dess += $detailsystems.eq(i).val() + ","; |
| | | } |
| | | } |
| | | if (dess.length > 0) |
| | | dess = dess.substr(0, dess.length - 1); |
| | | |
| | | var index = layer.load(0, { |
| | | 'shade': false |
| | | }); |
| | | $.post('api/homerecommend/addSpecial', { |
| | | 'name': $("#name").val(), |
| | | 'weight': $("#weight").val(), |
| | | 'bannerSizeRate': $("#bannerSizeRate").val(), |
| | | 'dataKey': $("#dataKey").val(), |
| | | 'detailsystemids': dess, |
| | | }, function (data) { |
| | | layer.close(index); |
| | | if (data.code == 0) { |
| | | layer.msg("添加成功"); |
| | | } else { |
| | | layer.msg(data.msg); |
| | | } |
| | | |
| | | doResponse(data, function () { |
| | | |
| | | }); |
| | | }, 'json'); |
| | | |
| | | }); |
| | | |
| | | }); |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
New file |
| | |
| | | <html lang="zh-cn"> |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| | | <meta name="referrer" content="never"> |
| | | <title>编辑栏目</title> |
| | | <link href="css/bootstrap.min.css" rel="stylesheet"> |
| | | <link href="css/maincontent.css" rel="stylesheet"> |
| | | <link href="css/tablestyle.css" rel="stylesheet"> |
| | | <style> |
| | | .form-group { |
| | | margin-bottom: 30px; |
| | | } |
| | | |
| | | .checkbox input[type=checkbox] { |
| | | top: 6px; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <nav class="navbar navbar-default navbar-fixed-top"> |
| | | </nav> |
| | | <div id="mainbody"> |
| | | <div id="sidebar"> |
| | | <dl> |
| | | </dl> |
| | | </div> |
| | | <div id="neirong"> |
| | | <div class="erjidh"> |
| | | <ol class="breadcrumb"> |
| | | <li> |
| | | <a href="tuijian-home-labels.html">顶部标签</a> |
| | | </li> |
| | | <li class="active">修改内容</li> |
| | | </ol> |
| | | </div> |
| | | <form class="form-horizontal" role="form"> |
| | | <div class="form-group"> |
| | | <label class="changdu1 control-label">名称</label> |
| | | <div class="col-sm-7"> |
| | | <input type="text" class="form-control" id="name" placeholder="" v-bind:value="special.name"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="changdu1 control-label">权重</label> |
| | | <div class="col-sm-7"> |
| | | <input type="text" class="form-control" id="weight" placeholder="" v-bind:value="special.weight"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="changdu1 control-label">轮播图比例</label> |
| | | <div class="col-sm-7"> |
| | | <input type="text" class="form-control" id="bannerSizeRate" placeholder="(0-1)" |
| | | v-bind:value="special.bannerSizeRate"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </form> |
| | | <div class="button0"> |
| | | <div class="button"> |
| | | <button type="button" class="btn btn-primary save" v-on:click="updateSpecial">保存</button> |
| | | </div> |
| | | <div class="button"> |
| | | <a href="tuijian-home-labels.html" class="btn btn-default" role="button">取消</a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script> |
| | | <script src="js/bootstrap.min.js"></script> |
| | | <script src="js/nav.js"></script> |
| | | <script src="js/vue.min.js"></script> |
| | | <script src="js/common.js"></script> |
| | | <script src="layer/layer.js"></script> |
| | | <script> |
| | | function getQueryString(name) { |
| | | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); |
| | | var r = window.location.search.substr(1).match(reg); |
| | | if (r != null) return unescape(r[2]); |
| | | return null; |
| | | } |
| | | |
| | | $(function () { |
| | | var app = new Vue({ |
| | | el: "#neirong", |
| | | data: { |
| | | special: {} |
| | | }, |
| | | methods: { |
| | | requestSpecial() { |
| | | var index = layer.load(0, { |
| | | 'shade': false |
| | | }); |
| | | //获取参数 |
| | | var id = getQueryString("id"); |
| | | $.post('api/homerecommend/getSpecial', { |
| | | 'id': id |
| | | }, function (data) { |
| | | layer.close(index); |
| | | if (data.code == 0) { |
| | | app.special = data.data; |
| | | } else { |
| | | layer.msg("数据加载失败"); |
| | | } |
| | | }, 'json'); |
| | | }, |
| | | updateSpecial() { |
| | | $.post('api/homerecommend/updateSpecial', { |
| | | id: app.special.id, |
| | | name: $("#name").val(), |
| | | weight: $("#weight").val(), |
| | | bannerSizeRate: $("#bannerSizeRate").val() |
| | | }, function (data) { |
| | | if (data.code == 0) { |
| | | layer.msg("修改成功"); |
| | | } else { |
| | | layer.msg("数据加载失败"); |
| | | } |
| | | }, 'json'); |
| | | } |
| | | } |
| | | }); |
| | | app.requestSpecial(); |
| | | }); |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
| | |
| | | </topNav> |
| | | <topNav url="tuijian-lanmuneirong.html" name="推荐"> |
| | | <!--二级菜单下面的东西 --> |
| | | |
| | | <secondNav url="tuijian-home-labels.html" name="顶部标签"> |
| | | <!-- 网页链接 --> |
| | | <url>add-tuijian-home-labels.html</url> |
| | | <url>edit-tuijian-home-labels.html</url> |
| | | <url>tuijian-home-labels.html</url> |
| | | </secondNav> |
| | | |
| | | <secondNav url="tuijian-lanmuneirong.html" name="栏目内容"> |
| | | <!-- 网页链接 --> |
| | | <url>add-lmneirong.html</url> |
| | | <url>edit-lmneirong.html</url> |
| | | <url>tuijian-lanmuneirong-videos.html</url> |
| | | <url>tuijian-lanmuneirong.html</url> |
| | | </secondNav> |
| | | <secondNav url="tuijian-banner.html" name="推荐Banner"> |
| | | <!-- 网页链接 --> |
| | |
| | | <![endif]--> |
| | | </head> |
| | | <body> |
| | | <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> |
| | | <div class="container-fluid"> |
| | | <!-- Brand and toggle get grouped for better mobile display --> |
| | | <div class="navbar-header"> |
| | | <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> |
| | | <a class="navbar-brand" href="#"> 视 频 后 台 管 理 系 统 </a> </div> |
| | | <nav class="navbar navbar-default navbar-fixed-top"> |
| | | |
| | | <!-- Collect the nav links, forms, and other content for toggling --> |
| | | <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
| | | <!-- <ul class="nav navbar-nav"> |
| | | <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">布丸视频<span class="caret"></span></a> |
| | | <ul class="dropdown-menu" role="menu"> |
| | | <li><a href="#">布丸视频</a></li> |
| | | <li class="divider"></li> |
| | | <li><a href="#">布丸影视大全</a></li> |
| | | </ul> |
| | | </li> |
| | | </ul>--> |
| | | |
| | | <ul class="nav navbar-nav navbar-left"> |
| | | <li><a href="#">数据</a></li> |
| | | <li><a href="tuijian-lanmuneirong.html">推荐</a></li> |
| | | <li><a href="fenqu.html">分区</a></li> |
| | | <li><a href="faxian.html">发现</a></li> |
| | | <li class="active"><a href="shezhi.html">设置</a></li> |
| | | </ul> |
| | | <ul class="nav navbar-nav navbar-right"> |
| | | <li class="hover"><a href="#">账户</a></li> |
| | | <li><a href="#">退出登录</a></li> |
| | | </ul> |
| | | </div> |
| | | <!-- /.navbar-collapse --> |
| | | </div> |
| | | <!-- /.container-fluid --> |
| | | </nav> |
| | | <div id="mainbody"> |
| | | <div id="sidebar"> |
| | | <dl> |
| | | <!-- <dt> |
| | | <div class="tubiao"><span class="glyphicon glyphicon-pencil"></span></div> |
| | | 数据</dt>--> |
| | | <dd><a href="shezhi.html"> |
| | | <div class="cebiandh">TOP通知栏</div> |
| | | </a></dd> |
| | | <dd><a href="send-message.html"> |
| | | <div class="cebiandh">消息推送</div> |
| | | </a></dd> |
| | | <dd><a href="share.html"> |
| | | <div class="cebiandh">分享内容</div> |
| | | </a></dd> |
| | | <dd><a href="production.html"> |
| | | <div class="cebiandh">产品信息</div> |
| | | </a></dd> |
| | | <dd><a href="systemlist.html"> |
| | | <div class="cebiandh">系统列表</div> |
| | | </a></dd> |
| | | <dd><a href="systemcanshu.html"> |
| | | <div class="cebiandh1">系统参数</div> |
| | | </a></dd> |
| | | </dl> |
| | | </div> |
| | | <div id="neirong"> |
| | | <div class="header"> |
| | | <h4 class="shujutitle">系统参数设置</h4> |
| | | <div class="fenge"></div> |
| | | <div> |
| | | <div class="erjidh search-div" style="padding: 10px;display: flex;"> |
| | | |
| | | <div class="col-lg-2"> |
| | | <select name="select" class="form-control search detailsystem col-lg-2"> |
| | | <option v-for="item in apps" v-bind:value="item.id">{{item.name}}</option> |
| | | </select> |
| | | </div> |
| | | <table class="table canshu"> |
| | | <tbody> |
| | | <tr> |
| | | <td><form class="form-horizontal" role="form"> |
| | | <div class="form-group"> |
| | | <label for="input1" class="changdu3 control-label"></label> |
| | | <div class="col-sm-7"> |
| | | <input type="text" class="form-control" id="input1" placeholder=""> |
| | | |
| | | <div class="form-group search col-lg-2" role="search" style="display: flex;"> |
| | | <input type="text" class="form-control search" id="kw" style="width: 200px;" placeholder="请输入名称"> |
| | | <button type="button" class="btn btn-default search-button" v-on:click="requestData">搜索 |
| | | </button> |
| | | </div> |
| | | |
| | | |
| | | <div class="tianjia col-lg-8" style="text-align: right;display: none;"> |
| | | <a href="add-tuijian-home-labels.html" class="btn btn-primary" role="button">添加配置 +</a> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="zhuti"> |
| | | <div> |
| | | <div v-for="item in configs" style="display: flex;margin-top: 10px;"> |
| | | <label class="col-lg-2" style="text-align: right">{{item.beizhu}}</label> |
| | | <div class="col-lg-6"> |
| | | <input type="text" :value="item.value" class="form-control content" |
| | | v-if="item.value.length<120"/> |
| | | <textarea class="form-control content" rows="5" v-else>{{item.value}}</textarea> |
| | | </div> |
| | | <div class="col-lg-1"> |
| | | <button class="form-control btn-primary" v-on:click="save(item,$event)">保存</button> |
| | | </div> |
| | | </div> |
| | | </form></td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | <div class="button0"> |
| | | <div class="button"> |
| | | <button type="button" name="save" class="btn btn-primary">保存</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <script src="js/bootstrap.min.js"></script> |
| | | <script src="layer/layer.js"></script> |
| | | <script src="js/nav.js"></script> |
| | | <script src="js/vue.min.js"></script> |
| | | <script src="js/common.js"></script> |
| | | <script type="text/javascript"> |
| | | |
| | | $(function(){ |
| | | var htmltemp = $(".canshu").prop("outerHTML"); |
| | | $(".canshu").remove(".canshu"); |
| | | |
| | | $.post("api/config/configList",{},function(data){ |
| | | $(function () { |
| | | var app = new Vue({ |
| | | el: "#neirong", |
| | | data: { |
| | | apps: [], |
| | | configs: [] |
| | | }, |
| | | methods: { |
| | | getDetailSystemList: function () { |
| | | $.post('api/common/detailsystemlist', function (data) { |
| | | if(data.code==0){ |
| | | var configList = data.configList; |
| | | for (var ii=0,mm =1;ii<configList.length;ii++,mm++) { |
| | | if(ii==0){ |
| | | $(".header").after(htmltemp); |
| | | }else{ |
| | | $(".canshu:last").after(htmltemp); |
| | | app.apps = data.data; |
| | | } |
| | | $(".canshu:last").find("label").text(configList[ii].beizhu); |
| | | $(".canshu:last").find("input").attr("key",configList[ii].key); |
| | | $(".canshu:last").find("input").attr("id",configList[ii].key); |
| | | $(".canshu:last").find("input").val(configList[ii].value); |
| | | } |
| | | }, 'json'); |
| | | }, |
| | | requestData: function () { |
| | | $.post("api/config/configList", { |
| | | detailSystemId: $(".detailsystem").val(), |
| | | key: $("#kw").val() |
| | | }, function (data) { |
| | | if (data.code == 0) { |
| | | app.configs = data.configList; |
| | | }else{ |
| | | layer.msg("获取信息失败!"); |
| | | } |
| | | },"json"); |
| | | |
| | | $("button[name='save']").bind("click",function(){ |
| | | var vals ={}; |
| | | $(".canshu").each(function(){ |
| | | var key = $(this).find("input").attr("key"); |
| | | var values = $(this).find("input").val(); |
| | | vals[key]= values; |
| | | }); |
| | | $.post("api/config/updateConfig",{"vals":JSON.stringify(vals)},function(data){ |
| | | if(data == "yes") { |
| | | }, |
| | | save: function (config, e) { |
| | | $.post("api/config/updateConfig", { |
| | | id: config.id, |
| | | value: $(e.target).parent().parent().find(".content").val() |
| | | }, function (data) { |
| | | if (data.code == 0) { |
| | | layer.alert('保存成功!', { |
| | | icon: 1, |
| | | skin: 'layer-ext-seaing' |
| | | }) |
| | | }else{ |
| | | layer.alert('保存失败!', { |
| | | layer.alert(data.msg, { |
| | | icon: 2, |
| | | skin: 'layer-ext-seaing' |
| | | }) |
| | | } |
| | | },"text"); |
| | | }, "json"); |
| | | } |
| | | } |
| | | }); |
| | | app.getDetailSystemList(); |
| | | setTimeout(function () { |
| | | app.requestData(); |
| | | }, 2000); |
| | | |
| | | |
| | | // $("button[name='save']").bind("click", function () { |
| | | // var vals = {}; |
| | | // $(".canshu").each(function () { |
| | | // var key = $(this).find("input").attr("key"); |
| | | // var values = $(this).find("input").val(); |
| | | // vals[key] = values; |
| | | // }); |
| | | // $.post("api/config/updateConfig", {"vals": JSON.stringify(vals)}, function (data) { |
| | | // if (data == "yes") { |
| | | // layer.alert('保存成功!', { |
| | | // icon: 1, |
| | | // skin: 'layer-ext-seaing' |
| | | // }) |
| | | // } else { |
| | | // layer.alert('保存失败!', { |
| | | // icon: 2, |
| | | // skin: 'layer-ext-seaing' |
| | | // }) |
| | | // } |
| | | // }, "text"); |
| | | // }); |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | </script> |
New file |
| | |
| | | <html lang="zh-cn"> |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| | | <meta name="referrer" content="never"> |
| | | <title>推荐-栏目内容</title> |
| | | <link href="css/bootstrap.min.css" rel="stylesheet"> |
| | | <link href="css/maincontent.css" rel="stylesheet"> |
| | | <style> |
| | | .search { |
| | | display: inline; |
| | | width: auto; |
| | | } |
| | | </style> |
| | | |
| | | </head> |
| | | |
| | | <body> |
| | | <nav class="navbar navbar-default navbar-fixed-top"> |
| | | |
| | | </nav> |
| | | <div id="mainbody"> |
| | | <div id="sidebar"> |
| | | |
| | | </div> |
| | | <div id="neirong"> |
| | | <div class="erjidh search-div" style="padding: 10px;"> |
| | | |
| | | <select name="select" class="form-control search select-detailsystem"> |
| | | |
| | | </select> |
| | | |
| | | <div class="form-group search" role="search"> |
| | | <input type="text" class="form-control search" id="kw" style="width: 200px;" placeholder="搜索"> |
| | | </div> |
| | | <button type="button" class="btn btn-default search-button">搜索</button> |
| | | |
| | | <div class="tianjia" class="search"> |
| | | <a href="add-tuijian-home-labels.html" class="btn btn-primary" role="button">添加标签 +</a> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="zhuti"> |
| | | <div class="zhutisousuo"> |
| | | <table class="table"> |
| | | <thead> |
| | | <th width="5%">选择</th> |
| | | <th width="10%">编号</th> |
| | | <th width="9%">标签名称</th> |
| | | <th width="20%">APP名称</th> |
| | | <th width="8%">轮播图高宽比</th> |
| | | <th width="8%">专题关键词</th> |
| | | <th width="10%">排序值</th> |
| | | <th width="12%">创建时间</th> |
| | | <th width="12%">更新时间</th> |
| | | <th width="5%">删除</th> |
| | | <th width="5%">编辑</th> |
| | | </thead> |
| | | |
| | | <tbody> |
| | | <tr v-for="(item,index) in list"> |
| | | <td> |
| | | <div class="xuanze"> |
| | | <label> |
| | | <input type="checkbox" class="check-item" v-bind:keys="item.special.id" |
| | | value="#"> |
| | | </label> |
| | | </div> |
| | | </td> |
| | | <td> |
| | | <div class="bianhao">{{item.special.id}}</div> |
| | | </td> |
| | | <td> |
| | | <div class="bianhao name"> |
| | | <a href="#">{{item.special.name}}</a> |
| | | </div> |
| | | </td> |
| | | |
| | | <td class="apps"> |
| | | <div class="appname" v-for="ds in item.detailSystemSelectList"> |
| | | <div class="checkbox"> |
| | | <label> |
| | | <input type="checkbox" value="#" v-bind:checked="ds.selected" |
| | | v-on:click="changeSuper(item.special.id,ds.detailSystem.id,$event)"> |
| | | {{ds.detailSystem.appName}}</label> |
| | | </div> |
| | | </div> |
| | | </td> |
| | | <td style="text-align:center;line-height:105px;">{{item.special.bannerSizeRate}}</td> |
| | | <td style="text-align:center;line-height:105px;">{{item.special.dataKey}}</td> |
| | | <td style="text-align:center;line-height:105px;">{{item.special.weight}}</td> |
| | | <td style="text-align:center;line-height:105px;" class="">{{item.special.createTime}}</td> |
| | | <td style="text-align:center;line-height:105px;" class="">{{item.special.updateTime}}</td> |
| | | <td> |
| | | <div class="anniu"><img src="image/dustbin.png" class="delete" |
| | | v-on:click="deleteSpecial(item.special.id,index)"> |
| | | </div> |
| | | </td> |
| | | <td> |
| | | <div class="anniu"> |
| | | <a v-bind:keys="item.special.id" href="javascript:void(0)" class="edit" |
| | | v-on:click="edit(item.special.id)"><img |
| | | src="image/bianji.png"></a> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | |
| | | </table> |
| | | </div> |
| | | </div> |
| | | <div class="bottom"> |
| | | <div class="qx"> |
| | | <div class="checkbox"> |
| | | <label> |
| | | <input type="checkbox" class="check-all" value="#"> |
| | | 全选</label> |
| | | </div> |
| | | </div> |
| | | <button class="btn btn-warning pl-del" type="button">批量删除</button> |
| | | <div class="page"> |
| | | <ul class="pagination"> |
| | | <li class="disabled pre"> |
| | | <a href="#">«</a> |
| | | </li> |
| | | <li class="active"> |
| | | <a href="#">1</a> |
| | | </li> |
| | | <li> |
| | | <a href="#">2</a> |
| | | </li> |
| | | <li> |
| | | <a href="#" class="next">»</a> |
| | | </li> |
| | | </ul> |
| | | <div class="form-group"> |
| | | <div class="tzan"> |
| | | <button type="button" class="btn btn-primary">跳转</button> |
| | | </div> |
| | | <div class="tz"> |
| | | <input class="form-control" type="text" placeholder="页数"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script> |
| | | <script src="js/bootstrap.min.js"></script> |
| | | <script src="js/page.js"></script> |
| | | <script src="js/nav.js"></script> |
| | | <script src="js/common.js"></script> |
| | | <script src="js/vue.min.js"></script> |
| | | <script src="layer/layer.js"></script> |
| | | <script> |
| | | $(function () { |
| | | |
| | | var app = new Vue({ |
| | | el: "#neirong", |
| | | data: { |
| | | list: [], |
| | | }, |
| | | methods: { |
| | | specialList: function (page) { |
| | | var index = layer.load(1, { |
| | | shade: false |
| | | }) |
| | | $.post('api/homerecommend/getSpcialList', { |
| | | "page": page, |
| | | "detailSystemId": $(".search-div .select-detailsystem").val(), |
| | | "key": $("#kw").val() |
| | | }, function (data) { |
| | | layer.close(index); |
| | | if (data.code != 0) |
| | | return; |
| | | app.list = data.data.data; |
| | | |
| | | fillPage(data.data.pageEntity, function (pageIndex) { |
| | | app.specialList(pageIndex); |
| | | }); |
| | | }, 'json'); |
| | | }, |
| | | changeSuper: function (id, detailSystemId, e) { |
| | | if ($(e.target).is(":checked")) { |
| | | $.post('api/homerecommend/addSuperSpecial', { |
| | | "id": id, |
| | | "detailSystemId": detailSystemId |
| | | }, function (data) { |
| | | if (data.code != 0) { |
| | | layer.msg(data.msg); |
| | | } else { |
| | | layer.msg("操作成功"); |
| | | } |
| | | }, 'json'); |
| | | } else { |
| | | $.post('api/homerecommend/deleteSuperSpecial', { |
| | | "id": id, |
| | | "detailSystemId": detailSystemId |
| | | }, function (data) { |
| | | if (data.code != 0) { |
| | | layer.msg(data.msg); |
| | | } else { |
| | | layer.msg("操作成功"); |
| | | } |
| | | }, 'json'); |
| | | } |
| | | }, |
| | | deleteSpecial: function (id, index) { |
| | | var indexDialog = layer.confirm('是否删除该条目?', { |
| | | btn: ['是', '否'] //按钮 |
| | | }, function () { |
| | | $.post('api/homerecommend/deleteSpcial', { |
| | | 'ids': id |
| | | }, function (data) { |
| | | layer.close(indexDialog); |
| | | if (data.code == 0) { |
| | | if (index > -1) { |
| | | app.list.splice(index, 1); |
| | | } else { |
| | | var ids = id.split(","); |
| | | console.log(ids); |
| | | for (var i = 0; i < ids.length; i++) { |
| | | for (var j = 0; j < app.list.length; j++) { |
| | | console.log(app.list[j].special.id + ":" + ids[i]) |
| | | if (app.list[j].special.id == ids[i]) { |
| | | app.list.splice(j, 1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | layer.msg("删除成功"); |
| | | } else { |
| | | layer.msg(data.msg); |
| | | } |
| | | }, 'json'); |
| | | }, function () { |
| | | |
| | | }); |
| | | }, |
| | | edit: function (id) { |
| | | window.location.href = "edit-tuijian-home-labels.html?id=" + id; |
| | | } |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | $(".search-div .search-button").click(function () { |
| | | app.specialList(1); |
| | | }); |
| | | |
| | | app.specialList(1); |
| | | |
| | | function getCheckedItems() { |
| | | var ids = ""; |
| | | for (var i = 0; i < $(".check-item").length; i++) { |
| | | if ($(".check-item").eq(i).is(':checked')) { |
| | | ids += $(".check-item").eq(i).attr("keys") + ","; |
| | | } |
| | | } |
| | | if (ids.length > 0) |
| | | ids = ids.substr(0, ids.length - 1); |
| | | return ids; |
| | | } |
| | | |
| | | $(".pl-del").click(function () { |
| | | var ids = getCheckedItems(); |
| | | if (ids.length < 1) { |
| | | layer.msg("请选择栏目"); |
| | | return; |
| | | } |
| | | |
| | | app.deleteSpecial(ids, -1); |
| | | |
| | | }); |
| | | |
| | | }); |
| | | </script> |
| | | |
| | | </body> |
| | | |
| | | </html> |
| | |
| | | |
| | | @Test |
| | | public void refound() { |
| | | String orderNo = "buwan_vip_80"; |
| | | String orderNo = "buwan_vip_107"; |
| | | try { |
| | | AlipayH5PayUtil.refund(getAppInfo(), orderNo, null, new BigDecimal("14.8"), orderNo+"_1"); |
| | | AlipayH5PayUtil.refund(getAppInfo(), orderNo, null, new BigDecimal("15"), orderNo+"_1"); |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | package com.hxh.spring.test; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.buwan.dao.system.DetailSystemConfigDao; |
| | | import com.yeshi.buwan.dao.system.SystemConfigDao; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.jump.JumpDetail; |
| | | import com.yeshi.buwan.domain.jump.JumpTypeEnum; |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.domain.system.SystemConfig; |
| | | import com.yeshi.buwan.job.AdJob; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.service.inter.system.SystemConfigService; |
| | | import org.json.JSONObject; |
| | | import org.junit.Test; |
| | |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.util.Date; |
| | | |
| | | @RunWith(SpringJUnit4ClassRunner.class) |
| | |
| | | |
| | | @Resource |
| | | private SystemConfigDao systemConfigDao; |
| | | @Resource |
| | | private DetailSystemConfigDao detailSystemConfigDao; |
| | | |
| | | |
| | | @Test |
| | |
| | | systemConfig.setCreateTime(new Date()); |
| | | systemConfig.setId(SystemConfig.createId(systemConfig.getKey())); |
| | | systemConfigDao.save(systemConfig); |
| | | |
| | | systemConfig = new SystemConfig(); |
| | | systemConfig.setBeizhu(""); |
| | | systemConfig.setKey("default_portrait"); |
| | | systemConfig.setName("默认头像"); |
| | | systemConfig.setValue("https://buwan-1255749512.cos.ap-guangzhou.myqcloud.com/resource/ic_portrait_default.png"); |
| | | systemConfig.setCreateTime(new Date()); |
| | | systemConfig.setId(SystemConfig.createId(systemConfig.getKey())); |
| | | systemConfigDao.save(systemConfig); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void addConfig() { |
| | | |
| | | DetailSystemConfig config = new DetailSystemConfig(); |
| | | config.setKey("web_speed_up_host"); |
| | | config.setValue("vip.ysdq.yeshitv.com"); |
| | | config.setBeizhu("网页加速域名"); |
| | | config.setSystemId(new BigInteger(44 + "")); |
| | | config.setMinVersion(106); |
| | | config.setCreatetime(System.currentTimeMillis() + ""); |
| | | detailSystemConfigDao.save(config); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.util.Scanner; |
| | | import java.util.*; |
| | | |
| | | public class LogTest { |
| | | |
| | |
| | | public void testLog() throws FileNotFoundException { |
| | | int count = 0; |
| | | String path = ""; |
| | | Scanner scanner = new Scanner(new FileInputStream("C:\\Users\\Administrator\\Desktop\\日志\\布丸播放\\video_play.2021-03-05.log")); |
| | | Scanner scanner = new Scanner(new FileInputStream("C:\\Users\\Administrator\\Desktop\\日志\\布丸播放\\video_play.2021-03-12.log")); |
| | | while (scanner.hasNextLine()) { |
| | | String text = scanner.nextLine(); |
| | | if (text != null && text.contains("getVideoDetail:")) { |
| | | if (text != null && text.contains("getUserVideoDetail:")) { |
| | | String content = text.split("getUserVideoDetail:")[1]; |
| | | content = content.replace("##", "# #"); |
| | | String[] sts = content.split("#"); |
| | | // device,utdId, loginUid, detailSystemId, videoId, resourceId, from |
| | | resource(sts[4]); |
| | | video(sts[3]); |
| | | |
| | | count++; |
| | | } |
| | | } |
| | | scanner.close(); |
| | | System.out.println(count); |
| | | printMap(resourceMap); |
| | | printMap(videoMap); |
| | | } |
| | | |
| | | Map<String, Integer> resourceMap = new HashMap<>(); |
| | | |
| | | |
| | | private void resource(String resourceId) { |
| | | Integer r = resourceMap.get(resourceId); |
| | | if (r == null) { |
| | | resourceMap.put(resourceId, 0); |
| | | } |
| | | resourceMap.put(resourceId, resourceMap.get(resourceId) + 1); |
| | | } |
| | | |
| | | Map<String, Integer> videoMap = new HashMap<>(); |
| | | |
| | | private void video(String videoId) { |
| | | Integer r = videoMap.get(videoId); |
| | | if (r == null) { |
| | | videoMap.put(videoId, 0); |
| | | } |
| | | videoMap.put(videoId, videoMap.get(videoId) + 1); |
| | | } |
| | | |
| | | private void printMap(Map<String, Integer> map) { |
| | | //list排序 |
| | | TreeMap<Integer, Set<String>> ordersMap = new TreeMap<>(Comparator.reverseOrder()); |
| | | for (Iterator<String> its = map.keySet().iterator(); its.hasNext(); ) { |
| | | String key = its.next(); |
| | | Integer value = map.get(key); |
| | | if (ordersMap.get(value) == null) { |
| | | ordersMap.put(value, new HashSet<>()); |
| | | } |
| | | ordersMap.get(value).add(key); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | int p = 0; |
| | | for (Iterator<Integer> its = ordersMap.keySet().iterator(); its.hasNext(); ) { |
| | | Integer key = its.next(); |
| | | System.out.println(key + ":" + ordersMap.get(key)); |
| | | p++; |
| | | if (p > 100) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.yeshi.buwan.pptv.entity.PPTVSeries; |
| | | import com.yeshi.buwan.service.inter.LoginUserService; |
| | | import com.yeshi.buwan.service.inter.juhe.PPTVService; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.log.LoggerUtil; |
| | | import jxl.Sheet; |
| | | import jxl.Workbook; |
| | | import jxl.write.Label; |
| | | import jxl.write.WritableCell; |
| | | import jxl.write.WritableSheet; |
| | | import jxl.write.WritableWorkbook; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | |
| | | import org.yeshi.utils.HtmlToolUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.util.*; |
| | | |
| | | |
| | | @RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试 |
| | |
| | | @Test |
| | | public void saveAll() { |
| | | List<PPTVSeries> list = PPTVApiUtil.getTotalList(); |
| | | pptvService.save(list); |
| | | // pptvService.save(list); |
| | | } |
| | | |
| | | @Test |
| | |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void getDetail() { |
| | | PPTVSeries pptvSeries = pptvService.getSeriesDetail("201161"); |
| | | System.out.println(pptvSeries); |
| | | } |
| | | |
| | | @Test |
| | | public void test() { |
| | |
| | | } |
| | | } |
| | | |
| | | private List<String[]> getPPTVVideos(File f, int sheetNum) { |
| | | List<String[]> videoList = new ArrayList<>(); |
| | | try { |
| | | jxl.Workbook rwb = Workbook.getWorkbook(new FileInputStream(f)); |
| | | Sheet sheet = rwb.getSheet(sheetNum); |
| | | for (int c = 1; c < sheet.getRows(); c++) { |
| | | String infoId = sheet.getCell(0, c).getContents().trim(); |
| | | String name = sheet.getCell(2, c).getContents().trim(); |
| | | String del = sheet.getCell(21, c).getContents().trim(); |
| | | if (!StringUtil.isNullOrEmpty(infoId) && StringUtil.isNullOrEmpty(del)) { |
| | | videoList.add(new String[]{infoId, name, del}); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return videoList; |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void checkPPTVVideos() { |
| | | List<String[]> list1 = getPPTVVideos(new File("C:\\Users\\Administrator\\Desktop\\全量.xls"), 0); |
| | | List<String[]> list2 = getPPTVVideos(new File("C:\\Users\\Administrator\\Desktop\\全量.xls"), 1); |
| | | Map<String, String[]> map = new TreeMap<>(); |
| | | for (String[] sts : list1) { |
| | | map.put(sts[0], sts); |
| | | } |
| | | |
| | | for (String[] sts : list2) { |
| | | map.put(sts[0], sts); |
| | | } |
| | | |
| | | List<PPTVSeries> list = pptvSeriesDao.list(0, 10000); |
| | | Set<String> infoIds = new HashSet<>(); |
| | | for (PPTVSeries s : list) { |
| | | infoIds.add(s.getInfoID()); |
| | | } |
| | | |
| | | for (String infoId : infoIds) { |
| | | map.remove(infoId); |
| | | } |
| | | |
| | | try { |
| | | save(map); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | System.out.println(map); |
| | | } |
| | | |
| | | private void save(Map<String, String[]> data) throws Exception { |
| | | WritableWorkbook wwb = Workbook.createWorkbook(new File("C:\\Users\\Administrator\\Desktop\\布丸输出片单_缺失.xls")); |
| | | WritableSheet sheet = wwb.createSheet("缺失", 0); |
| | | sheet.addCell((WritableCell) new Label(0, 0, "百科ID")); |
| | | sheet.addCell((WritableCell) new Label(1, 0, "名称")); |
| | | int row = 1; |
| | | for (Iterator<String> its = data.keySet().iterator(); its.hasNext(); ) { |
| | | String key = its.next(); |
| | | sheet.addCell((WritableCell) new Label(0, row, key)); |
| | | sheet.addCell((WritableCell) new Label(1, row, data.get(key)[1])); |
| | | row++; |
| | | } |
| | | wwb.write(); |
| | | wwb.close(); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void logs() { |
| | | LoggerUtil.getVIPLogger().info("123123"); |
| | | // LoggerUtil.getVIPLogger().info("123123"); |
| | | |
| | | Map<String, String[]> data = new TreeMap<>(); |
| | | data.put("4234234", new String[]{"4234234", "测试"}); |
| | | try { |
| | | save(data); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void getDetail() { |
| | | PPTVSeries series = PPTVApiUtil.getDetail("32385373"); |
| | | pptvService.save(series); |
| | | System.out.println(series); |
| | | } |
| | | |
| | | |
| | |
| | | @Test |
| | | public void addVIPPrice() { |
| | | VIPPrice price = new VIPPrice(); |
| | | // price.setActualPrice(new BigDecimal("8.8")); |
| | | price.setActualPrice(new BigDecimal("14.8")); |
| | | price.setActualPrice(new BigDecimal("8.8")); |
| | | price.setPrice(new BigDecimal("14.8")); |
| | | price.setType(VIPPriceType.month); |
| | | price.setPptvGoodsNo("DA7559531560894"); |
| | |
| | | } |
| | | |
| | | price = new VIPPrice(); |
| | | // price.setActualPrice(new BigDecimal("22.8")); |
| | | price.setActualPrice(new BigDecimal("37.8")); |
| | | price.setActualPrice(new BigDecimal("22.8")); |
| | | price.setPrice(new BigDecimal("37.8")); |
| | | price.setType(VIPPriceType.season); |
| | | price.setPptvGoodsNo("DA7559574625089"); |
| | |
| | | |
| | | |
| | | price = new VIPPrice(); |
| | | // price.setActualPrice(new BigDecimal("42")); |
| | | price.setActualPrice(new BigDecimal("68.8")); |
| | | price.setActualPrice(new BigDecimal("42")); |
| | | price.setPrice(new BigDecimal("68.8")); |
| | | price.setType(VIPPriceType.halfYear); |
| | | price.setPptvGoodsNo("DA6989580247516"); |
| | |
| | | |
| | | |
| | | price = new VIPPrice(); |
| | | // price.setActualPrice(new BigDecimal("77.8")); |
| | | price.setActualPrice(new BigDecimal("128.8")); |
| | | price.setActualPrice(new BigDecimal("77.8")); |
| | | price.setPrice(new BigDecimal("128.8")); |
| | | price.setType(VIPPriceType.year); |
| | | price.setPptvGoodsNo("DA8129574268091"); |