删除冗余代码,初步优化首页的推荐专题,3.8.7之后在我的里面添加VIP分类
21个文件已删除
9 文件已重命名
135个文件已修改
14个文件已添加
| | |
| | | <!-- Spring AOP --> |
| | | <!-- https://mvnrepository.com/artifact/aspectj/aspectjrt --> |
| | | <dependency> |
| | | <groupId>aspectj</groupId> |
| | | <groupId>org.aspectj</groupId> |
| | | <artifactId>aspectjrt</artifactId> |
| | | <version>1.5.3</version> |
| | | <version>1.8.0</version> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/aspectj/aspectjweaver --> |
| | | <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver --> |
| | | <dependency> |
| | | <groupId>aspectj</groupId> |
| | | <groupId>org.aspectj</groupId> |
| | | <artifactId>aspectjweaver</artifactId> |
| | | <version>1.5.4</version> |
| | | <version>1.8.0</version> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/cglib/cglib-nodep --> |
New file |
| | |
| | | package com.yeshi.buwan.aspect; |
| | | |
| | | import com.beust.jcommander.internal.Lists; |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.buwan.exception.ParamsException; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Before; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; |
| | | import org.hibernate.validator.resourceloading.PlatformResourceBundleLocator; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.validation.ConstraintViolation; |
| | | import javax.validation.Validation; |
| | | import javax.validation.Validator; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 参数检查AOP |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | public class ParamsCheckAspect { |
| | | private static Validator validator; |
| | | |
| | | static { |
| | | validator = Validation.byDefaultProvider().configure() |
| | | .messageInterpolator(new ResourceBundleMessageInterpolator( |
| | | new PlatformResourceBundleLocator("validationMessages"))) //手动指定校验提示资源(默认在resource目录下ValidationMessages.properties) |
| | | .buildValidatorFactory().getValidator(); |
| | | } |
| | | |
| | | @Pointcut("@annotation(org.springframework.validation.annotation.Validated))") |
| | | public void validateMethod() { |
| | | } |
| | | |
| | | @Before("validateMethod()") |
| | | public void before(JoinPoint joinPoint) throws ParamsException { |
| | | Object[] args = joinPoint.getArgs(); |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | // 执行方法参数的校验 |
| | | Set<ConstraintViolation<Object>> constraintViolations = validator.forExecutables().validateParameters(joinPoint.getThis(), signature.getMethod(), args); |
| | | List<String> messages = Lists.newArrayList(); |
| | | for (ConstraintViolation<Object> error : constraintViolations) { |
| | | messages.add(error.getMessage()); |
| | | } |
| | | if (!messages.isEmpty()) { |
| | | throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, new Gson().toJson(messages.get(0))); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.buwan.aspect; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | | import com.yeshi.buwan.util.Utils; |
| | |
| | | package com.yeshi.buwan.controller; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.vip.VIPOrderRecord; |
| | | import com.yeshi.buwan.exception.PPTVException; |
| | | import com.yeshi.buwan.exception.vip.VIPException; |
| | | import com.yeshi.buwan.funtv.FunTVUtil; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.service.inter.vip.VIPService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | @RequestMapping("test") |
| | | public class TestController { |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | |
| | | @Resource |
| | | private FunTVUtil funTVUtil; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.HomeNotice; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.recommend.CategoryRecommendVideo; |
| | | import com.yeshi.buwan.domain.recommend.SuperCategoryRecommendVideo; |
| | | import com.yeshi.buwan.service.imp.recommend.CategoryRecommendVideoService; |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.web.CategoryRecommendVideoAdmin; |
| | | import com.yeshi.buwan.service.imp.ClassService; |
| | | import com.yeshi.buwan.service.imp.HomeTypeService; |
| | | import com.yeshi.buwan.service.imp.HotVideoTypeService; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.service.imp.recommend.CategoryRecommendVideoService; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.SystemUtil; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.ad.CommonAd; |
| | | import com.yeshi.buwan.domain.ad.CommonAdPosition; |
| | | import com.yeshi.buwan.domain.ad.CommonAdPositionAd; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.SuperHomeAd; |
| | | import com.yeshi.buwan.service.imp.HomeAdService; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.AdminInfo; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.HomeNotice; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.SuperHomeType; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoIntersection; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.AdminInfo; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.HomeNotice; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.HotSearch; |
| | | import com.yeshi.buwan.domain.SuperHotSearch; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoIntersection; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HotStar; |
| | | import com.yeshi.buwan.domain.SuperHotStar; |
| | | import com.yeshi.buwan.service.imp.StarService; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.RecommendAd; |
| | | import com.yeshi.buwan.domain.SuperRecommendAd; |
| | | import com.yeshi.buwan.service.imp.AdService; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | | import com.yeshi.buwan.domain.special.SuperSpecial; |
| | | import com.yeshi.buwan.service.imp.SpecialService; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.AdminInfo; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.HomeNotice; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.SuperUserBanner; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.UserBanner; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoIntersection; |
| | |
| | | import com.yeshi.buwan.domain.HomeNotice; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.VideoDetailInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoIntersection; |
| | |
| | | import com.yeshi.buwan.service.imp.HomeNoticeService; |
| | | import com.yeshi.buwan.service.imp.HomeTypeService; |
| | | import com.yeshi.buwan.service.imp.IntersectionService; |
| | | import com.yeshi.buwan.service.imp.OtherService; |
| | | import com.yeshi.buwan.service.imp.VideoManager; |
| | | import com.yeshi.buwan.service.imp.VideoService; |
| | | import com.yeshi.buwan.service.imp.WeiXinService; |
| | |
| | | import com.yeshi.buwan.domain.HomeNotice; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoIntersection; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | |
| | | } |
| | | String type = req.getParameter("type"); |
| | | if (type.equalsIgnoreCase("getResource")) {// 获取来源列表 |
| | | out.print(videoResourceService.resourceListToJson(videoResourceService.getResourceList(), null)); |
| | | out.print(videoResourceService.resourceListToJson(videoResourceService.getResourceList())); |
| | | } else if (type.equalsIgnoreCase("getNextVideoTypeList")) {// 获取下级分类 |
| | | String id = req.getParameter("id"); |
| | | List<VideoType> list = classService.getFirstTypeList(id); |
| | |
| | | package com.yeshi.buwan.controller.admin.api; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.job.AdJob; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | | import net.sf.json.JSONObject; |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.CategoryContry; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.service.imp.VideoService; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.yeshi.buwan.domain.Config; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/new/api/config") |
| | | public class ConfigController { |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | |
| | | @Resource |
| | | private EHCacheManager ehCacheManager; |
| | |
| | | @RequestMapping("configList") |
| | | public void configList(PrintWriter out) { |
| | | |
| | | List<Config> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion()); |
| | | List<DetailSystemConfig> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion()); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("code", "0"); |
| | | JSONArray listJson = new JSONArray(list); |
| | |
| | | |
| | | @RequestMapping(value = "updateConfig", method = RequestMethod.POST) |
| | | public void updateConfig(String vals, PrintWriter out) { |
| | | List<Config> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion()); |
| | | List<DetailSystemConfig> list = configService.getConfig(SystemUtil.getDetailSystemId(), SystemUtil.getDefaultVersion()); |
| | | |
| | | System.out.println("vals----" + vals); |
| | | JSONObject json = new JSONObject(vals); |
| | | for (Config cf : list) { |
| | | for (DetailSystemConfig cf : list) { |
| | | String key = cf.getKey(); |
| | | cf.setValue(json.getString(key)); |
| | | // configService.updateConfig(cf); |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoBanQuan; |
| | | import com.yeshi.buwan.domain.VideoBanQuanVideo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.SuperHomeAd; |
| | | import com.yeshi.buwan.domain.SuperHomeType; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | | import com.yeshi.buwan.domain.web.DetailSystemSelect; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeNotice; |
| | | import com.yeshi.buwan.domain.SuperHomeNotice; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.web.HomeNoticeAdmin; |
| | | import com.yeshi.buwan.service.imp.HomeNoticeService; |
| | | import com.yeshi.buwan.util.Constant; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.SuperHomeType; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HotSearch; |
| | | import com.yeshi.buwan.domain.SuperHotSearch; |
| | | import com.yeshi.buwan.domain.web.HotSearchAdmin; |
| | |
| | | package com.yeshi.buwan.controller.admin.api; |
| | | |
| | | import java.io.PrintWriter; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import com.yeshi.buwan.util.SystemUtil; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HotStar; |
| | | import com.yeshi.buwan.domain.SuperHotStar; |
| | | import com.yeshi.buwan.domain.web.HotStarAdmin; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.ShareContent; |
| | | import com.yeshi.buwan.service.imp.ShareService; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | |
| | | package com.yeshi.buwan.controller.admin.api; |
| | | |
| | | import java.io.PrintWriter; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import com.yeshi.buwan.util.SystemUtil; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | | import com.yeshi.buwan.domain.special.SpecialVideo; |
| | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.AdminInfo; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.web.tag.PageEntity; |
| | | |
| | | @Controller |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.SuperVideoType; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | | import com.yeshi.buwan.service.imp.ClassService; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.util.SystemUtil; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.AdminInfo; |
| | | import com.yeshi.buwan.service.imp.AdminUserService; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | |
| | |
| | | public class LoginController { |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | @Resource |
| | | private AdminUserService adminUserService; |
| | | |
| | |
| | | package com.yeshi.buwan.controller.api; |
| | | |
| | | import com.yeshi.buwan.domain.video.VideoWatchHistory; |
| | | import com.yeshi.buwan.pptv.entity.PPTVProgram; |
| | | import com.yeshi.buwan.pptv.entity.PPTVSeriesProgramMap; |
| | | import com.yeshi.buwan.pptv.entity.VideoPPTVMap; |
| | | import com.yeshi.buwan.service.inter.juhe.PPTVService; |
| | | import com.yeshi.buwan.service.inter.push.PushDeviceTokenService; |
| | | import com.yeshi.buwan.service.inter.video.VideoWatchHistoryService; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | Logger logger = LoggerFactory.getLogger(VideoPlayController.class); |
| | | |
| | | @Resource |
| | | private PushDeviceTokenService pushDeviceTokenService; |
| | | private PPTVService pptvService; |
| | | |
| | | @Resource |
| | | private VideoWatchHistoryService videoWatchHistoryService; |
| | | |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param acceptData |
| | | * @param loginUid |
| | | * @param cid |
| | | * @param vid |
| | | * @param Cid |
| | | * @param Vid |
| | | * @return |
| | | */ |
| | | @RequestMapping("pptvPlay") |
| | | @ResponseBody |
| | | public String pptvPlay(AcceptData acceptData, String loginUid, String cid, String vid) { |
| | | public String pptvPlay(AcceptData acceptData, String loginUid, String Cid, String Vid) { |
| | | |
| | | logger.info("播放PPTV:loginUid-{},cid-{},vid-{}", loginUid, cid, vid); |
| | | logger.info("播放PPTV:loginUid-{},cid-{},vid-{}", loginUid, Cid, Vid); |
| | | |
| | | PPTVSeriesProgramMap map = pptvService.selectMapByCode(Cid, Vid); |
| | | if (map != null) { |
| | | String infoId = map.getInfoId(); |
| | | VideoPPTVMap videoPPTVMap = pptvService.selectVideoPPTVMapByInfoId(infoId); |
| | | if (videoPPTVMap != null) { |
| | | PPTVProgram program = pptvService.selectProgramById(Vid); |
| | | if (program != null && program.getSeriesNum() != null) { |
| | | //当前播放的集数 program.getSeriesNum(); |
| | | VideoWatchHistory history = new VideoWatchHistory(); |
| | | history.setDevice(acceptData.getDevice()); |
| | | history.setVideoId(videoPPTVMap.getVideoId()); |
| | | history.setUid(loginUid); |
| | | history.setPosition(Integer.parseInt(program.getSeriesNum()) - 1); |
| | | videoWatchHistoryService.add(history); |
| | | } |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | |
| | | package com.yeshi.buwan.controller.parser; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.service.inter.baidu.BaiDuCPUService; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | |
| | | import com.yeshi.buwan.domain.ad.CommonAdPositionAd; |
| | | import com.yeshi.buwan.domain.recommend.CategoryRecommendVideo; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | 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.imp.*; |
| | | import com.yeshi.buwan.service.imp.recommend.CategoryRecommendVideoService; |
| | | import com.yeshi.buwan.service.manager.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.SolrCommonVideoDataManager; |
| | | import com.yeshi.buwan.util.*; |
| | | import com.yeshi.buwan.util.JuHe.VideoResourceUtil; |
| | | import com.yeshi.buwan.util.ad.CommonAdUtil; |
| | | import com.yeshi.buwan.util.annotation.RequireUid; |
| | | import com.yeshi.buwan.util.video.VideoConstant; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import com.yeshi.buwan.vo.HomeClassVO; |
| | | import com.yeshi.buwan.vo.video.VideoListResultVO; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.PrintWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | @Controller |
| | | public class ClassParser { |
| | |
| | | |
| | | @Resource |
| | | private RedisManager redisManager; |
| | | @Resource |
| | | private SolrAlbumVideoDataManager solrAlbumVideoDataManager; |
| | | |
| | | @Resource |
| | | private SearchService searchService; |
| | | |
| | | @RequireUid |
| | | public void getClass(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | |
| | | } |
| | | } |
| | | |
| | | // if (acceptData.getPlatform().equalsIgnoreCase("android")) { |
| | | // for (SuperVideoType type : list) { |
| | | // if (type.getType().getName().contains("资讯")) { |
| | | // type.getType().setName("主播"); |
| | | // type.getType().setId(1111); |
| | | // type.getType().setIcon("http://img.zcool.cn/community/017fdb57610d8a0000012e7e74b496.png"); |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() > 53 && !"qq".equalsIgnoreCase(acceptData.getChannel())) { |
| | | SuperVideoType sty = new SuperVideoType(); |
| | | sty.setCreatetime(0 + ""); |
| | | sty.setPicture(""); |
| | | VideoType vt = new VideoType(22222); |
| | | VideoType vt = new VideoType(Constant.VIDEO_TYPE_ZHIBO); |
| | | vt.setName("美女直播"); |
| | | vt.setShow("1"); |
| | | vt.setCategoryType("http://m.v.6.cn/event/porkvideo?src=9n8wc5medm&nologo=1&t=2"); |
| | |
| | | if (!isC) |
| | | list.add(sty); |
| | | } |
| | | |
| | | //Android平台3.8.7之后返回VIP |
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() >= 105) { |
| | | |
| | | SuperVideoType sty = new SuperVideoType(); |
| | | sty.setCreatetime(0 + ""); |
| | | sty.setPicture(""); |
| | | VideoType vt = new VideoType(Constant.VIDEO_TYPE_VIP); |
| | | vt.setName("VIP"); |
| | | vt.setShow("1"); |
| | | vt.setIcon("https://hbimg.huabanimg.com/12834704bb4aa39342c2fb51e0c644181b13997b70eb-CqlE1I_fw658/format/webp"); |
| | | sty.setType(vt); |
| | | boolean isC = false; |
| | | for (SuperVideoType svt : list) { |
| | | if (svt.getType().getId() == vt.getId()) { |
| | | isC = true; |
| | | break; |
| | | } |
| | | } |
| | | list.add(sty); |
| | | } |
| | | |
| | | |
| | | List<VideoType> typelist = new ArrayList<VideoType>(); |
| | | for (SuperVideoType sv : list) { |
| | |
| | | /** |
| | | * 获取当前系统所有后台视频分类 |
| | | * |
| | | * @param uid |
| | | * @param acceptData |
| | | * @param request |
| | | * @param out |
| | | */ |
| | |
| | | .toString(); |
| | | } else if (!StringUtil.isNullOrEmpty(videoType)) { |
| | | if (StringUtil.isNullOrEmpty(categoryType) || "genre".equalsIgnoreCase(categoryType)) {// 按分类检索数据 |
| | | |
| | | if (!StringUtil.isNullOrEmpty(order)) { |
| | | Long startTime = System.currentTimeMillis(); |
| | | List<VideoInfo> list1 = classService.getTypeVideoList(videoType, detailSystem, pageIndex, 20, |
| | |
| | | list.add(info); |
| | | } |
| | | count = 1200 + ""; |
| | | |
| | | |
| | | } else {// 按地区检索数据 |
| | | //非VIP分类 |
| | | List<Integer> vipTypes = Arrays.asList(Constant.vipTypes); |
| | | if (vipTypes.contains(Integer.parseInt(videoType))) { |
| | | //VIP分类 |
| | | SolrVideoSearchFilter filter = new SolrVideoSearchFilter(); |
| | | filter.setFreeType(1); |
| | | switch (Integer.parseInt(videoType)) { |
| | | case Constant.VIDEO_TYPE_VIP_MOVIE: |
| | | filter.setVideoType(VideoConstant.VIDEO_CATEGORY_DIANYING); |
| | | break; |
| | | case Constant.VIDEO_TYPE_VIP_TV: |
| | | filter.setVideoType(VideoConstant.VIDEO_CATEGORY_DIANSHIJU); |
| | | break; |
| | | case Constant.VIDEO_TYPE_VIP_CARTOON: |
| | | filter.setVideoType(VideoConstant.VIDEO_CATEGORY_DONGMAN); |
| | | break; |
| | | case Constant.VIDEO_TYPE_VIP_SHOW: |
| | | filter.setVideoType(VideoConstant.VIDEO_CATEGORY_ZONGYI); |
| | | break; |
| | | default: |
| | | } |
| | | filter.setResourceIds(new String[]{PPTVUtil.RESOURCE_ID + ""}); |
| | | |
| | | //更新时间 |
| | | if ("1".equalsIgnoreCase(order)) { |
| | | filter.setSortKey("updateTime"); |
| | | } else { |
| | | //观看次数 |
| | | filter.setSortKey("watchcount"); |
| | | } |
| | | SolrResultDTO resultDTO = solrAlbumVideoDataManager.find(filter, pageIndex, 20); |
| | | count = resultDTO.getTotalCount() + ""; |
| | | list = searchService.convertSolrAlbumResultToVideo(resultDTO.getVideoList(), resourceList); |
| | | } else { |
| | | String areaId = videoType;// 国籍ID |
| | | CategoryContry cc = categoryAreaService.getCategoryArea(areaId); |
| | | String country = cc.getName(); |
| | |
| | | + "-" + CacheUtil.getMD5Long(resourceList))); |
| | | System.out.println("列表最终数量:" + list.size()); |
| | | count = 1000 + ""; |
| | | } |
| | | } |
| | | } |
| | | list = banQuanService.getBanQuanVideo(list, detailSystem.getId(), CacheUtil.getMD5VideoInfo(list)); |
| | |
| | | list.add(vt); |
| | | } |
| | | |
| | | if (acceptData.getVersion() > 60) { // 20170915删除推荐 |
| | | list.remove(0); |
| | | } |
| | | |
| | | } else if ((Constant.VIDEO_TYPE_VIP + "").equalsIgnoreCase(parentId)) { |
| | | //VIP分类 |
| | | VideoType type = new VideoType(Constant.VIDEO_TYPE_VIP); |
| | | type.setName("全部"); |
| | | type.setShow("1"); |
| | | type.setCategoryType("area"); |
| | | list.add(type); |
| | | |
| | | |
| | | type = new VideoType(Constant.VIDEO_TYPE_VIP_MOVIE); |
| | | type.setName("电影"); |
| | | type.setShow("1"); |
| | | type.setCategoryType("area"); |
| | | list.add(type); |
| | | |
| | | type = new VideoType(Constant.VIDEO_TYPE_VIP_TV); |
| | | type.setName("电视剧"); |
| | | type.setShow("1"); |
| | | type.setCategoryType("area"); |
| | | list.add(type); |
| | | |
| | | |
| | | type = new VideoType(Constant.VIDEO_TYPE_VIP_CARTOON); |
| | | type.setName("动漫"); |
| | | type.setShow("1"); |
| | | type.setCategoryType("area"); |
| | | list.add(type); |
| | | |
| | | // type = new VideoType(Constant.VIDEO_TYPE_VIP_SHOW); |
| | | // type.setName("综艺"); |
| | | // type.setShow("1"); |
| | | // type.setCategoryType("area"); |
| | | // list.add(type); |
| | | |
| | | } else { |
| | | List<VideoType> clist = classService.getFirstTypeList(parentId); |
| | | list = new ArrayList<VideoType>(); |
| | |
| | | type.setShow("1"); |
| | | type.setCategoryType("genre"); |
| | | list.add(0, type); |
| | | if (acceptData.getVersion() > 60) { // 20170915删除推荐 |
| | | list.remove(0); |
| | | } |
| | | } |
| | | for (int i = 0; i < list.size(); i++) { |
| | | array.add(StringUtil.outPutResultJson(list.get(i))); |
| | | } |
| | | if (acceptData.getVersion() > 60) { // 20170915删除推荐 |
| | | array.remove(0); |
| | | } |
| | | |
| | | object.put("count", array.size()); |
| | | object.put("data", array); |
| | | out.print(JsonUtil.loadTrueJson(object.toString())); |
| | |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | List<VideoInfo> rankList = categoryRecommendCacheVideoService.getVideoListByRank(Integer.parseInt(typeid), |
| | | detailSystem.getId(), acceptData.getPlatform(), acceptData.getVersion()); |
| | | List<VideoInfo> list = new ArrayList<VideoInfo>(); |
| | | List<VideoInfo> list = new ArrayList<>(); |
| | | list.addAll(rankList); |
| | | for (VideoInfo vi : list) {// 清除无用数据,防止浪费带宽,更改图片 |
| | | vi.setIntroduction(""); |
| | |
| | | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.user.LoginUser; |
| | | import com.yeshi.buwan.dto.user.LoginInfoDto; |
| | | import com.yeshi.buwan.dto.user.QQUserInfo; |
| | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.annotations.Expose; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.yeshi.buwan.domain.Config; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.recommend.FloatAD; |
| | | import com.yeshi.buwan.dto.config.ADShieldIPConfig; |
| | | import com.yeshi.buwan.log.LogHelper; |
| | |
| | | import com.yeshi.buwan.util.IPUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import net.sf.json.JSONArray; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | | |
| | | import net.sf.json.JSONObject; |
| | |
| | | |
| | | Logger logger = LoggerFactory.getLogger(ConfigParser.class); |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | @Resource |
| | | private SystemService systemService; |
| | | |
| | |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HotStar; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.ad.CommonAd; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.xxl.rpc.util.ThreadPoolUtil; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.video.VideoWatchHistory; |
| | | import com.yeshi.buwan.pptv.PPTVUtil; |
| | | import com.yeshi.buwan.pptv.entity.PPTVSeries; |
| | |
| | | import com.yeshi.buwan.service.inter.video.VideoWatchHistoryService; |
| | | import com.yeshi.buwan.util.*; |
| | | import com.yeshi.buwan.util.annotation.RequireUid; |
| | | import com.yeshi.buwan.util.log.VideoLogFactory; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import org.apache.commons.httpclient.HttpClient; |
| | | import org.apache.commons.httpclient.HttpException; |
| | | import org.apache.commons.httpclient.methods.GetMethod; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import com.yeshi.buwan.domain.entity.PlayUrl; |
| | |
| | | @Resource |
| | | private HomeTypeService homeTypeService; |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | @Resource |
| | | private AdService adService; |
| | | @Resource |
| | |
| | | |
| | | @Resource |
| | | private VideoWatchHistoryService videoWatchHistoryService; |
| | | |
| | | private final Logger playLogger = LoggerFactory.getLogger("videoPlay"); |
| | | |
| | | @RequireUid |
| | | public void getHomeAd(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | |
| | | if (StringUtil.isNullOrEmpty(vtid)) { |
| | | vtid = "309"; // 为了兼容以前的推荐 |
| | | } |
| | | |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | JSONObject object = new JSONObject(); |
| | | |
| | |
| | | String thirdType = request.getParameter("Type"); |
| | | String loginUid = request.getParameter("LoginUid"); |
| | | String position = request.getParameter("Position"); |
| | | String from = request.getParameter("From"); |
| | | |
| | | if (StringUtil.isNullOrEmpty(videoId)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传VideoId")); |
| | |
| | | } |
| | | }); |
| | | |
| | | playLogger.info(VideoLogFactory.createUserVideoDetailLog(acceptData.getDevice(), loginUid, acceptData.getDetailSystem().getId(), videoId, resourceId, from)); |
| | | |
| | | |
| | | //PPTV网页播放 |
| | | if (resourceId != null && Integer.parseInt(resourceId) == PPTVUtil.RESOURCE_ID) { |
| | |
| | | int p = 0; |
| | | if (!StringUtil.isNullOrEmpty(position)) { |
| | | p = Integer.parseInt(position); |
| | | } else { |
| | | //取播放记录 |
| | | VideoWatchHistory history = videoWatchHistoryService.getWatchHistory(acceptData.getDevice(), videoId); |
| | | if (history != null && history.getPosition() != null) { |
| | | p = history.getPosition(); |
| | | } |
| | | } |
| | | |
| | | p = p >= series.getSeries().size() ? 0 : p; |
| | |
| | | |
| | | public void isPraise(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | Config config = configService.getConfigByKey("banner_praise", detailSystem, acceptData.getVersion()); |
| | | DetailSystemConfig config = configService.getConfigByKey("banner_praise", detailSystem, acceptData.getVersion()); |
| | | if ("是".equals(config.getValue())) { |
| | | out.print(JsonUtil.loadTrueJson("1")); |
| | | } else { |
| | |
| | | import com.yeshi.buwan.domain.jump.JumpDetail; |
| | | import com.yeshi.buwan.domain.jump.JumpTypeEnum; |
| | | import com.yeshi.buwan.domain.recommend.AdRecommendRight; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.funtv.FunTVNewApi; |
| | | import com.yeshi.buwan.service.imp.*; |
| | | import com.yeshi.buwan.service.imp.recommend.AdRecommendRightService; |
| | |
| | | |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.Collection; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.user.LoginUser; |
| | | import com.yeshi.buwan.dto.user.LoginInfoDto; |
| | | import com.yeshi.buwan.exception.user.LoginUserException; |
| | |
| | | @Resource |
| | | private SystemService systemService; |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | |
| | | private List<VideoDetailInfo> createSearchVideoDetailsVO(VideoInfo video) { |
| | | List<VideoDetailInfo> detailList = new ArrayList<>(); |
| | | if (video.getVideoType() != null && (Integer.parseInt(video.getVideoType().getId() + "") == VideoCategoryConstant.CATEGORY_DIANSHIJU || Integer.parseInt(video.getVideoType().getId() + "") == VideoCategoryConstant.CATEGORY_DONGMAN)) { |
| | | if (video.getVideocount() <= 5) { |
| | | if (video.getVideocount()!=null&& video.getVideocount() <= 5) { |
| | | for (int i = 0; i < video.getVideocount(); i++) { |
| | | VideoDetailInfo detail = new VideoDetailInfo(); |
| | | detail.setTag((i + 1) + ""); |
| | |
| | | pageIndex = 1; |
| | | } |
| | | |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | UserInfo user1 = userService.getUserInfo(acceptData.getUid()); |
| | | if (Utils.isTest(request, user1, detailSystem.getId())) { |
| | | detailSystem = systemService.getDetailSystemById(40 + ""); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("count", 0); |
| | | JSONArray array = new JSONArray(); |
| | | object.put("data", array); |
| | | out.print(JsonUtil.loadTrueJson(object.toString())); |
| | | } else { |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, acceptData.getVersion()); |
| | | 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(detailSystem.getId(), request.getRemoteAddr(), |
| | | VideoListResultVO videoListResultVO = searchService.searchNew(acceptData.getDetailSystem().getId(), request.getRemoteAddr(), |
| | | acceptData.getUid(), key, pageIndex, Integer.parseInt(type), |
| | | acceptData.getSystem(), resourceList, cacheMD5); |
| | | //组织数据 |
| | |
| | | cacheMD5 += info.getId() + "#"; |
| | | } |
| | | } |
| | | List<VideoInfo> list = banQuanService.getBanQuanVideo(videoListResultVO.getVideoList(), detailSystem.getId(), cacheMD5); |
| | | List<VideoInfo> list = banQuanService.getBanQuanVideo(videoListResultVO.getVideoList(), acceptData.getDetailSystem().getId(), cacheMD5); |
| | | |
| | | JSONObject object = new JSONObject(); |
| | | object.put("count", Constant.isUpdate ? 19 + "" : videoListResultVO.getCount()); |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | if (JuheVideoUtil.isNeedDelete((VideoInfo) list.get(i), detailSystem.getId())) { |
| | | if (JuheVideoUtil.isNeedDelete((VideoInfo) list.get(i), acceptData.getDetailSystem().getId())) { |
| | | list.remove(i); |
| | | i--; |
| | | } |
| | | } |
| | | // |
| | | // List<String> keyList = banQuanService.getBanQuanKeyListAll(Integer.parseInt(detailSystem.getId())); |
| | | // for (int i = 0; i < list.size(); i++) { |
| | | // |
| | | // boolean delete = false; |
| | | // for (int j = 0; j < keyList.size(); j++) { |
| | | // if (list.get(i).getName().contains(keyList.get(j))) { |
| | | // delete = true; |
| | | // break; |
| | | // } |
| | | // } |
| | | // if (delete) { |
| | | // list.remove(i); |
| | | // i--; |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | ((VideoInfo) list.get(i)) |
| | |
| | | } |
| | | |
| | | out.print(JsonUtil.loadTrueJson(object.toString())); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | Map<String, VideoInfo> videoInfoMap = new HashMap<>(); |
| | | if (videoInfoList != null) |
| | | for (VideoInfo vi : videoInfoList) { |
| | | if (vi != null) |
| | | videoInfoMap.put(vi.getId(), vi); |
| | | } |
| | | for (VideoWatchHistory wh : list) { |
| | |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.Config; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.service.imp.zhibo.ZhiBoServcie; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | |
| | | private SystemService systemService; |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | |
| | | |
| | | public void getTop(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | |
| | | List<LiveType> typelist = new ArrayList<LiveType>(); |
| | | String value = ""; |
| | | if ("IOS".equalsIgnoreCase(acceptData.getPlatform())) { |
| | | Config config = configService.getConfigByKey("open_huajiao_IOS", detailSystem, acceptData.getVersion()); |
| | | DetailSystemConfig config = configService.getConfigByKey("open_huajiao_IOS", detailSystem, acceptData.getVersion()); |
| | | value = config.getValue(); |
| | | } else { |
| | | Config config = configService.getConfigByKey("open_huajiao_Android", detailSystem, acceptData.getVersion()); |
| | | DetailSystemConfig config = configService.getConfigByKey("open_huajiao_Android", detailSystem, acceptData.getVersion()); |
| | | value = config.getValue(); |
| | | } |
| | | if ("是".equals(value)) { |
| | |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HotStar; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import com.yeshi.buwan.domain.CategoryContry; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | |
| | | import com.yeshi.buwan.service.imp.ClassService; |
| | | import com.yeshi.buwan.service.imp.CollectionService; |
| | | import com.yeshi.buwan.service.imp.CommentService; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.service.imp.HomeAdService; |
| | | import com.yeshi.buwan.service.imp.HomeTypeService; |
| | | import com.yeshi.buwan.service.imp.RecommendService; |
| | |
| | | @Resource |
| | | private HomeTypeService homeTypeService; |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | @Resource |
| | | private AdService adService; |
| | | @Resource |
| | |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import com.yeshi.buwan.controller.parser.UserParser; |
| | | import com.yeshi.buwan.domain.Attention; |
| | | import com.yeshi.buwan.domain.Comment2; |
| | | import com.yeshi.buwan.domain.CommentReply; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.user.LoginUser; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.service.imp.AttentionService; |
| | |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import com.rabbitmq.tools.json.JSONUtil; |
| | | import com.yeshi.buwan.domain.CategoryContry; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoDetailInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoType; |
New file |
| | |
| | | package com.yeshi.buwan.dao.recommend; |
| | | |
| | | import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial; |
| | | import com.yeshi.buwan.dao.base.MongodbBaseDao; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public class HomeRecommendSpecialDao extends MongodbBaseDao<HomeRecommendSpecial> { |
| | | |
| | | public List<HomeRecommendSpecial> list(List<String> ids) { |
| | | Query query = new Query(); |
| | | List<Criteria> orList = new ArrayList<>(); |
| | | |
| | | if (ids != null) { |
| | | for (String id : ids) { |
| | | orList.add(Criteria.where("id").is(id)); |
| | | } |
| | | } |
| | | |
| | | Criteria criteria = new Criteria(); |
| | | if (orList.size() > 0) { |
| | | Criteria[] ors = new Criteria[orList.size()]; |
| | | orList.toArray(ors); |
| | | criteria = criteria.orOperator(ors); |
| | | } |
| | | query.addCriteria(criteria); |
| | | return findList(query); |
| | | } |
| | | |
| | | public List<HomeRecommendSpecial> list(DaoQuery daoQuery) { |
| | | Query query = new Query(); |
| | | List<Criteria> andList = new ArrayList<>(); |
| | | |
| | | if (daoQuery.systemId != null) { |
| | | andList.add(Criteria.where("systemId").is(daoQuery.systemId)); |
| | | } |
| | | |
| | | Criteria criteria = new Criteria(); |
| | | if (andList.size() > 0) { |
| | | Criteria[] ands = new Criteria[andList.size()]; |
| | | andList.toArray(ands); |
| | | criteria = criteria.andOperator(ands); |
| | | } |
| | | |
| | | query.addCriteria(criteria); |
| | | |
| | | query.skip(daoQuery.start); |
| | | query.limit(daoQuery.count); |
| | | query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "weight"))); |
| | | |
| | | return findList(query); |
| | | } |
| | | |
| | | public void updateSelective(HomeRecommendSpecial bean) { |
| | | Query query = new Query(); |
| | | Update update = new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | if (bean.getName() != null) { |
| | | update.set("name", bean.getName()); |
| | | } |
| | | if (bean.getSystemId() != null) { |
| | | update.set("systemId", bean.getSystemId()); |
| | | } |
| | | if (bean.getBannerSizeRate() != null) { |
| | | update.set("bannerSizeRate", bean.getBannerSizeRate()); |
| | | } |
| | | if (bean.getWeight() != null) { |
| | | update.set("weight", bean.getWeight()); |
| | | } |
| | | if (bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | |
| | | |
| | | public static class DaoQuery { |
| | | public String systemId; |
| | | public int start; |
| | | public int count; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.buwan.dao.recommend; |
| | | |
| | | import com.yeshi.buwan.dao.base.MongodbBaseDao; |
| | | import com.yeshi.buwan.domain.recommend.SuperHomeRecommendSpecial; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public class SuperHomeRecommendSpecialDao extends MongodbBaseDao<SuperHomeRecommendSpecial> { |
| | | |
| | | |
| | | public List<SuperHomeRecommendSpecial> list(SuperHomeRecommendSpecialDao.DaoQuery daoQuery) { |
| | | Query query = new Query(); |
| | | List<Criteria> andList = new ArrayList<>(); |
| | | |
| | | if (daoQuery.specialId != null) { |
| | | andList.add(Criteria.where("specialId").is(daoQuery.specialId)); |
| | | } |
| | | |
| | | if (daoQuery.detailSystemId != null) { |
| | | andList.add(Criteria.where("detailSystemId").is(daoQuery.detailSystemId)); |
| | | } |
| | | |
| | | |
| | | Criteria criteria = new Criteria(); |
| | | if (andList.size() > 0) { |
| | | Criteria[] ands = new Criteria[andList.size()]; |
| | | andList.toArray(ands); |
| | | criteria = criteria.andOperator(ands); |
| | | } |
| | | |
| | | query.addCriteria(criteria); |
| | | |
| | | query.skip(daoQuery.start); |
| | | query.limit(daoQuery.count); |
| | | query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "weight"))); |
| | | |
| | | return findList(query); |
| | | } |
| | | |
| | | public void updateSelective(SuperHomeRecommendSpecial bean) { |
| | | Query query = new Query(); |
| | | Update update = new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | if (bean.getSpecialId() != null) { |
| | | update.set("specialId", bean.getSpecialId()); |
| | | } |
| | | if (bean.getDetailSystemId() != null) { |
| | | update.set("detailSystemId", bean.getDetailSystemId()); |
| | | } |
| | | if (bean.getShowName() != null) { |
| | | update.set("showName", bean.getShowName()); |
| | | } |
| | | if (bean.getWeight() != null) { |
| | | update.set("weight", bean.getWeight()); |
| | | } |
| | | if (bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | |
| | | public static class DaoQuery { |
| | | public String specialId; |
| | | public String detailSystemId; |
| | | public int start; |
| | | public int count; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.buwan.dao.system; |
| | | |
| | | import com.yeshi.buwan.dao.base.BaseDao; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public class DetailSystemConfigDao extends BaseDao<DetailSystemConfig> { |
| | | |
| | | /** |
| | | * 根据系统ID与版本号获取值 |
| | | * |
| | | * @param systemId |
| | | * @param maxVersion |
| | | * @return |
| | | */ |
| | | public List<DetailSystemConfig> listBySystemIdAndMaxVersion(Long systemId, int maxVersion) { |
| | | List list = sqlListWithEntity("SELECT a.* FROM (SELECT * FROM `wk_video_config` vc WHERE vc.`systemId`=? AND vc.`minVersion`<=? ORDER BY vc.`minVersion` DESC) a GROUP BY a.`systemId`,a.`key`", DetailSystemConfig.class, systemId, maxVersion); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | public DetailSystemConfig selectByKey(String key, Long systemId, int maxVersion) { |
| | | List list = sqlListWithEntity("SELECT a.* FROM (SELECT * FROM `wk_video_config` vc where vc.`key`=? and vc.`systemId`=? AND vc.`minVersion`<=? ORDER BY vc.`minVersion` DESC) a GROUP BY a.`systemId`,a.`key`", DetailSystemConfig.class, key, systemId, maxVersion); |
| | | if (list != null && list.size() > 0) |
| | | return (DetailSystemConfig) list.get(0); |
| | | return null; |
| | | } |
| | | |
| | | } |
File was renamed from src/main/java/com/yeshi/buwan/dao/DetailSystemDao.java |
| | |
| | | package com.yeshi.buwan.dao; |
| | | package com.yeshi.buwan.dao.system; |
| | | |
| | | import com.yeshi.buwan.dao.base.BaseDao; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | @Repository |
| | | public class DetailSystemDao extends BaseDao<DetailSystem> { |
| | | |
New file |
| | |
| | | package com.yeshi.buwan.dao.system; |
| | | |
| | | import com.yeshi.buwan.domain.system.SystemConfig; |
| | | import com.yeshi.buwan.dao.base.MongodbBaseDao; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Repository |
| | | public class SystemConfigDao extends MongodbBaseDao<SystemConfig>{ |
| | | |
| | | public void updateSelective(SystemConfig bean) { |
| | | Query query = new Query(); |
| | | Update update=new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | if(bean.getName() != null) { |
| | | update.set("name", bean.getName()); |
| | | } |
| | | if(bean.getKey() != null) { |
| | | update.set("key", bean.getKey()); |
| | | } |
| | | if(bean.getValue() != null) { |
| | | update.set("value", bean.getValue()); |
| | | } |
| | | if(bean.getBeizhu() != null) { |
| | | update.set("beizhu", bean.getBeizhu()); |
| | | } |
| | | if(bean.getCreateTime() != null) { |
| | | update.set("createTime", bean.getCreateTime()); |
| | | } |
| | | update.set("updateTime", new Date()); |
| | | update(query, update); |
| | | } |
| | | |
| | | } |
File was renamed from src/main/java/com/yeshi/buwan/dao/SystemInfoDao.java |
| | |
| | | package com.yeshi.buwan.dao; |
| | | package com.yeshi.buwan.dao.system; |
| | | |
| | | import com.yeshi.buwan.dao.base.BaseDao; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | @Repository |
| | | public class SystemInfoDao extends BaseDao<SystemInfo> { |
| | | |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | /** |
| | | * 首页提醒 |
| | |
| | | import javax.validation.constraints.Pattern; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | /** |
| | | * 首页的分类 |
| | |
| | | import javax.persistence.ManyToOne; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | /** |
| | | * 热门搜索 |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.ManyToOne; |
| | | import java.io.Serializable; |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | public class HotVideoType { |
| | | public HotVideoType(String id) { |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | public class RecommendAd { |
| | | private String id; |
| | |
| | | import javax.persistence.ManyToOne; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperHomeAd { |
| | | private String id; |
| | | private String createtime; |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperHomeNotice { |
| | | @Expose |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperHomeType { |
| | | private String id; |
| | | private String createtime; |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperHotSearch { |
| | | |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperHotStar { |
| | | @Expose |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperHotType { |
| | | private String id; |
| | | private HotVideoType hotType; |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperRecommendAd { |
| | | private String id; |
| | | private RecommendAd recommendAd; |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperUserBanner { |
| | | |
| | | private String id; |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class SuperVideoType implements Serializable{ |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.persistence.Entity; |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.ManyToOne; |
| | | |
| | |
| | | import javax.persistence.ManyToOne; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | /** |
| | | * 用户信息 |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | /** |
| | | * 版权视频名称库 |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class VideoBanQuanVideo { |
| | | @Expose |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class VideoPlayStatistics { |
| | | private String id; |
| | | private VideoInfo videoInfo; |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.ManyToOne; |
| | | |
| | |
| | | package com.yeshi.buwan.domain; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.FetchType; |
| | |
| | | package com.yeshi.buwan.domain.news; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | public class FoundNews { |
| | | private String id; |
| | |
| | | package com.yeshi.buwan.domain.news; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperFoundNews { |
| | | private String id; |
| | |
| | | package com.yeshi.buwan.domain.recommend; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | | import com.yeshi.buwan.domain.ad.CommonAd; |
New file |
| | |
| | | package com.yeshi.buwan.domain.recommend; |
| | | |
| | | |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | //首页推荐专题 |
| | | @Document(collection = "homeRecommendSpecial") |
| | | public class HomeRecommendSpecial { |
| | | //主键ID |
| | | @Id |
| | | private String id; |
| | | //名称 |
| | | @NotEmpty(message = "名称不能为空") |
| | | private String name; |
| | | //系统 |
| | | @NotEmpty(message = "系统不能为空") |
| | | private String systemId; |
| | | //banner的宽高比 |
| | | @NotNull(message = "轮播图的比例不能为空") |
| | | private BigDecimal bannerSizeRate; |
| | | //权重 |
| | | private Integer weight; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getSystemId() { |
| | | return systemId; |
| | | } |
| | | |
| | | public void setSystemId(String systemId) { |
| | | this.systemId = systemId; |
| | | } |
| | | |
| | | public BigDecimal getBannerSizeRate() { |
| | | return bannerSizeRate; |
| | | } |
| | | |
| | | public void setBannerSizeRate(BigDecimal bannerSizeRate) { |
| | | this.bannerSizeRate = bannerSizeRate; |
| | | } |
| | | |
| | | public Integer getWeight() { |
| | | return weight; |
| | | } |
| | | |
| | | public void setWeight(Integer weight) { |
| | | this.weight = weight; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.buwan.domain.recommend; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | //大区推荐视频 |
| | | public class SuperCategoryRecommendVideo { |
New file |
| | |
| | | package com.yeshi.buwan.domain.recommend; |
| | | |
| | | |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.annotation.Transient; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | //首页推荐专题 |
| | | @Document(collection = "superHomeRecommendSpecial") |
| | | public class SuperHomeRecommendSpecial { |
| | | @Id |
| | | private String id; |
| | | //专题ID |
| | | @NotEmpty(message = "专题不能为空") |
| | | private String specialId; |
| | | @NotEmpty(message = "子系统不能为空") |
| | | //系统ID |
| | | private String detailSystemId; |
| | | //展示名称 |
| | | private String showName; |
| | | //权重 |
| | | private Integer weight; |
| | | |
| | | private Date createTime; |
| | | |
| | | private Date updateTime; |
| | | |
| | | @Transient |
| | | private HomeRecommendSpecial special; |
| | | |
| | | |
| | | public static String createId(String specialId, String detailSystemId) { |
| | | return specialId + "-" + detailSystemId; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getSpecialId() { |
| | | return specialId; |
| | | } |
| | | |
| | | public void setSpecialId(String specialId) { |
| | | this.specialId = specialId; |
| | | } |
| | | |
| | | public String getDetailSystemId() { |
| | | return detailSystemId; |
| | | } |
| | | |
| | | public void setDetailSystemId(String detailSystemId) { |
| | | this.detailSystemId = detailSystemId; |
| | | } |
| | | |
| | | public String getShowName() { |
| | | return showName; |
| | | } |
| | | |
| | | public void setShowName(String showName) { |
| | | this.showName = showName; |
| | | } |
| | | |
| | | public Integer getWeight() { |
| | | return weight; |
| | | } |
| | | |
| | | public void setWeight(Integer weight) { |
| | | this.weight = weight; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public HomeRecommendSpecial getSpecial() { |
| | | return special; |
| | | } |
| | | |
| | | public void setSpecial(HomeRecommendSpecial special) { |
| | | this.special = special; |
| | | } |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.ad.CommonAd; |
| | | |
| | | public class Special implements Serializable{ |
| | |
| | | package com.yeshi.buwan.domain.special; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class SuperSpecial { |
| | | @Expose |
File was renamed from src/main/java/com/yeshi/buwan/domain/DetailSystem.java |
| | |
| | | package com.yeshi.buwan.domain; |
| | | package com.yeshi.buwan.domain.system; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | import javax.persistence.ManyToOne; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.AdminInfo; |
| | | |
| | | /** |
| | | * 大系统下面的分系统 |
File was renamed from src/main/java/com/yeshi/buwan/domain/Config.java |
| | |
| | | package com.yeshi.buwan.domain; |
| | | package com.yeshi.buwan.domain.system; |
| | | |
| | | import javax.persistence.Entity; |
| | | import java.math.BigInteger; |
| | |
| | | * @author Administrator |
| | | */ |
| | | @Entity |
| | | public class Config { |
| | | public class DetailSystemConfig { |
| | | private Integer id; |
| | | private String key; |
| | | private String value; |
New file |
| | |
| | | package com.yeshi.buwan.domain.system; |
| | | |
| | | import org.springframework.data.annotation.Id; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import javax.persistence.Entity; |
| | | import java.math.BigInteger; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 系统配置 |
| | | * |
| | | * @author Administrator |
| | | */ |
| | | @Document(collection = "systemConfig") |
| | | public class SystemConfig { |
| | | @Id |
| | | private String id; |
| | | private String name; |
| | | private String key; |
| | | private String value; |
| | | private String beizhu; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | public static String createId(String key) { |
| | | return key; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getBeizhu() { |
| | | return beizhu; |
| | | } |
| | | |
| | | public void setBeizhu(String beizhu) { |
| | | this.beizhu = beizhu; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
File was renamed from src/main/java/com/yeshi/buwan/domain/SystemInfo.java |
| | |
| | | package com.yeshi.buwan.domain; |
| | | package com.yeshi.buwan.domain.system; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | import javax.persistence.ManyToOne; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.AdminInfo; |
| | | |
| | | @Entity |
| | | public class SystemInfo implements Serializable{ |
| | |
| | | |
| | | private String uid; |
| | | |
| | | @Expose |
| | | private Integer position; |
| | | |
| | | @Expose |
| | |
| | | package com.yeshi.buwan.domain.web; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class DetailSystemSelect { |
| | | @Expose |
New file |
| | |
| | | package com.yeshi.buwan.exception; |
| | | |
| | | public class ParamsException extends Exception { |
| | | |
| | | public static final int CODE_PARAMS_NOT_ENOUGH = 10003; |
| | | |
| | | public ParamsException(int code, String message) { |
| | | super(message); |
| | | } |
| | | |
| | | public ParamsException(String message) { |
| | | super(message); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.buwan.domain.Config; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.util.EHCacheManager; |
| | | import net.sf.json.JSONObject; |
| | |
| | | @Component |
| | | public class AdJob { |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | @Resource |
| | | private SystemService systemService; |
| | | @Resource |
| | |
| | | * @param version |
| | | */ |
| | | public void showAd(String channel, DetailSystem detailSystem, int version) { |
| | | Config config = configService.getConfigByKey("video_detail_full_video_version_channel", detailSystem, version); |
| | | DetailSystemConfig config = configService.getConfigByKey("video_detail_full_video_version_channel", detailSystem, version); |
| | | updateVersionConfig(channel, config, version); |
| | | config = configService.getConfigByKey("ad_splash_config", detailSystem, version); |
| | | updateVersionConfig(channel, config, version); |
| | |
| | | * @return |
| | | */ |
| | | public int getOnliningVersionCode(DetailSystem detailSystem) { |
| | | Config config = configService.getConfigByKey("ad_click_download_version", detailSystem, 1); |
| | | DetailSystemConfig config = configService.getConfigByKey("ad_click_download_version", detailSystem, 1); |
| | | return Integer.parseInt(config.getValue()); |
| | | } |
| | | |
| | | public void setOnliningVersionCode(int versionCode, DetailSystem detailSystem) { |
| | | Config config = configService.getConfigByKey("ad_click_download_version", detailSystem, 1); |
| | | DetailSystemConfig config = configService.getConfigByKey("ad_click_download_version", detailSystem, 1); |
| | | config.setValue(versionCode + ""); |
| | | configService.updateConfig(config); |
| | | } |
| | |
| | | * @param config |
| | | * @param version |
| | | */ |
| | | private void updateVersionConfig(String channel, Config config, int version) { |
| | | private void updateVersionConfig(String channel, DetailSystemConfig config, int version) { |
| | | channel = channel.toLowerCase(); |
| | | if (config == null) |
| | | return; |
| | |
| | | import com.yeshi.buwan.util.video.AcfunApiUtil; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | @Component |
| | | public class JuHeVideoUpdateJob { |
| | | @Resource |
| | | private IqiyiUtil iqiyiUtil; |
| | | @Resource |
| | | private SoHuUtil soHuUtil; |
| | | |
| | | @Resource |
| | | private FunTVUtil funTVUtil; |
| | | |
| | | @Resource |
| | | private AcFunUtil acFunUtil; |
| | | |
| | | @Resource |
| | | private IqiyiQueueService iqiyiQueueService; |
| | | |
| | | @Resource |
| | | private AcfunVideoNewService acfunVideoNewService; |
| | | |
| | | private static int c = 1; |
| | | |
| | |
| | | iqiyiUtil.updateAll(""); |
| | | } |
| | | }).start(); |
| | | |
| | | // new Thread(new Runnable() { |
| | | // |
| | | // public void run() { |
| | | // soHuUtil.parseAll(); |
| | | // } |
| | | // }).start(); |
| | | |
| | | // new Thread(new Runnable() { |
| | | // |
| | | // public void run() { |
| | | // YouKuDJUtil.startParseUpdate(); |
| | | // } |
| | | // }).start(); |
| | | // |
| | | // new Thread(new Runnable() { |
| | | // |
| | | // public void run() { |
| | | // YouKuDJUtil.startParseDelete(); |
| | | // } |
| | | // }).start(); |
| | | |
| | | // new Thread(new Runnable() { |
| | | // |
| | | // public void run() { |
| | | // pptvUtil.startParseTV(); |
| | | // } |
| | | // }).start(); |
| | | // |
| | | // new Thread(new Runnable() { |
| | | // |
| | | // public void run() { |
| | | // pptvUtil.startParseMovie(); |
| | | // pptvUtil.startParseShow(); |
| | | // pptvUtil.startParseCartoon(); |
| | | // pptvUtil.startParseShortVideo(); |
| | | // } |
| | | // }).start(); |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 2 * * ?") |
| | | public void updateAcFun() { |
| | | if (!Constant.JobTasker) |
| | | return; |
| | | |
| | | AcfunVideoResult result = AcfunApiUtil.videoList(""); |
| | | while (result != null && result.pcursor != null && !result.pcursor.equalsIgnoreCase("no_more")) { |
| | | if (result.videoList != null) { |
| | | acfunVideoNewService.save(result.videoList); |
| | | for (AcfunVideoNew video : result.videoList) |
| | | try { |
| | | acFunUtil.addVideo(video); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | result = AcfunApiUtil.videoList(result.pcursor); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 3,4 * * ? ") |
| | | // @Scheduled(cron = "0 52 * * * ? ") |
| | | public void updateFuntvAll() { |
| | | if (!Constant.JobTasker) |
| | | return; |
| | | synchronized (funTVUtil) { |
| | | funTVUtil.startUpdate(); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 0/1 * * ? ") |
| | | public void updateFuntv() { |
| | | if (!Constant.JobTasker) |
| | | return; |
| | | synchronized (funTVUtil) { |
| | | funTVUtil.startUpdate(); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0 5 0,12,20 * * ? ") |
New file |
| | |
| | | package com.yeshi.buwan.job.video; |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.buwan.acFun.AcFunUtil; |
| | | import com.yeshi.buwan.acFun.AcfunVideoNew; |
| | | import com.yeshi.buwan.acFun.AcfunVideoResult; |
| | | import com.yeshi.buwan.pptv.PPTVApiUtil; |
| | | import com.yeshi.buwan.pptv.entity.PPTVSeries; |
| | | import com.yeshi.buwan.service.imp.juhe.AcfunVideoNewService; |
| | | import com.yeshi.buwan.service.inter.juhe.PPTVService; |
| | | import com.yeshi.buwan.util.video.AcfunApiUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | public class AcfunVideoUpdate { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(AcfunVideoUpdate.class); |
| | | |
| | | @Resource |
| | | private AcfunVideoNewService acfunVideoNewService; |
| | | |
| | | @Resource |
| | | private AcFunUtil acFunUtil; |
| | | |
| | | |
| | | /** |
| | | * 更新最近几天的视频 |
| | | * |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("video-update-acfun-updateLatestVideo") |
| | | public ReturnT<String> updateLatestVideo(String param) throws Exception { |
| | | AcfunVideoResult result = AcfunApiUtil.videoList(""); |
| | | while (result != null && result.pcursor != null && !result.pcursor.equalsIgnoreCase("no_more")) { |
| | | if (result.videoList != null) { |
| | | acfunVideoNewService.save(result.videoList); |
| | | for (AcfunVideoNew video : result.videoList) |
| | | try { |
| | | acFunUtil.addVideo(video); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | result = AcfunApiUtil.videoList(result.pcursor); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.yeshi.buwan.dao.SuperRecommendAdDao; |
| | | import com.yeshi.buwan.dao.WXAdDao; |
| | | import com.yeshi.buwan.dao.WXStatisticsDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.RecommendAd; |
| | | import com.yeshi.buwan.domain.SuperRecommendAd; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.WXAd; |
| | | import com.yeshi.buwan.domain.WXStatistics; |
| | | import com.yeshi.buwan.domain.ad.AdStatistics; |
| | |
| | | import com.yeshi.buwan.dao.VideoBanQuanDao; |
| | | import com.yeshi.buwan.dao.VideoBanQuanVideoDao; |
| | | import com.yeshi.buwan.dao.WebVideoDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.VideoBanQuan; |
| | | import com.yeshi.buwan.domain.VideoBanQuanVideo; |
| | |
| | | package com.yeshi.buwan.service.imp; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | import com.yeshi.buwan.dao.CategoryContryDao; |
| | | import com.yeshi.buwan.domain.CategoryContry; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoResource; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | |
| | | @Service |
| | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.inter.video.VideoInfoExtraService; |
| | | import com.yeshi.buwan.util.JuHe.VideoResourceUtil; |
| | | import org.hibernate.HibernateException; |
| | |
| | | vr.setHpicture(objs[5] + ""); |
| | | vr.setLatestVpicture(objs[6] + ""); |
| | | vr.setLatestHpicture(objs[7] + ""); |
| | | vr.setWatchCount(objs[8] + ""); |
| | | vr.setCommentCount(Integer.parseInt(objs[9] + "")); |
| | | vr.setWatchCount(objs[8] != null ? objs[8] + "" : "0"); |
| | | vr.setCommentCount(objs[9] != null ? Integer.parseInt(objs[9] + "") : 0); |
| | | vr.setOrderBy(Integer.parseInt(objs[10] + "")); |
| | | vr.setTag(objs[11] + ""); |
| | | vr.setVideocount(0); |
| | | if (vr.getRank() > 0) { |
| | | rks.add(vr); |
| | | } else |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService; |
| | | import com.yeshi.buwan.service.inter.video.VideoInfoExtraService; |
| | | import org.hibernate.CacheMode; |
| | | import org.hibernate.HibernateException; |
| | |
| | | import com.yeshi.buwan.dao.VideoInfoDao; |
| | | import com.yeshi.buwan.dao.VideoTypeDao; |
| | | import com.yeshi.buwan.domain.CategoryVideo; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.SuperHotType; |
| | | import com.yeshi.buwan.domain.SuperVideoType; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | |
| | | info.setHpicture(obj[4] + ""); |
| | | info.setLatestHpicture(obj[5] + ""); |
| | | info.setWatchCount(obj[6] + ""); |
| | | info.setCommentCount(Integer.parseInt(obj[7] + "")); |
| | | info.setCommentCount(obj[7]!=null? Integer.parseInt(obj[7] + ""):0); |
| | | if (obj.length > 8) { |
| | | String[] resourceIds = (obj[8] + "").split(","); |
| | | List<VideoResource> resourceList = new ArrayList<VideoResource>(); |
File was renamed from src/main/java/com/yeshi/buwan/service/imp/ConfigService.java |
| | |
| | | package com.yeshi.buwan.service.imp; |
| | | |
| | | import com.yeshi.buwan.dao.ConfigDao; |
| | | import com.yeshi.buwan.domain.Config; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.dao.system.DetailSystemConfigDao; |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import org.hibernate.HibernateException; |
| | | import org.hibernate.Session; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class ConfigService { |
| | | public class DetailSystemConfigService { |
| | | @Resource |
| | | private ConfigDao configDao; |
| | | private DetailSystemConfigDao configDao; |
| | | |
| | | // 获取配置文件 |
| | | public List<Config> getConfig(Long systemId, int version) { |
| | | public List<DetailSystemConfig> getConfig(Long systemId, int version) { |
| | | return configDao.listBySystemIdAndMaxVersion(systemId, version); |
| | | } |
| | | |
| | | @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>(); |
| | | List<Config> list = getConfig(Long.parseLong(system.getId()), version); |
| | | for (Config cg : list) { |
| | | List<DetailSystemConfig> list = getConfig(Long.parseLong(system.getId()), version); |
| | | for (DetailSystemConfig cg : list) { |
| | | map.put(cg.getKey(), cg.getValue()); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public Config getConfigByKey(String key, DetailSystem system, int version) { |
| | | public DetailSystemConfig getConfigByKey(String key, DetailSystem system, int version) { |
| | | return configDao.selectByKey(key, Long.parseLong(system.getId()), version); |
| | | } |
| | | |
| | | // 更新某个配置文件 |
| | | public void updateConfig(final Config cg) { |
| | | public void updateConfig(final DetailSystemConfig cg) { |
| | | configDao.excute(new HibernateCallback() { |
| | | public Object doInHibernate(Session session) throws HibernateException { |
| | | try { |
| | |
| | | }); |
| | | } |
| | | |
| | | public boolean updateConfigList(final List<Config> cgs) { |
| | | public boolean updateConfigList(final List<DetailSystemConfig> cgs) { |
| | | return (Boolean) configDao.excute(new HibernateCallback() { |
| | | public Object doInHibernate(Session session) throws HibernateException { |
| | | try { |
| | | session.getTransaction().begin(); |
| | | for (Config cg : cgs) { |
| | | for (DetailSystemConfig cg : cgs) { |
| | | session.update(cg); |
| | | } |
| | | session.flush(); |
| | |
| | | |
| | | import com.yeshi.buwan.dao.HomeAdDao; |
| | | import com.yeshi.buwan.dao.SuperHomeAdDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.SuperHomeAd; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.web.DetailSystemSelect; |
| | | import com.yeshi.buwan.domain.web.HomeAdAdmin; |
| | |
| | | import com.yeshi.buwan.dao.HomeNoticeDao; |
| | | import com.yeshi.buwan.dao.SuperHomeNoticeDao; |
| | | import com.yeshi.buwan.dao.VideoInfoDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeNotice; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.SuperHomeNotice; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.web.DetailSystemSelect; |
| | | import com.yeshi.buwan.domain.web.HomeNoticeAdmin; |
| | | import com.yeshi.buwan.util.Constant; |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.buwan.dao.*; |
| | | import com.yeshi.buwan.dao.system.DetailSystemDao; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.inter.video.VideoInfoExtraService; |
| | | import org.hibernate.HibernateException; |
| | | import org.hibernate.Session; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | |
| | | private DetailSystemDao detailSystemDao; |
| | | |
| | | @Resource |
| | | private VideoResourceMapExtraInfoService videoResourceMapExtraInfoService; |
| | | private VideoInfoExtraService videoInfoExtraService; |
| | | |
| | | public List<HomeType> getHomeTypeDetailList() { |
| | | List<HomeType> list = homeTypeDao.list("from HomeType h order by h.orderby desc"); |
| | |
| | | video.setHpicture(obj[16] + ""); |
| | | video.setLatestHpicture(obj[17] + ""); |
| | | video.setWatchCount(obj[18] + ""); |
| | | video.setCommentCount(Integer.parseInt(obj[19] + "")); |
| | | video.setCommentCount(obj[19] != null ? Integer.parseInt(obj[19] + "") : 0); |
| | | |
| | | ht.setIcon(obj[20] + ""); |
| | | hv.setVideo(video); |
| | |
| | | // hv.getVideo().getName()); |
| | | |
| | | // 更改图片显示 |
| | | //如果为竖版 |
| | | if (ht.getColumns() == 2) { |
| | | if (!StringUtil.isNullOrEmpty(hv.getVideo().getLatestHpicture())) |
| | | hv.getVideo().setPicture(hv.getVideo().getLatestHpicture()); |
| | | else |
| | | hv.getVideo().setPicture(hv.getVideo().getHpicture()); |
| | | } else { |
| | | // hv.getVideo().setPicture(hv.getVideo().getVpicture()); |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(hv.getPicture())) |
| | | hv.setPicture(hv.getVideo().getPicture()); |
| | |
| | | |
| | | } |
| | | }); |
| | | List<String> videoIdList = new ArrayList<>(); |
| | | List<VideoInfo> videoInfoList = new ArrayList<>(); |
| | | for (HomeType ht : homeTypeList) { |
| | | if (ht.getHomeVideoList() != null) |
| | | for (HomeVideo hv : ht.getHomeVideoList()) { |
| | | if (hv.getVideo() != null) |
| | | videoIdList.add(hv.getVideo().getId()); |
| | | videoInfoList.add(hv.getVideo()); |
| | | } |
| | | } |
| | | |
| | | Map<String, VideoResourceMapExtraInfo> videoMap = videoResourceMapExtraInfoService.listMap(videoIdList, resourceIds); |
| | | for (HomeType ht : homeTypeList) { |
| | | if (ht.getHomeVideoList() != null) |
| | | for (HomeVideo hv : ht.getHomeVideoList()) { |
| | | if (hv.getVideo() != null) { |
| | | hv.getVideo().setVideoResourceMapExtraInfo(videoMap.get(hv.getVideo().getId())); |
| | | if (hv.getVideo().getVideoResourceMapExtraInfo() != null) |
| | | hv.getVideo().setFree(hv.getVideo().getVideoResourceMapExtraInfo().getFree()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | videoInfoExtraService.batchExtra(videoInfoList, resourceIds); |
| | | return homeTypeList; |
| | | } |
| | | |
| | |
| | | |
| | | import com.yeshi.buwan.dao.HotTypeDao; |
| | | import com.yeshi.buwan.dao.SuperHotTypeDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HotVideoType; |
| | | import com.yeshi.buwan.domain.SuperHotType; |
| | | import com.yeshi.buwan.domain.web.DetailSystemSelect; |
| | |
| | | package com.yeshi.buwan.service.imp; |
| | | |
| | | import com.yeshi.buwan.dao.*; |
| | | import com.yeshi.buwan.dao.system.DetailSystemDao; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.solr.SolrAlbumVideo; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.web.DetailSystemSelect; |
| | | 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.service.inter.VideoResourceMapExtraInfoService; |
| | | import com.yeshi.buwan.service.inter.video.VideoInfoExtraService; |
| | | import com.yeshi.buwan.service.manager.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.util.*; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 将搜索结果对象转为视频对象 |
| | | * |
| | | * @param solrAlbumVideoList |
| | | * @param resourceList |
| | | * @return |
| | | */ |
| | | public List<VideoInfo> convertSolrAlbumResultToVideo(List<SolrAlbumVideo> solrAlbumVideoList, List<Long> resourceList) { |
| | | List<VideoInfo> videoInfoList = new ArrayList<>(); |
| | | for (SolrAlbumVideo sv : solrAlbumVideoList) { |
| | | VideoInfo video = VideoInfoFactory.create(sv); |
| | | videoInfoList.add(video); |
| | | } |
| | | //获取附加信息 |
| | | videoInfoList = videoInfoExtraService.batchExtra(videoInfoList, resourceList); |
| | | return videoInfoList; |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.orm.hibernate4.HibernateCallback; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.buwan.dao.DetailSystemDao; |
| | | import com.yeshi.buwan.dao.system.DetailSystemDao; |
| | | import com.yeshi.buwan.dao.SpecialDao; |
| | | import com.yeshi.buwan.dao.SpecialVideoDao; |
| | | import com.yeshi.buwan.dao.SuperSpecialDao; |
| | | import com.yeshi.buwan.dao.VideoInfoDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | | import com.yeshi.buwan.domain.special.SpecialVideo; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService; |
| | | import com.yeshi.buwan.service.inter.video.VideoInfoExtraService; |
| | | import org.hibernate.HibernateException; |
| | | import org.hibernate.Session; |
| | |
| | | import org.springframework.orm.hibernate4.HibernateCallback; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.buwan.dao.DetailSystemDao; |
| | | import com.yeshi.buwan.dao.system.DetailSystemDao; |
| | | import com.yeshi.buwan.dao.HotStarDao; |
| | | import com.yeshi.buwan.dao.SuperHotStarDao; |
| | | import com.yeshi.buwan.dao.VideoInfoDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HotStar; |
| | | import com.yeshi.buwan.domain.SuperHotStar; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | |
| | | import com.yeshi.buwan.dao.VideoPlayStatisticsDao; |
| | | import com.yeshi.buwan.dao.VideoTypeDao; |
| | | import com.yeshi.buwan.domain.CategoryContry; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HotSearch; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoPlayStatistics; |
| | |
| | | package com.yeshi.buwan.service.imp; |
| | | |
| | | import com.yeshi.buwan.dao.DetailSystemDao; |
| | | import com.yeshi.buwan.dao.SystemInfoDao; |
| | | import com.yeshi.buwan.dao.system.DetailSystemDao; |
| | | import com.yeshi.buwan.dao.system.SystemInfoDao; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | | import com.yeshi.buwan.domain.special.SuperSpecial; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import org.apache.log4j.Logger; |
| | | import org.hibernate.HibernateException; |
| | |
| | | |
| | | import com.yeshi.buwan.dao.SuperUserBannerDao; |
| | | import com.yeshi.buwan.dao.UserBannerDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.SuperUserBanner; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.UserBanner; |
| | | import com.yeshi.buwan.domain.web.DetailSystemSelect; |
| | | import com.yeshi.buwan.domain.web.UserBannerAdmin; |
| | |
| | | import com.yeshi.buwan.dao.user.LoginUserExtraDao; |
| | | import com.yeshi.buwan.domain.user.LoginUserExtra; |
| | | import com.yeshi.buwan.dto.user.LoginInfoDto; |
| | | import com.yeshi.buwan.dto.user.QQUserInfo; |
| | | import com.yeshi.buwan.exception.user.LoginUserException; |
| | | import com.yeshi.buwan.exception.user.RegisterUserException; |
| | | import com.yeshi.buwan.service.inter.LoginUserService; |
| | |
| | | import com.yeshi.buwan.dao.user.LoginUserDao; |
| | | import com.yeshi.buwan.dao.UserDao; |
| | | import com.yeshi.buwan.domain.user.LoginUser; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.UserData; |
| | | import com.yeshi.buwan.domain.UserInfo; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import org.yeshi.utils.entity.wx.WeiXinUser; |
| | | |
| | | @Service |
| | | public class UserService { |
| | |
| | | VideoInfo vi = list.get(i); |
| | | if (getSameDirectorOrActorCount(vi.getDirector(), newVideoInfo.getDirector()) > 0 || getSameDirectorOrActorCount(vi.getMainActor(), newVideoInfo.getMainActor()) > 0) { |
| | | // if (getSameDirectorOrActorCount(vi.getMainActor(), newVideoInfo.getMainActor()) > 0) { |
| | | //主分类一样 |
| | | if (vi.getVideoType() != null && newVideoInfo.getVideoType() != null && vi.getVideoType().getId() == newVideoInfo.getVideoType().getId()) |
| | | return list.get(i); |
| | | // } |
| | | } |
| | |
| | | package com.yeshi.buwan.service.imp; |
| | | |
| | | import com.yeshi.buwan.dao.VideoResourceDao; |
| | | import com.yeshi.buwan.domain.LeShiAccount; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoResource; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | |
| | | videoResourceDao.update(re); |
| | | } |
| | | |
| | | public String resourceListToJson(List<VideoResource> list, List<LeShiAccount> accountList) { |
| | | public String resourceListToJson(List<VideoResource> list) { |
| | | JSONObject object = new JSONObject(); |
| | | JSONArray array = new JSONArray(); |
| | | VideoResource vr; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import org.hibernate.HibernateException; |
| | | import org.hibernate.Session; |
| | | import org.springframework.orm.hibernate4.HibernateCallback; |
| | |
| | | |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | |
| | | private WeiXinInfo getWeiXin(List<WeiXinInfo> list) { |
| | | OtherService service = new OtherService(); |
| | |
| | | import com.yeshi.buwan.dao.video.AlbumVideoMapDao; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.entity.PlayUrl; |
| | | import com.yeshi.buwan.domain.system.SystemConfig; |
| | | import com.yeshi.buwan.domain.video.AlbumVideoMap; |
| | | import com.yeshi.buwan.iqiyi.IqiYiNewAPI; |
| | | import com.yeshi.buwan.iqiyi.entity.IqiyiAlbum2; |
| | |
| | | import com.yeshi.buwan.iqiyi.util.IqiyiUtil; |
| | | import com.yeshi.buwan.iqiyi.util.IqiyiUtil2; |
| | | import com.yeshi.buwan.query.Iqiyi2AlbumQuery; |
| | | import com.yeshi.buwan.service.imp.CategoryVideoService; |
| | | import com.yeshi.buwan.service.imp.ResourceVideoService; |
| | | import com.yeshi.buwan.service.imp.VideoInfoService; |
| | | import com.yeshi.buwan.service.imp.VideoResourceService; |
| | | import com.yeshi.buwan.service.imp.*; |
| | | import com.yeshi.buwan.service.inter.juhe.Iqiyi2Service; |
| | | import com.yeshi.buwan.service.inter.system.SystemConfigService; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | | import com.yeshi.buwan.util.log.VideoLogFactory; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.regex.Pattern; |
| | | |
| | | @Service |
| | |
| | | |
| | | @Resource |
| | | private VideoResourceService videoResourceService; |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | public List<VideoDetailInfo> getVideoDetailList(String videoId, int page, int pageSize) { |
| | | //查询专辑 |
| | |
| | | iqiyiAlbum2Dao.save(album); |
| | | } |
| | | |
| | | public boolean isUnNormalUpdateVideoName(String name) { |
| | | SystemConfig config = systemConfigService.getConfigByKeyCache("iqiyi_update_video_name"); |
| | | if (config != null) { |
| | | String[] sts = config.getValue().split(","); |
| | | List<String> list = new ArrayList<>(); |
| | | for (String st : sts) { |
| | | list.add(st.trim()); |
| | | } |
| | | return list.contains(name.trim()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public void addToVideoInfo(IqiyiAlbum2 album) { |
| | | if (album.getFeatureAlbumId() > 0L && album.getChannelId() != IqiYiNewAPI.TYPE_DIANYING) { |
| | |
| | | } |
| | | |
| | | |
| | | if (album.getChannelId() != 1 && !VideoConstant.iqiyiSpecialNames.contains(album.getName())) { |
| | | if (album.getChannelId() != 1 && !isUnNormalUpdateVideoName(album.getName())) { |
| | | //标题中只能包含中英文与数字 |
| | | String regx = "^[(\\u4e00-\\u9fa5)(:)( )a-zA-Z0-9]+$"; |
| | | if (!Pattern.matches(regx, album.getName())) { |
| | |
| | | } |
| | | |
| | | //过滤某些短片与影评 |
| | | if (album.getName().contains("《") && !VideoConstant.iqiyiSpecialNames.contains(album.getName())) |
| | | if (album.getName().contains("《") && !isUnNormalUpdateVideoName(album.getName())) |
| | | return; |
| | | |
| | | //空电视剧或者是空动漫则返回 |
| | |
| | | return getSeriesDetail(map.getInfoId()); |
| | | } |
| | | |
| | | @Override |
| | | public PPTVProgram selectProgramById(String id) { |
| | | return pptvProgramDao.get(id); |
| | | } |
| | | |
| | | @Override |
| | | public PPTVSeriesProgramMap selectMapByCode(String seriesCode, String programCode) { |
| | | PPTVQuery query = new PPTVQuery(); |
| | | query.programCode = programCode; |
| | | query.seriesCode = seriesCode; |
| | | query.count = 1; |
| | | List<PPTVSeriesProgramMap> list = pptvSeriesProgramMapDao.list(query); |
| | | if (list == null || list.size() == 0) |
| | | return null; |
| | | return list.get(0); |
| | | } |
| | | |
| | | @Override |
| | | public VideoPPTVMap selectVideoPPTVMapByInfoId(String infoId) { |
| | | return videoPPTVMapDao.selectByInfoId(infoId); |
| | | } |
| | | |
| | | /** |
| | | * 删除剧集 |
| | | * |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.buwan.dao.news.NewsDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.news.FoundNews; |
| | | import com.yeshi.buwan.domain.news.News; |
| | | import com.yeshi.buwan.domain.news.NewsImage; |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.hibernate.HibernateException; |
| | | import org.hibernate.SQLQuery; |
| | | import org.hibernate.Session; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.orm.hibernate4.HibernateCallback; |
| | |
| | | import com.yeshi.buwan.dao.recommend.CategoryRecommendCacheVideoNumberDao; |
| | | import com.yeshi.buwan.dao.recommend.CategoryRecommendVideoDao; |
| | | import com.yeshi.buwan.dao.recommend.SuperCategoryRecommendVideoDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.recommend.CategoryRecommendCacheVideo; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.recommend.CategoryRecommendCacheVideoNumber; |
| | | import com.yeshi.buwan.domain.recommend.CategoryRecommendVideo; |
| | | import com.yeshi.buwan.domain.recommend.SuperCategoryRecommendVideo; |
New file |
| | |
| | | package com.yeshi.buwan.service.imp.recommend; |
| | | |
| | | import com.yeshi.buwan.dao.recommend.HomeRecommendSpecialDao; |
| | | 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.exception.ParamsException; |
| | | import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class HomeRecommendSpecialServiceImpl implements HomeRecommendSpecialService { |
| | | |
| | | @Resource |
| | | private HomeRecommendSpecialDao homeRecommendSpecialDao; |
| | | |
| | | @Resource |
| | | private SuperHomeRecommendSpecialDao superHomeRecommendSpecialDao; |
| | | |
| | | |
| | | @Validated |
| | | @Override |
| | | public void addSpecial(@Valid HomeRecommendSpecial special) throws ParamsException, Exception { |
| | | if (special.getId() == null) { |
| | | special.setId(System.currentTimeMillis() + ""); |
| | | } |
| | | |
| | | if (special.getCreateTime() == null) { |
| | | special.setCreateTime(new Date()); |
| | | } |
| | | if (special.getWeight() == null) { |
| | | special.setWeight(1); |
| | | } |
| | | homeRecommendSpecialDao.save(special); |
| | | } |
| | | |
| | | @Override |
| | | public void updateSpecial(HomeRecommendSpecial special) throws Exception { |
| | | if (special.getId() == null) |
| | | return; |
| | | homeRecommendSpecialDao.updateSelective(special); |
| | | } |
| | | |
| | | @Override |
| | | public List<HomeRecommendSpecial> listSpecialBySystemId(String systemId) { |
| | | HomeRecommendSpecialDao.DaoQuery query = new HomeRecommendSpecialDao.DaoQuery(); |
| | | query.systemId = systemId; |
| | | query.count = Integer.MAX_VALUE; |
| | | return homeRecommendSpecialDao.list(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<HomeRecommendSpecial> listSpecialByDetailSystemId(String detailSystemId) { |
| | | SuperHomeRecommendSpecialDao.DaoQuery query = new SuperHomeRecommendSpecialDao.DaoQuery(); |
| | | query.detailSystemId = detailSystemId; |
| | | query.count = Integer.MAX_VALUE; |
| | | List<SuperHomeRecommendSpecial> list = superHomeRecommendSpecialDao.list(query); |
| | | List<String> specialIds = new ArrayList<>(); |
| | | for (SuperHomeRecommendSpecial special : list) { |
| | | specialIds.add(special.getSpecialId()); |
| | | } |
| | | List<HomeRecommendSpecial> specials = homeRecommendSpecialDao.list(specialIds); |
| | | Map<String, HomeRecommendSpecial> map = new HashMap<>(); |
| | | for (HomeRecommendSpecial special : specials) { |
| | | map.put(special.getId(), special); |
| | | } |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | if (map.get(list.get(i).getSpecialId()) == null) { |
| | | list.remove(i--); |
| | | continue; |
| | | } |
| | | list.get(i).setSpecial(map.get(list.get(i).getSpecialId())); |
| | | //替换显示名称 |
| | | if (!StringUtil.isNullOrEmpty(list.get(i).getShowName())) { |
| | | list.get(i).getSpecial().setName(list.get(i).getShowName()); |
| | | } |
| | | } |
| | | specials = new ArrayList<>(); |
| | | |
| | | for (SuperHomeRecommendSpecial superHomeRecommendSpecial : list) { |
| | | specials.add(superHomeRecommendSpecial.getSpecial()); |
| | | } |
| | | |
| | | return specials; |
| | | } |
| | | |
| | | @Override |
| | | public void deleteSpecial(String specialId) { |
| | | |
| | | List<SuperHomeRecommendSpecial> list = listSuperSpecialBySpecialId(specialId); |
| | | if (list != null) |
| | | for (SuperHomeRecommendSpecial superHomeRecommendSpecial : list) { |
| | | superHomeRecommendSpecialDao.deleteByPrimaryKey(superHomeRecommendSpecial.getId()); |
| | | } |
| | | homeRecommendSpecialDao.deleteByPrimaryKey(specialId); |
| | | } |
| | | |
| | | @Validated |
| | | @Override |
| | | public void addSuperSpecial(@Valid SuperHomeRecommendSpecial superSpecial) throws ParamsException, Exception { |
| | | //查询专题是否存在 |
| | | HomeRecommendSpecial special = homeRecommendSpecialDao.get(superSpecial.getSpecialId()); |
| | | if (special == null) { |
| | | throw new Exception("专题不存在"); |
| | | } |
| | | if (superSpecial.getId() == null) { |
| | | superSpecial.setId(SuperHomeRecommendSpecial.createId(superSpecial.getSpecialId(), superSpecial.getDetailSystemId())); |
| | | } |
| | | if (superSpecial.getWeight() == null) { |
| | | superSpecial.setWeight(special.getWeight()); |
| | | } |
| | | if (superSpecial.getCreateTime() == null) |
| | | superSpecial.setCreateTime(new Date()); |
| | | superHomeRecommendSpecialDao.save(superSpecial); |
| | | } |
| | | |
| | | @Override |
| | | public void updateSuperSpecial(SuperHomeRecommendSpecial superSpecial) throws Exception { |
| | | if (superSpecial.getId() == null) |
| | | return; |
| | | superHomeRecommendSpecialDao.updateSelective(superSpecial); |
| | | } |
| | | |
| | | @Override |
| | | public List<SuperHomeRecommendSpecial> listSuperSpecialBySpecialId(String specialId) { |
| | | SuperHomeRecommendSpecialDao.DaoQuery query = new SuperHomeRecommendSpecialDao.DaoQuery(); |
| | | query.specialId = specialId; |
| | | query.start = 0; |
| | | query.count = Integer.MAX_VALUE; |
| | | return superHomeRecommendSpecialDao.list(query); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteSuperSpecial(String specialId, String detailSystemId) { |
| | | SuperHomeRecommendSpecialDao.DaoQuery query = new SuperHomeRecommendSpecialDao.DaoQuery(); |
| | | query.specialId = specialId; |
| | | query.detailSystemId = detailSystemId; |
| | | query.start = 0; |
| | | query.count = Integer.MAX_VALUE; |
| | | List<SuperHomeRecommendSpecial> list = superHomeRecommendSpecialDao.list(query); |
| | | if (list != null) |
| | | for (SuperHomeRecommendSpecial superHomeRecommendSpecial : list) { |
| | | superHomeRecommendSpecialDao.deleteByPrimaryKey(superHomeRecommendSpecial.getId()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void deleteSuperSpecial(String id) { |
| | | superHomeRecommendSpecialDao.deleteByPrimaryKey(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.buwan.service.imp.system; |
| | | |
| | | import com.yeshi.buwan.dao.system.SystemConfigDao; |
| | | import com.yeshi.buwan.domain.system.SystemConfig; |
| | | import com.yeshi.buwan.service.inter.system.SystemConfigService; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Service |
| | | public class SystemConfigServiceImpl implements SystemConfigService { |
| | | |
| | | @Resource |
| | | private SystemConfigDao systemConfigDao; |
| | | |
| | | |
| | | @Override |
| | | public SystemConfig getConfigByKey(String key) { |
| | | return systemConfigDao.get(key); |
| | | } |
| | | |
| | | @Cacheable(value = "configCache", key = "'system-getConfigByKey'+'-'+#key") |
| | | @Override |
| | | public SystemConfig getConfigByKeyCache(String key) { |
| | | return getConfigByKey(key); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void batchExtra(List<VideoInfo> videoInfoList) { |
| | | if (videoInfoList == null || videoInfoList.size() == 0) |
| | | return; |
| | | List<String> ids = new ArrayList<>(); |
| | | for (VideoInfo videoInfo : videoInfoList) { |
| | | ids.add(videoInfo.getId()); |
| | |
| | | public List<VideoWatchHistory> listHistory(String device, int page, int pageSize) { |
| | | return videoWatchHistoryDao.list(device, (page - 1) * pageSize, pageSize); |
| | | } |
| | | |
| | | @Override |
| | | public VideoWatchHistory getWatchHistory(String device, String videoId) { |
| | | String id = VideoWatchHistory.createId(device, videoId); |
| | | return videoWatchHistoryDao.get(id); |
| | | } |
| | | } |
| | |
| | | package com.yeshi.buwan.service.inter.juhe; |
| | | |
| | | import com.yeshi.buwan.pptv.entity.PPTVProgram; |
| | | import com.yeshi.buwan.pptv.entity.PPTVSeries; |
| | | import com.yeshi.buwan.pptv.entity.PPTVSeriesProgramMap; |
| | | import com.yeshi.buwan.pptv.entity.VideoPPTVMap; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public PPTVSeries getSeriesDetailByVideoId(String videoId); |
| | | |
| | | |
| | | /** |
| | | * 根据ID查询节目 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public PPTVProgram selectProgramById(String id); |
| | | |
| | | /** |
| | | * 根据code查询映射 |
| | | * |
| | | * @param seriesCode |
| | | * @param programCode |
| | | * @return |
| | | */ |
| | | public PPTVSeriesProgramMap selectMapByCode(String seriesCode, String programCode); |
| | | |
| | | |
| | | /** |
| | | * 根据infoId查询 |
| | | * |
| | | * @param infoId |
| | | * @return |
| | | */ |
| | | public VideoPPTVMap selectVideoPPTVMapByInfoId(String infoId); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.buwan.service.inter.recommend; |
| | | |
| | | import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial; |
| | | import com.yeshi.buwan.domain.recommend.SuperHomeRecommendSpecial; |
| | | import com.yeshi.buwan.exception.ParamsException; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | public interface HomeRecommendSpecialService { |
| | | |
| | | /** |
| | | * 添加专题 |
| | | * |
| | | * @param special |
| | | * @throws Exception |
| | | */ |
| | | public void addSpecial(@Valid HomeRecommendSpecial special) throws ParamsException, Exception; |
| | | |
| | | /** |
| | | * 专题更新 |
| | | * |
| | | * @param special |
| | | * @throws Exception |
| | | */ |
| | | public void updateSpecial(HomeRecommendSpecial special) throws Exception; |
| | | |
| | | /** |
| | | * 根据系统ID检索 |
| | | * |
| | | * @param systemId |
| | | * @return |
| | | */ |
| | | public List<HomeRecommendSpecial> listSpecialBySystemId(String systemId); |
| | | |
| | | /** |
| | | * 根据子系统ID检索 |
| | | * |
| | | * @param detailSystemId |
| | | * @return |
| | | */ |
| | | public List<HomeRecommendSpecial> listSpecialByDetailSystemId(String detailSystemId); |
| | | |
| | | |
| | | /** |
| | | * 删除专题 |
| | | * |
| | | * @param specialId |
| | | */ |
| | | public void deleteSpecial(String specialId); |
| | | |
| | | |
| | | /** |
| | | * 添加专题子系统映射 |
| | | * |
| | | * @param superSpecial |
| | | * @throws Exception |
| | | */ |
| | | public void addSuperSpecial(@Valid SuperHomeRecommendSpecial superSpecial) throws ParamsException, Exception; |
| | | |
| | | |
| | | /** |
| | | * 更新映射 |
| | | * |
| | | * @param superSpecial |
| | | * @throws Exception |
| | | */ |
| | | public void updateSuperSpecial(SuperHomeRecommendSpecial superSpecial) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 根据专题ID检索 |
| | | * |
| | | * @param specialId |
| | | * @return |
| | | */ |
| | | public List<SuperHomeRecommendSpecial> listSuperSpecialBySpecialId(String specialId); |
| | | |
| | | |
| | | /** |
| | | * 删除映射 |
| | | * |
| | | * @param specialId |
| | | * @param detailSystemId |
| | | */ |
| | | public void deleteSuperSpecial(String specialId, String detailSystemId); |
| | | |
| | | |
| | | public void deleteSuperSpecial(String id); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.buwan.service.inter.system; |
| | | |
| | | import com.yeshi.buwan.domain.system.SystemConfig; |
| | | |
| | | public interface SystemConfigService { |
| | | //根据Key值查询 |
| | | public SystemConfig getConfigByKey(String key); |
| | | |
| | | public SystemConfig getConfigByKeyCache(String key); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | public List<VideoWatchHistory> listHistory(String device, int page, int pageSize); |
| | | |
| | | public VideoWatchHistory getWatchHistory(String device,String videoId); |
| | | |
| | | |
| | | } |
| | |
| | | query.setOffset((page - 1) * pageSize); |
| | | /** 设置每页显示记录数,默认10 */ |
| | | query.setRows(pageSize); |
| | | if (StringUtil.isNullOrEmpty(filter.getSortKey())) { |
| | | query.addSort(new Sort(Sort.Direction.DESC, "year")); |
| | | } else { |
| | | if (!StringUtil.isNullOrEmpty(filter.getSortKey())) { |
| | | query.addSort(new Sort(Sort.Direction.DESC, filter.getSortKey())); |
| | | } |
| | | |
| | |
| | | |
| | | public static boolean IsOutNet = true;// 是否为外网 |
| | | |
| | | public static boolean JobTasker = false; |
| | | public static boolean JobTasker = true; |
| | | |
| | | public static int pageCount = 20; |
| | | public static int HOT_SEARCH_COUNT = 20; |
| | |
| | | public static int VERSION_NEW_IOS_V2 = 15;// 新版版本号 |
| | | |
| | | |
| | | //分类中的VIP |
| | | public final static int VIDEO_TYPE_VIP = 100001; |
| | | |
| | | //电影 |
| | | public final static int VIDEO_TYPE_VIP_MOVIE = 100002; |
| | | //电视剧 |
| | | public final static int VIDEO_TYPE_VIP_TV = 100003; |
| | | //综艺 |
| | | public final static int VIDEO_TYPE_VIP_SHOW = 100004; |
| | | //动漫 |
| | | public final static int VIDEO_TYPE_VIP_CARTOON = 100005; |
| | | |
| | | 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 |
| | | }; |
| | | |
| | | //分类中的直播 |
| | | public final static int VIDEO_TYPE_ZHIBO = 22222; |
| | | |
| | | |
| | | //腾讯短信验证码配置 |
| | | public static TencentSMSConfig tencentSMSConfig; |
| | | |
| | |
| | | package com.yeshi.buwan.util; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.buwan.domain.LeShiAccountVideo; |
| | | import com.yeshi.buwan.domain.entity.VideoAccount; |
| | | |
| | | import jxl.Cell; |
| | | import jxl.Sheet; |
| | | import jxl.Workbook; |
| | | import jxl.read.biff.BiffException; |
| | | |
| | | public class ExcelReadUtil { |
| | | |
| | | public static List<LeShiAccountVideo> getLeShiAccountFromExcel(int start, |
| | | int end) { |
| | | List<LeShiAccountVideo> list = new ArrayList<LeShiAccountVideo>(); |
| | | try { |
| | | String fileName = "C:/Users/Administrator/Desktop/影片本地表.xls"; // Excel文件所在路径 |
| | | File file = new File(fileName); // 创建文件对象 |
| | | Workbook wb = Workbook.getWorkbook(file); // 从文件流中获取Excel工作区对象(WorkBook) |
| | | Sheet sheet = wb.getSheet(0); // 从工作区中取得页(Sheet) |
| | | |
| | | for (int i = start - 1; i < end; i++) { // 循环打印Excel表中的内容 |
| | | Cell cell = sheet.getCell(0, i); |
| | | Cell cell1 = sheet.getCell(1, i); |
| | | Cell cell2 = sheet.getCell(2, i); |
| | | LeShiAccountVideo video = new LeShiAccountVideo(); |
| | | video.setAccount(cell.getContents().trim() + "@" |
| | | + cell1.getContents().trim()); |
| | | video.setPwd(cell2.getContents().trim()); |
| | | video.setState("0"); |
| | | video.setValid("0"); |
| | | video.setDetailId("0"); |
| | | video.setUsecount("0"); |
| | | // juhe.setRegisterip().trim()); |
| | | list.add(video); |
| | | LogUtil.i(cell.getContents()); |
| | | } |
| | | } catch (BiffException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public static List<VideoAccount> getRegisterLeShiAccountFromExcel( |
| | | int start, int count) { |
| | | List<VideoAccount> list = new ArrayList<VideoAccount>(); |
| | | try { |
| | | String fileName = "C:/Users/Administrator/Desktop/影片本地表.xls"; // Excel文件所在路径 |
| | | File file = new File(fileName); // 创建文件对象 |
| | | Workbook wb = Workbook.getWorkbook(file); // 从文件流中获取Excel工作区对象(WorkBook) |
| | | Sheet sheet = wb.getSheet(0); // 从工作区中取得页(Sheet) |
| | | |
| | | for (int i = start - 1; i < 1 + start + count; i++) { // 循环打印Excel表中的内容 |
| | | Cell cell = sheet.getCell(0, i);// 账号 |
| | | Cell cell1 = sheet.getCell(1, i);// 账号 |
| | | Cell cell2 = sheet.getCell(2, i);// 账号 |
| | | Cell cell3 = sheet.getCell(5, i);// 账号 |
| | | String account = cell.getContents() + "@" + cell1.getContents(); |
| | | String pwd = cell2.getContents(); |
| | | String url = cell3.getContents(); |
| | | VideoAccount video = new VideoAccount(); |
| | | video.setAccount(account); |
| | | video.setName(pwd); |
| | | video.setBeizhu(url); |
| | | // if (url != null && url.length() > 20) |
| | | list.add(video); |
| | | LogUtil.i(cell.getContents()); |
| | | } |
| | | } catch (BiffException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public static List<VideoAccount> getLeShiAccount(String filePath, |
| | | int start, int end) { |
| | | List<VideoAccount> list = new ArrayList<VideoAccount>(); |
| | | try { |
| | | String fileName = filePath; // Excel文件所在路径 |
| | | File file = new File(fileName); // 创建文件对象 |
| | | Workbook wb = Workbook.getWorkbook(file); // 从文件流中获取Excel工作区对象(WorkBook) |
| | | Sheet sheet = wb.getSheet(0); // 从工作区中取得页(Sheet) |
| | | |
| | | for (int i = start; i < end; i++) { // 循环打印Excel表中的内容 |
| | | Cell cell = sheet.getCell(0, i);// 账号 |
| | | Cell cell1 = sheet.getCell(3, i);// 密码 |
| | | String account = cell.getContents(); |
| | | String pwd = cell1.getContents(); |
| | | VideoAccount video = new VideoAccount(); |
| | | video.setAccount(account); |
| | | video.setName(pwd); |
| | | if (!StringUtil.isNullOrEmpty(account)) |
| | | list.add(video); |
| | | LogUtil.i(account); |
| | | } |
| | | } catch (BiffException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.buwan.util.JuHe; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | } |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | return list; |
| | | } |
| | |
| | | package com.yeshi.buwan.util; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import java.util.List; |
| | | |
| | | public class SystemUtil { |
| | | |
| | |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import org.apache.commons.httpclient.HttpClient; |
| | | import org.apache.commons.httpclient.HttpException; |
| | | import org.apache.commons.httpclient.NameValuePair; |
| | | import org.apache.commons.httpclient.methods.PostMethod; |
| | | import org.apache.commons.httpclient.params.HttpMethodParams; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.support.FileSystemXmlApplicationContext; |
| | | |
| | | import com.yeshi.buwan.domain.entity.NewVideoDetail; |
| | | import com.yeshi.buwan.domain.entity.NewVideoInfo; |
| | | import com.yeshi.buwan.domain.entity.VideoResourceVideo; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.service.imp.UserService; |
| | | import com.yeshi.buwan.zhibo.entity.Live; |
| | | |
| | | @Entity |
| | | public class Utils { |
| | |
| | | de.setWatchCount(info.getWatchCount()); |
| | | de.setYear(info.getYear()); |
| | | de.setShare(info.getShare()); |
| | | de.setCanSave(info.isCanSave()); |
| | | de.setCanSave(info.getCanSave()); |
| | | de.setResourceList(info.getResourceList()); |
| | | de.setPlayPicture(info.getPlayPicture()); |
| | | de.setShowType(info.getShowType()); |
| | |
| | | ni.setArea(vi.getArea()); |
| | | ni.setBaseurl(vi.getBaseurl()); |
| | | ni.setBeizhu(vi.getBeizhu()); |
| | | ni.setCanSave(vi.isCanSave()); |
| | | ni.setCanSave(vi.getCanSave()); |
| | | ni.setCommentCount(vi.getCommentCount()); |
| | | ni.setCreatetime(vi.getCreatetime() + ""); |
| | | ni.setDay(vi.getDay()); |
| | |
| | | new UserService().updateUserInfo(user); |
| | | } |
| | | |
| | | Map<String, String> map = new ConfigService().getConfigAsMap(new DetailSystem(SystemUtil.getDetailSystemId() + ""), SystemUtil.getDefaultVersion()); |
| | | Map<String, String> map = new DetailSystemConfigService().getConfigAsMap(new DetailSystem(SystemUtil.getDetailSystemId() + ""), SystemUtil.getDefaultVersion()); |
| | | String[] detailsystemIds = new String[]{"1", "2", "3", "4", "5", "6", "14", "12", "20", "11"}; |
| | | for (String d : detailsystemIds) { |
| | | if (detailSystemId.equalsIgnoreCase(d)) { |
| | |
| | | System.out.println("---"); |
| | | } |
| | | |
| | | if (vi.getVideocount() > 1) { |
| | | if (vi.getVideocount()!=null&&vi.getVideocount() > 1) { |
| | | if (platform.equalsIgnoreCase("android")) {// Android |
| | | if (StringUtil.isNullOrEmpty(version) || Integer.parseInt(version) < 35) { |
| | | if (!StringUtil.isNullOrEmpty(vi.getLatestVpicture())) { |
| | |
| | | package com.yeshi.buwan.util.api; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | /** |
| | | * 播放统计 |
| | | * |
| | | * @param detailSystemId |
| | | * @param resourceid |
| | | * @param videoid |
| | |
| | | } |
| | | |
| | | /** |
| | | * 用户视频详情 |
| | | * |
| | | * @param detailSystemId |
| | | * @param videoId |
| | | * @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); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 爱奇艺视频更新 |
| | | * |
| | | * @param album2 |
| | |
| | | package com.yeshi.buwan.util.video; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | |
| | | public class DataCloneUtil { |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import org.apache.commons.httpclient.HttpClient; |
| | | import org.apache.commons.httpclient.HttpException; |
| | | import org.apache.commons.httpclient.methods.GetMethod; |
| | |
| | | |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | |
| | | public final static String MEINV_FX = "meinv_fx";// 酷狗繁星 |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | |
| | | public List<HomeVideo> getMeiNvZhiBo(String type, DetailSystem system,int version) { |
| | | Map<String, String> map = configService.getConfigAsMap(system,version); |
| | |
| | | package com.yeshi.buwan.util.zhibo; |
| | | |
| | | import com.yeshi.buwan.domain.Config; |
| | | import com.yeshi.buwan.service.imp.ConfigService; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.zhibo.entity.Live; |
| | | import net.sf.json.JSONArray; |
| | |
| | | public class ZhiBoUtil { |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | private DetailSystemConfigService configService; |
| | | |
| | | private static ZhiBoUtil zhiBoUtil; |
| | | |
| | |
| | | package com.yeshi.buwan.vo; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class AcceptData { |
| | | private String method; |
| | |
| | | public class HomeClassVO extends VideoType { |
| | | public final static String DATA_TYPE_RECOMMEND="recommend"; |
| | | public final static String DATA_TYPE_CLASS="class"; |
| | | //小说 |
| | | public final static String DATA_TYPE_NOVEL="novel"; |
| | | //common |
| | | public final static String DATA_TYPE_COMMON = "common"; |
| | | |
| | | |
| | | @Expose |
| | | private String dataType;//数据类型 "recommend"-推荐 "class"-分类 "novel"-小说 |
| | | |
| | | @Expose |
| | | private String dataKey;//关键词 |
| | | |
| | | public String getDataType() { |
| | | return dataType; |
| | |
| | | public void setDataType(String dataType) { |
| | | this.dataType = dataType; |
| | | } |
| | | |
| | | public String getDataKey() { |
| | | return dataKey; |
| | | } |
| | | |
| | | public void setDataKey(String dataKey) { |
| | | this.dataKey = dataKey; |
| | | } |
| | | } |
| | |
| | | import java.util.Set; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | |
| | | public class LiveType { |
| | | @Expose |
File was renamed from src/main/resources/domain/DetailSystem.hbm.xml |
| | |
| | | "-//Hibernate/Hibernate Mapping DTD 3.0//EN" |
| | | "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> |
| | | <hibernate-mapping package="com.yeshi.buwan.domain"> |
| | | <class name="DetailSystem" table="wk_video_detailsystem"> |
| | | <class name="com.yeshi.buwan.domain.system.DetailSystem" table="wk_video_detailsystem"> |
| | | <id name="id" column="id"> |
| | | <generator class="native"></generator> |
| | | </id> |
File was renamed from src/main/resources/domain/Config.hbm.xml |
| | |
| | | "-//Hibernate/Hibernate Mapping DTD 3.0//EN" |
| | | "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> |
| | | <hibernate-mapping package="com.yeshi.buwan.domain"> |
| | | <class name="Config" table="wk_video_config"> |
| | | <class name="com.yeshi.buwan.domain.system.DetailSystemConfig" table="wk_video_config"> |
| | | <id name="id" column="id"> |
| | | <generator class="native"></generator> |
| | | </id> |
File was renamed from src/main/resources/domain/SystemInfo.hbm.xml |
| | |
| | | "-//Hibernate/Hibernate Mapping DTD 3.0//EN" |
| | | "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> |
| | | <hibernate-mapping package="com.yeshi.buwan.domain"> |
| | | <class name="SystemInfo" table="wk_video_system"> |
| | | <class name="com.yeshi.buwan.domain.system.SystemInfo" table="wk_video_system"> |
| | | <id name="id" column="id"> |
| | | <generator class="native"></generator> |
| | | </id> |
| | |
| | | <key> |
| | | <column name="livetype_id"></column> |
| | | </key> |
| | | <many-to-many column="sys_id" class="com.yeshi.buwan.domain.DetailSystem"/> |
| | | <many-to-many column="sys_id" class="com.yeshi.buwan.domain.system.DetailSystem"/> |
| | | </set> |
| | | </class> |
| | | |
| | |
| | | <mapping resource="domain/AdType.hbm.xml"/> |
| | | <mapping resource="domain/Advice.hbm.xml"/> |
| | | <mapping resource="domain/Collection.hbm.xml"/> |
| | | <mapping resource="domain/Config.hbm.xml"/> |
| | | <mapping resource="domain/system/DetailSystemConfig.hbm.xml"/> |
| | | <mapping resource="domain/GetScoreCollect.hbm.xml"/> |
| | | <mapping resource="domain/GetScoreOpen.hbm.xml"/> |
| | | <mapping resource="domain/GetScoreRule.hbm.xml"/> |
| | |
| | | <mapping resource="domain/HotStarVideo.hbm.xml"/> |
| | | <mapping resource="domain/SearchHistory.hbm.xml"/> |
| | | <mapping resource="domain/ScoreHistory.hbm.xml"/> |
| | | <mapping resource="domain/SystemInfo.hbm.xml"/> |
| | | <mapping resource="domain/system/SystemInfo.hbm.xml"/> |
| | | <mapping resource="domain/UserInfo.hbm.xml"/> |
| | | <mapping resource="domain/UseScoreHistory.hbm.xml"/> |
| | | <mapping resource="domain/VideoDetailInfo.hbm.xml"/> |
| | |
| | | <mapping resource="domain/WXAd.hbm.xml"/> |
| | | <mapping resource="domain/WXStatistics.hbm.xml"/> |
| | | <mapping resource="domain/ShareContent.hbm.xml"/> |
| | | <mapping resource="domain/DetailSystem.hbm.xml"/> |
| | | <mapping resource="domain/LeShiAccount.hbm.xml"/> |
| | | <mapping resource="domain/LeShiUrl.hbm.xml"/> |
| | | <mapping resource="domain/system/DetailSystem.hbm.xml"/> |
| | | <mapping resource="domain/VideoPlayError.hbm.xml"/> |
| | | <mapping resource="domain/LeShiWatch.hbm.xml"/> |
| | | <mapping resource="domain/LeShiAccountVideo.hbm.xml"/> |
| | | <mapping resource="domain/DeviceInfo.hbm.xml"/> |
| | | <mapping resource="domain/LeShiDownLoad.hbm.xml"/> |
| | | <mapping resource="domain/LeShiWatchCopy.hbm.xml"/> |
| | | <mapping resource="domain/HomeNotice.hbm.xml"/> |
| | | <mapping resource="domain/WeiXinInfo.hbm.xml"/> |
| | | <mapping resource="domain/WeiXinImage.hbm.xml"/> |
| | | <mapping resource="domain/ImageInfo.hbm.xml"/> |
| | | <mapping resource="domain/LeShiRegister.hbm.xml"/> |
| | | <mapping resource="domain/KKInstall.hbm.xml"/> |
| | | <mapping resource="domain/HotVideoType.hbm.xml"/> |
| | | <mapping resource="domain/VideoTypeStatistics.hbm.xml"/> |
| | |
| | | <mapping resource="domain/RecommendAd.hbm.xml"/> |
| | | <mapping resource="domain/SuperHomeType.hbm.xml"/> |
| | | <mapping resource="domain/SuperHomeAd.hbm.xml"/> |
| | | <mapping resource="domain/LeShiMovieVip.hbm.xml"/> |
| | | <mapping resource="domain/SuperVideoType.hbm.xml"/> |
| | | <mapping resource="domain/SuperHotType.hbm.xml"/> |
| | | <mapping resource="domain/SuperUserBanner.hbm.xml"/> |
| | | <mapping resource="domain/SuperRecommendAd.hbm.xml"/> |
| | | <mapping resource="domain/SuperHotSearch.hbm.xml"/> |
| | | <mapping resource="domain/SuperHomeNotice.hbm.xml"/> |
| | | <mapping resource="domain/LeShiUrlIds.hbm.xml"/> |
| | | <mapping resource="domain/AcfunUrlId.hbm.xml"/> |
| | | <mapping resource="domain/AcfunVideoUrl.hbm.xml"/> |
| | | <mapping resource="domain/Comment.hbm.xml"/> |
| | |
| | | <beans xmlns="http://www.springframework.org/schema/beans" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xmlns:solr="http://www.springframework.org/schema/data/solr" |
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans |
| | | https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/data/solr http://www.springframework.org/schema/data/solr/spring-solr.xsd"> |
| | | xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd |
| | | http://www.springframework.org/schema/data/solr http://www.springframework.org/schema/data/solr/spring-solr-2.0.xsd"> |
| | | |
| | | <!--<bean id="solrClient" class="org.apache.solr.client.solrj.impl.HttpSolrClient">--> |
| | | <!--<constructor-arg value="${solr.url}"></constructor-arg>--> |
| | | <!--</bean>--> |
| | | <solr:solr-client id="client" url="${solr.url}"></solr:solr-client> |
| | | |
| | | <bean id="solrTemplate" |
| | | class="org.springframework.data.solr.core.SolrTemplate"> |
| | | <constructor-arg name="solrClient" ref="client"/> |
| | | <constructor-arg ref="client"/> |
| | | </bean> |
| | | </beans> |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | //@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试 |
| | | //@ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | | //@WebAppConfiguration |
| | | @RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试 |
| | | @ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | | @WebAppConfiguration |
| | | public class AcfunTest { |
| | | |
| | | @Resource |
| | |
| | | |
| | | @org.junit.Test |
| | | public void test1() { |
| | | juHeVideoUpdateJob.updateAcFun(); |
| | | } |
| | | |
| | | @org.junit.Test |
| | |
| | | package com.hxh.spring.test; |
| | | |
| | | import com.yeshi.buwan.dao.system.SystemConfigDao; |
| | | import com.yeshi.buwan.domain.system.SystemConfig; |
| | | import com.yeshi.buwan.job.AdJob; |
| | | import com.yeshi.buwan.service.inter.system.SystemConfigService; |
| | | import org.json.JSONObject; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @RunWith(SpringJUnit4ClassRunner.class) |
| | | @ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | |
| | | public class ConfigTest { |
| | | |
| | | @Resource |
| | | private AdJob adJob; |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Resource |
| | | private SystemConfigDao systemConfigDao; |
| | | |
| | | |
| | | @Test |
| | | public void test1() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("appId", "10409568"); |
| | | jsonObject.put("detailSystemId", "44"); |
| | | try { |
| | | adJob.openHWAd(jsonObject.toString()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | public void addSystemConfig() { |
| | | SystemConfig systemConfig = new SystemConfig(); |
| | | systemConfig.setBeizhu(""); |
| | | systemConfig.setKey("iqiyi_update_video_name"); |
| | | systemConfig.setName("爱奇艺特殊更新的视频名称"); |
| | | systemConfig.setValue("《卧底》,没关系,是青春啊!,山海情(原声版),我的时代,你的时代,你好,安怡"); |
| | | systemConfig.setCreateTime(new Date()); |
| | | systemConfig.setId(SystemConfig.createId(systemConfig.getKey())); |
| | | systemConfigDao.save(systemConfig); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.yeshi.buwan.dao.juhe.funtv.VideoFunTVDao; |
| | | import com.yeshi.buwan.dao.juhe.funtv.VideoFunTVNewDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.funtv.FunTVApi; |
| | | import com.yeshi.buwan.funtv.FunTVDataParseUtil; |
| | | import com.yeshi.buwan.funtv.FunTVUtil; |
| | | import com.yeshi.buwan.funtv.entity.VideoFunTV; |
| | | import com.yeshi.buwan.funtv.vo.FunTVShortVideo; |
| | | import com.yeshi.buwan.funtv.vo.FunTVTVAlbum; |
| | | import com.yeshi.buwan.service.imp.juhe.FunTVService; |
| | | import com.yeshi.buwan.util.BeanUtil; |
| | |
| | | import com.yeshi.buwan.dao.base.MongodbBaseDao; |
| | | import com.yeshi.buwan.dao.video.VideoResourceVersionMapDao; |
| | | 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.SystemConfig; |
| | | import com.yeshi.buwan.domain.video.VideoResourceVersionMap; |
| | | import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService; |
| | | import org.yeshi.utils.generater.SpringComponentGenerater; |
| | |
| | | @org.junit.Test |
| | | public void createDao() { |
| | | try { |
| | | SpringComponentGenerater.createMongoDao(new MongoDBDaoData.Builder().setBaseDaoClass(MongodbBaseDao.class).setDaoPackageName("com.yeshi.buwan.dao.video").setEntityClass(VideoInfo.class).create(), "D:\\workspace\\BuWan\\src\\main\\java\\com\\yeshi\\buwan\\dao\\video\\"); |
| | | SpringComponentGenerater.createMongoDao(new MongoDBDaoData.Builder().setBaseDaoClass(MongodbBaseDao.class).setDaoPackageName("com.yeshi.buwan.dao.recommend").setEntityClass(SuperHomeRecommendSpecial.class).create(), "D:\\workspace\\BuWan\\src\\main\\java\\com\\yeshi\\buwan\\dao\\recommend\\"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.util.Scanner; |
| | | |
| | | public class LogTest { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(LogTest.class); |
| | | |
| | | @Test |
| | | public void testLog() { |
| | | logger.info("测试"); |
| | | 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")); |
| | | while (scanner.hasNextLine()) { |
| | | String text = scanner.nextLine(); |
| | | if (text != null && text.contains("getVideoDetail:")) { |
| | | count++; |
| | | } |
| | | } |
| | | scanner.close(); |
| | | System.out.println(count); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void reAddVideo(){ |
| | | reAdd("武林外传"); |
| | | } |
| | | |
| | | private void reAdd(String name) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("name").is(name)); |
| | | PPTVSeries series = pptvSeriesDao.findOne(query); |
| | | if (series != null) { |
| | | pptvService.offLineSeries(series.getInfoID()); |
| | | //添加到详情 |
| | | try { |
| | | Thread.sleep(1000 * 3L); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | series = pptvService.getSeriesDetail(series.getInfoID()); |
| | | pptvService.addToVideoInfo(series); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void logs() { |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoDetailInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | |
| | | package com.hxh.spring.test; |
| | | |
| | | import com.yeshi.buwan.dao.VideoInfoDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.entity.PlayUrl; |
| | | import com.yeshi.buwan.iqiyi.IqiYiNewAPI; |