Files
service-common/utils/channel.go

14 lines
296 B
Go

package utils
import (
"fmt"
"git.hlsq.asia/alex/proto/proto/ss/sspb"
"strings"
)
// GetChannelName 获得频道名称
func GetChannelName(t sspb.ChannelType, sn int64) string {
s := sspb.ChannelType_name[int32(t)]
return fmt.Sprintf("%v-%v", strings.TrimPrefix(s, "CHANNEL_TYPE_"), sn)
}