评论中心与站内信
评论中心:
设计数据库字段:id、user_id、content、entity_id、entity_type、created_date、status;
设计DAO层:插入评论addComment,删除评论updateStatus,根据entity实体查找评论selectByEntity,查询评论总数getCommentCount
设计Service层:包装DAO层,对插入的评论内容进行html过滤,敏感词过滤。
设计Controller层:添加评论,过滤html标签,敏感词,对发起评论的用户进行辨别,如果hostholder里面没有user(非登陆用户),设置匿名用户,调用service层addComment,更新评论数量。
消息中心:
设计数据库字段:id、from_id、to_id、content、createdDate、hasRead、conversationId;
设计DAO层:插入消息addMessage,根据conversationId获取详细消息getConversationDetail,获取用户userId消息中心列表getConversationList,更新conversation的has_read字段。
设计Service层:包装DAO层,对插入的消息进行html过滤,敏感词过滤。
设计Controller层:添加消息addMessage,获取用户userId消息中心列表getConversationList,根据conversationId获取详细消息getConversationDetail
原文:https://www.cnblogs.com/laphome/p/10604610.html