2026-05-11 19:26:01 +08:00

22 lines
605 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package service
import "strconv"
func boolString(value bool) string {
// 腾讯云 IM 自定义消息 attributes 只放字符串bool 在这里统一转成小写字面量。
if value {
return "true"
}
return "false"
}
func int64String(value int64) string {
// 用户 ID 等数值进入 attributes 时保持十进制字符串,和 IM identifier 映射一致。
return strconv.FormatInt(value, 10)
}
func int32String(value int32) string {
// 麦位编号和座位总数同样使用十进制字符串,避免客户端解析多种数字格式。
return strconv.FormatInt(int64(value), 10)
}