MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / GetUID

Method GetUID

client/internal/cache/cache.go:8–21  ·  view source on GitHub ↗

GetUID 根据uin获取uid

(uin uint32, groupUin ...uint32)

Source from the content-addressed store, hash-verified

6
7// GetUID 根据uin获取uid
8func (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
24func (c *Cache) GetUin(uid string, groupUin ...uint32) (uin uint32) {

Callers

nothing calls this directly

Calls 1

getCacheOfFunction · 0.85

Tested by

no test coverage detected