|
@@ -255,6 +255,7 @@ func Publish(c *gin.Context) { |
|
|
|
|
|
|
|
|
//插入es记录 |
|
|
//插入es记录 |
|
|
now := time.Now() |
|
|
now := time.Now() |
|
|
|
|
|
nowStr := now.Format("2006-01-02 15:04:05") |
|
|
createDocRet, err := es.CreateDoc(md.EggFriendCircleEsIndex, strconv.FormatInt(user.Id, 10)+"_"+utils.Int64ToStr(now.Unix()), md.EggFriendCircleEs{ |
|
|
createDocRet, err := es.CreateDoc(md.EggFriendCircleEsIndex, strconv.FormatInt(user.Id, 10)+"_"+utils.Int64ToStr(now.Unix()), md.EggFriendCircleEs{ |
|
|
Uid: user.Id, |
|
|
Uid: user.Id, |
|
|
ImUid: imUser.Id, |
|
|
ImUid: imUser.Id, |
|
@@ -268,8 +269,8 @@ func Publish(c *gin.Context) { |
|
|
State: 1, |
|
|
State: 1, |
|
|
IsTopUp: 2, |
|
|
IsTopUp: 2, |
|
|
IsPraise: 2, |
|
|
IsPraise: 2, |
|
|
CreatedAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
|
|
UpdatedAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
|
|
|
|
|
CreatedAt: nowStr, |
|
|
|
|
|
UpdatedAt: nowStr, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
fmt.Printf("CreateDoc ==> %+v \n\n", createDocRet) |
|
|
fmt.Printf("CreateDoc ==> %+v \n\n", createDocRet) |
|
@@ -288,9 +289,11 @@ func Publish(c *gin.Context) { |
|
|
m := md.EggEnergyUserEggScoreEs{ |
|
|
m := md.EggEnergyUserEggScoreEs{ |
|
|
Uid: user.Id, |
|
|
Uid: user.Id, |
|
|
SendCircleOfFriendNums: 1, |
|
|
SendCircleOfFriendNums: 1, |
|
|
|
|
|
CreatedAt: nowStr, |
|
|
|
|
|
UpdatedAt: nowStr, |
|
|
} |
|
|
} |
|
|
newCreateDoc, err := es.CreateDoc(index, id, &m) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
|
newCreateDoc, err1 := es.CreateDoc(index, id, &m) |
|
|
|
|
|
if err1 != nil { |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|