Ver Fonte

feat:p618 保存订阅向导调整

fuwencai há 7 meses atrás
pai
commit
db513b3535

+ 5 - 3
jyBXSubscribe/rpc/internal/logic/savetsguidelogic.go

@@ -128,7 +128,7 @@ func (l *SaveTSGuideLogic) SaveTSGuide(in *bxsubscribe.SaveTSGuideReq) (*bxsubsc
 		for i := 0; i < len(in.Keywords); i++ {
 			tmp := processKeyword(in.Keywords[i])
 			if len(tmp) > 0 {
-				arryMap = append(arryMap, map[string]interface{}{"matchway": 1, "key": tmp[0], "notkey": nil, "updatetime": time.Now().Unix()})
+				arryMap = append(arryMap, map[string]interface{}{"matchway": 1, "key": tmp[0:1], "notkey": nil, "updatetime": time.Now().Unix()})
 			}
 			if len(key) >= countLimit {
 				break
@@ -154,9 +154,11 @@ func (l *SaveTSGuideLogic) SaveTSGuide(in *bxsubscribe.SaveTSGuideReq) (*bxsubsc
 		updateMap[fmt.Sprintf(field, "a_items")] = []map[string]interface{}{item}
 	}
 
-	updateMap[fmt.Sprintf(field, "l_modifydate")] = date.NowFormat(date.Date_Full_Layout)
+	updateMap[fmt.Sprintf(field, "l_modifydate")] = time.Now()
 	updateMap["i_ts_guide"] = tsGuidefinished
-	if !IC.Compatible.Update(in.UserId, updateMap) {
+	if !IC.Compatible.Update(in.UserId, map[string]interface{}{
+		"$set": updateMap,
+	}) {
 		logx.Error("设置订阅向导更新失败", in.UserId, updateMap)
 		return nil, errors.New("设置订阅向导更新失败")
 	}

+ 16 - 0
jyBXSubscribe/test/618.http

@@ -0,0 +1,16 @@
+POST https://jybx3-webtest.jydev.jianyu360.com/jyapi/jybx/subscribe/fType/someInfo
+Content-Type: application/json
+Cookie: SESSIONID=5696788f98bb1cc7e24b9d2e6c4ba58c0ee38ddd
+
+
+###
+POST https://jybx3-webtest.jydev.jianyu360.com/jyapi/jybx/subscribe/fType/saveTSGuide
+Content-Type: application/json
+Cookie: SESSIONID=5696788f98bb1cc7e24b9d2e6c4ba58c0ee38ddd
+
+{
+  "area": "{\"福建\" : [\"福州市\",\"厦门市\"]}",
+  "keywords": ["设备"]
+}
+
+