Open glacierck opened 7 months ago
Is it worth to introduce startWith
property if undefined then its root, otherwise take the id of comment to build the nested structure starting with it?
The advantage of this is that it is easy to build a comment view with only two layers. The first layer is the root comment, which is oriented towards the comment object (article), and the second layer is the reply to the comment, with the reply target being the root comment or other reply. Similar to the following view:
comment:
To achieve such a view, we only need to maintain two relationships for comments: the root relationship and the reply relationship. Of course, as root comments, they can be set null (when the reply target is a root comment, it is possible to only maintain the root relationship without filling in the reply relationship. In this case, they are the same)
The current flat structure returns no application value, it is like a journal. And the tree structure does not have pagination function and has no engineering significance
Each descendant comment should record their root comment ID, so that we can perform pagination queries on the root comment and recall the N levels of descendant comments below each root comment。