This commit is contained in:
1-6
2023-07-25 16:43:15 +08:00
parent fd2053e14c
commit 3a09771432
9 changed files with 272 additions and 40 deletions
+5 -1
View File
@@ -34,14 +34,16 @@ var senders sync.Map
// }
func GetSender(uuid string) (common.Sender, error) {
if uuid == "" {
return &CustomSender{
f: &Factory{
F: &Factory{
botid: "*",
},
}, nil
}
v, ok := senders.Load(uuid)
fmt.Println("uuid", uuid, v, ok)
if !ok {
return nil, errors.New("not found sender")
}
@@ -138,6 +140,7 @@ func (sg *SillyGirlService) SenderListen(stream srpc.SillyGirlService_SenderList
// defer fmt.Println("已关闭,", "===")
for {
req, err := stream.Recv()
// fmt.Println("carry", carry, err)
if err == io.EOF {
break // 如果流已经关闭,则退出循环
@@ -146,6 +149,7 @@ func (sg *SillyGirlService) SenderListen(stream srpc.SillyGirlService_SenderList
return err
}
if carry != nil {
fmt.Println("req.Uuid", req.Uuid)
echo := req.GetUuid()
value := req.GetValue()
// fmt.Println("echo", echo, "value", value)