GetUID 根据uin获取uid
(uin uint32, groupUin ...uint32)
| 6 | |
| 7 | // GetUID 根据uin获取uid |
| 8 | func (c *Cache) GetUID(uin uint32, groupUin ...uint32) string { |
| 9 | if len(groupUin) == 0 { |
| 10 | if friend, ok := getCacheOf[entity.User](c, uin); ok { |
| 11 | return friend.UID |
| 12 | } |
| 13 | return "" |
| 14 | } |
| 15 | if group, ok := getCacheOf[Cache](c, groupUin[0]); ok { |
| 16 | if member, ok := getCacheOf[entity.GroupMember](group, uin); ok { |
| 17 | return member.UID |
| 18 | } |
| 19 | } |
| 20 | return "" |
| 21 | } |
| 22 | |
| 23 | // GetUin 根据uid获取uin |
| 24 | func (c *Cache) GetUin(uid string, groupUin ...uint32) (uin uint32) { |
nothing calls this directly
no test coverage detected