|
@@ -106,6 +106,25 @@ func ActivityVivoWxUserRaiLabelRedisAdd(sourceId, uid int, createTime time.Time)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// 添加用户阅读图表标签到Redis
|
|
|
+func KeyChartWxUserRaiLabelRedisAdd(sourceId, uid int, label string) (err error) {
|
|
|
+ defer func() {
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ msg := fmt.Sprint("sourceId:", sourceId, "userId:", uid)
|
|
|
+ go utils.SendAlarmMsg("用户关注产业更新相关标签,写入Redis队列消息失败:"+err.Error()+msg, 2)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+ log := &models.WxUserRaiLabelRedis{UserId: uid, SourceId: sourceId, SourceType: 10, Label: label, CreateTime: time.Now(), RegisterPlatform: utils.REGISTER_PLATFORM}
|
|
|
+ if utils.Re == nil {
|
|
|
+ err := utils.Rc.LPush(utils.WX_USER_RAI_LABEL_KEY, log)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("WxUserRaiLabelRedis LPush Err:" + err.Error())
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func UpdateWxUserRaiLabelRedis() (err error) {
|
|
|
for {
|
|
|
// SourceType int `description:"来源1:搜索关键字标签、2:产业/个股标签(线下活动)、3:产业/个股标签(线下路演)、4:产业/个股标签(线上活动)、5:产业/个股标签(线上路演)、6:销售输入标签、7:产业/个股标签(报告)、8:报告类型标签"`
|