Browse Source

feat: publish record to mq when user comment

master
shenjiachi 1 week ago
parent
commit
0cdea2faa4
2 changed files with 12 additions and 1 deletions
  1. +11
    -0
      app/hdl/friend_circle/hdl_comment.go
  2. +1
    -1
      go.mod

+ 11
- 0
app/hdl/friend_circle/hdl_comment.go View File

@@ -7,8 +7,10 @@ import (
svc2 "applet/app/svc/friend_circle" svc2 "applet/app/svc/friend_circle"
"applet/app/utils/cache" "applet/app/utils/cache"
"code.fnuoos.com/EggPlanet/egg_system_rules.git/md" "code.fnuoos.com/EggPlanet/egg_system_rules.git/md"
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md"
svc3 "code.fnuoos.com/EggPlanet/egg_system_rules.git/svc" svc3 "code.fnuoos.com/EggPlanet/egg_system_rules.git/svc"
"code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es" "code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es"
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit"
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
@@ -164,6 +166,15 @@ func Comment(c *gin.Context) {
} }
} }


// 推到 es 更新评论次数
ch, err := rabbit.Cfg.Pool.GetChannel()
if err != nil {
return
}
defer ch.Release()

ch.Publish(md2.EggAppExchange, md2.EggCommentData{Uid: user.Id}, md2.EggRoutKeyForComment)

e.OutSuc(c, "success", nil) e.OutSuc(c, "success", nil)
} }




+ 1
- 1
go.mod View File

@@ -34,7 +34,7 @@ require (


require ( require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241225092233-b22661930965 code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241225092233-b22661930965
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241226083724-d7b4eb9ea3b5
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241227092843-802cf07ae61c
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible


Loading…
Cancel
Save