在受监视的聊天应用程序中构造数据和用户

问题描述

抱歉,我仍然是一个学习者。我在这里以及在Google周围已经看到了使用Fire Store 解释的不同结构化方法,但是我仍然不清楚这是否是我要在​​Firebase上做的事情。另外,Firebase是否是我下面要执行的操作的正确选择?谢谢您的指导或评论,无论大小如何。

如果恰好有两个班,两个老师,每个老师三个学生,即。

  1. 老师A的班级的学生A,B或C只能与老师1的班级的学生1、2或3聊天(每对学生在自己的聊天室中);
  2. 老师A仅看到并批准或拒绝 A类发送的每条消息;老师1仅看到并且批准或拒绝第1类;
  3. 发送的每条消息
  4. 老师A只能看到从Class A发送的消息;老师1只能看到从班级1发送的消息;

这是构造数据库方法吗?

ChatRooms (collection)  
    Chatroom1 (document)                // custom roomID from a pair of studentIDs
        ApprovedMessages (collection)   // produces messageID
            Message1_1 (document) 
                from : "alice"          // student A's emailID / userID
                msg : "hiya"            
                timestamp : "2020-09-16T19:45:00"
                teacher : "miss@abc"    // teacher A's email
                class : "classA"
            Message1_2 (document)
                from : "bob"            // student 1's email / userID
                msg : "hey yourself"
                timestamp : "2020-09-16T19:46:00"
                teacher : "sir@xyz"     // teacher 1's email
                class : "Class1"
        PendingMessages (collection)
            Message (document)
                from : "alice"
                msg : "foobar"
                timestamp : "2020-09-16T19:49:00"

I got as far as ...
[Firebase realtime database single chat structure][1]


  [1]: https://i.stack.imgur.com/dhlqI.png

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)