No comments assume that the initial functions, now how to add Comments

First of all: the existing module and user information,

Next add a comment logic is that the user A, user B, the information add comments.

Implementation:

                From the underlying implementation to create a table entry contains the comment id userId entityId conmment like columns.

                Establish commentDAO data persistence layer to achieve add a comment @Insert (), delete comment @Delete

                Use the bottom commentService packaging DAO layer, which defines methods to add and remove comment.

Add comment here take the lift chestnuts,

             addcomment (userId newId comment) // add method calls the main parameters commentDAO layer. In the upper Controller

Layer, to achieve add a comment, use the post, first passing comment newsId userID, parameters, determine whether the user has logged in, if not logged in, redirect to the jump page,

If the user is logged in, then add the comment.

Guess you like

Origin www.cnblogs.com/bowenqianngzhibushiwo/p/11600940.html