|
@@ -2,6 +2,12 @@
|
|
|
|
|
|
投流数据文章相关服务开发
|
|
|
|
|
|
+### 0. 启动服务
|
|
|
+
|
|
|
+ hypercorn touliu_app:app --config touliu.toml
|
|
|
+
|
|
|
+ nohup hypercorn touliu_app:app --config touliu.toml
|
|
|
+
|
|
|
### 1. LogServer
|
|
|
###### code: 日志码
|
|
|
rangs 1001 --> 9999
|
|
@@ -17,3 +23,73 @@
|
|
|
touliu + "_" + uuid + "_" + timestamp
|
|
|
###### data: 日志附加信息
|
|
|
一般存储传参,返回结果等json信息
|
|
|
+
|
|
|
+### 2.数据库设计
|
|
|
+###### top_videos_daily
|
|
|
+从pq每日获取单日回流top5000的视频
|
|
|
+
|
|
|
+ CREATE TABLE `top_videos_daily` (
|
|
|
+ `video_id` bigint(16) NOT NULL COMMENT '视频id',
|
|
|
+ `uid` bigint(16) DEFAULT NULL COMMENT '用户id',
|
|
|
+ `title` varchar(255) DEFAULT NULL COMMENT '视频标题',
|
|
|
+ `return_cnt` int(11) DEFAULT NULL COMMENT '回流',
|
|
|
+ `view_cnt` int(11) DEFAULT NULL COMMENT '曝光数量',
|
|
|
+ `share_cnt` int(11) DEFAULT NULL COMMENT '分享数量',
|
|
|
+ `category` varchar(16) DEFAULT NULL COMMENT '视频品类',
|
|
|
+ `rov` double DEFAULT NULL,
|
|
|
+ `ros` double DEFAULT NULL,
|
|
|
+ `status` int(11) DEFAULT NULL,
|
|
|
+ `dt` varchar(16) NOT NULL,
|
|
|
+ PRIMARY KEY (`video_id`,`dt`)
|
|
|
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='每日top5000的视频, 为投流业务服务'
|
|
|
+
|
|
|
+###### touliu_published_videos
|
|
|
+投流业务已经发布出去的视频的表现回收
|
|
|
+
|
|
|
+ CREATE TABLE `touliu_published_videos` (
|
|
|
+ `video_id` bigint(16) DEFAULT NULL COMMENT '视频id',
|
|
|
+ `root_source_id` varchar(155) DEFAULT NULL,
|
|
|
+ `business_type` varchar(16) DEFAULT NULL COMMENT '业务类型',
|
|
|
+ `play_first_level` bigint(16) DEFAULT NULL COMMENT '首层播放',
|
|
|
+ `play_fission` bigint(16) DEFAULT NULL COMMENT '裂变层播放',
|
|
|
+ `total_play` bigint(16) DEFAULT NULL COMMENT '总播放',
|
|
|
+ `return_first_level` bigint(16) DEFAULT NULL,
|
|
|
+ `return_fission` bigint(16) DEFAULT NULL,
|
|
|
+ `return_total` bigint(16) DEFAULT NULL,
|
|
|
+ `convert_first_level` bigint(16) DEFAULT NULL,
|
|
|
+ `convert_fission` bigint(16) DEFAULT NULL,
|
|
|
+ `convert_total` bigint(16) DEFAULT NULL,
|
|
|
+ `income_first_level` double DEFAULT NULL,
|
|
|
+ `income_fission` double DEFAULT NULL,
|
|
|
+ `income_total` double DEFAULT NULL,
|
|
|
+ `arpu_first_level` double DEFAULT NULL COMMENT '首层arpu',
|
|
|
+ `arpu_fission` double DEFAULT NULL COMMENT '裂变层arpu',
|
|
|
+ `arpu_total` double DEFAULT NULL COMMENT '总arpu',
|
|
|
+ `publish_dt` datetime DEFAULT NULL COMMENT '视频发布时间',
|
|
|
+ `origin_time` datetime DEFAULT NULL,
|
|
|
+ `recycle_dt` datetime DEFAULT NULL,
|
|
|
+ `uv_first_level` int(16) DEFAULT NULL,
|
|
|
+ `uv_fission` bigint(16) DEFAULT NULL,
|
|
|
+ `uv_total` bigint(16) DEFAULT NULL
|
|
|
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='投流已发布视频数据'
|
|
|
+
|
|
|
+###### touliu_source_id
|
|
|
+投流视频文章&&source_id表
|
|
|
+
|
|
|
+ CREATE TABLE `touliu_source_id` (
|
|
|
+ `video_id` bigint(16) DEFAULT NULL,
|
|
|
+ `video_cover` text COMMENT '视频封面url',
|
|
|
+ `video_title` varchar(255) DEFAULT NULL COMMENT '视频标题',
|
|
|
+ `uid` bigint(16) DEFAULT NULL,
|
|
|
+ `gh_id` varchar(32) DEFAULT NULL,
|
|
|
+ `account_name` varchar(255) DEFAULT NULL COMMENT '公众号名称',
|
|
|
+ `article_title` varchar(255) DEFAULT NULL COMMENT '文章标题',
|
|
|
+ `business_type` int(1) DEFAULT NULL COMMENT '1: 公众号投流,2:小程序投流, 3: 企微投流',
|
|
|
+ `cooperation` varchar(255) DEFAULT NULL COMMENT '合作商',
|
|
|
+ `position` int(1) DEFAULT NULL COMMENT '位置',
|
|
|
+ `source_id` varchar(128) DEFAULT NULL,
|
|
|
+ `share_path` varchar(255) DEFAULT NULL COMMENT '分享路径',
|
|
|
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
|
|
+ `minigram_name` varchar(255) DEFAULT NULL COMMENT '小程序名字',
|
|
|
+ `minigram_id` varchar(255) DEFAULT NULL COMMENT '小程序id'
|
|
|
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='投流专用source_id表'
|