- 节点管理服务(node)
- 1.1 简介
- 1.2 项目结构
- 1.3 技术支撑
- 1.3.1 maven依赖管理及部分包相关版本
- 1.3.2 数据库
- 1.3.3 缓存管理
- 1.3.4 服务注册和发现
- 1.3.5 定时调度
- 1.3.6 监控和日志
- 1.3.7 服务间的对接
- 1.4 服务详情
- 1.4.1 node-common
- 项目工具包
- 主要公共依赖
- 1.4.2 node-auto
- 1.4.3 node-customer
- 1.4.4 node-event
- 1.4.5 node-email
- 1.4.6 node-enterprise-wechat
- 1.4.7 node-sms
- 1.4.8 node-tiktok
- 1.4.9 node-weibo
- 1.4.10 node-woa
- 1.4.11 xxl-job-admin
- 1.4.12 node-scheduler
- 1.5 新节点添加
- 1.5.1 maven依赖
- 1.5.2 编写相关业务逻辑
- 1.5.3 画布节点设计
- 1.5.4 获取链路中前面节点数据信息
- 1.5.5 链路数据校验
- 1.5.6 下发投放单
- 1.5.7 定时任务
节点管理服务(node)
1.1 简介
node目的在于对画布的节点进行分化管理,主要包含画布上时间、类型、渠道三类节点。
时间: 时间节点
类型: 客群、事件、客户+事件、广告投放节点(投放媒体源,待开发)、客户 + 广告投放节点、 事件 + 广告投放节点、 客户 + 事件 + 广告投放节点
渠道: rtb(pc端、移动端、联网大屏)、短信、微信、邮件、企业微信、微信公众号、企业抖音服务、企业微博
1.2 项目结构
node 项目
- pom.xml 项目所需的依赖包版本管理
- node-common 工具包
- node-auto 汽车行业相关管理服务
- node-customer 客户群节点管理
- node-event 事件节点管理
- node-email 邮件服务
- node-enterprise-wechat 企业微信服务
- node-sms 短信服务
- node-tiktok 抖音服务
- node-weibo 微博服务
- node-woa 微信公众号服务
- xxl-job-admin xxl-job定时任务服务端
- node-scheduler 任务调度服务
1.3 技术支撑
1.3.1 maven依赖管理及部分包相关版本
- node项目依赖于 spring-boot-starter-parent,版本:2.1.5.RELEASE
- 使用官方spring-cloud-dependencies,版本:Greenwich.SR1
- 使用阿里spring-cloud-alibaba-dependencies,版本:0.9.0.RELEASE
1.3.2 数据库
- 数据库类型:mysql数据库,目前数据库版本支持json结构操作
- 连接池配置:HikariCP
- ORM映射使用mybatis-plus
1.3.3 缓存管理
- redis缓存
1.3.4 服务注册和发现
- 使用nacos服务发现和服务健康监测
- 使用nacos动态配置服务
1.3.5 定时调度
- 使用xxl-job定时任务管理
- node-scheduler负责注册到xxl-job,并对接各个节点的定时任务
1.3.6 监控和日志
- 使用logback收集日志
- 暂使用spring-cloud-admin,监控服务状态和日志分析
1.3.7 服务间的对接
- 使用feign接口进行各个服务间的业务对接
- RestTemplate:客户群节点接口类型数据来源
1.4 服务详情
1.4.1 node-common
项目工具包
- config包:全局配置类
- encrypt包:全局通信加密 暂未使用
- exception包: 全局异常包
- redis包:redis缓存配置
- result包:响应返回值类型
- utils包:工具类以及素材上传方法
主要公共依赖
spring-context 版本:5.1.7.RELEASE
spring-web 版本:5.1.7.RELEASE
spring-webmvc 版本:5.1.7.RELEASE
spring-boot-autoconfigure 版本:2.1.5.RELEASE
spring-boot-starter-actuator 版本:2.2.6.RELEASE
spring-boot-starter-aop 版本:2.1.5.RELEASE
spring-cloud-starter-netflix-hystrix 版本:2.1.1.RELEASE
spring-cloud-starter-openfeign 版本:2.1.1.RELEASE
spring-cloud-starter-alibaba-nacos-discovery 版本:0.9.0.RELEASE
spring-cloud-starter-alibaba-nacos-config 版本:0.9.0.RELEASE
spring-cloud-starter-alibaba-sentinel 版本:0.9.0.RELEASE
commons-net 版本:3.2
commons-fileupload 版本:1.3.2
commons-lang3 版本:3.8.1
commons-codec 版本:1.10
hutool-all 版本:5.7.18
logback-classic 版本:1.2.3
jedis 版本:2.9.3
spring-boot-starter-data-redis 版本:2.1.5.RELEASE
mysql-connector-java 版本:8.0.26
mybatis-plus-boot-starter 版本:3.3.1
springfox-swagger-ui/springfox-swagger2 版本:2.9.2
springfox-swagger2/swagger-annotations/swagger-models 版本:1.5.22
freemarker 版本:2.3.31
fastjson 版本:1.2.83
1.4.2 node-auto
汽车行业
相关功能实现
接口文档详情:http://106.75.119.248:9071/auto/swagger-ui.html
1.4.3 node-customer
事务管理-客户群管理
功能:数据库、接口 、文件导入的人员、标签管理;
接口文档详情:http://106.75.119.248:9011/customer/swagger-ui.html
1.4.4 node-event
事务管理-事件管理
功能:行业事件的定义和事件属性详情管理
接口文档详情:http://106.75.119.248:9031/event/swagger-ui.html
1.4.5 node-email
触点管理-邮件
功能:邮件渠道和推送邮件功能实现
接口文档详情:http://106.75.119.248:9021/mail/swagger-ui.html
1.4.6 node-enterprise-wechat
触点管理-企业微信
功能:企业内部部门,成员的查看;
企业用户所属客户和消息模板、标签管理;
推送消息,消息日志记录;
第三方数据定时拉取;
接口文档详情:http://106.75.119.248:9081/qiye/wx/swagger-ui.html
1.4.7 node-sms
触点管理-短信
功能:短信渠道和推送短信功能实现,目前使用的亿美;
接口文档详情:http://106.75.119.248:9041/sms/swagger-ui.html
1.4.8 node-tiktok
触点管理-企业抖音
功能:抖音号、粉丝、标签、消息模板的管理;
推送消息,消息日志记录、第三方数据定时拉取;
接口文档详情:http://106.75.119.248:9101/qiye/tiktok/swagger-ui.html
1.4.9 node-weibo
触点管理-企业微博
功能:微博号、粉丝、标签、消息模板的管理;
推送消息,消息日志记录;
第三方数据定时拉取;
接口文档详情:http://106.75.119.248:9091/qiye/weibo/swagger-ui.html
1.4.10 node-woa
触点管理-微信公众号
功能:微博公众号号、粉丝、标签、消息模板的管理;
推送消息,消息日志记录;
第三方数据定时拉取;
接口文档详情:http://106.75.119.248:9051/wx/swagger-ui.html
1.4.11 xxl-job-admin
xxl-job
管理定时任务以及日志记录
样例地址:http://106.75.119.248:8050/xxl-job-admin/
1.4.12 node-scheduler
feign实现调度各个服务中定时任务
1.5 新节点添加
1.5.1 maven依赖
<!--父项目依赖-->
<parent>
<groupId>com.huaat</groupId>
<artifactId>node</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<!--公共包-->
<dependency>
<groupId>com.huaat</groupId>
<artifactId>node-common</artifactId>
</dependency>
1.5.2 编写相关业务逻辑
1.5.3 画布节点设计
节点信息json设计
例微信公众号:
[
{
"label":"微信",
"name":"wx",
"type":"outreach",
"url":"/wx/manage/msgTemplate/list",
"required":true,
"value":{
"id":"ZIk-qUp0DmorOq6DbBc9Rlio-h5O_Ba_hUisSlBrTQg",
"appid":"wx4808dfb1965e979a",
"appName":"思凡12",
"templateId":"ZIk-qUp0DmorOq6DbBc9Rlio-h5O_Ba_hUisSlBrTQg",
"name":"ZIk-qUp0DmorOq6DbBc9Rlio-h5O_Ba_hUisSlBrTQg",
"title":"测试",
"content":"欢迎您,{{first.DATA}} 登录微信公众号 初始账号为:{{keyword1.DATA}} 初始密码为:{{keyword2.DATA}} 请尽快修改",
"data":null,
"url":null,
"miniprogram":null,
"status":true,
"delFlag":null,
"updateTime":"2021-11-05 00:00:04",
"example":null,
"checked":true,
"contentDescribe":{
"first.DATA":"openid",
"keyword1.DATA":"昵称",
"keyword2.DATA":"微信号"
},
"transData":{
"first.DATA":[
"v2"
],
"keyword1.DATA":[
"v4"
],
"keyword2.DATA":[
"v1"
]
}
}
}
]
1.5.4 获取链路中前面节点数据信息
dsp项目
1.请求:GET /dsp-web/webapi/bus/nodeInfo/getParentParam
2.部分返回值详情:
appid:应用的唯一id
importId:精确人群的标签
dataSource:客户群类型 见dsp包枚举类DataSourceEnum
3.部分接口
获取客群人群信息 dsp包:
/dsp-web/node/api/selectCustomerByDataSource
1.5.5 链路数据校验
dsp预执行请求:/dsp-web/webapi/bus/projectInfo/preRun
1.5.6 下发投放单
dsp项目中ProjectInfoTaskManager类
handleTask定时方法-handleMsgTask增加时间触达逻辑
解析当前链路中各类节点json信息:
strategyChannel.invoke(nodeMessage,projectTaskMessage);
•rtb流程:
下发redis
•事件触达:
链路中不存在事件节点,为定时循环消息触达。handleTask定时方法最终会落定时表project_task_message
链路中存在事件节点,则只会下发redis。事件触达请求触发:/dsp-web/traffic/data 匹配适合的投放计划
1.5.7 定时任务
定时任务表:project_task_message
1.新节点:
定时任务逻辑接口写在新节点controller层
2.node-scheduler:
jobhandler包中编写响应JobHandler方法
@XxlJob("任务名")
进行feign接口调用定时接口。
3.xxll-job页面:
http://106.75.119.248:8050/xxl-job-admin/
新建定时任务
最后编辑:admin 更新时间:2022-08-22 10:44