| | |
| | | <dependency> |
| | | <groupId>com.yeshi</groupId> |
| | | <artifactId>utils</artifactId> |
| | | <version>0.1.1</version> |
| | | <version>0.1.4</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.slf4j</groupId> |
New file |
| | |
| | | package com.yeshi.buwan.controller; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.annotations.SerializedName; |
| | | import com.yeshi.buwan.service.inter.order.OrderService; |
| | | import com.yeshi.buwan.util.RedisManager; |
| | | import com.yeshi.buwan.util.log.LoggerUtil; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.yeshi.utils.wx.WXUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | @Controller |
| | | @RequestMapping("apple") |
| | | public class AppleController { |
| | | Logger logger = LoggerFactory.getLogger(AppleController.class); |
| | | |
| | | @Resource |
| | | private RedisManager redisManager; |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | private String getRequestBody(HttpServletRequest request) { |
| | | try { |
| | | byte[] buffer = new byte[2048]; |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | int readBytes; |
| | | while ((readBytes = request.getInputStream().read(buffer)) > 0) { |
| | | stringBuilder.append(new String(buffer, 0, readBytes)); |
| | | } |
| | | |
| | | return stringBuilder.toString(); |
| | | } catch (Exception var4) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 字段说明:https://developer.apple.com/documentation/appstoreservernotifications/responsebody |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | | @RequestMapping("notify") |
| | | public void notify(HttpServletRequest request, HttpServletResponse response) { |
| | | String content = getRequestBody(request); |
| | | logger.info("回调内容为:{}", content); |
| | | |
| | | ResponseBody responseBody = new Gson().fromJson(content, ResponseBody.class); |
| | | //获取内容 |
| | | switch (responseBody.getNotificationType()) { |
| | | //初次购买订阅 |
| | | case "INITIAL_BUY": |
| | | |
| | | |
| | | break; |
| | | |
| | | //表示已成功自动续订过去未能续订的过期订阅。 |
| | | case "DID_RECOVER": |
| | | break; |
| | | |
| | | //表示客户的订阅已成功自动续订新的交易时段。 |
| | | case "DID_RENEW": |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | private class ResponseBody { |
| | | @SerializedName("auto_renew_product_id") |
| | | private String productId; |
| | | @SerializedName("notification_type") |
| | | private String notificationType; |
| | | @SerializedName("original_transaction_id") |
| | | private long originalTransactionId; |
| | | @SerializedName("unified_receipt") |
| | | private String unifiedReceipt; |
| | | //Sandbox, PROD |
| | | private String environment; |
| | | @SerializedName("bid") |
| | | private String bundleId; |
| | | @SerializedName("bvrs") |
| | | private String version; |
| | | @SerializedName("auto_renew_status") |
| | | private boolean status; |
| | | |
| | | public String getProductId() { |
| | | return productId; |
| | | } |
| | | |
| | | public void setProductId(String productId) { |
| | | this.productId = productId; |
| | | } |
| | | |
| | | public String getNotificationType() { |
| | | return notificationType; |
| | | } |
| | | |
| | | public void setNotificationType(String notificationType) { |
| | | this.notificationType = notificationType; |
| | | } |
| | | |
| | | public long getOriginalTransactionId() { |
| | | return originalTransactionId; |
| | | } |
| | | |
| | | public void setOriginalTransactionId(long originalTransactionId) { |
| | | this.originalTransactionId = originalTransactionId; |
| | | } |
| | | |
| | | public String getUnifiedReceipt() { |
| | | return unifiedReceipt; |
| | | } |
| | | |
| | | public void setUnifiedReceipt(String unifiedReceipt) { |
| | | this.unifiedReceipt = unifiedReceipt; |
| | | } |
| | | |
| | | public String getEnvironment() { |
| | | return environment; |
| | | } |
| | | |
| | | public void setEnvironment(String environment) { |
| | | this.environment = environment; |
| | | } |
| | | |
| | | public String getBundleId() { |
| | | return bundleId; |
| | | } |
| | | |
| | | public void setBundleId(String bundleId) { |
| | | this.bundleId = bundleId; |
| | | } |
| | | |
| | | public String getVersion() { |
| | | return version; |
| | | } |
| | | |
| | | public void setVersion(String version) { |
| | | this.version = version; |
| | | } |
| | | |
| | | public boolean isStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(boolean status) { |
| | | this.status = status; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.buwan.controller.admin.api; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.buwan.domain.special.SearchSpecial; |
| | | import com.yeshi.buwan.domain.special.SearchSpecialPosition; |
| | | import com.yeshi.buwan.service.inter.search.SearchSpecialPositionService; |
| | | import com.yeshi.buwan.service.inter.search.SearchSpecialService; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | | import com.yeshi.buwan.util.SystemUtil; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.PrintWriter; |
| | | import java.lang.reflect.Type; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Controller |
| | | @RequestMapping("admin/new/api/search/special") |
| | | public class SearchSpecialAdminController { |
| | | @Resource |
| | | private SearchSpecialService searchSpecialService; |
| | | |
| | | @Resource |
| | | private SearchSpecialPositionService searchSpecialPositionService; |
| | | |
| | | private Gson getGson() { |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | @Override |
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) { |
| | | if (value == null) { |
| | | return new JsonPrimitive(""); |
| | | } else { |
| | | return new JsonPrimitive(TimeUtil.getGernalTime(value.getTime(), "yyyy.MM.dd HH:mm")); |
| | | } |
| | | } |
| | | }).create(); |
| | | return gson; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取专题列表 |
| | | * |
| | | * @param key |
| | | * @param page |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "/getSpecialList", method = RequestMethod.POST) |
| | | public void getSpecialList(String key, int page, HttpSession session, PrintWriter out) { |
| | | String systemId = SystemUtil.getAdminSelectedSystemId(session); |
| | | List<SearchSpecial> list = searchSpecialService.listSpecial(key, systemId, page, Constant.pageCount); |
| | | long count = searchSpecialService.countSpecial(key, systemId); |
| | | Gson gson = getGson(); |
| | | JSONObject root = new JSONObject(); |
| | | root.put("data", gson.toJson(list)); |
| | | root.put("count", count); |
| | | out.print(JsonUtil.loadTrueAdmin(root)); |
| | | } |
| | | |
| | | /** |
| | | * 获取专题详情 |
| | | * |
| | | * @param session |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "/getSpecialDetail", method = RequestMethod.POST) |
| | | public void getSpecialDetail(String id, HttpSession session, PrintWriter out) { |
| | | SearchSpecial searchSpecial = searchSpecialService.selectByPrimaryKey(id); |
| | | if (searchSpecial == null) { |
| | | out.print(JsonUtil.loadFalseAdmin("专题不存在")); |
| | | } else { |
| | | Gson gson = getGson(); |
| | | out.print(JsonUtil.loadTrueAdmin(gson.toJson(searchSpecial))); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除专题 |
| | | * |
| | | * @param ids |
| | | * @param session |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "/deleteSpecial", method = RequestMethod.POST) |
| | | public void deleteSpecial(String ids, HttpSession session, PrintWriter out) { |
| | | JSONArray array = JSONArray.fromObject(ids); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | searchSpecialService.deleteByPrimaryKey(array.optString(i)); |
| | | } |
| | | out.print(JsonUtil.loadTrueAdmin("")); |
| | | } |
| | | |
| | | /** |
| | | * 更新专题 |
| | | * |
| | | * @param id |
| | | * @param content |
| | | * @param session |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "/updateSpecial", method = RequestMethod.POST) |
| | | public void updateSpecial(String id, String content, HttpSession session, PrintWriter out) { |
| | | SearchSpecial searchSpecial = getGson().fromJson(content, SearchSpecial.class); |
| | | //查询是否存在 |
| | | SearchSpecial old = searchSpecialService.selectByPrimaryKey(id); |
| | | if (old == null) { |
| | | out.print(JsonUtil.loadFalseAdmin("id不存在")); |
| | | return; |
| | | } |
| | | old.setAlbumQuery(searchSpecial.getAlbumQuery()); |
| | | old.setInternetQuery(searchSpecial.getInternetQuery()); |
| | | old.setShortQuery(searchSpecial.getShortQuery()); |
| | | if (searchSpecial.getColumn() != null) |
| | | old.setColumn(searchSpecial.getColumn()); |
| | | if (searchSpecial.getKey() != null) { |
| | | old.setKey(searchSpecial.getKey()); |
| | | } |
| | | if (searchSpecial.getName() != null) { |
| | | old.setName(searchSpecial.getName()); |
| | | } |
| | | |
| | | if (searchSpecial.getRemarks() != null) { |
| | | old.setRemarks(searchSpecial.getRemarks()); |
| | | } |
| | | old.setUpdateTime(new Date()); |
| | | searchSpecialService.updateSelective(old); |
| | | out.print(JsonUtil.loadTrueAdmin("")); |
| | | } |
| | | |
| | | /** |
| | | * 添加专题 |
| | | * |
| | | * @param content |
| | | * @param session |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "/addSpecial", method = RequestMethod.POST) |
| | | public void addSpecial(String content, HttpSession session, PrintWriter out) { |
| | | SearchSpecial searchSpecial = getGson().fromJson(content, SearchSpecial.class); |
| | | try { |
| | | searchSpecialService.save(searchSpecial); |
| | | out.print(JsonUtil.loadTrueAdmin("")); |
| | | } catch (Exception e) { |
| | | out.print(JsonUtil.loadFalseAdmin("")); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.buwan.controller.admin.api; |
| | | |
| | | import java.io.PrintWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | for (int i = 0; i < array.size(); i++) { |
| | | rids[i] = array.optString(i); |
| | | } |
| | | filter.setResourceIds(rids); |
| | | filter.setResourceIds(Arrays.asList(rids)); |
| | | } |
| | | |
| | | filter.setSortKey("updateTime"); |
| | |
| | | package com.yeshi.buwan.controller.api; |
| | | |
| | | import com.yeshi.buwan.controller.parser.*; |
| | | import com.yeshi.buwan.domain.special.SearchSpecial; |
| | | import com.yeshi.buwan.service.imp.UserService; |
| | | import com.yeshi.buwan.service.inter.baidu.BaiDuCPUService; |
| | | import com.yeshi.buwan.service.inter.search.SearchSpecialService; |
| | | import com.yeshi.buwan.util.IPUtil; |
| | | import com.yeshi.buwan.util.JsonUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Resource |
| | | private SearchParser searchParser; |
| | | |
| | | @RequestMapping(value = "/ad", method = RequestMethod.POST) |
| | | public void ad(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | |
| | | break; |
| | | case "isPraise": |
| | | homeParser.isPraise(acceptData, request, out); |
| | | break; |
| | | |
| | | case "getRecommendSearchSpecial": |
| | | homeParser.getRecommendSearchSpecial(acceptData, request, out); |
| | | break; |
| | | } |
| | | out.close(); |
| | |
| | | case "deleteWatchHistory": |
| | | userVideoParser.deleteWatchHistory(acceptData, request, out); |
| | | break; |
| | | case "getUserVideoDataCount": |
| | | userVideoParser.getUserVideoDataCount(acceptData, request, out); |
| | | break; |
| | | } |
| | | |
| | | out.close(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/search", method = RequestMethod.POST) |
| | | public void search(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | String method = request.getParameter("Method"); |
| | | |
| | | switch (method) { |
| | | case "getSpecialVideo": |
| | | searchParser.getSpecialVideo(acceptData, request, out); |
| | | break; |
| | | case "getSearchVideoType": |
| | | //获取分类 |
| | | searchParser.getSearchVideoType(acceptData, request, out); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | out.close(); |
| | | } |
| | | |
| | | // 搜索类接口 |
| | | @RequestMapping(value = "/search/{method}", method = RequestMethod.POST) |
| | | public void search(AcceptData acceptData, @PathVariable String method, HttpServletRequest request, PrintWriter out) { |
| | | if (StringUtil.isNullOrEmpty(method)) |
| | | return; |
| | | |
| | | if (method.equalsIgnoreCase("getConfig")) {// 获取配置信息 |
| | | configParser.getConfig(acceptData, request, out); |
| | | } |
| | | |
| | | out.close(); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | if (record.getPayWay() == OrderRecord.PAY_WAY_IAPP) { |
| | | //TODO 验证支付结果是否一致 |
| | | return JsonUtilV2.loadFalseJson(""); |
| | | try { |
| | | orderService.checkApplePay(record.getId(), receipt); |
| | | JSONObject data = new JSONObject(); |
| | | return JsonUtilV2.loadTrueJson(data.toString()); |
| | | } catch (Exception e) { |
| | | return JsonUtilV2.loadFalseJson(e.getMessage()); |
| | | } |
| | | } else { |
| | | record = orderService.checkOrderPayState(id); |
| | | //未支付 |
| | |
| | | break; |
| | | default: |
| | | } |
| | | filter.setResourceIds(new String[]{PPTVUtil.RESOURCE_ID + ""}); |
| | | filter.setResourceIds(Arrays.asList(new String[]{PPTVUtil.RESOURCE_ID + ""})); |
| | | |
| | | //更新时间 |
| | | if ("1".equalsIgnoreCase(order)) { |
| | |
| | | //获取购买记录链接 |
| | | data.put("buyRecordUrl", systemConfigService.getConfigValueByKeyCache("buyRecordUrl")); |
| | | |
| | | //联系我们 |
| | | data.put("contactUsLink", map.get("contact_us_link")); |
| | | //注销 |
| | | data.put("unRegisterLink", map.get("unregister_link")); |
| | | |
| | | |
| | | out.print(JsonUtil.loadTrueJson(data.toString())); |
| | | } |
| | | |
| | |
| | | |
| | | import java.io.PrintWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | |
| | | DetailSystemConfig onLineVersion = detailSystemConfigService.getConfigByKey("ios_online_version", ds, acceptData.getVersion()); |
| | | if (onLineVersion != null && Integer.parseInt(onLineVersion.getValue()) <= acceptData.getVersion()) { |
| | | SolrVideoSearchFilter filter = new SolrVideoSearchFilter(); |
| | | filter.setResourceIds(new String[]{PPTVUtil.RESOURCE_ID + ""}); |
| | | filter.setResourceIds(Arrays.asList(new String[]{PPTVUtil.RESOURCE_ID + ""})); |
| | | SolrResultDTO resultDTO = solrAlbumVideoDataManager.find(filter, Integer.parseInt(page), Constant.pageCount); |
| | | if (resultDTO != null) { |
| | | List<SolrAlbumVideo> solrAlbumVideoList = resultDTO.getVideoList(); |
| | |
| | | import com.yeshi.buwan.domain.jump.JumpDetail; |
| | | import com.yeshi.buwan.domain.jump.JumpTypeEnum; |
| | | import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial; |
| | | import com.yeshi.buwan.domain.solr.SolrShortVideo; |
| | | import com.yeshi.buwan.domain.special.SearchSpecialPositionMap; |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.video.InternetSearchVideo; |
| | |
| | | import com.yeshi.buwan.service.inter.juhe.YouKuService; |
| | | import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService; |
| | | import com.yeshi.buwan.service.inter.recommend.HomeVideoService; |
| | | import com.yeshi.buwan.service.inter.search.SearchSpecialPositionMapService; |
| | | import com.yeshi.buwan.service.inter.video.VideoWatchHistoryService; |
| | | import com.yeshi.buwan.service.manager.VideoPlayStatisticManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.tencent.TencentVideoUtil; |
| | | import com.yeshi.buwan.util.*; |
| | | import com.yeshi.buwan.util.annotation.RequireUid; |
| | |
| | | import com.yeshi.buwan.util.log.LoggerUtil; |
| | | import com.yeshi.buwan.util.log.UserActiveLogFactory; |
| | | import com.yeshi.buwan.util.log.VideoLogFactory; |
| | | import com.yeshi.buwan.util.video.shortvideo.ShortVideoUtil; |
| | | import com.yeshi.buwan.videos.bilibili.BilibiliUtil; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import com.yeshi.buwan.vo.video.VideoDetailVO; |
| | |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | JSONObject object = new JSONObject(); |
| | | |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(),acceptData.getChannel()); |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(), acceptData.getChannel()); |
| | | List<HomeType> list1 = homeTypeService.getHomeType(detailSystem.getId(), acceptData.getPlatform(), acceptData.getVersion(), resourceList, |
| | | CacheUtil.getMD5Long(resourceList), -1, special != null ? special.getDataKey() : null); |
| | | List<HomeType> list = new ArrayList<>(); |
| | |
| | | |
| | | long count = homeTypeService.countHomeType(acceptData.getDetailSystem().getId(), acceptData.getVersion(), dataKey); |
| | | |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(),acceptData.getChannel()); |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(), acceptData.getChannel()); |
| | | List<HomeType> homeTypeList = homeTypeService.getHomeTypeList(acceptData.getDetailSystem().getId(), acceptData.getVersion(), dataKey, Integer.parseInt(page), Integer.parseInt(pageSize)); |
| | | |
| | | if (homeTypeList != null) |
| | |
| | | return; |
| | | } |
| | | |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(),acceptData.getChannel()); |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(), acceptData.getChannel()); |
| | | //查询大图 |
| | | List<HomeVideo> bigPictureVideos = new ArrayList<>(); |
| | | |
| | |
| | | @Resource |
| | | private VideoPlayStatisticManager videoPlayStatisticManager; |
| | | |
| | | @Resource |
| | | private VideoResourceService videoResourceService; |
| | | |
| | | |
| | | private String createVideoDetailSessionId(AcceptData acceptData, String uid, String videoName, String videoId, String resourceId) { |
| | | |
| | |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private SolrShortVideoDataManager solrShortVideoDataManager; |
| | | |
| | | public void getVideoDetailForShortVideo(AcceptData acceptData, String videoId, HttpServletRequest request, PrintWriter out) { |
| | | String loginUid = request.getParameter("LoginUid"); |
| | | SolrShortVideo solrShortVideo = solrShortVideoDataManager.findOne(videoId); |
| | | String resourceId = solrShortVideo.getResourceId() + ""; |
| | | VideoResource videoResource = videoResourceService.getResource(resourceId); |
| | | videoResource.setChecked(true); |
| | | VideoInfo info = VideoInfoFactory.create(solrShortVideo); |
| | | info.setResourceList(Arrays.asList(new VideoResource[]{videoResource})); |
| | | if (info != null) |
| | | info.setPageSize(1); |
| | | info.setWatchCount("" + (int) (Math.random() * 1000)); |
| | | info.setPlayPicture(info.getPicture()); |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | JSONObject obj = new JSONObject(); |
| | | out.print(JsonUtil.loadTrueJson(StringUtil.outPutResultJson(Utils.convertVideo(info)), array.toString(), |
| | | obj.toString())); |
| | | // out.print(JsonUtil.loadTrueJson(StringUtil.outPutResultJson(new VideoDetailVO(Utils.convertVideo(info), deviceAdStrategyService.getVideoDetailAdStrategy(acceptData.getUtdId(), acceptData.getDetailSystem().getId(), loginUid), null, createVideoDetailSessionId(acceptData, loginUid, info.getName(), videoId, resourceId))), array.toString(), |
| | | // obj.toString())); |
| | | } |
| | | |
| | | |
| | |
| | | if (!NumberUtil.isNumeric(videoId)) { |
| | | String[] cidVid = PPTVUtil.parseCidAndVidFromVisualVideoId(videoId); |
| | | if (cidVid == null) { |
| | | //短视频 |
| | | if (ShortVideoUtil.isShortVideoId(videoId)) { |
| | | getVideoDetailForShortVideo(acceptData, videoId, request, out); |
| | | return; |
| | | } |
| | | getVideoDetailForInternetSearch(acceptData, videoId, request, out); |
| | | return; |
| | | } |
| | |
| | | |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(),acceptData.getChannel()); |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(), acceptData.getChannel()); |
| | | |
| | | //获取优先展示的渠道 |
| | | if (StringUtil.isNullOrEmpty(resourceId)) { |
| | |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(type)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传type")); |
| | | return; |
| | | } |
| | | // if (StringUtil.isNullOrEmpty(type)) { |
| | | // out.print(JsonUtil.loadFalseJson("请上传type")); |
| | | // return; |
| | | // } |
| | | |
| | | if (StringUtil.isNullOrEmpty(id)) |
| | | id = eid; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private SearchSpecialPositionMapService searchSpecialPositionMapService; |
| | | |
| | | /** |
| | | * 获取推荐的搜索专题 |
| | | * |
| | | * @param acceptData |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | public void getRecommendSearchSpecial(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | //推荐搜索专题 |
| | | DetailSystemConfig config = configService.getConfigByKey("recommend_search_special_position", detailSystem, acceptData.getVersion()); |
| | | if (config == null) { |
| | | out.print(JsonUtil.loadFalseAdmin("位置为空")); |
| | | return; |
| | | } |
| | | String key = config.getValue(); |
| | | List<SearchSpecialPositionMap> mapList = searchSpecialPositionMapService.listDetailByPosition(key, 1, 20); |
| | | JSONArray array = new JSONArray(); |
| | | for (SearchSpecialPositionMap map : mapList) { |
| | | JSONObject item = new JSONObject(); |
| | | item.put("icon", map.getIcon()); |
| | | item.put("name", map.getShowName() == null ? map.getSpecial().getName() : map.getShowName()); |
| | | item.put("id", map.getSpecialId()); |
| | | array.add(item); |
| | | } |
| | | out.print(JsonUtil.loadTrueJson(array.toString())); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yeshi.buwan.controller.parser; |
| | | |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | | import com.yeshi.buwan.domain.solr.SolrAlbumVideo; |
| | | import com.yeshi.buwan.domain.solr.SolrShortVideo; |
| | | import com.yeshi.buwan.domain.special.SearchSpecial; |
| | | import com.yeshi.buwan.domain.special.SearchSpecialPositionMap; |
| | | import com.yeshi.buwan.domain.video.InternetSearchVideo; |
| | | import com.yeshi.buwan.dto.search.SolrResultDTO; |
| | | import com.yeshi.buwan.service.inter.search.SearchSpecialPositionMapService; |
| | | import com.yeshi.buwan.service.inter.search.SearchSpecialService; |
| | | import com.yeshi.buwan.service.manager.search.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrInternetSearchVideoDataManager; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.PrintWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @Controller |
| | | public class SearchParser { |
| | | @Resource |
| | | private SearchSpecialService searchSpecialService; |
| | | |
| | | @Resource |
| | | private SearchSpecialPositionMapService searchSpecialPositionMapService; |
| | | |
| | | @Resource |
| | | private SolrAlbumVideoDataManager solrAlbumVideoDataManager; |
| | |
| | | */ |
| | | public void getSpecialVideo(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | String key = request.getParameter("key"); |
| | | SearchSpecial searchSpecial = searchSpecialService.selectByKey(key); |
| | | SearchSpecial searchSpecial = searchSpecialService.selectByPrimaryKey(key); |
| | | if (searchSpecial == null) { |
| | | out.print(JsonUtil.loadFalseJson("搜索专题不存在")); |
| | | return; |
| | | } |
| | | |
| | | String page = request.getParameter("page"); |
| | | if (NumberUtil.isNumeric(page)) { |
| | | if (!NumberUtil.isNumeric(page)) { |
| | | out.print(JsonUtil.loadFalseJson("页码错误")); |
| | | return; |
| | | } |
| | |
| | | for (SolrShortVideo av : list) { |
| | | videoInfoList.add(VideoInfoFactory.create(av)); |
| | | } |
| | | Collections.shuffle(videoInfoList); |
| | | if (list.size() > 0) { |
| | | hasNextPage = true; |
| | | } |
| | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("hasNextPage", hasNextPage); |
| | | data.put("list", array); |
| | | data.put("column", 2); |
| | | out.print(JsonUtil.loadTrueAdmin(data)); |
| | | data.put("column", searchSpecial.getColumn()); |
| | | out.print(JsonUtil.loadTrueJson(data.toString())); |
| | | } |
| | | |
| | | |
| | | public void getSearchVideoType(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | String pid = request.getParameter("pid"); |
| | | if (StringUtil.isNullOrEmpty(pid)) { |
| | | out.print(JsonUtil.loadFalseJson("位置ID不能为空")); |
| | | return; |
| | | } |
| | | JSONArray array = new JSONArray(); |
| | | List<SearchSpecialPositionMap> mapList = searchSpecialPositionMapService.listDetailByPosition(pid, 0, 50); |
| | | for (SearchSpecialPositionMap map : mapList) { |
| | | JSONObject item = new JSONObject(); |
| | | item.put("name", StringUtil.isNullOrEmpty(map.getShowName()) ? map.getSpecial().getName() : map.getShowName()); |
| | | item.put("id", map.getSpecialId()); |
| | | item.put("icon", map.getIcon()); |
| | | array.add(item); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", array); |
| | | data.put("count", array.size()); |
| | | out.print(JsonUtil.loadTrueJson(data.toString())); |
| | | } |
| | | |
| | | |
| | |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.Collection; |
| | | import com.yeshi.buwan.domain.solr.SolrAlbumVideo; |
| | | import com.yeshi.buwan.domain.solr.SolrShortVideo; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystemConfig; |
| | | import com.yeshi.buwan.domain.user.LoginUser; |
| | | import com.yeshi.buwan.domain.video.InternetSearchVideo; |
| | | import com.yeshi.buwan.dto.log.BaseLog; |
| | | import com.yeshi.buwan.dto.search.SolrResultDTO; |
| | | import com.yeshi.buwan.dto.search.SolrShortVideoSearchFilter; |
| | | import com.yeshi.buwan.dto.search.SolrVideoSearchFilter; |
| | | import com.yeshi.buwan.dto.user.LoginInfoDto; |
| | | import com.yeshi.buwan.exception.user.LoginUserException; |
| | |
| | | import com.yeshi.buwan.service.inter.system.SystemConfigService; |
| | | import com.yeshi.buwan.service.manager.search.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrInternetSearchVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.util.*; |
| | | import com.yeshi.buwan.util.JuHe.VideoResourceUtil; |
| | | import com.yeshi.buwan.util.annotation.RequireUid; |
| | | import com.yeshi.buwan.util.email.MailSenderUtil; |
| | | import com.yeshi.buwan.util.factory.VideoInfoFactory; |
| | | import com.yeshi.buwan.util.factory.vo.UserInfoVOFactory; |
| | | import com.yeshi.buwan.util.log.LoggerUtil; |
| | | import com.yeshi.buwan.util.log.UserActiveLogFactory; |
| | | import com.yeshi.buwan.util.video.VideoCategoryConstant; |
| | | import com.yeshi.buwan.util.video.VideoConstant; |
| | | import com.yeshi.buwan.util.video.shortvideo.ShortVideoUtil; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import com.yeshi.buwan.vo.video.VideoListResultVO; |
| | | import net.sf.json.JSONArray; |
| | |
| | | private SolrAlbumVideoDataManager solrDataManager; |
| | | @Resource |
| | | private SolrInternetSearchVideoDataManager solrInternetSearchVideoDataManager; |
| | | |
| | | @Resource |
| | | private SolrShortVideoDataManager solrShortVideoDataManager; |
| | | |
| | | @Resource |
| | | private ConfigParser configParser; |
| | | @Resource |
| | |
| | | int rootType = internetSearchVideo.getRootType(); |
| | | SolrVideoSearchFilter filter = new SolrVideoSearchFilter(); |
| | | filter.setVideoType(rootType); |
| | | filter.setResourceIds(new String[]{PPTVUtil.RESOURCE_ID + ""}); |
| | | filter.setResourceIds(Arrays.asList(new String[]{PPTVUtil.RESOURCE_ID + ""})); |
| | | filter.setSortKey("watchcount"); |
| | | SolrResultDTO dto = solrDataManager.find(filter, 1, 20); |
| | | List<SolrAlbumVideo> solrAlbumVideoList = new ArrayList<>(); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | private void guessLikeForShortVideo(AcceptData acceptData, String videoId, PrintWriter out) { |
| | | SolrShortVideo solrShortVideo = solrShortVideoDataManager.findOne(videoId); |
| | | SolrShortVideoSearchFilter filter = new SolrShortVideoSearchFilter(); |
| | | filter.setRootVideoType(solrShortVideo.getRootVideoType()); |
| | | if (solrShortVideo.getArea() != null) { |
| | | filter.setAreas(Arrays.asList(solrShortVideo.getArea().split(","))); |
| | | } |
| | | |
| | | SolrResultDTO dto = solrShortVideoDataManager.find(filter, 1, 10); |
| | | |
| | | |
| | | JSONObject object = new JSONObject(); |
| | | object.put("count", dto.getVideoList().size() + ""); |
| | | JSONArray array = new JSONArray(); |
| | | |
| | | for (int i = 0; i < dto.getVideoList().size(); i++) { |
| | | SolrShortVideo temp = (SolrShortVideo) dto.getVideoList().get(i); |
| | | if (temp.getId().equalsIgnoreCase(videoId)) |
| | | continue; |
| | | array.add(StringUtil.outPutResultJson(VideoInfoFactory.create(temp))); |
| | | } |
| | | if (array.size() % 2 != 0) { |
| | | array.remove(array.size() - 1); |
| | | } |
| | | |
| | | object.put("data", array); |
| | | out.print(JsonUtil.loadTrueJson(object.toString())); |
| | | } |
| | | |
| | | // 猜你喜欢 |
| | | public void guessLike(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | |
| | | String videoId = request.getParameter("VideoId"); |
| | | if (!NumberUtil.isNumeric(videoId)) { |
| | | if (ShortVideoUtil.isShortVideoId(videoId)) { |
| | | guessLikeForShortVideo(acceptData, videoId, out); |
| | | return; |
| | | } |
| | | |
| | | guessLikeForInternetSearch(acceptData, videoId, out); |
| | | return; |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | private void getRelativeVideosForShortVideo(AcceptData acceptData, String videoId, PrintWriter out) { |
| | | SolrShortVideo solrShortVideo = solrShortVideoDataManager.findOne(videoId); |
| | | SolrShortVideoSearchFilter filter = new SolrShortVideoSearchFilter(); |
| | | filter.setKey(solrShortVideo.getName()); |
| | | filter.setFuzzy(true); |
| | | |
| | | SolrResultDTO dto = solrShortVideoDataManager.find(filter, 1, 10); |
| | | |
| | | |
| | | JSONObject object = new JSONObject(); |
| | | object.put("count", dto.getVideoList().size() + ""); |
| | | JSONArray array = new JSONArray(); |
| | | |
| | | for (int i = 0; i < dto.getVideoList().size(); i++) { |
| | | SolrShortVideo temp = (SolrShortVideo) dto.getVideoList().get(i); |
| | | if (temp.getId().equalsIgnoreCase(videoId)) |
| | | continue; |
| | | array.add(StringUtil.outPutResultJson(VideoInfoFactory.create(temp))); |
| | | } |
| | | if (array.size() % 2 != 0) { |
| | | array.remove(array.size() - 1); |
| | | } |
| | | |
| | | object.put("data", array); |
| | | out.print(JsonUtil.loadTrueJson(object.toString())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 相关视频 |
| | | * |
| | |
| | | } |
| | | |
| | | if (!NumberUtil.isNumeric(videoId)) { |
| | | if (ShortVideoUtil.isShortVideoId(videoId)) { |
| | | getRelativeVideosForShortVideo(acceptData, videoId, out); |
| | | return; |
| | | } |
| | | |
| | | |
| | | getRelativeVideosForInternetSearch(acceptData, videoId, out); |
| | | return; |
| | | } |
| | |
| | | |
| | | // 注册 --用户名,昵称,密码 |
| | | LoginUser user = userService.getLoginUser(loginUid); |
| | | //隐藏user中的email |
| | | user.setEmail(UserInfoVOFactory.getHiddenEmail(user.getEmail())); |
| | | if (user.getPortrait() != null && !user.getPortrait().startsWith("http")) |
| | | user.setPortrait("http://" + Constant.WEBSITE + "/BuWan" + user.getPortrait()); |
| | | out.print(JsonUtil.loadTrueJson(StringUtil.outPutResultJson(user))); |
| | |
| | | |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.video.VideoWatchHistory; |
| | | import com.yeshi.buwan.service.imp.AttentionService; |
| | | import com.yeshi.buwan.service.imp.CollectionService; |
| | | import com.yeshi.buwan.service.imp.VideoService; |
| | | import com.yeshi.buwan.service.inter.video.VideoWatchHistoryService; |
| | | import com.yeshi.buwan.util.Constant; |
| | |
| | | |
| | | @Resource |
| | | private VideoService videoService; |
| | | |
| | | @Resource |
| | | private CollectionService collectionService; |
| | | |
| | | @Resource |
| | | private AttentionService attentionService; |
| | | |
| | | public void getWatchHistory(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | |
| | |
| | | out.print(JsonUtil.loadTrueJson("")); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户视频数据数量信息 |
| | | * |
| | | * @param acceptData |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | public void getUserVideoDataCount(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | |
| | | String loginUid = request.getParameter("LoginUid"); |
| | | if (StringUtil.isNullOrEmpty(loginUid)) { |
| | | out.print(JsonUtil.loadFalseJson("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | long collectionCount = collectionService.getCollectVideoCount(acceptData.getUid()); |
| | | long attentionCount = attentionService.getAttentionCountByLoginUid(Long.parseLong(loginUid)); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("collectionCount", collectionCount); |
| | | data.put("attentionCount", attentionCount); |
| | | out.print(JsonUtil.loadTrueJson(data.toString())); |
| | | } |
| | | |
| | | } |
| | |
| | | Query query = new Query(); |
| | | List<Criteria> andList = new ArrayList<>(); |
| | | if (daoQuery.key != null) { |
| | | andList.add(Criteria.where("").is(daoQuery.key)); |
| | | andList.add(Criteria.where("key").is(daoQuery.key)); |
| | | } |
| | | |
| | | if (daoQuery.regexName != null) { |
| | |
| | | return findOne(query); |
| | | } |
| | | |
| | | /** |
| | | * 根据IOS内购商品ID查询 |
| | | * |
| | | * @param productId |
| | | * @return |
| | | */ |
| | | public VIPPrice selectByIOSProductId(String productId) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("iosProductId").is(productId)); |
| | | return findOne(query); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import org.apache.solr.client.solrj.beans.Field; |
| | | import org.springframework.data.annotation.Id; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | //位置ID |
| | | private String positionId; |
| | | private Integer weight; |
| | | //显示名称 |
| | | private String showName; |
| | | private String icon; |
| | | private Date createTime; |
| | | private Date updateTime; |
| | |
| | | public void setSpecial(SearchSpecial special) { |
| | | this.special = special; |
| | | } |
| | | |
| | | public String getShowName() { |
| | | return showName; |
| | | } |
| | | |
| | | public void setShowName(String showName) { |
| | | this.showName = showName; |
| | | } |
| | | } |
| | |
| | | import com.google.gson.annotations.SerializedName; |
| | | |
| | | public class LoginUser { |
| | | |
| | | public final static int STATE_NORMAL=0; |
| | | public final static int STATE_UNREGISTER=1;//已经注销 |
| | | |
| | | public final static int LOGIN_TYPE_QQ=1; |
| | | public final static int LOGIN_TYPE_WX=2; |
| | | public final static int LOGIN_TYPE_EMAIL=3; |
| | | public final static int LOGIN_TYPE_PHONE=4; |
| | | |
| | | public final static int STATE_NORMAL = 0; |
| | | public final static int STATE_UNREGISTER = 1;//已经注销 |
| | | |
| | | public final static int LOGIN_TYPE_QQ = 1; |
| | | public final static int LOGIN_TYPE_WX = 2; |
| | | public final static int LOGIN_TYPE_EMAIL = 3; |
| | | public final static int LOGIN_TYPE_PHONE = 4; |
| | | |
| | | |
| | | @Expose |
| | | private String id; |
| | | @Expose |
| | | private String id; |
| | | |
| | | |
| | | private String systemId; |
| | | private String systemId; |
| | | |
| | | private String qqOpenId; |
| | | private String qqOpenId; |
| | | |
| | | |
| | | private String wxOpenId; |
| | | private String wxUnionId; |
| | | private String wxOpenId; |
| | | private String wxUnionId; |
| | | |
| | | private String email; |
| | | private String phone; |
| | | @Expose |
| | | private String email; |
| | | private String phone; |
| | | |
| | | @Expose |
| | | @SerializedName("Nickname") |
| | | private String name; |
| | | private String openid; |
| | | @Expose |
| | | private String portrait; |
| | | private String device; |
| | | private String createtime; |
| | | private String detailsystem; |
| | | private int loginType; |
| | | private String pwd; |
| | | private String ipinfo; |
| | | @Expose |
| | | private String sex; |
| | | @Expose |
| | | private String birthday; |
| | | @Expose |
| | | private String sign; |
| | | |
| | | //状态 |
| | | |
| | | private Integer state; |
| | | @Expose |
| | | @SerializedName("Nickname") |
| | | private String name; |
| | | private String openid; |
| | | @Expose |
| | | private String portrait; |
| | | private String device; |
| | | private String createtime; |
| | | private String detailsystem; |
| | | private int loginType; |
| | | private String pwd; |
| | | private String ipinfo; |
| | | @Expose |
| | | private String sex; |
| | | @Expose |
| | | private String birthday; |
| | | @Expose |
| | | private String sign; |
| | | |
| | | public String getSystemId() { |
| | | return systemId; |
| | | } |
| | | //状态 |
| | | |
| | | public void setSystemId(String systemId) { |
| | | this.systemId = systemId; |
| | | } |
| | | private Integer state; |
| | | |
| | | public String getQqOpenId() { |
| | | return qqOpenId; |
| | | } |
| | | public String getSystemId() { |
| | | return systemId; |
| | | } |
| | | |
| | | public void setQqOpenId(String qqOpenId) { |
| | | this.qqOpenId = qqOpenId; |
| | | } |
| | | public void setSystemId(String systemId) { |
| | | this.systemId = systemId; |
| | | } |
| | | |
| | | public String getQqOpenId() { |
| | | return qqOpenId; |
| | | } |
| | | |
| | | public void setQqOpenId(String qqOpenId) { |
| | | this.qqOpenId = qqOpenId; |
| | | } |
| | | |
| | | |
| | | public String getWxOpenId() { |
| | | return wxOpenId; |
| | | } |
| | | public String getWxOpenId() { |
| | | return wxOpenId; |
| | | } |
| | | |
| | | public void setWxOpenId(String wxOpenId) { |
| | | this.wxOpenId = wxOpenId; |
| | | } |
| | | public void setWxOpenId(String wxOpenId) { |
| | | this.wxOpenId = wxOpenId; |
| | | } |
| | | |
| | | public String getWxUnionId() { |
| | | return wxUnionId; |
| | | } |
| | | public String getWxUnionId() { |
| | | return wxUnionId; |
| | | } |
| | | |
| | | public void setWxUnionId(String wxUnionId) { |
| | | this.wxUnionId = wxUnionId; |
| | | } |
| | | public void setWxUnionId(String wxUnionId) { |
| | | this.wxUnionId = wxUnionId; |
| | | } |
| | | |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getIpinfo() { |
| | | return ipinfo; |
| | | } |
| | | public String getIpinfo() { |
| | | return ipinfo; |
| | | } |
| | | |
| | | public void setIpinfo(String ipinfo) { |
| | | this.ipinfo = ipinfo; |
| | | } |
| | | public void setIpinfo(String ipinfo) { |
| | | this.ipinfo = ipinfo; |
| | | } |
| | | |
| | | public String getSex() { |
| | | return sex; |
| | | } |
| | | public String getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(String sex) { |
| | | this.sex = sex; |
| | | } |
| | | public void setSex(String sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getBirthday() { |
| | | return birthday; |
| | | } |
| | | public String getBirthday() { |
| | | return birthday; |
| | | } |
| | | |
| | | public void setBirthday(String birthday) { |
| | | this.birthday = birthday; |
| | | } |
| | | public void setBirthday(String birthday) { |
| | | this.birthday = birthday; |
| | | } |
| | | |
| | | public String getSign() { |
| | | return sign; |
| | | } |
| | | public String getSign() { |
| | | return sign; |
| | | } |
| | | |
| | | public void setSign(String sign) { |
| | | this.sign = sign; |
| | | } |
| | | public void setSign(String sign) { |
| | | this.sign = sign; |
| | | } |
| | | |
| | | public String getPwd() { |
| | | return pwd; |
| | | } |
| | | public String getPwd() { |
| | | return pwd; |
| | | } |
| | | |
| | | public void setPwd(String pwd) { |
| | | this.pwd = pwd; |
| | | } |
| | | public void setPwd(String pwd) { |
| | | this.pwd = pwd; |
| | | } |
| | | |
| | | public LoginUser() { |
| | | } |
| | | public LoginUser() { |
| | | } |
| | | |
| | | public LoginUser(String id) { |
| | | this.id = id; |
| | | } |
| | | public LoginUser(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getLoginType() { |
| | | return loginType; |
| | | } |
| | | public int getLoginType() { |
| | | return loginType; |
| | | } |
| | | |
| | | public void setLoginType(int loginType) { |
| | | this.loginType = loginType; |
| | | } |
| | | public void setLoginType(int loginType) { |
| | | this.loginType = loginType; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getOpenid() { |
| | | return openid; |
| | | } |
| | | public String getOpenid() { |
| | | return openid; |
| | | } |
| | | |
| | | public void setOpenid(String openid) { |
| | | this.openid = openid; |
| | | } |
| | | public void setOpenid(String openid) { |
| | | this.openid = openid; |
| | | } |
| | | |
| | | public String getPortrait() { |
| | | return portrait; |
| | | } |
| | | public String getPortrait() { |
| | | return portrait; |
| | | } |
| | | |
| | | public void setPortrait(String portrait) { |
| | | this.portrait = portrait; |
| | | } |
| | | public void setPortrait(String portrait) { |
| | | this.portrait = portrait; |
| | | } |
| | | |
| | | public String getDevice() { |
| | | return device; |
| | | } |
| | | public String getDevice() { |
| | | return device; |
| | | } |
| | | |
| | | public void setDevice(String device) { |
| | | this.device = device; |
| | | } |
| | | public void setDevice(String device) { |
| | | this.device = device; |
| | | } |
| | | |
| | | public String getCreatetime() { |
| | | return createtime; |
| | | } |
| | | public String getCreatetime() { |
| | | return createtime; |
| | | } |
| | | |
| | | public void setCreatetime(String createtime) { |
| | | this.createtime = createtime; |
| | | } |
| | | public void setCreatetime(String createtime) { |
| | | this.createtime = createtime; |
| | | } |
| | | |
| | | public String getDetailsystem() { |
| | | return detailsystem; |
| | | } |
| | | public String getDetailsystem() { |
| | | return detailsystem; |
| | | } |
| | | |
| | | public void setDetailsystem(String detailsystem) { |
| | | this.detailsystem = detailsystem; |
| | | } |
| | | public void setDetailsystem(String detailsystem) { |
| | | this.detailsystem = detailsystem; |
| | | } |
| | | |
| | | } |
| | |
| | | //备注 |
| | | private String remarks; |
| | | |
| | | private String appleTransactionId; |
| | | |
| | | private String appleOriginalTransactionId; |
| | | |
| | | |
| | | public String getAppleTransactionId() { |
| | | return appleTransactionId; |
| | | } |
| | | |
| | | public void setAppleTransactionId(String appleTransactionId) { |
| | | this.appleTransactionId = appleTransactionId; |
| | | } |
| | | |
| | | public String getAppleOriginalTransactionId() { |
| | | return appleOriginalTransactionId; |
| | | } |
| | | |
| | | public void setAppleOriginalTransactionId(String appleOriginalTransactionId) { |
| | | this.appleOriginalTransactionId = appleOriginalTransactionId; |
| | | } |
| | | |
| | | public String getProgramCode() { |
| | | return programCode; |
New file |
| | |
| | | package com.yeshi.buwan.dto.order; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | public class OrderPaySuccessForm { |
| | | |
| | | private String id; |
| | | private int payWay; |
| | | private BigDecimal payMoney; |
| | | private Date payTime; |
| | | private String appleTransactionId; |
| | | private String appleOriginalTransactionId; |
| | | |
| | | public OrderPaySuccessForm(String id, int payWay, BigDecimal payMoney, Date payTime) { |
| | | this.id = id; |
| | | this.payWay = payWay; |
| | | this.payMoney = payMoney; |
| | | this.payTime = payTime; |
| | | } |
| | | |
| | | public OrderPaySuccessForm(String id, int payWay, BigDecimal payMoney, Date payTime, String appleTransactionId, String appleOriginalTransactionId) { |
| | | this.id = id; |
| | | this.payWay = payWay; |
| | | this.payMoney = payMoney; |
| | | this.payTime = payTime; |
| | | this.appleTransactionId = appleTransactionId; |
| | | this.appleOriginalTransactionId = appleOriginalTransactionId; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getPayWay() { |
| | | return payWay; |
| | | } |
| | | |
| | | public void setPayWay(int payWay) { |
| | | this.payWay = payWay; |
| | | } |
| | | |
| | | public BigDecimal getPayMoney() { |
| | | return payMoney; |
| | | } |
| | | |
| | | public void setPayMoney(BigDecimal payMoney) { |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Date getPayTime() { |
| | | return payTime; |
| | | } |
| | | |
| | | public void setPayTime(Date payTime) { |
| | | this.payTime = payTime; |
| | | } |
| | | |
| | | public String getAppleTransactionId() { |
| | | return appleTransactionId; |
| | | } |
| | | |
| | | public void setAppleTransactionId(String appleTransactionId) { |
| | | this.appleTransactionId = appleTransactionId; |
| | | } |
| | | |
| | | public String getAppleOriginalTransactionId() { |
| | | return appleOriginalTransactionId; |
| | | } |
| | | |
| | | public void setAppleOriginalTransactionId(String appleOriginalTransactionId) { |
| | | this.appleOriginalTransactionId = appleOriginalTransactionId; |
| | | } |
| | | } |
| | |
| | | package com.yeshi.buwan.dto.search; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 短视频 |
| | | */ |
| | | public class SolrShortVideoSearchFilter { |
| | | private boolean fuzzy; |
| | | private String key; |
| | | private String area; |
| | | private List<String> areas; |
| | | private String tag; |
| | | private Integer rootVideoType; |
| | | private Integer resourceId; |
| | | private List<Integer> resourceIds; |
| | | private String categoryName; |
| | | private String sortKey; |
| | | |
| | |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getArea() { |
| | | return area; |
| | | |
| | | public List<String> getAreas() { |
| | | return areas; |
| | | } |
| | | |
| | | public void setArea(String area) { |
| | | this.area = area; |
| | | public void setAreas(List<String> areas) { |
| | | this.areas = areas; |
| | | } |
| | | |
| | | public String getTag() { |
| | |
| | | this.rootVideoType = rootVideoType; |
| | | } |
| | | |
| | | public Integer getResourceId() { |
| | | return resourceId; |
| | | |
| | | public List<Integer> getResourceIds() { |
| | | return resourceIds; |
| | | } |
| | | |
| | | public void setResourceId(Integer resourceId) { |
| | | this.resourceId = resourceId; |
| | | public void setResourceIds(List<Integer> resourceIds) { |
| | | this.resourceIds = resourceIds; |
| | | } |
| | | |
| | | public String getCategoryName() { |
| | |
| | | package com.yeshi.buwan.dto.search; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class SolrVideoSearchFilter { |
| | | |
| | | //是否模糊 |
| | |
| | | |
| | | private Integer contentType; |
| | | private Integer videoType; |
| | | private String[] resourceIds; |
| | | private List<String> resourceIds; |
| | | private String sortKey; |
| | | |
| | | private Integer freeType; |
| | |
| | | this.videoType = videoType; |
| | | } |
| | | |
| | | public String[] getResourceIds() { |
| | | public List<String> getResourceIds() { |
| | | return resourceIds; |
| | | } |
| | | |
| | | public void setResourceIds(String[] resourceIds) { |
| | | public void setResourceIds(List<String> resourceIds) { |
| | | this.resourceIds = resourceIds; |
| | | } |
| | | |
| | |
| | | public final static int RESOURCE_ID = 13; |
| | | public final static String RESOURCE_NAME = "爱奇艺"; |
| | | |
| | | public final int PLAY_NONE = 0;// 不能播放 |
| | | public final int PLAY_HTML = 1;// 跳转移动端网页播放 |
| | | public final int PLAY_SWF = 2;// 嵌套网页播放 |
| | | public final static int PLAY_NONE = 0;// 不能播放 |
| | | public final static int PLAY_HTML = 1;// 跳转移动端网页播放 |
| | | public final static int PLAY_SWF = 2;// 嵌套网页播放 |
| | | |
| | | public int getPlayType(IqiyiVideoInfo info) { |
| | | IqiyiVideoInfo vinfo = IqiYiAPI.getVideoInfo(info.getTvId() + ""); |
New file |
| | |
| | | package com.yeshi.buwan.job.video; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.buwan.iqiyi.IqiYiNewAPI; |
| | | import com.yeshi.buwan.iqiyi.entity.IqiyiAlbum2; |
| | | import com.yeshi.buwan.service.manager.search.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.tencent.TencentVideoUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.factory.SolrShortVideoFactory; |
| | | import com.yeshi.buwan.util.video.shortvideo.IqiyiWebUtil; |
| | | import com.yeshi.buwan.util.video.shortvideo.TencentWebUtil; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 短视频更新 |
| | | */ |
| | | @Component |
| | | public class ShortVideoUpdateJob { |
| | | |
| | | @Resource |
| | | private SolrShortVideoDataManager solrShortVideoDataManager; |
| | | |
| | | private class URLParams { |
| | | |
| | | private Integer videoType; |
| | | private String url; |
| | | private String area; |
| | | |
| | | public Integer getVideoType() { |
| | | return videoType; |
| | | } |
| | | |
| | | public void setVideoType(Integer videoType) { |
| | | this.videoType = videoType; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getArea() { |
| | | return area; |
| | | } |
| | | |
| | | public void setArea(String area) { |
| | | this.area = area; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 同 |
| | | * |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | |
| | | private URLParams getParams(String param) throws Exception { |
| | | if (StringUtil.isNullOrEmpty(param)) { |
| | | throw new Exception("参数不能为空"); |
| | | } |
| | | URLParams urlParams = new Gson().fromJson(param, URLParams.class); |
| | | if (urlParams.getVideoType() == null) { |
| | | throw new Exception("videoType不能为空"); |
| | | } |
| | | if (StringUtil.isNullOrEmpty(urlParams.getUrl())) { |
| | | throw new Exception("url不能为空"); |
| | | } |
| | | return urlParams; |
| | | } |
| | | |
| | | /** |
| | | * 更新爱奇艺视频 |
| | | * |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("video-update-shortvideo-iqiyi") |
| | | public ReturnT<String> updateIqiyiShortVideo(String param) throws Exception { |
| | | URLParams urlParams = getParams(param); |
| | | |
| | | for (int i = 0; i < 20; i++) { |
| | | try { |
| | | List<Long> idList = IqiyiWebUtil.getVideoTvidList(IqiyiWebUtil.parseParams(urlParams.getUrl()), i + 1); |
| | | if (idList.size() == 0) { |
| | | break; |
| | | } |
| | | //保存 |
| | | for (Long id : idList) { |
| | | IqiyiAlbum2 album = IqiYiNewAPI.getAlbumOrVideoDetail(id); |
| | | if (album != null) |
| | | solrShortVideoDataManager.saveOrUpdate(SolrShortVideoFactory.create(album, urlParams.getVideoType())); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 更新腾讯视频 |
| | | * |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("video-update-shortvideo-tencent") |
| | | public ReturnT<String> updateTencentShortVideo(String param) throws Exception { |
| | | URLParams urlParams = getParams(param); |
| | | if (StringUtil.isNullOrEmpty(urlParams.getArea())) { |
| | | throw new Exception("area不能为空"); |
| | | } |
| | | |
| | | for (int i = 0; i < 20; i++) { |
| | | try { |
| | | List<TencentWebUtil.TencentWebVideoInfo> list = TencentWebUtil.getVideoList(TencentWebUtil.parseParams(urlParams.getUrl()), i + 1); |
| | | if (list.size() == 0) |
| | | break; |
| | | for (TencentWebUtil.TencentWebVideoInfo videoInfo : list) { |
| | | solrShortVideoDataManager.saveOrUpdate(SolrShortVideoFactory.create(videoInfo, urlParams.getArea(), urlParams.getVideoType())); |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| | |
| | | |
| | | @Service |
| | | public class AttentionService { |
| | | @Resource |
| | | private AttentionDao attentionDao; |
| | | @Resource |
| | | private VideoDetailUtil videoDetailUtil; |
| | | @Resource |
| | | private LoginUserDao loginUserDao; |
| | | @Resource |
| | | private AttentionDao attentionDao; |
| | | @Resource |
| | | private VideoDetailUtil videoDetailUtil; |
| | | @Resource |
| | | private LoginUserDao loginUserDao; |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Caching(evict = { |
| | | @CacheEvict(value = "attentionCache", key = "'isAddAttention'+'-'+#attention.loginUser.id+'-'+#attention.videoInfo.id"), |
| | | @CacheEvict(value = "attentionCache", key = "'getAttentionVideoListByLoginUid'+'-'+#attention.loginUser.id+'-1'") }) |
| | | public boolean addAttention(final Attention attention) { |
| | | boolean isS = false; |
| | | isS = (Boolean) attentionDao.excute(new HibernateCallback<Boolean>() { |
| | | public Boolean doInHibernate(Session session) throws HibernateException { |
| | | Boolean isS = false; |
| | | try { |
| | | List<Attention> list = session |
| | | .createQuery("from Attention a where a.videoInfo.id=? and a.loginUser.id=?") |
| | | .setParameter(0, attention.getVideoInfo().getId()) |
| | | .setParameter(1, attention.getLoginUser().getId()).list(); |
| | | session.getTransaction().begin(); |
| | | if (list != null && list.size() > 0) { |
| | | list.get(0).setShow(true); |
| | | list.get(0).setCreatetime(System.currentTimeMillis() + ""); |
| | | session.update(list.get(0)); |
| | | } else { |
| | | session.persist(attention); |
| | | } |
| | | session.flush(); |
| | | session.getTransaction().commit(); |
| | | isS = true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return isS; |
| | | } |
| | | }); |
| | | return isS; |
| | | } |
| | | @SuppressWarnings("unchecked") |
| | | @Caching(evict = { |
| | | @CacheEvict(value = "attentionCache", key = "'isAddAttention'+'-'+#attention.loginUser.id+'-'+#attention.videoInfo.id"), |
| | | @CacheEvict(value = "attentionCache", key = "'getAttentionVideoListByLoginUid'+'-'+#attention.loginUser.id+'-1'")}) |
| | | public boolean addAttention(final Attention attention) { |
| | | boolean isS = false; |
| | | isS = (Boolean) attentionDao.excute(new HibernateCallback<Boolean>() { |
| | | public Boolean doInHibernate(Session session) throws HibernateException { |
| | | Boolean isS = false; |
| | | try { |
| | | List<Attention> list = session |
| | | .createQuery("from Attention a where a.videoInfo.id=? and a.loginUser.id=?") |
| | | .setParameter(0, attention.getVideoInfo().getId()) |
| | | .setParameter(1, attention.getLoginUser().getId()).list(); |
| | | session.getTransaction().begin(); |
| | | if (list != null && list.size() > 0) { |
| | | list.get(0).setShow(true); |
| | | list.get(0).setCreatetime(System.currentTimeMillis() + ""); |
| | | session.update(list.get(0)); |
| | | } else { |
| | | session.persist(attention); |
| | | } |
| | | session.flush(); |
| | | session.getTransaction().commit(); |
| | | isS = true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return isS; |
| | | } |
| | | }); |
| | | return isS; |
| | | } |
| | | |
| | | // @Cacheable(value = "attentionCache", key = "'isAddAttention'+'-'+#loginuid+'-'+#videoid") |
| | | public boolean isAddAttention(String loginuid, String videoid) { |
| | | return attentionDao.getCount( |
| | | "select count(a.id) from Attention a where a.videoInfo.id=? and a.loginUser.id=? and a.show=1", |
| | | new Serializable[] { videoid, loginuid }) > 0; |
| | | } |
| | | // @Cacheable(value = "attentionCache", key = "'isAddAttention'+'-'+#loginuid+'-'+#videoid") |
| | | public boolean isAddAttention(String loginuid, String videoid) { |
| | | return attentionDao.getCount( |
| | | "select count(a.id) from Attention a where a.videoInfo.id=? and a.loginUser.id=? and a.show=1", |
| | | new Serializable[]{videoid, loginuid}) > 0; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Caching(evict = { |
| | | @CacheEvict(value = "attentionCache", key = "'isAddAttention'+'-'+#attention.loginUser.id+'-'+#videoid"), |
| | | @CacheEvict(value = "attentionCache", key = "'getAttentionVideoListByLoginUid'+'-'+#loginuid+'-1'") }) |
| | | public boolean deleteAttention(final long videoid, final long loginuid) { |
| | | boolean isS = false; |
| | | isS = (Boolean) attentionDao.excute(new HibernateCallback<Boolean>() { |
| | | public Boolean doInHibernate(Session session) throws HibernateException { |
| | | boolean isS = false; |
| | | try { |
| | | List<Attention> list = session |
| | | .createQuery("from Attention a where a.videoInfo.id=? and a.loginUser.id=?") |
| | | .setParameter(0, videoid + "").setParameter(1, loginuid + "").list(); |
| | | session.getTransaction().begin(); |
| | | if (list != null && list.size() > 0) { |
| | | list.get(0).setShow(false); |
| | | session.update(list.get(0)); |
| | | } |
| | | session.flush(); |
| | | session.getTransaction().commit(); |
| | | isS = true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return isS; |
| | | } |
| | | }); |
| | | return isS; |
| | | } |
| | | @SuppressWarnings("unchecked") |
| | | @Caching(evict = { |
| | | @CacheEvict(value = "attentionCache", key = "'isAddAttention'+'-'+#attention.loginUser.id+'-'+#videoid"), |
| | | @CacheEvict(value = "attentionCache", key = "'getAttentionVideoListByLoginUid'+'-'+#loginuid+'-1'")}) |
| | | public boolean deleteAttention(final long videoid, final long loginuid) { |
| | | boolean isS = false; |
| | | isS = (Boolean) attentionDao.excute(new HibernateCallback<Boolean>() { |
| | | public Boolean doInHibernate(Session session) throws HibernateException { |
| | | boolean isS = false; |
| | | try { |
| | | List<Attention> list = session |
| | | .createQuery("from Attention a where a.videoInfo.id=? and a.loginUser.id=?") |
| | | .setParameter(0, videoid + "").setParameter(1, loginuid + "").list(); |
| | | session.getTransaction().begin(); |
| | | if (list != null && list.size() > 0) { |
| | | list.get(0).setShow(false); |
| | | session.update(list.get(0)); |
| | | } |
| | | session.flush(); |
| | | session.getTransaction().commit(); |
| | | isS = true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return isS; |
| | | } |
| | | }); |
| | | return isS; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Caching(evict = { |
| | | @CacheEvict(value = "attentionCache", key = "'getAttentionVideoListByLoginUid'+'-'+#loginuid+'-1'") }) |
| | | public boolean deleteAttentions(final List<Long> videoList, final long loginuid) { |
| | | boolean isS = false; |
| | | isS = (Boolean) attentionDao.excute(new HibernateCallback<Boolean>() { |
| | | public Boolean doInHibernate(Session session) throws HibernateException { |
| | | Boolean isS = false; |
| | | try { |
| | | @SuppressWarnings("unchecked") |
| | | @Caching(evict = { |
| | | @CacheEvict(value = "attentionCache", key = "'getAttentionVideoListByLoginUid'+'-'+#loginuid+'-1'")}) |
| | | public boolean deleteAttentions(final List<Long> videoList, final long loginuid) { |
| | | boolean isS = false; |
| | | isS = (Boolean) attentionDao.excute(new HibernateCallback<Boolean>() { |
| | | public Boolean doInHibernate(Session session) throws HibernateException { |
| | | Boolean isS = false; |
| | | try { |
| | | |
| | | for (Long videoid : videoList) { |
| | | List<Attention> list = session |
| | | .createQuery( |
| | | "from Attention a where a.videoInfo.id=? and a.loginUser.id=? and a.show=1") |
| | | .setParameter(0, videoid + "").setParameter(1, loginuid + "").list(); |
| | | for (Long videoid : videoList) { |
| | | List<Attention> list = session |
| | | .createQuery( |
| | | "from Attention a where a.videoInfo.id=? and a.loginUser.id=? and a.show=1") |
| | | .setParameter(0, videoid + "").setParameter(1, loginuid + "").list(); |
| | | |
| | | if (list != null && list.size() > 0) { |
| | | session.getTransaction().begin(); |
| | | session.createSQLQuery( |
| | | "update wk_video_attention a set a.show=0 where a.id=" + list.get(0).getId()) |
| | | .executeUpdate(); |
| | | session.flush(); |
| | | session.getTransaction().commit(); |
| | | } |
| | | if (list != null && list.size() > 0) { |
| | | session.getTransaction().begin(); |
| | | session.createSQLQuery( |
| | | "update wk_video_attention a set a.show=0 where a.id=" + list.get(0).getId()) |
| | | .executeUpdate(); |
| | | session.flush(); |
| | | session.getTransaction().commit(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | isS = true; |
| | | } catch (Exception e) { |
| | | isS = false; |
| | | e.printStackTrace(); |
| | | session.getTransaction().rollback(); |
| | | } |
| | | return isS; |
| | | } |
| | | }); |
| | | return isS; |
| | | } |
| | | isS = true; |
| | | } catch (Exception e) { |
| | | isS = false; |
| | | e.printStackTrace(); |
| | | session.getTransaction().rollback(); |
| | | } |
| | | return isS; |
| | | } |
| | | }); |
| | | return isS; |
| | | } |
| | | |
| | | // 按照Uid获取关注列表 |
| | | // 按照Uid获取关注列表 |
| | | |
| | | public List<Attention> getAttentionListByLoginUid(long loginUid, int pageIndex) { |
| | | return attentionDao.list( |
| | | "from Attention a where a.show=1 and a.videoInfo.show=1 and a.loginUser.id=? order by FROM_UNIXTIME(a.createtime/1000) desc", |
| | | (pageIndex - 1) * Constant.pageCount, Constant.pageCount, new Serializable[] { loginUid + "" }); |
| | | } |
| | | public List<Attention> getAttentionListByLoginUid(long loginUid, int pageIndex) { |
| | | return attentionDao.list( |
| | | "from Attention a where a.show=1 and a.videoInfo.show=1 and a.loginUser.id=? order by FROM_UNIXTIME(a.createtime/1000) desc", |
| | | (pageIndex - 1) * Constant.pageCount, Constant.pageCount, new Serializable[]{loginUid + ""}); |
| | | } |
| | | |
| | | public List<Attention> getAttentionListByLoginUidOrderbyUpdateTime(long loginUid, int pageIndex) { |
| | | return attentionDao.list( |
| | | "from Attention a where a.show=1 and a.videoInfo.show=1 and a.loginUser.id=? order by FROM_UNIXTIME(a.videoInfo.updatetime/1000) desc", |
| | | (pageIndex - 1) * Constant.pageCount, Constant.pageCount, new Serializable[] { loginUid + "" }); |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | // 获取关注视频的动态 |
| | | @Cacheable(value = "attentionCache", key = "'getAttentionVideoListByLoginUid'+'-'+#loginUid+'-'+#pageIndex") |
| | | public List<Attention> getAttentionVideoListByLoginUid(final long loginUid, final int pageIndex) { |
| | | final Map<Long, Object> map = new HashMap<Long, Object>(); |
| | | final List<Attention> newList = getAttentionListByLoginUidOrderbyUpdateTime(loginUid, pageIndex); |
| | | List<Attention> list = (List<Attention>) attentionDao.excute(new HibernateCallback<List<Attention>>() { |
| | | public List<Attention> doInHibernate(Session session) throws HibernateException { |
| | | public long getAttentionCountByLoginUid(long loginUid) { |
| | | return attentionDao.getCount( |
| | | "select count(*) from Attention a where a.show=1 and a.videoInfo.show=1 and a.loginUser.id=?", |
| | | new Serializable[]{loginUid + ""}); |
| | | } |
| | | |
| | | try { |
| | | for (Attention at : newList) { |
| | | List<VideoResource> resourceList = session |
| | | .createQuery( |
| | | "select rv.resource from ResourceVideo rv where rv.video.id=? order by (15- rv.resource.id)") |
| | | .setParameter(0, at.getVideoInfo().getId()).list(); |
| | | map.put(at.getId(), resourceList.get(0)); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | public List<Attention> getAttentionListByLoginUidOrderbyUpdateTime(long loginUid, int pageIndex) { |
| | | return attentionDao.list( |
| | | "from Attention a where a.show=1 and a.videoInfo.show=1 and a.loginUser.id=? order by FROM_UNIXTIME(a.videoInfo.updatetime/1000) desc", |
| | | (pageIndex - 1) * Constant.pageCount, Constant.pageCount, new Serializable[]{loginUid + ""}); |
| | | } |
| | | |
| | | return newList; |
| | | } |
| | | }); |
| | | @SuppressWarnings("unchecked") |
| | | // 获取关注视频的动态 |
| | | @Cacheable(value = "attentionCache", key = "'getAttentionVideoListByLoginUid'+'-'+#loginUid+'-'+#pageIndex") |
| | | public List<Attention> getAttentionVideoListByLoginUid(final long loginUid, final int pageIndex) { |
| | | final Map<Long, Object> map = new HashMap<Long, Object>(); |
| | | final List<Attention> newList = getAttentionListByLoginUidOrderbyUpdateTime(loginUid, pageIndex); |
| | | List<Attention> list = (List<Attention>) attentionDao.excute(new HibernateCallback<List<Attention>>() { |
| | | public List<Attention> doInHibernate(Session session) throws HibernateException { |
| | | |
| | | for (Attention at : list) { |
| | | if (map.get(at.getId()) != null) { |
| | | VideoResource vr = (VideoResource) map.get(at.getId()); |
| | | VideoDetailInfo detail = videoDetailUtil.getLatestVideoDetail(at.getVideoInfo().getId(), vr); |
| | | List<VideoDetailInfo> detailInfos = new ArrayList<>(); |
| | | detailInfos.add(detail); |
| | | at.getVideoInfo().setVideoDetailList(detailInfos); |
| | | } |
| | | } |
| | | // Comparator<Attention> cm = new Comparator<Attention>() { |
| | | // |
| | | // public int compare(Attention o1, Attention o2) {// 倒序排列 |
| | | // return (int) (Long.parseLong(o2.getVideoInfo().getUpdatetime()) |
| | | // - Long.parseLong(o1.getVideoInfo().getUpdatetime())); |
| | | // } |
| | | // }; |
| | | // Collections.sort(list, cm); |
| | | try { |
| | | for (Attention at : newList) { |
| | | List<VideoResource> resourceList = session |
| | | .createQuery( |
| | | "select rv.resource from ResourceVideo rv where rv.video.id=? order by (15- rv.resource.id)") |
| | | .setParameter(0, at.getVideoInfo().getId()).list(); |
| | | map.put(at.getId(), resourceList.get(0)); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | if (list != null) { |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).getVideoInfo().setAdmin(null); |
| | | list.get(i).getVideoInfo().setIntroduction(""); |
| | | list.get(i).getVideoInfo().setUpdatetime( |
| | | TimeUtil.getCommentTime(Long.parseLong(list.get(i).getVideoInfo().getUpdatetime()))); |
| | | } |
| | | } |
| | | return newList; |
| | | } |
| | | }); |
| | | |
| | | return list; |
| | | } |
| | | for (Attention at : list) { |
| | | if (map.get(at.getId()) != null) { |
| | | VideoResource vr = (VideoResource) map.get(at.getId()); |
| | | VideoDetailInfo detail = videoDetailUtil.getLatestVideoDetail(at.getVideoInfo().getId(), vr); |
| | | List<VideoDetailInfo> detailInfos = new ArrayList<>(); |
| | | detailInfos.add(detail); |
| | | at.getVideoInfo().setVideoDetailList(detailInfos); |
| | | } |
| | | } |
| | | // Comparator<Attention> cm = new Comparator<Attention>() { |
| | | // |
| | | // public int compare(Attention o1, Attention o2) {// 倒序排列 |
| | | // return (int) (Long.parseLong(o2.getVideoInfo().getUpdatetime()) |
| | | // - Long.parseLong(o1.getVideoInfo().getUpdatetime())); |
| | | // } |
| | | // }; |
| | | // Collections.sort(list, cm); |
| | | |
| | | // 根据VideoId查找是谁关注的 |
| | | public List<LoginUser> getUserListByAttentionVideo(String videoid) { |
| | | return loginUserDao.list("select a.loginUser from Attention a where a.videoInfo.id=" + videoid); |
| | | } |
| | | if (list != null) { |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).getVideoInfo().setAdmin(null); |
| | | list.get(i).getVideoInfo().setIntroduction(""); |
| | | list.get(i).getVideoInfo().setUpdatetime( |
| | | TimeUtil.getCommentTime(Long.parseLong(list.get(i).getVideoInfo().getUpdatetime()))); |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | // 根据VideoId查找是谁关注的 |
| | | public List<LoginUser> getUserListByAttentionVideo(String videoid) { |
| | | return loginUserDao.list("select a.loginUser from Attention a where a.videoInfo.id=" + videoid); |
| | | } |
| | | |
| | | } |
| | |
| | | SolrVideoSearchFilter filter = new SolrVideoSearchFilter(); |
| | | filter.setKey(key); |
| | | if (videoType == Constant.SEARCH_RESULT_TYPE_HIGH_DEFINITION) { |
| | | filter.setResourceIds(new String[]{PPTVUtil.RESOURCE_ID + ""}); |
| | | filter.setResourceIds(Arrays.asList(new String[]{PPTVUtil.RESOURCE_ID + ""})); |
| | | logger.info("高清搜索# key:{}", key); |
| | | } else |
| | | filter.setVideoType(videoType == 0 ? null : videoType); |
| | |
| | | } else { |
| | | internetSearchVideoDao.updateSelective(video); |
| | | } |
| | | //小视频不加入搜索引擎 |
| | | // InternetSearchVideoMQMsg msg = new InternetSearchVideoMQMsg(); |
| | | // msg.setId(video.getId()); |
| | | // msg.setResourceId(resourceId); |
| | | // CMQManager.getInstance().addInternetSearchVideoUpdateMsg(msg); |
| | | //全网搜入搜索引擎 |
| | | InternetSearchVideoMQMsg msg = new InternetSearchVideoMQMsg(); |
| | | msg.setId(video.getId()); |
| | | msg.setResourceId(resourceId); |
| | | CMQManager.getInstance().addInternetSearchVideoUpdateMsg(msg); |
| | | |
| | | return video; |
| | | } |
| | |
| | | import com.yeshi.buwan.dao.video.AlbumVideoMapDao; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.entity.PlayUrl; |
| | | import com.yeshi.buwan.domain.solr.SolrShortVideo; |
| | | import com.yeshi.buwan.domain.system.SystemConfig; |
| | | import com.yeshi.buwan.domain.video.AlbumVideoMap; |
| | | import com.yeshi.buwan.dto.mq.UpdateResourceVideoMQMsg; |
| | |
| | | import com.yeshi.buwan.service.imp.VideoResourceService; |
| | | import com.yeshi.buwan.service.inter.juhe.Iqiyi2Service; |
| | | import com.yeshi.buwan.service.inter.system.SystemConfigService; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.ThreadUtil; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | | import com.yeshi.buwan.util.log.VideoLogFactory; |
| | | import com.yeshi.buwan.util.mq.CMQManager; |
| | | import com.yeshi.buwan.util.video.shortvideo.ShortVideoUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Resource |
| | | private SolrShortVideoDataManager solrShortVideoDataManager; |
| | | |
| | | public List<VideoDetailInfo> getVideoDetailList(String videoId, int page, int pageSize) { |
| | | //查询专辑 |
| | |
| | | |
| | | @Override |
| | | public PlayUrl getPlayUrl(String detailSystemId, int resourceId, String id, String videoId) { |
| | | |
| | | IqiyiAlbum2 album = iqiyiAlbum2Dao.get(Long.parseLong(id)); |
| | | VideoResource vr = videoResourceService.getResource(resourceId + ""); |
| | | int t = IqiyiUtil2.getPlayType(album); |
| | |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.yeshi.buwan.dao.vip.OrderRecordDao; |
| | | import com.yeshi.buwan.domain.vip.OrderRecord; |
| | | import com.yeshi.buwan.domain.vip.OrderType; |
| | | import com.yeshi.buwan.domain.vip.UserVIPInfo; |
| | | import com.yeshi.buwan.domain.vip.VIPPriceType; |
| | | import com.yeshi.buwan.dao.vip.VIPPriceDao; |
| | | import com.yeshi.buwan.domain.vip.*; |
| | | import com.yeshi.buwan.dto.order.OrderPaySuccessForm; |
| | | import com.yeshi.buwan.dto.order.PayWayInfoDTO; |
| | | import com.yeshi.buwan.exception.PPTVException; |
| | | import com.yeshi.buwan.exception.goldcorn.GoldCornException; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.yeshi.utils.alipay.AlipayH5PayUtil; |
| | | import org.yeshi.utils.entity.wx.WXPayOrderInfoV3; |
| | | import org.yeshi.utils.ios.pay.IOSPayVerifyUtil; |
| | | import org.yeshi.utils.ios.pay.vo.IOSAPPBuyVerifyResult; |
| | | import org.yeshi.utils.wx.WXPayV3Util; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private GoldCornManager goldCornManager; |
| | | |
| | | @Resource |
| | | private VIPPriceDao vipPriceDao; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | |
| | | } catch (Exception e) { |
| | | throw new GoldCornException(1, "影视豆扣除出错"); |
| | | } |
| | | paySuccess(record.getId(), OrderRecord.PAY_WAY_GOLDCORN, null, new Date()); |
| | | paySuccess(new OrderPaySuccessForm(record.getId(), OrderRecord.PAY_WAY_GOLDCORN, null, new Date())); |
| | | |
| | | orderLogger.info("订单影视豆支付成功:id-{}", record.getId()); |
| | | case OrderRecord |
| | |
| | | } catch (Exception e) { |
| | | throw new GoldCornException(1, "影视豆扣除出错"); |
| | | } |
| | | paySuccess(record.getId(), OrderRecord.PAY_WAY_GOLDCORN, null, new Date()); |
| | | paySuccess(new OrderPaySuccessForm(record.getId(), OrderRecord.PAY_WAY_GOLDCORN, null, new Date())); |
| | | orderLogger.info("订单影视豆支付成功:id-{} 类型-{}", record.getId(), record.getOrderType().name()); |
| | | case OrderRecord |
| | | .PAY_WAY_WX: { |
| | |
| | | } catch (Exception e) { |
| | | throw new GoldCornException(1, "影视豆扣除出错"); |
| | | } |
| | | paySuccess(record.getId(), OrderRecord.PAY_WAY_GOLDCORN, null, new Date()); |
| | | paySuccess(new OrderPaySuccessForm(record.getId(), OrderRecord.PAY_WAY_GOLDCORN, null, new Date())); |
| | | return new PayWayInfoDTO(0, VipUtil.getPaySuccessUrl(record.getId())); |
| | | } |
| | | case OrderRecord.PAY_WAY_IAPP: |
| | |
| | | return OrderRecord.STATE_PAY; |
| | | else |
| | | return OrderRecord.STATE_NOT_PAY; |
| | | case OrderRecord.PAY_WAY_IAPP: |
| | | if (record.getMoneyPay()) |
| | | return OrderRecord.STATE_PAY; |
| | | else |
| | | return OrderRecord.STATE_NOT_PAY; |
| | | } |
| | | return OrderRecord.STATE_NOT_PAY; |
| | | } |
| | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public OrderRecord paySuccess(String id, int payWay, BigDecimal payMoney, Date payTime) throws |
| | | public OrderRecord paySuccess(OrderPaySuccessForm successForm) throws |
| | | VIPException, PPTVException, VideoBuyRecordException, OrderException { |
| | | orderLogger.info("订单支付成功目的执行:id-{},支付方式-{},支付金额-{},支付时间-{}", id, payWay, payMoney, payTime.getTime()); |
| | | orderLogger.info("订单支付成功目的执行:id-{},支付方式-{},支付金额-{},支付时间-{}", successForm.getId(), successForm.getPayWay(), successForm.getPayMoney(), successForm.getPayTime()); |
| | | |
| | | Session session = vipOrderRecordDao.getSession(); |
| | | |
| | | //修改记录 |
| | | Query query = session.createSQLQuery("select * from wk_vip_order_record r where r.id=? for update").addEntity(OrderRecord.class).setCacheable(false).setParameter(0, id); |
| | | Query query = session.createSQLQuery("select * from wk_vip_order_record r where r.id=? for update").addEntity(OrderRecord.class).setCacheable(false).setParameter(0, successForm.getId()); |
| | | List<OrderRecord> list = query.list(); |
| | | if (list == null || list.size() == 0) |
| | | throw new OrderException(10, "订单不存在"); |
| | |
| | | throw new OrderException(1, "订单未处于待支付状态"); |
| | | |
| | | |
| | | if (payWay != OrderRecord.PAY_WAY_GOLDCORN) { |
| | | record.setPayMoney(payMoney); |
| | | if (successForm.getPayWay() != OrderRecord.PAY_WAY_GOLDCORN) { |
| | | record.setPayMoney(successForm.getPayMoney()); |
| | | record.setMoneyPay(true); |
| | | record.setAppleTransactionId(successForm.getAppleTransactionId()); |
| | | record.setAppleOriginalTransactionId(successForm.getAppleOriginalTransactionId()); |
| | | } else { |
| | | record.setGoldCornPay(true); |
| | | } |
| | | |
| | | record.setPayTime(payTime); |
| | | record.setPayTime(successForm.getPayTime()); |
| | | record.setUpdateTime(new Date()); |
| | | record.setState(getPayState(record)); |
| | | |
| | | //已经支付成功 |
| | | if (record.getState() == OrderRecord.STATE_PAY) { |
| | | session.createSQLQuery("insert into wk_vip_order_pay_success(id,create_time) value(?,now())").setParameter(0, id).executeUpdate(); |
| | | session.createSQLQuery("insert into wk_vip_order_pay_success(id,create_time) value(?,now())").setParameter(0, successForm.getId()).executeUpdate(); |
| | | } |
| | | |
| | | if (record.getOrderType() == OrderType.vip) { |
| | | Date[] expireDate = addExpireTime(session, record.getUid(), payTime, record.getType()); |
| | | Date[] expireDate = addExpireTime(session, record.getUid(), successForm.getPayTime(), record.getType()); |
| | | record.setVipStartTime(expireDate[0]); |
| | | record.setVipEndTime(expireDate[1]); |
| | | if (expireDate == null) { |
| | |
| | | |
| | | |
| | | if (record.getState() == OrderRecord.STATE_PAY) { |
| | | orderLogger.info("订单全部支付成功:id-{}", id); |
| | | orderLogger.info("订单全部支付成功:id-{}", successForm.getId()); |
| | | //购买VIP |
| | | pptvVipManager.buyVIP(record); |
| | | orderLogger.info("购买VIP成功:id-{}", id); |
| | | orderLogger.info("购买VIP成功:id-{}", successForm.getId()); |
| | | } else { |
| | | orderLogger.info("订单部分支付成功:id-{}", id); |
| | | orderLogger.info("订单部分支付成功:id-{}", successForm.getId()); |
| | | } |
| | | |
| | | } else if (record.getOrderType() == OrderType.video) { |
| | | record.setVipStartTime(payTime); |
| | | record.setVipStartTime(successForm.getPayTime()); |
| | | //7天之内有效 |
| | | record.setVipEndTime(new Date(payTime.getTime() + 1000 * 60 * 60L * 24 * 7)); |
| | | record.setVipEndTime(new Date(successForm.getPayTime().getTime() + 1000 * 60 * 60L * 24 * 7)); |
| | | session.update(record); |
| | | //单片购买成功(7天有效期) |
| | | if (record.getState() == OrderRecord.STATE_PAY) { |
| | | orderLogger.info("订单全部支付成功:id-{}", id); |
| | | orderLogger.info("订单全部支付成功:id-{}", successForm.getId()); |
| | | //购买单片 |
| | | pptvVipManager.buyVideo(record); |
| | | orderLogger.info("购买单片成功:id-{}", id); |
| | | orderLogger.info("购买单片成功:id-{}", successForm.getId()); |
| | | } else { |
| | | orderLogger.info("订单部分支付成功:id-{}", id); |
| | | orderLogger.info("订单部分支付成功:id-{}", successForm.getId()); |
| | | } |
| | | } |
| | | |
| | |
| | | //支付成功 |
| | | if (res.isSuccess() && "TRADE_SUCCESS".equalsIgnoreCase(res.getTradeStatus())) { |
| | | try { |
| | | return paySuccess(id, OrderRecord.PAY_WAY_ALIPAY, new BigDecimal(res.getTotalAmount()), new Date()); |
| | | return paySuccess(new OrderPaySuccessForm(id, OrderRecord.PAY_WAY_ALIPAY, new BigDecimal(res.getTotalAmount()), new Date())); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | try { |
| | | WXPayOrderInfoV3 info = WXPayV3Util.getPayOrderInfo(VIPOrderUtil.getOutOrderNo(record.getOrderType(), id), VipUtil.getWXAPP()); |
| | | if (info != null && info.getTrade_state().equalsIgnoreCase("SUCCESS")) { |
| | | paySuccess(id, record.getPayWay(), new BigDecimal(info.getAmount().getPayer_total()).divide(new BigDecimal(100), 2, RoundingMode.FLOOR), new Date()); |
| | | paySuccess(new OrderPaySuccessForm(id, record.getPayWay(), new BigDecimal(info.getAmount().getPayer_total()).divide(new BigDecimal(100), 2, RoundingMode.FLOOR), new Date())); |
| | | return record; |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public OrderRecord checkApplePay(String orderNo, String receipt) throws Exception { |
| | | OrderRecord orderRecord = vipOrderRecordDao.find(OrderRecord.class, orderNo); |
| | | if (orderRecord == null) { |
| | | throw new OrderException(1, "订单号不存在"); |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(orderRecord.getAppleTransactionId())) { |
| | | throw new OrderException(2, "订单已支付"); |
| | | } |
| | | |
| | | IOSAPPBuyVerifyResult result = IOSPayVerifyUtil.buyAppVerify(receipt, "28ca52e358b94c4eba3de41dfa7dd023", false); |
| | | List<IOSAPPBuyVerifyResult.OrderInfo> orderInfoList = result.getLatestReceiptInfo(); |
| | | IOSAPPBuyVerifyResult.OrderInfo orderInfo = orderInfoList.get(0); |
| | | String productId = orderInfo.getProduct_id(); |
| | | VIPPrice vipPrice = vipPriceDao.selectByIOSProductId(productId); |
| | | if (vipPrice == null) |
| | | throw new Exception("商品ID不存在"); |
| | | if (orderRecord.getType() != vipPrice.getType()) |
| | | throw new Exception("价格类型不匹配"); |
| | | //String id, int payWay, BigDecimal payMoney, Date payTime, String appleTransactionId, String appleOriginalTransactionId |
| | | OrderPaySuccessForm successForm = new OrderPaySuccessForm(orderRecord.getId(), OrderRecord.PAY_WAY_IAPP, new BigDecimal(0), new Date(orderInfo.getPurchaseDateMs()), orderInfo.getTransactionId(), orderInfo.getOriginalTransactionId()); |
| | | paySuccess(successForm); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<OrderRecord> listOrderRecord(String uid, OrderType orderType, Integer state, int page, int pageSize) { |
| | |
| | | Query query = new Query(); |
| | | Criteria[] ors = new Criteria[ids.size()]; |
| | | for (int i = 0; i < ids.size(); i++) { |
| | | ors[i] = Criteria.where("_id").is(ids.get(0)); |
| | | ors[i] = Criteria.where("_id").is(ids.get(i)); |
| | | } |
| | | query.addCriteria(new Criteria().orOperator(ors)); |
| | | return searchSpecialDao.findList(query); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void update(SearchSpecial special) { |
| | | public void updateSelective(SearchSpecial special) { |
| | | if (special.getUpdateTime() == null) { |
| | | special.setUpdateTime(new Date()); |
| | | } |
| | |
| | | return vipPriceDao.selectByType(type); |
| | | } |
| | | |
| | | @Override |
| | | public VIPPrice selectByIOSProductId(String productId) { |
| | | |
| | | return vipPriceDao.selectByIOSProductId(productId); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.yeshi.buwan.domain.vip.OrderRecord; |
| | | import com.yeshi.buwan.domain.vip.OrderType; |
| | | import com.yeshi.buwan.dto.order.OrderPaySuccessForm; |
| | | import com.yeshi.buwan.dto.order.PayWayInfoDTO; |
| | | import com.yeshi.buwan.exception.PPTVException; |
| | | import com.yeshi.buwan.exception.goldcorn.GoldCornException; |
| | |
| | | public OrderRecord checkOrderPayState(String id); |
| | | |
| | | |
| | | public OrderRecord checkApplePay(String orderNo,String receipt) throws Exception; |
| | | |
| | | public OrderRecord getOrderRecord(String id); |
| | | |
| | | |
| | |
| | | /** |
| | | * 支付成功 |
| | | * |
| | | * @param id |
| | | * @param payWay |
| | | * @param payMoney |
| | | * @param payTime |
| | | * @return |
| | | * @throws VIPException |
| | | * @throws PPTVException |
| | | */ |
| | | public OrderRecord paySuccess(final String id, int payWay, BigDecimal payMoney, Date payTime) throws VIPException, PPTVException, VideoBuyRecordException, OrderException; |
| | | public OrderRecord paySuccess(OrderPaySuccessForm successForm) throws VIPException, PPTVException, VideoBuyRecordException, OrderException; |
| | | |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param special |
| | | */ |
| | | public void update(SearchSpecial special); |
| | | public void updateSelective(SearchSpecial special); |
| | | |
| | | public void save(SearchSpecial special) throws Exception; |
| | | |
| | |
| | | */ |
| | | public VIPPrice selectByType(VIPPriceType type); |
| | | |
| | | public VIPPrice selectByIOSProductId(String productId); |
| | | |
| | | |
| | | } |
| | |
| | | criteria = criteria.and("director").expression("\"" + filter.getDirector() + "\""); |
| | | } |
| | | |
| | | if (filter.getResourceIds() != null && filter.getResourceIds().length > 0) { |
| | | if (filter.getResourceIds() != null && filter.getResourceIds().size() > 0) { |
| | | criteria = criteria.and("resourceIds").contains(filter.getResourceIds()); |
| | | } |
| | | |
| | |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("root_video_type").is(filter.getVideoType()))); |
| | | } |
| | | |
| | | if (filter.getResourceIds() != null && filter.getResourceIds().length > 0) { |
| | | if (filter.getResourceIds() != null && filter.getResourceIds().size() > 0) { |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("resourceIds").contains(filter.getResourceIds()))); |
| | | } |
| | | if (filter.getFreeType() != null) { |
| | |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("rootType").is(filter.getVideoType()))); |
| | | } |
| | | |
| | | if (filter.getResourceIds() != null && filter.getResourceIds().length > 0) { |
| | | if (filter.getResourceIds() != null && filter.getResourceIds().size() > 0) { |
| | | // String[] rids=new String[filter.getResourceIds().size()]; |
| | | // filter.getResourceIds().toArray(rids); |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("resourceIds").contains(filter.getResourceIds()))); |
| | | } |
| | | |
| | |
| | | package com.yeshi.buwan.service.manager.search; |
| | | |
| | | import com.yeshi.buwan.domain.VideoResource; |
| | | import com.yeshi.buwan.domain.entity.PlayUrl; |
| | | import com.yeshi.buwan.domain.solr.SolrShortVideo; |
| | | import com.yeshi.buwan.dto.search.SolrResultDTO; |
| | | import com.yeshi.buwan.dto.search.SolrShortVideoSearchFilter; |
| | | import com.yeshi.buwan.iqiyi.util.IqiyiUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.video.shortvideo.ShortVideoUtil; |
| | | import org.apache.solr.client.solrj.response.UpdateResponse; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | /** |
| | | * 删除所有 |
| | | */ |
| | | // public void clear() { |
| | | // Query query = new SimpleQuery("name:*"); |
| | | // UpdateResponse updateResponse = solrTemplate.delete(query); |
| | | // if (updateResponse.getStatus() == 0) { |
| | | // solrTemplate.commit(); |
| | | // } else { |
| | | // solrTemplate.rollback(); |
| | | // } |
| | | // } |
| | | public void clear() { |
| | | Query query = new SimpleQuery("name:*"); |
| | | UpdateResponse updateResponse = solrTemplate.delete(query); |
| | | if (updateResponse.getStatus() == 0) { |
| | | solrTemplate.commit(); |
| | | } else { |
| | | solrTemplate.rollback(); |
| | | } |
| | | } |
| | | public void deleteById(String id) { |
| | | UpdateResponse updateResponse = solrTemplate.deleteById(CORE_NAME, id); |
| | | if (updateResponse.getStatus() == 0) { |
| | |
| | | } |
| | | |
| | | public SolrShortVideo findOne(String id) { |
| | | SolrShortVideo solrVideo = solrTemplate.getById(CORE_NAME, id, SolrShortVideo.class); |
| | | return solrVideo; |
| | | Query query = new SimpleQuery(new Criteria("id").is(id)); |
| | | ScoredPage<SolrShortVideo> result = solrTemplate.queryForPage(CORE_NAME, query, SolrShortVideo.class); |
| | | if (result != null && result.getContent().size() > 0) { |
| | | return result.getContent().get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public SolrResultDTO find(SolrShortVideoSearchFilter filter, int page, int pageSize) { |
| | |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("root_video_type").is(filter.getRootVideoType()))); |
| | | } |
| | | |
| | | if (filter.getResourceId() != null) { |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("resource_id").is(filter.getResourceId()))); |
| | | } |
| | | if (filter.getCategoryName() != null) { |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("free_type").contains(filter.getCategoryName()))); |
| | | if (filter.getResourceIds() != null && filter.getResourceIds().size() > 0) { |
| | | Criteria criteria = null; |
| | | for (Integer resourceId : filter.getResourceIds()) { |
| | | if (criteria == null) |
| | | criteria = Criteria.where("resource_id").is(resourceId); |
| | | else |
| | | criteria = criteria.or("resource_id").is(resourceId); |
| | | } |
| | | query.addFilterQuery(new SimpleFilterQuery(criteria)); |
| | | } |
| | | |
| | | if (filter.getArea() != null) { |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("area").contains(filter.getArea()))); |
| | | if (filter.getCategoryName() != null) { |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("category_names").contains(filter.getCategoryName()))); |
| | | } |
| | | |
| | | //区域 |
| | | if (filter.getAreas() != null && filter.getAreas().size() > 0) { |
| | | Criteria criteria = null; |
| | | for (String area : filter.getAreas()) { |
| | | if (criteria == null) |
| | | criteria = Criteria.where("area").is(area); |
| | | else |
| | | criteria = criteria.or("area").is(area); |
| | | } |
| | | query.addFilterQuery(new SimpleFilterQuery(criteria)); |
| | | } |
| | | |
| | | if (filter.getTag() != null) { |
| | | query.addFilterQuery(new SimpleFilterQuery(Criteria.where("tag").is(filter.getTag()))); |
| | | } |
| | | |
| | | |
| | |
| | | return new SolrResultDTO(list, (int) result.getTotalElements()); |
| | | } |
| | | |
| | | public PlayUrl getPlayUrl(String id, VideoResource videoResource) { |
| | | //短视频 |
| | | if (ShortVideoUtil.isShortVideoId(id)) { |
| | | SolrShortVideo solrShortVideo = findOne(id); |
| | | if (solrShortVideo == null) |
| | | return null; |
| | | PlayUrl pu = new PlayUrl(); |
| | | pu.setParams(""); |
| | | pu.setPlayType(IqiyiUtil.PLAY_HTML); |
| | | pu.setResource(videoResource); |
| | | pu.setUrl(solrShortVideo.getPlayUrl()); |
| | | return pu; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.yeshi.buwan.service.imp.VideoTypeService; |
| | | import com.yeshi.buwan.service.inter.juhe.InternetSearchVideoService; |
| | | import com.yeshi.buwan.service.inter.juhe.TencentVideoService; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.tencent.entity.TencentCoverInfo; |
| | | import com.yeshi.buwan.tencent.entity.TencentCoverVideo; |
| | | import com.yeshi.buwan.tencent.entity.TencentSearchVideoMap; |
| | | import com.yeshi.buwan.util.factory.VideoInfoFactory; |
| | | import com.yeshi.buwan.util.video.VideoConstant; |
| | | import com.yeshi.buwan.util.video.shortvideo.ShortVideoUtil; |
| | | import com.yeshi.buwan.youku.YouKuUtil; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | @Resource |
| | | private VideoTypeService videoTypeService; |
| | | |
| | | @Resource |
| | | private SolrShortVideoDataManager solrShortVideoDataManager; |
| | | |
| | | public final static int RESOURCE_ID = 17; |
| | | |
| | | public static VideoDetailInfo convertToDetail(TencentCoverVideo tencentCoverVideo, TencentCoverInfo coverInfo) { |
| | |
| | | |
| | | public static InternetSearchVideo create(BilibiliMediaInfo info) { |
| | | |
| | | int videoCount = info.getTotal(); |
| | | int videoCount = info.getEpList().size(); |
| | | |
| | | Date pubTime = new Date(TimeUtil.convertGernalTime(info.getPubInfo().getPub_time(), "yyyy-MM-dd HH:mm:ss")); |
| | | |
| | |
| | | solrShortVideo.setResourceId(TencentVideoUtil.RESOURCE_ID); |
| | | solrShortVideo.setRootVideoType(rootVideoType); |
| | | solrShortVideo.setThirdUpdateTime(System.currentTimeMillis()); |
| | | solrShortVideo.setPlayUrl(tencentWebVideoInfo.getPlayUrl()); |
| | | return solrShortVideo; |
| | | } |
| | | |
| | |
| | | solrShortVideo.setArea(album.getAreas()); |
| | | solrShortVideo.setDuration(duration); |
| | | solrShortVideo.setId(SolrShortVideo.createId(IqiyiUtil2.RESOURCE_ID, album.getUrl())); |
| | | solrShortVideo.setPlayUrl(album.getUrl()); |
| | | solrShortVideo.setName(album.getName()); |
| | | solrShortVideo.setNameStr(album.getName()); |
| | | solrShortVideo.setPicture(album.getImageUrl()); |
| | | solrShortVideo.setPicture(album.getImageUrl().replace(".jpg", "_480_270.jpg")); |
| | | solrShortVideo.setResourceId(IqiyiUtil2.RESOURCE_ID); |
| | | solrShortVideo.setRootVideoType(rootVideoType); |
| | | solrShortVideo.setTag(album.getThreeCategoryNames()); |
| | | solrShortVideo.setThirdUpdateTime(TimeUtil.convertGernalTime(album.getUpdateTime(), "yyyy-MM-dd HH:mm:dd")); |
| | | return solrShortVideo; |
| | | } |
| | |
| | | package com.yeshi.buwan.util.factory; |
| | | |
| | | import com.yeshi.buwan.domain.VideoDetailInfo; |
| | | import com.yeshi.buwan.domain.solr.SolrAlbumVideo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | |
| | | import com.yeshi.buwan.domain.video.InternetSearchVideo; |
| | | import com.yeshi.buwan.pptv.PPTVUtil; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class VideoInfoFactory { |
| | | |
| | |
| | | video.setMainActor(""); |
| | | video.setShow(1 + ""); |
| | | video.setLatestHpicture(""); |
| | | video.setDuration("0"); |
| | | video.setDuration(solrVideo.getDuration()); |
| | | video.setScore("9.0"); |
| | | video.setVpicture(""); |
| | | video.setLatestVpicture(""); |
| | |
| | | video.setVideoType(new VideoType(solrVideo.getRootVideoType())); |
| | | video.setDefinition(0); |
| | | video.setYear(TimeUtil.getGernalTime(solrVideo.getThirdUpdateTime(), "yyyy")); |
| | | List<VideoDetailInfo> detailInfoList = new ArrayList<>(); |
| | | VideoDetailInfo detailInfo = new VideoDetailInfo(); |
| | | detailInfo.setExtraId(solrVideo.getId()); |
| | | detailInfo.setTag(solrVideo.getName()); |
| | | detailInfoList.add(detailInfo); |
| | | video.setVideoDetailList(detailInfoList); |
| | | |
| | | return video; |
| | | } |
| | | |
| | |
| | | return openId.substring(0, 4) + "****" + openId.substring(openId.length() - 4, openId.length() - 4); |
| | | } |
| | | |
| | | private static String getHiddenEmail(String email) { |
| | | public static String getHiddenEmail(String email) { |
| | | if (StringUtil.isNullOrEmpty(email)) { |
| | | return null; |
| | | } |
| | |
| | | String prefix = email.substring(0, index); |
| | | if (prefix.length() < 2) |
| | | return prefix.substring(0, 1) + "**" + email.substring(index, email.length()); |
| | | return prefix.substring(0, 2) + "**" + email.substring(index, email.length()); |
| | | return prefix.substring(0, 2) + "****" + email.substring(index, email.length()); |
| | | } |
| | | |
| | | |
| | |
| | | import com.yeshi.buwan.iqiyi.util.IqiyiUtil2; |
| | | import com.yeshi.buwan.mogotv.MogoTVUtil; |
| | | import com.yeshi.buwan.service.imp.VideoInfoService; |
| | | import com.yeshi.buwan.service.imp.VideoResourceService; |
| | | import com.yeshi.buwan.service.imp.juhe.FunTVService; |
| | | import com.yeshi.buwan.service.imp.juhe.IqiyiService; |
| | | import com.yeshi.buwan.service.imp.juhe.SoHuService; |
| | | import com.yeshi.buwan.service.inter.juhe.*; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.sohu.SoHuUtil; |
| | | import com.yeshi.buwan.tencent.TencentVideoUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.log.VideoLogFactory; |
| | | import com.yeshi.buwan.util.video.shortvideo.ShortVideoUtil; |
| | | import com.yeshi.buwan.videos.bilibili.BilibiliUtil; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import com.yeshi.buwan.youku.YouKuUtil; |
| | |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | private SolrShortVideoDataManager solrShortVideoDataManager; |
| | | |
| | | @Resource |
| | | private VideoResourceService videoResourceService; |
| | | |
| | | |
| | | @Cacheable(value = "homeCache", key = "'getPlayUrl'+'-'+#detailSystemId+'-'+#id+'-'+#type+'-'+#resourceid") |
| | | public PlayUrl getPlayUrl(AcceptData acceptData, String detailSystemId, String id, String type, int resourceid, String videoid) { |
| | | playLogger.info(VideoLogFactory.createPlayUrlLog(detailSystemId, id, type, resourceid, videoid)); |
| | | if (ShortVideoUtil.isShortVideoId(id)) { |
| | | VideoResource vr = videoResourceService.getResource(resourceid + ""); |
| | | return solrShortVideoDataManager.getPlayUrl(id, vr); |
| | | } |
| | | |
| | | switch (resourceid) { |
| | | case IqiyiUtil2.RESOURCE_ID: |
| | | return iqiyi2Service.getPlayUrl(detailSystemId, resourceid, id, videoid); |
| | |
| | | package com.yeshi.buwan.util.video.shortvideo; |
| | | |
| | | import com.yeshi.buwan.domain.VideoResource; |
| | | import com.yeshi.buwan.domain.entity.PlayUrl; |
| | | import com.yeshi.buwan.domain.solr.SolrShortVideo; |
| | | import com.yeshi.buwan.iqiyi.util.IqiyiUtil; |
| | | |
| | | public class ShortVideoUtil { |
| | | |
| | | /** |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | <id>1001</id> |
| | | </item> |
| | | <item> |
| | | <name>大家在看</name> |
| | | <id>1090</id> |
| | | </item> |
| | | <item> |
| | | <name>实时资讯</name> |
| | | <id>1081</id> |
| | | </item> |
| | |
| | | |
| | | <!--<dubbo:registry address="zookeeper://193.112.35.168:2182"/>--> |
| | | |
| | | <dubbo:annotation package="com"/> |
| | | <dubbo:annotation package="com"/> |
| | | |
| | | </beans> |
| | |
| | | <property name="moneyPay" column="money_pay" type="boolean"></property> |
| | | <property name="goldCornPay" column="gold_corn_pay" type="boolean"></property> |
| | | <property name="remarks" column="remarks" type="string"></property> |
| | | <property name="appleTransactionId" column="apple_transaction_id" type="string"></property> |
| | | <property name="appleOriginalTransactionId" column="apple_original_transaction_id" type="string"></property> |
| | | |
| | | |
| | | </class> |
| | |
| | | debug日志会输出到debugAppender指定的文件中 |
| | | info日志会输出到infoAppender指定的文件中 |
| | | error日志会输出到errorAppender指定的文件中--> |
| | | <appender name="KAFKA_APPLE_PAY" class="com.yeshi.buwan.log.KafkaAppender"> |
| | | <!-- encoder必须配置, 日志格式 --> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <!--<pattern>--> |
| | | <!--%red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %highlight(%-5level) %green([%thread]) %boldMagenta(%logger{10}) - %cyan(%msg%n)--> |
| | | <!--</pattern>--> |
| | | <!--为了便于分析将日志数据转为json格式--> |
| | | <pattern>${log.pattern}</pattern> |
| | | <!-- 控制台也要使用UTF-8,不要使用GBK,否则会中文乱码 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <bootstrapServers>${log.config.kafka.bootstrapServers}</bootstrapServers> |
| | | <topic>log_buwan_ios_pay</topic> |
| | | <batchSize>${log.config.kafka.batchSize}</batchSize> |
| | | <lingerMs>${log.config.kafka.lingerMs}</lingerMs> |
| | | <compressionType>${log.config.kafka.compressionType}</compressionType> |
| | | <retries>${log.config.kafka.retries}</retries> |
| | | <maxRequestSize>${log.config.kafka.maxRequestSize}</maxRequestSize> |
| | | <isSend>${log.config.kafka.isSend}</isSend> |
| | | </appender> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <logger name="com.hxh.spring" level="INFO"> |
| | |
| | | </logger> |
| | | |
| | | |
| | | <logger name="com.yeshi.buwan.controller.AppleController" level="INFO" additivity="false"> |
| | | <appender-ref ref="KAFKA_APPLE_PAY"></appender-ref> |
| | | </logger> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 一切logger都会继承自root,root默认的层级level为debug --> |
| | | <root> |
| | | <level value="INFO"/> |
New file |
| | |
| | | <html lang="zh-cn"> |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| | | <meta name="referrer" content="never"> |
| | | <title>分区搜索专题</title> |
| | | <link href="css/bootstrap.min.css" rel="stylesheet"> |
| | | <link href="css/maincontent.css" rel="stylesheet"> |
| | | <!--[if lt IE 9]> |
| | | <script src="js/html5shiv.js"></script> |
| | | <script src="js/respond.min.js"></script> |
| | | <script src="js/vue.min.js"></script> |
| | | <![endif]--> |
| | | </head> |
| | | |
| | | <body> |
| | | <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> |
| | | </nav> |
| | | <div id="mainbody"> |
| | | <div id="sidebar"> |
| | | <dl> |
| | | <!-- <dt> |
| | | <div class="tubiao"><span class="glyphicon glyphicon-pencil"></span></div> |
| | | 数据</dt>--> |
| | | </dl> |
| | | </div> |
| | | <div id="neirong"> |
| | | <div class="erjidh"> |
| | | <table class="table"> |
| | | <tbody> |
| | | <tr> |
| | | <td class="xiala"> |
| | | <select id="classtype" name="select" class="form-control"> |
| | | </select> |
| | | </td> |
| | | <td class="xiala"> |
| | | <select id="appclass" name="select" class="form-control"> |
| | | <option value="">全部</option> |
| | | </select> |
| | | </td> |
| | | <td> |
| | | <form class="form-inline" role="form"> |
| | | <div class="form-group" role="search"> |
| | | <input type="text" id="search-text" class="form-control" style="width:200px;" |
| | | placeholder="搜索"> |
| | | </div> |
| | | <button type="button" id="search" class="btn btn-default">搜索</button> |
| | | </form> |
| | | </td> |
| | | <td> |
| | | <div class="tianjia"> |
| | | <a href="edit-recommend-banner.html" class="btn btn-primary" type="button">添加内容 +</a> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | <div class="bottom" style="display: none;"> |
| | | <div class="qx"> |
| | | <div class="checkbox"> |
| | | <label> |
| | | <input type="checkbox" value="#" name="checkAll" onclick="checkAll(this)"> |
| | | 全选</label> |
| | | </div> |
| | | </div> |
| | | <button class="btn btn-warning" type="button" name='delVideos' data-container="body" data-toggle="popover" |
| | | data-placement="right">批量删除 |
| | | </button> |
| | | <ul class="pagination"> |
| | | <li class="disabled"> |
| | | <a href="#">«</a> |
| | | </li> |
| | | <li class="active"> |
| | | <a href="#">1</a> |
| | | </li> |
| | | <li> |
| | | <a href="#">2</a> |
| | | </li> |
| | | <li> |
| | | <a href="#">»</a> |
| | | </li> |
| | | </ul> |
| | | <div class="form-group"> |
| | | <div class="tzan"> |
| | | <button type="button" class="btn btn-primary">跳转</button> |
| | | </div> |
| | | <div class="tz"> |
| | | <input class="form-control" type="text" placeholder="页数"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="zhuti"> |
| | | <div class="zhutisousuo"> |
| | | <table class="table"> |
| | | <thead> |
| | | <tr> |
| | | <th width="7%">选择</th> |
| | | <th width="7%">编号</th> |
| | | <th width="7%">名称</th> |
| | | <th width="7%">标识</th> |
| | | <th width="5%">展现列数</th> |
| | | <th width="19%">备注</th> |
| | | <th width="15%">创建时间</th> |
| | | <th width="15%">更新时间</th> |
| | | <th width="7%">删除</th> |
| | | <th width="7%">编辑</th> |
| | | </tr> |
| | | </thead> |
| | | </table> |
| | | </div> |
| | | <div class="liebiao"> |
| | | <table class="table"> |
| | | <tbody> |
| | | <tr v-for="(item,index) in list"> |
| | | <td width="7%"> |
| | | <div class="xuanze"><label><input type="checkbox" name="videoName" :value="item.id"></label> |
| | | </div> |
| | | </td> |
| | | <td width="7%"> |
| | | <div>{{item.id}}</div> |
| | | </td> |
| | | <td width="7%"> |
| | | <div>{{item.name}}</div> |
| | | </td> |
| | | <td width="7%"> |
| | | <div>{{item.key}}</div> |
| | | </td> |
| | | |
| | | <td width="5%"> |
| | | <div>{{item.column}}</div> |
| | | </td> |
| | | |
| | | <td width="19%"> |
| | | <div>{{item.remarks}}</div> |
| | | </td> |
| | | |
| | | <td width="15%"> |
| | | <div>{{item.createTime}}</div> |
| | | </td> |
| | | |
| | | <td width="15%"> |
| | | <div>{{item.updateTime}}</div> |
| | | </td> |
| | | <td width="7%"> |
| | | <div class="anniu"><img onclick="delVideo(453)" src="image/dustbin.png" data-toggle="modal" |
| | | data-target="#myModal"></div> |
| | | </td> |
| | | <td width="7%"> |
| | | <div class="anniu"><a href="edit-recommend-banner.html?key=453"><img src="image/bianji.png"></a> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | <div class="bottom"> |
| | | <div class="qx"> |
| | | <div class="checkbox"> |
| | | <label> |
| | | <input type="checkbox" value="#" name="checkAll" onclick="checkAll(this)"> |
| | | 全选</label> |
| | | </div> |
| | | </div> |
| | | <button class="btn btn-warning" type="button" name='delVideos'>批量删除</button> |
| | | <div class="page"> |
| | | <ul class="pagination"> |
| | | <li class="disabled pre"> |
| | | <a href="#">«</a> |
| | | </li> |
| | | <li> |
| | | <a href="#" class="next">»</a> |
| | | </li> |
| | | </ul> |
| | | <div class="form-group"> |
| | | <div class="tzan"> |
| | | <button type="button" class="btn btn-primary">跳转</button> |
| | | </div> |
| | | <div class="tz"> |
| | | <input class="form-control" type="text" id="customPage" placeholder="页数"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="js/jquery.min.js"></script> |
| | | <script src="js/bootstrap.min.js"></script> |
| | | <script src="js/page.js"></script> |
| | | <script src="js/nav.js"></script> |
| | | <script src="layer/layer.js"></script> |
| | | |
| | | <script> |
| | | var allSystems; |
| | | $(function () { |
| | | |
| | | var app = new Vue({ |
| | | el: "", |
| | | data: { |
| | | list: [] |
| | | }, |
| | | methods: { |
| | | getList: function (key, page) { |
| | | $.post("api/class/getAllFirstClass", { |
| | | key: key, |
| | | page: page |
| | | }, function (data) { |
| | | |
| | | }, 'json'); |
| | | }, |
| | | delete: function () { |
| | | layer.confirm('您确定要删除?', { |
| | | btn: ['否', '是'] //按钮 |
| | | }, function (index) { |
| | | layer.close(index); |
| | | return false; |
| | | }, function () { |
| | | var ids = "" + iid + ""; |
| | | $.post("api/class/deleteCategoryRecommendVideo", {'ids': ids}, function (data) { |
| | | if (data == "yes") { |
| | | getData(1); |
| | | } |
| | | }, 'text'); |
| | | }); |
| | | }, |
| | | edit: function () { |
| | | |
| | | }, |
| | | |
| | | } |
| | | }); |
| | | }); |
| | | </script> |
| | | <script> |
| | | |
| | | function set(obj) { |
| | | var appid = $(obj).attr("name"); |
| | | var key = $(obj).attr("key"); |
| | | var ck = $(obj).context.checked; |
| | | var type = ck ? "add" : "delete"; |
| | | |
| | | $.post("api/class/CategoryRecommendVideoAdminServlet", { |
| | | 'type': type, |
| | | 'id': key, |
| | | 'systemid': appid |
| | | }, function (data) { |
| | | if ("yes" == data) { |
| | | if (ck) { |
| | | layer.msg("添加成功!"); |
| | | } else { |
| | | layer.msg("删除成功!"); |
| | | } |
| | | } |
| | | }, 'text'); |
| | | } |
| | | |
| | | function jump() { |
| | | var val = $("#customPage").val(); |
| | | var reg = new RegExp("^[0-9]*$"); |
| | | if (reg.test(val)) { |
| | | getData(val); |
| | | } else { |
| | | layer.msg("请输入一个正整数!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | function delVideo(iid) { |
| | | |
| | | layer.confirm('您确定要删除?', { |
| | | btn: ['否', '是'] //按钮 |
| | | }, function (index) { |
| | | layer.close(index); |
| | | return false; |
| | | }, function () { |
| | | var ids = "" + iid + ""; |
| | | $.post("api/class/deleteCategoryRecommendVideo", {'ids': ids}, function (data) { |
| | | if (data == "yes") { |
| | | getData(1); |
| | | } |
| | | }, 'text'); |
| | | }); |
| | | } |
| | | |
| | | function getData(pageIndex) { |
| | | var keyText = $("#search-text").val(); |
| | | var classTypeVal = $("#classtype").val(); |
| | | var detailsystem = $("#appclass").val(); |
| | | $.post("api/class/getseachList", { |
| | | 'key': keyText, |
| | | 'page': pageIndex, |
| | | 'videotype': classTypeVal, |
| | | 'detailsystem': detailsystem |
| | | }, function (data) { |
| | | if (data.code == 0) { |
| | | //var len = (data.pageEntity.pageSize < data.pageEntity.totalCount) ? data.pageEntity.pageSize : data.pageEntity.totalCount; |
| | | setData(data, pageIndex); |
| | | fillPage(data.pageEntity, function (page) { |
| | | getData(page); |
| | | }); |
| | | } |
| | | }, 'json'); |
| | | } |
| | | |
| | | function checkAll(obj) { |
| | | if (obj.checked) { |
| | | $("input[name='videoName']").prop('checked', true) |
| | | } else { |
| | | $("input[name='videoName']").prop('checked', false) |
| | | } |
| | | }; |
| | | |
| | | function setData(data, pageIndex) { |
| | | $(".liebiao").empty(); |
| | | pageIndex = pageIndex - 1; // |
| | | var pageSize = data.pageEntity.pageSize; |
| | | var totalCount = data.pageEntity.totalCount; |
| | | var len = (pageSize < totalCount - (pageIndex * pageSize)) ? pageSize : totalCount - (pageIndex * pageSize); |
| | | var ll = len; |
| | | len = (pageIndex * pageSize) + len; |
| | | var ii = pageIndex * pageSize; |
| | | for (var qq = 0; ii < len && ii < totalCount; ii++, qq++) { |
| | | var info = data.crv[qq].categoryRecommendVideo.categoryRecommendVideo.videoInfo; |
| | | var id = data.crv[qq].categoryRecommendVideo.categoryRecommendVideo.id; |
| | | var name = info.name; |
| | | var timeMS = info.createtime; |
| | | var mydate = new Date(parseInt(timeMS)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " "); |
| | | var picture = data.crv[qq].categoryRecommendVideo.categoryRecommendVideo.picture; |
| | | $(".liebiao").append("<table class='table'>" + |
| | | "<tbody>" + |
| | | "<tr>" + |
| | | "<td width='7%'>" + |
| | | "<div class='xuanze'>" + |
| | | "<label>" + |
| | | "<input type='checkbox' name='videoName' value='" + id + "'>" + |
| | | "</label>" + |
| | | "</div>" + |
| | | "</td>" + |
| | | "<td width='7%'>" + |
| | | "<div class='bianhao' id='" + id + "'>" + id + "</div>" + |
| | | "</td>" + |
| | | "<td width='15%'>" + |
| | | "<div class='bianhao' name='" + name + "'>" + name + "</div>" + |
| | | "</td>" + |
| | | "<td width='23%'>" + |
| | | "<div class='tupian-banner'><img alt src='" + picture + "' style='width:240px;'></div>" + |
| | | "</td>" + |
| | | "<td width='19%' name='apptd'>" + |
| | | "</td>" + |
| | | "<td width='15%' style='text-align:center; line-height:105px;'>" + mydate + "</td>" + |
| | | "<td width='7%'>" + |
| | | "<div class='anniu'><img onclick='delVideo(" + id + ")' src='image/dustbin.png' data-toggle='modal' data-target='#myModal'/>" + |
| | | "</div>" + |
| | | "</td>" + |
| | | "<td width='7%'>" + |
| | | "<div class='anniu'>" + |
| | | "<a href='edit-recommend-banner.html?key=" + id + "'><img src='image/bianji.png'></a>" + |
| | | "</div>" + |
| | | "</td>" + |
| | | "</tr>" + |
| | | "</tbody>" + |
| | | "</table>" + |
| | | "<hr>"); |
| | | } |
| | | var apptd = $("td[name='apptd']"); |
| | | for (var index in allSystems) { |
| | | var edata = allSystems[index]; |
| | | apptd.append("<div class='appname'>" + |
| | | "<div class='checkbox'>" + |
| | | "<label>" + |
| | | "<input type='checkbox' name='" + edata.id + "' onclick='set(this)' value='#'>" + |
| | | " " + edata.name + "</label>" + |
| | | "</div>" + |
| | | "</div>"); |
| | | } |
| | | var mm = 0; |
| | | for (; mm < ll; mm++) { |
| | | var nn = 0; |
| | | data.crv[mm].detailSystemList.forEach(function () { |
| | | var appid = data.crv[mm].detailSystemList[nn].detailSystem.id; |
| | | var sele = data.crv[mm].detailSystemList[nn].selected; |
| | | var id = data.crv[mm].categoryRecommendVideo.categoryRecommendVideo.id; |
| | | $(".appname .checkbox input[name='" + appid + "']").eq(mm).prop("checked", sele); |
| | | $(".appname .checkbox input[name='" + appid + "']").eq(mm).attr("key", id); |
| | | nn++; |
| | | }); |
| | | } |
| | | } |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
| | |
| | | <!-- 网页链接 --> |
| | | <url></url> |
| | | </secondNav> |
| | | |
| | | <secondNav url="fenqu-search-special-position.html" name="搜索专题位置"> |
| | | <!-- 网页链接 --> |
| | | <url></url> |
| | | </secondNav> |
| | | |
| | | <secondNav url="fenqu-search-special.html" name="搜索专题"> |
| | | <!-- 网页链接 --> |
| | | <url></url> |
| | | </secondNav> |
| | | |
| | | </topNav> |
| | | |
| | | <topNav url="vip-user-list.html" name="用户"> |
| | |
| | | </td> |
| | | |
| | | <td width="10%"> |
| | | <div v-if="item.payWay>0">{{item.payWay==1?'支付宝':'微信'}}</div> |
| | | <div v-if="item.payWay">{{item.payWay}}</div> |
| | | </td> |
| | | |
| | | <td width="10%"> |
| | |
| | | app.requestData(pageIndex); |
| | | }); |
| | | |
| | | for (var i = 0; i < data.data.list.length; i++) { |
| | | var payWay =data.data.list[i].payWay+""; |
| | | if (payWay.indexOf("1") > -1) { |
| | | payWay = "支付宝"; |
| | | } else if (payWay.indexOf("2") > -1) { |
| | | payWay = "微信"; |
| | | } else if (payWay.indexOf("3") > -1) { |
| | | payWay = "影视豆"; |
| | | } else if (payWay.indexOf("4") > -1) { |
| | | payWay = "苹果内购"; |
| | | } |
| | | data.data.list[i].payWay = payWay; |
| | | } |
| | | |
| | | app.list = data.data.list; |
| | | |
| | | app.pageEntity = data.data.pageEntity; |
| | | } |
| | | }, 'json'); |
| | |
| | | public class DES { |
| | | @org.junit.Test |
| | | public void test1() { |
| | | |
| | | String st = "iDp+mknN2urZPWPAdmBTv1ME3YqW7QwsBUCzbtjAkAje04mhRA8Wv6RAdFDJIZmEp2WT2ZmB4yJ2drO/wgzaiw=="; |
| | | String st = "iDp+mknN2urZPWPAdmBTv1ME3YqW7QwsfhAy2vuuu5CVsK44pBV6Oc3DK0LVEPK/ub/3zZPrRFLcpzNeQC0aZHqfoLGqiUKMvuuaHz1qzAdv+nTV8eBkkVMAM6fQI8wdQYb/zqKW8Eiq9Dmc3GgSnjWBohTKFpFJv4FmiGN8aTwDMwzRJK2Yne1j/f2nXTSJ0otygjq7pazihUJK2LsOeA=="; |
| | | System.out.println(DESUtil.decode(st)); |
| | | } |
| | | |
| | |
| | | public void test2() throws IOException { |
| | | String text = FileUtil.readTxt("C:\\Users\\Administrator\\Desktop\\切片缓存\\新建文本文档.txt"); |
| | | System.out.println(DESUtil.decode(text)); |
| | | |
| | | } |
| | | } |
| | |
| | | import com.yeshi.buwan.dao.video.AlbumVideoMapDao; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.solr.SolrAlbumVideo; |
| | | import com.yeshi.buwan.domain.solr.SolrShortVideo; |
| | | import com.yeshi.buwan.domain.video.AlbumVideoMap; |
| | | import com.yeshi.buwan.domain.video.InternetSearchVideo; |
| | | import com.yeshi.buwan.dto.search.SolrResultDTO; |
| | | import com.yeshi.buwan.dto.search.SolrShortVideoSearchFilter; |
| | | import com.yeshi.buwan.dto.search.SolrVideoSearchFilter; |
| | | import com.yeshi.buwan.job.video.ShortVideoUpdateJob; |
| | | import com.yeshi.buwan.service.imp.VideoInfoService; |
| | | import com.yeshi.buwan.service.inter.juhe.AlbumVideoMapService; |
| | | import com.yeshi.buwan.service.inter.juhe.InternetSearchVideoService; |
| | | import com.yeshi.buwan.service.manager.search.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.SolrCommonVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrInternetSearchVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.factory.VideoInfoFactory; |
| | | import com.yeshi.buwan.util.video.VideoConstant; |
| | | import net.sf.json.JSONObject; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | |
| | | |
| | | @Resource |
| | | private SolrInternetSearchVideoDataManager solrInternetSearchVideoDataManager; |
| | | |
| | | @Resource |
| | | private SolrShortVideoDataManager solrShortVideoDataManager; |
| | | |
| | | @Resource |
| | | private InternetSearchVideoService internetSearchVideoService; |
| | |
| | | |
| | | @Test |
| | | public void deleteInternet() { |
| | | String st="161469b4aa35ca7ae1cc5d3ddaa23276,3b57b603b4eef496ce0de50f06ca40c0"; |
| | | String st = "161469b4aa35ca7ae1cc5d3ddaa23276,3b57b603b4eef496ce0de50f06ca40c0"; |
| | | |
| | | |
| | | for (String id : st.split(",")) |
| | |
| | | // solrDataManager.clear(); |
| | | // } |
| | | |
| | | @Resource |
| | | private com.yeshi.buwan.job.video.ShortVideoUpdateJob shortVideoUpdateJob; |
| | | |
| | | @Test |
| | | public void iqiyiShortVideo() { |
| | | |
| | | JSONObject params = new JSONObject(); |
| | | params.put("videoType", 155); |
| | | params.put("url", "https://list.iqiyi.com/www/7/186-------------24-1-2-iqiyi--.html?s_source=PCW_LC"); |
| | | |
| | | try { |
| | | shortVideoUpdateJob.updateIqiyiShortVideo(params.toString()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | //https://v.qq.com/channel/ent?_all=1&channel=ent&iarea=2&listpage=1&sort=40 |
| | | @Test |
| | | public void tencentShortVideo() { |
| | | JSONObject params = new JSONObject(); |
| | | params.put("videoType", 155); |
| | | params.put("area", "日韩"); |
| | | params.put("url", "https://v.qq.com/channel/ent?_all=1&channel=ent&iarea=2&listpage=1&sort=40"); |
| | | |
| | | try { |
| | | shortVideoUpdateJob.updateTencentShortVideo(params.toString()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void clearShortVideo() { |
| | | SolrShortVideoSearchFilter filter = new SolrShortVideoSearchFilter(); |
| | | for (int i = 0; i < 4; i++) { |
| | | SolrResultDTO dto = solrShortVideoDataManager.find(filter, 1, 500); |
| | | List<SolrShortVideo> list = (List<SolrShortVideo>) dto.getVideoList(); |
| | | for (SolrShortVideo video : list) { |
| | | solrShortVideoDataManager.deleteById(video.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Test |
| | | public void test2() throws Exception { |
| | | BilibiliApiUtil.MediaUrlResult result = BilibiliApiUtil.getMediaList(BilibiliUtil.TYPE_JILUPIAN, 2, 1); |
| | | BilibiliApiUtil.MediaUrlResult result = BilibiliApiUtil.getMediaList(BilibiliUtil.TYPE_GUOMAN, 2, 1); |
| | | int page = result.getTotal() % 20 == 0 ? result.getTotal() / 20 : result.getTotal() / 20 + 1; |
| | | for (int i = 0; i < 10; i++) { |
| | | System.out.println("page:" + i); |
| | |
| | | |
| | | @Test |
| | | public void addToSearch() throws Exception { |
| | | BilibiliMediaInfo mediaInfo = bilibiliVideoService.getSimpleMediaDetail(28223059L); |
| | | BilibiliMediaInfo mediaInfo = BilibiliApiUtil.parseMediaInfo("https://www.bilibili.com/bangumi/play/ss28761/"); |
| | | // BilibiliMediaInfo mediaInfo = bilibiliVideoService.getSimpleMediaDetail(365413358L); |
| | | bilibiliVideoService.addToInternetSearch(mediaInfo); |
| | | |
| | | |
| | |
| | | |
| | | @Test |
| | | public void test2() { |
| | | // try { |
| | | // mogoTVVideoUpdate.updateLatestVideo("电视剧"); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | |
| | | try { |
| | | mogoTVVideoUpdate.updateLatestVideo("电视剧"); |
| | | mogoTVVideoUpdate.updateSingleVideo("362723"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | } |
| | | @Test |
| | | public void addToSearch() { |
New file |
| | |
| | | package com.hxh.spring.test.video; |
| | | |
| | | |
| | | import com.yeshi.buwan.domain.solr.SolrShortVideo; |
| | | import com.yeshi.buwan.domain.special.SearchSpecial; |
| | | import com.yeshi.buwan.domain.special.SearchSpecialPosition; |
| | | import com.yeshi.buwan.domain.special.SearchSpecialPositionMap; |
| | | import com.yeshi.buwan.dto.search.SolrShortVideoSearchFilter; |
| | | import com.yeshi.buwan.dto.search.SolrVideoSearchFilter; |
| | | import com.yeshi.buwan.service.inter.search.SearchSpecialPositionMapService; |
| | | import com.yeshi.buwan.service.inter.search.SearchSpecialPositionService; |
| | | import com.yeshi.buwan.service.inter.search.SearchSpecialService; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.test.context.ContextConfiguration; |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | |
| | | // |
| | | @RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试 |
| | | @ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | | @WebAppConfiguration |
| | | public class SearchSpecialTest { |
| | | |
| | | @Resource |
| | | private SearchSpecialService searchSpecialService; |
| | | |
| | | @Resource |
| | | private SearchSpecialPositionService searchSpecialPositionService; |
| | | |
| | | @Resource |
| | | private SearchSpecialPositionMapService searchSpecialPositionMapService; |
| | | |
| | | |
| | | @Test |
| | | public void addPosition() throws Exception { |
| | | // SearchSpecialPosition position = new SearchSpecialPosition(); |
| | | // position.setName("韩剧推荐圆形专题"); |
| | | // position.setSystemId("2"); |
| | | // position.setId("hanju-recommend-special"); |
| | | // searchSpecialPositionService.add(position); |
| | | |
| | | SearchSpecialPosition position = new SearchSpecialPosition(); |
| | | position.setName("韩剧分类"); |
| | | position.setSystemId("2"); |
| | | position.setId("hanju-video-types"); |
| | | searchSpecialPositionService.add(position); |
| | | } |
| | | |
| | | |
| | | //添加专题 |
| | | @Test |
| | | public void addSpecial() throws Exception { |
| | | |
| | | int systemId = 3; |
| | | |
| | | SearchSpecial searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-电视剧"); |
| | | searchSpecial.setKey("hanju-tv"); |
| | | SolrVideoSearchFilter filter = new SolrVideoSearchFilter(); |
| | | filter.setArea("韩国"); |
| | | filter.setContentType(1); |
| | | filter.setVideoType(150); |
| | | searchSpecial.setAlbumQuery(filter); |
| | | searchSpecial.setInternetQuery(filter); |
| | | searchSpecial.setColumn(2); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | |
| | | |
| | | searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-电影"); |
| | | searchSpecial.setKey("hanju-movie"); |
| | | filter.setArea("韩国"); |
| | | filter.setContentType(1); |
| | | filter.setVideoType(151); |
| | | searchSpecial.setAlbumQuery(filter); |
| | | searchSpecial.setInternetQuery(filter); |
| | | searchSpecial.setColumn(3); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | |
| | | |
| | | searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-综艺"); |
| | | searchSpecial.setKey("hanju-show"); |
| | | filter.setArea("韩国"); |
| | | filter.setContentType(1); |
| | | filter.setVideoType(152); |
| | | searchSpecial.setAlbumQuery(filter); |
| | | searchSpecial.setInternetQuery(filter); |
| | | searchSpecial.setColumn(3); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | |
| | | |
| | | searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-少儿"); |
| | | searchSpecial.setKey("hanju-shaoer"); |
| | | filter.setArea("日本"); |
| | | // filter.setContentType(1); |
| | | filter.setVideoType(153); |
| | | searchSpecial.setAlbumQuery(filter); |
| | | searchSpecial.setInternetQuery(filter); |
| | | searchSpecial.setColumn(2); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | |
| | | |
| | | SolrShortVideoSearchFilter sfilter = new SolrShortVideoSearchFilter(); |
| | | searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-娱乐"); |
| | | searchSpecial.setKey("hanju-yule"); |
| | | sfilter.setAreas(Arrays.asList(new String[]{"韩国", "日韩"})); |
| | | sfilter.setRootVideoType(155); |
| | | // sfilter.setTag(); |
| | | searchSpecial.setShortQuery(sfilter); |
| | | searchSpecial.setColumn(2); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | |
| | | |
| | | sfilter = new SolrShortVideoSearchFilter(); |
| | | searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-八卦"); |
| | | searchSpecial.setKey("hanju-bagua"); |
| | | sfilter.setAreas(Arrays.asList(new String[]{"韩国", "日韩"})); |
| | | sfilter.setRootVideoType(155); |
| | | sfilter.setTag("八卦"); |
| | | searchSpecial.setShortQuery(sfilter); |
| | | searchSpecial.setColumn(2); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | |
| | | sfilter = new SolrShortVideoSearchFilter(); |
| | | searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-新闻"); |
| | | searchSpecial.setKey("hanju-news"); |
| | | sfilter.setAreas(Arrays.asList(new String[]{"韩国", "日韩"})); |
| | | sfilter.setRootVideoType(155); |
| | | sfilter.setTag("新闻"); |
| | | searchSpecial.setShortQuery(sfilter); |
| | | searchSpecial.setColumn(2); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | |
| | | sfilter = new SolrShortVideoSearchFilter(); |
| | | searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-明星"); |
| | | searchSpecial.setKey("hanju-stars"); |
| | | sfilter.setAreas(Arrays.asList(new String[]{"韩国", "日韩"})); |
| | | sfilter.setRootVideoType(155); |
| | | sfilter.setTag("明星"); |
| | | searchSpecial.setShortQuery(sfilter); |
| | | searchSpecial.setColumn(2); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | |
| | | sfilter = new SolrShortVideoSearchFilter(); |
| | | searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-热点"); |
| | | searchSpecial.setKey("hanju-hots"); |
| | | sfilter.setAreas(Arrays.asList(new String[]{"韩国", "日韩"})); |
| | | sfilter.setRootVideoType(155); |
| | | sfilter.setTag("热点"); |
| | | searchSpecial.setShortQuery(sfilter); |
| | | searchSpecial.setColumn(2); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | |
| | | |
| | | sfilter = new SolrShortVideoSearchFilter(); |
| | | searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-音乐"); |
| | | searchSpecial.setKey("hanju-music"); |
| | | sfilter.setAreas(Arrays.asList(new String[]{"韩国", "日韩"})); |
| | | sfilter.setRootVideoType(155); |
| | | sfilter.setTag("音乐"); |
| | | searchSpecial.setShortQuery(sfilter); |
| | | searchSpecial.setColumn(2); |
| | | searchSpecial.setSystemId(systemId + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | } |
| | | |
| | | @Test |
| | | public void addHanjuFound() throws Exception { |
| | | SearchSpecial searchSpecial = new SearchSpecial(); |
| | | searchSpecial.setName("韩剧-发现"); |
| | | searchSpecial.setKey("hanju-found"); |
| | | SolrShortVideoSearchFilter filter = new SolrShortVideoSearchFilter(); |
| | | filter.setAreas(Arrays.asList(new String[]{"日韩", "韩国"})); |
| | | filter.setRootVideoType(155); |
| | | filter.setSortKey("third_update_time"); |
| | | |
| | | searchSpecial.setAlbumQuery(null); |
| | | searchSpecial.setInternetQuery(null); |
| | | searchSpecial.setShortQuery(filter); |
| | | searchSpecial.setColumn(1); |
| | | searchSpecial.setSystemId(2 + ""); |
| | | searchSpecialService.save(searchSpecial); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void addHomeRecommendMap() throws Exception { |
| | | SearchSpecialPositionMap map = new SearchSpecialPositionMap(); |
| | | map.setWeight(5); |
| | | map.setIcon("https://buwan-1255749512.cos.ap-guangzhou.myqcloud.com/resource/hanju/icon_show.png"); |
| | | map.setPositionId("hanju-recommend-special"); |
| | | map.setSpecialId("3#hanju-show"); |
| | | map.setShowName("综艺"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(4); |
| | | map.setIcon("https://buwan-1255749512.cos.ap-guangzhou.myqcloud.com/resource/hanju/icon_shaoer.png"); |
| | | map.setPositionId("hanju-recommend-special"); |
| | | map.setSpecialId("3#hanju-shaoer"); |
| | | map.setShowName("少儿"); |
| | | searchSpecialPositionMapService.add(map); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void addClassMap() throws Exception { |
| | | SearchSpecialPositionMap map = new SearchSpecialPositionMap(); |
| | | map.setWeight(10); |
| | | map.setIcon("https://hbimg.huabanimg.com/ad0761f6e6e9e75338d16779b53a7bdadd15e0725b64-oM63yV_fw658/format/jpg"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-tv"); |
| | | map.setShowName("电视剧"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(9); |
| | | map.setIcon("https://hbimg.huabanimg.com/4aacfc22d74810599f5aa866c47d2fc799b2ae758196-0v1WNZ_fw658/format/jpg"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-movie"); |
| | | map.setShowName("电影"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(8); |
| | | map.setIcon("https://hbimg.huabanimg.com/c952195a742d4fe333e1b2e9be565813ca2c7f1d6ba9-liOuwf_fw658/format/jpg"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-show"); |
| | | map.setShowName("综艺"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(7); |
| | | map.setIcon("https://hbimg.huabanimg.com/c0dc03bf2916f01f3e63e1beeb92b1451d584a117a6e-W8V942_fw658/format/png"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-shaoer"); |
| | | map.setShowName("少儿"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(6); |
| | | map.setIcon("https://hbimg.huabanimg.com/aed790cbc6ff99960e946cf67cae64e15e356c8c372f-tG2lOO_fw658/format/jpg"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-yule"); |
| | | map.setShowName("娱乐"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(5); |
| | | map.setIcon("https://hbimg.huabanimg.com/ac027864000ffc7c8b914036a8ef8cbd67d060043dec-ce9xDD_fw658/format/jpg"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-bagua"); |
| | | map.setShowName("八卦"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(4); |
| | | map.setIcon("https://hbimg.huabanimg.com/7f1017e39a4adbf48dc0e15c5bd9ba16de9391dd43f0-ZlHBfQ_fw658/format/jpg"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-news"); |
| | | map.setShowName("新闻"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(3); |
| | | map.setIcon("https://hbimg.huabanimg.com/e92f33ceffdb854e1fb6150b8fd61b51f237e94238bd-nFZvvS_fw658/format/jpg"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-stars"); |
| | | map.setShowName("明星"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(2); |
| | | map.setIcon("https://hbimg.huabanimg.com/d21c6c2c57c93ea961f03c7c0a6d91d5bbf3ee983cee-RHoY6U_fw658/format/jpg"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-hots"); |
| | | map.setShowName("热点"); |
| | | searchSpecialPositionMapService.add(map); |
| | | |
| | | map = new SearchSpecialPositionMap(); |
| | | map.setWeight(1); |
| | | map.setIcon("https://hbimg.huabanimg.com/a97df73eefc83240018da0728469301e836d0df63ce9-v0oEs4_fw658/format/jpg"); |
| | | map.setPositionId("hanju-video-types"); |
| | | map.setSpecialId("3#hanju-music"); |
| | | map.setShowName("音乐"); |
| | | searchSpecialPositionMapService.add(map); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Test |
| | | public void addHJAndroid() { |
| | | String[] resourceIds = null; |
| | | resourceIds = new String[]{"13", "19", "21", "22", "24", "25"}; |
| | | for (String rid : resourceIds) { |
| | | try { |
| | | videoResourceVersionMapService.add(new VideoResourceVersionMap("48", 1, rid, null)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void addBuWanIOS() { |
| | | String[] resourceIds = new String[]{"19", "24", "25"}; |
| | | for (String rid : resourceIds) { |
| | | try { |
| | | videoResourceVersionMapService.add(new VideoResourceVersionMap("43", 86, rid, "appstore")); |
| | | videoResourceVersionMapService.add(new VideoResourceVersionMap("43", 88, rid, "appstore")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | |
| | | @Test |
| | | public void test3() throws Exception { |
| | | OrderRecord record = orderService.getOrderRecord("82"); |
| | | OrderRecord record = orderService.getOrderRecord("1000592"); |
| | | pptvVipManager.buyVIP(record); |
| | | } |
| | | |