蛋蛋星球-制度模式
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.0 KiB

  1. package svc
  2. import (
  3. "code.fnuoos.com/EggPlanet/egg_system_rules.git/md"
  4. egg_system_rules "code.fnuoos.com/EggPlanet/egg_system_rules.git/utils"
  5. "strconv"
  6. "time"
  7. )
  8. func GetEggFriendCircleCommentEsIndex(userId int64) string {
  9. return md.EggFriendCircleCommentEsIndex + GetUserIdSuffix(userId)
  10. }
  11. func GetEggFriendCircleCommentEsIndexId(userId int64, circleId string) string {
  12. return circleId + "_" + strconv.FormatInt(userId, 10) + "_" + egg_system_rules.Int64ToStr(time.Now().Unix())
  13. }
  14. func GetEggFriendCircleLikeEsIndex(userId int64) string {
  15. return md.EggFriendCircleLikeEsIndex + GetUserIdSuffix(userId)
  16. }
  17. func GetEggFriendCircleLikeEsIndexId(userId int64, circleId string) string {
  18. return circleId + "_" + strconv.FormatInt(userId, 10)
  19. }
  20. func GetUserIdSuffix(userId int64) string {
  21. numberStr := strconv.FormatInt(userId, 10) // 将数字转换为字符串
  22. lastChar := numberStr[len(numberStr)-1] // 获取最后一个字符
  23. //return strconv.Itoa(int(lastChar)) // 将 byte 类型的值隐式转换为 int
  24. return string(lastChar)
  25. }