|
@@ -3,6 +3,7 @@ package logic
|
|
import (
|
|
import (
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
|
|
+ "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
|
|
IC "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/init"
|
|
IC "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/init"
|
|
"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/internal/svc"
|
|
"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/internal/svc"
|
|
"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
|
|
"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
|
|
@@ -161,15 +162,33 @@ func (l *SaveTSGuideLogic) SaveTSGuide(in *bxsubscribe.SaveTSGuideReq) (*bxsubsc
|
|
if in.AppSwitch {
|
|
if in.AppSwitch {
|
|
updateMap["o_pushset.o_subset.i_apppush"] = 1
|
|
updateMap["o_pushset.o_subset.i_apppush"] = 1
|
|
}
|
|
}
|
|
|
|
+ go SetLog(in.UserId, strings.ReplaceAll(field, ".%s", ""))
|
|
if !IC.Compatible.Update(in.UserId, map[string]interface{}{
|
|
if !IC.Compatible.Update(in.UserId, map[string]interface{}{
|
|
"$set": updateMap,
|
|
"$set": updateMap,
|
|
}) {
|
|
}) {
|
|
logx.Error("设置订阅向导更新失败", in.UserId, updateMap)
|
|
logx.Error("设置订阅向导更新失败", in.UserId, updateMap)
|
|
return nil, errors.New("设置订阅向导更新失败")
|
|
return nil, errors.New("设置订阅向导更新失败")
|
|
}
|
|
}
|
|
|
|
+ go jy.Publish(IC.MgoLog, IC.C.Nsq, IC.C.NsqTopic, "task", in.UserId, jy.Jyweb_node2, map[string]interface{}{
|
|
|
|
+ "code": 1015, //首次订阅
|
|
|
|
+ "types": "subscribeKeyWords",
|
|
|
|
+ "num": 50,
|
|
|
|
+ "baseUserId": baseUserId,
|
|
|
|
+ "positionId": positionId,
|
|
|
|
+ })
|
|
return &bxsubscribe.StatusResp{}, nil
|
|
return &bxsubscribe.StatusResp{}, nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// SetLog 订阅设置记录
|
|
|
|
+func SetLog(userid, types string) {
|
|
|
|
+ if data := IC.Compatible.Select(userid, `{"o_vipjy":1,"o_member_jy":1,"o_jy":1}`); len(*data) > 0 && data != nil {
|
|
|
|
+ (*data)["userid"] = userid
|
|
|
|
+ (*data)["type"] = types
|
|
|
|
+ (*data)["createtime"] = time.Now().Unix()
|
|
|
|
+ IC.MgoLog.Save("ovipjy_log", data)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
// 保存入库之前,处理订阅的关键词
|
|
// 保存入库之前,处理订阅的关键词
|
|
func processKeyword(keyword string) []string {
|
|
func processKeyword(keyword string) []string {
|
|
keywordReg := regexp.MustCompile("([\\s\u3000\u2003\u00a0+,,])+")
|
|
keywordReg := regexp.MustCompile("([\\s\u3000\u2003\u00a0+,,])+")
|