Browse Source

update

master
shenjiachi 1 month ago
parent
commit
04ee23549e
2 changed files with 15 additions and 2 deletions
  1. +6
    -1
      rule/egg_energy/md/mq_im.go
  2. +9
    -1
      svc/svc_es.go

+ 6
- 1
rule/egg_energy/md/mq_im.go View File

@@ -3,7 +3,8 @@ package md
const IMEggEnergyExchange = "im.egg.energy"

const (
IMEggEnergyRoutKeyForBatchSendMessageData = "batch_send_message_data" // 批量发送信息
IMEggEnergyRoutKeyForBatchSendMessageData = "batch_send_message_data" // 批量发送信息
IMEggEnergyRoutKeyForDelFriendCircleCommentData = "del_friend_circle_comment_data" // 删除朋友圈评论
)

type IMEggEnergyStructForBatchSendMessageData struct {
@@ -13,3 +14,7 @@ type IMEggEnergyStructForBatchSendMessageData struct {
ReceiveIMId int64 `json:"receive_id"` // 接受者IM id
Content string `json:"content"` // 消息内容
}

type IMEggEnergyStructForDelFriendCircleCommentData struct {
CommentIndexId string `json:"comment_index_id"` // 文章索引
}

+ 9
- 1
svc/svc_es.go View File

@@ -14,8 +14,16 @@ func GetEggFriendCircleCommentEsIndexId(userId int64, circleId string) string {
return circleId + "_" + strconv.FormatInt(userId, 10) + "_" + egg_system_rules.Int64ToStr(time.Now().Unix())
}

func GetEggFriendCircleLikeEsIndex(userId int64) string {
return md.EggFriendCircleLikeEsIndex + GetUserIdSuffix(userId)
}
func GetEggFriendCircleLikeEsIndexId(userId int64, circleId string) string {
return circleId + "_" + strconv.FormatInt(userId, 10)
}

func GetUserIdSuffix(userId int64) string {
numberStr := strconv.FormatInt(userId, 10) // 将数字转换为字符串
lastChar := numberStr[len(numberStr)-1] // 获取最后一个字符
return strconv.Itoa(int(lastChar))
//return strconv.Itoa(int(lastChar)) // 将 byte 类型的值隐式转换为 int
return string(lastChar)
}

Loading…
Cancel
Save