|
@@ -0,0 +1,92 @@
|
|
|
+package com.tzld.piaoquan.recommend.feature.domain;
|
|
|
+
|
|
|
+import lombok.Data;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Data
|
|
|
+public class VideoBytesFeature {
|
|
|
+ private final byte[] videoId;
|
|
|
+
|
|
|
+ private final byte[] upId;
|
|
|
+
|
|
|
+ private final byte[] titleLength;
|
|
|
+
|
|
|
+ private final byte[] playLength;
|
|
|
+
|
|
|
+ private final byte[] totolTime;
|
|
|
+
|
|
|
+ private final byte[] daysSinceUpload;
|
|
|
+
|
|
|
+
|
|
|
+ // 当天统计量信息
|
|
|
+ private Map<String, byte[]> item_day1_cnt_features;
|
|
|
+ // 3天内统计量
|
|
|
+ private Map<String, byte[]> item_day3_cnt_features;
|
|
|
+ // 7天内统计量
|
|
|
+ private Map<String, byte[]> item_day7_cnt_features;
|
|
|
+ // 3个月统计量
|
|
|
+ private Map<String, byte[]> item_month3_cnt_features;
|
|
|
+
|
|
|
+ public VideoBytesFeature(ItemFeature feature) {
|
|
|
+ videoId = feature.getVideoId().getBytes();
|
|
|
+ upId = feature.getUpId().getBytes();
|
|
|
+
|
|
|
+ titleLength = feature.getTitleLength().getBytes();
|
|
|
+ playLength = feature.getPlayLength().getBytes();
|
|
|
+ totolTime = feature.getTotalTime().getBytes();
|
|
|
+ daysSinceUpload = feature.getDaysSinceUpload().getBytes();
|
|
|
+ // 1day
|
|
|
+
|
|
|
+
|
|
|
+ // 1 day statistic
|
|
|
+ item_day1_cnt_features = new HashMap<String, byte[]>();
|
|
|
+ item_day1_cnt_features.put("exp", String.valueOf(feature.getDay1_cnt_features().getExp_cnt()).getBytes());
|
|
|
+ item_day1_cnt_features.put("click", String.valueOf(feature.getDay1_cnt_features().getClick_cnt()).getBytes());
|
|
|
+ item_day1_cnt_features.put("share", String.valueOf(feature.getDay1_cnt_features().getShare_cnt()).getBytes());
|
|
|
+ item_day1_cnt_features.put("return", String.valueOf(feature.getDay1_cnt_features().getReturn_cnt()).getBytes());
|
|
|
+ item_day1_cnt_features.put("ctr", String.valueOf(feature.getDay1_cnt_features().getCtr()).getBytes());
|
|
|
+ item_day1_cnt_features.put("str", String.valueOf(feature.getDay1_cnt_features().getStr()).getBytes());
|
|
|
+ item_day1_cnt_features.put("rov", String.valueOf(feature.getDay1_cnt_features().getRov()).getBytes());
|
|
|
+ item_day1_cnt_features.put("ros", String.valueOf(feature.getDay1_cnt_features().getRos()).getBytes());
|
|
|
+
|
|
|
+
|
|
|
+ // 3 day statistic
|
|
|
+ item_day3_cnt_features = new HashMap<String, byte[]>();
|
|
|
+ item_day3_cnt_features.put("exp", String.valueOf(feature.getDay3_cnt_features().getExp_cnt()).getBytes());
|
|
|
+ item_day3_cnt_features.put("click", String.valueOf(feature.getDay3_cnt_features().getClick_cnt()).getBytes());
|
|
|
+ item_day3_cnt_features.put("share", String.valueOf(feature.getDay3_cnt_features().getShare_cnt()).getBytes());
|
|
|
+ item_day3_cnt_features.put("return", String.valueOf(feature.getDay3_cnt_features().getReturn_cnt()).getBytes());
|
|
|
+ item_day3_cnt_features.put("ctr", String.valueOf(feature.getDay3_cnt_features().getCtr()).getBytes());
|
|
|
+ item_day3_cnt_features.put("str", String.valueOf(feature.getDay3_cnt_features().getStr()).getBytes());
|
|
|
+ item_day3_cnt_features.put("rov", String.valueOf(feature.getDay3_cnt_features().getRov()).getBytes());
|
|
|
+ item_day3_cnt_features.put("ros", String.valueOf(feature.getDay3_cnt_features().getRos()).getBytes());
|
|
|
+
|
|
|
+
|
|
|
+ // 7 day statistic
|
|
|
+ item_day7_cnt_features = new HashMap<String, byte[]>();
|
|
|
+ item_day7_cnt_features.put("exp", String.valueOf(feature.getDay7_cnt_features().getExp_cnt()).getBytes());
|
|
|
+ item_day7_cnt_features.put("click", String.valueOf(feature.getDay7_cnt_features().getClick_cnt()).getBytes());
|
|
|
+ item_day7_cnt_features.put("share", String.valueOf(feature.getDay7_cnt_features().getShare_cnt()).getBytes());
|
|
|
+ item_day7_cnt_features.put("return", String.valueOf(feature.getDay7_cnt_features().getReturn_cnt()).getBytes());
|
|
|
+ item_day7_cnt_features.put("ctr", String.valueOf(feature.getDay7_cnt_features().getCtr()).getBytes());
|
|
|
+ item_day7_cnt_features.put("str", String.valueOf(feature.getDay7_cnt_features().getStr()).getBytes());
|
|
|
+ item_day7_cnt_features.put("rov", String.valueOf(feature.getDay7_cnt_features().getRov()).getBytes());
|
|
|
+ item_day7_cnt_features.put("ros", String.valueOf(feature.getDay7_cnt_features().getRos()).getBytes());
|
|
|
+
|
|
|
+
|
|
|
+ // 3 month statisic
|
|
|
+ item_month3_cnt_features = new HashMap<String, byte[]>();
|
|
|
+ item_month3_cnt_features.put("exp", String.valueOf(feature.getMonth3_cnt_features().getExp_cnt()).getBytes());
|
|
|
+ item_month3_cnt_features.put("click", String.valueOf(feature.getMonth3_cnt_features().getClick_cnt()).getBytes());
|
|
|
+ item_month3_cnt_features.put("share", String.valueOf(feature.getMonth3_cnt_features().getShare_cnt()).getBytes());
|
|
|
+ item_month3_cnt_features.put("return", String.valueOf(feature.getMonth3_cnt_features().getReturn_cnt()).getBytes());
|
|
|
+ item_month3_cnt_features.put("ctr", String.valueOf(feature.getMonth3_cnt_features().getCtr()).getBytes());
|
|
|
+ item_month3_cnt_features.put("str", String.valueOf(feature.getMonth3_cnt_features().getStr()).getBytes());
|
|
|
+ item_month3_cnt_features.put("rov", String.valueOf(feature.getMonth3_cnt_features().getRov()).getBytes());
|
|
|
+ item_month3_cnt_features.put("ros", String.valueOf(feature.getMonth3_cnt_features().getRos()).getBytes());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|