新增聊天功能

This commit is contained in:
2024-10-14 17:40:11 +08:00
parent 99ed84f534
commit 245875881c
13 changed files with 360 additions and 12 deletions
+9
View File
@@ -42,6 +42,15 @@ func (s *zeroconfService) FindService() ([]models.Online, error) {
return s.onlines, nil
}
func (s *zeroconfService) GetOnline(id string) *models.Online {
for _, online := range s.onlines {
if online.ID == id {
return &online
}
}
return nil
}
func (s *zeroconfService) StartFindService() error {
resolver, err := zeroconf.NewResolver(nil)
if err != nil {