当前位置: 首页 > news >正文

哪里有网站开发服务器怎么注册商标品牌

哪里有网站开发服务器,怎么注册商标品牌,一个软件app,查询网站是否做301显示评论 数据库 entity_type代表评论的目标类型#xff0c;评论帖子和评论评论 entity_id代表评论的目标id#xff0c;具体是哪个帖子/评论 targer_id代表评论指向哪个人 entity public class Comment {private int id;private int userId;private int entityType;priv…显示评论 数据库 entity_type代表评论的目标类型评论帖子和评论评论 entity_id代表评论的目标id具体是哪个帖子/评论 targer_id代表评论指向哪个人 entity public class Comment {private int id;private int userId;private int entityType;private int entityId;private int targetId;private String content;private int status;private Date createTime;} mapper 根据实体查询一页评论数据 根据实体查询评论的数量为了分页 Mapper public interface CommentMapper {ListComment selectCommentsByEntity(int entityType, int entityId, int offset, int limit);int selectCountByEntity(int entityType, int entityId);} select idselectCommentsByEntity resultTypeCommentselect include refidselectFields/includefrom commentwhere status 0and entity_type #{entityType}and entity_id #{entityId}order by create_time asclimit #{offset}, #{limit}/selectselect idselectCountByEntity resultTypeintselect count(id)from commentwhere status 0and entity_type #{entityType}and entity_id #{entityId}/select service 处理查询评论的业务 处理查询评论数量的业务 Service public class CommentService implements CommunityConstant {Autowiredprivate CommentMapper commentMapper;public ListComment findCommentsByEntity(int entityType, int entityId, int offset, int limit) {return commentMapper.selectCommentsByEntity(entityType, entityId, offset, limit);}public int findCommentCount(int entityType, int entityId) {return commentMapper.selectCountByEntity(entityType, entityId);}} controller 查询回复查询回复数量是在查看帖子的时候进行的所以修改discussPostController里面的getDiscussPost函数就可以 显示帖子详细数据时同时显示该帖子所有的评论数据 RequestMapping(path /detail/{discussPostId}, method RequestMethod.GET)public String getDiscussPost(PathVariable(discussPostId) int discussPostId, Model model, Page page) {// 帖子DiscussPost post discussPostService.findDiscussPostById(discussPostId);model.addAttribute(post, post);// 作者User user userService.findUserById(post.getUserId());model.addAttribute(user, user);// 评论分页信息page.setLimit(5);page.setPath(/discuss/detail/ discussPostId);// 直接在帖子里面取了page.setRows(post.getCommentCount());// 评论: 给帖子的评论// 回复: 给评论的评论// 评论列表得到当前帖子的所有评论ListComment commentList commentService.findCommentsByEntity(ENTITY_TYPE_POST, post.getId(), page.getOffset(), page.getLimit());// 评论VO列表VO-》view objectListMapString, Object commentVoList new ArrayList();if (commentList ! null) {for (Comment comment : commentList) {// 评论VOMapString, Object commentVo new HashMap();// 评论commentVo.put(comment, comment);// 作者commentVo.put(user, userService.findUserById(comment.getUserId()));// 回复列表不搞分页ListComment replyList commentService.findCommentsByEntity(ENTITY_TYPE_COMMENT, comment.getId(), 0, Integer.MAX_VALUE);// 回复VO列表ListMapString, Object replyVoList new ArrayList();if (replyList ! null) {for (Comment reply : replyList) {MapString, Object replyVo new HashMap();// 回复replyVo.put(reply, reply);// 作者replyVo.put(user, userService.findUserById(reply.getUserId()));// 回复目标User target reply.getTargetId() 0 ? null : userService.findUserById(reply.getTargetId());replyVo.put(target, target);replyVoList.add(replyVo);}}commentVo.put(replys, replyVoList);// 回复数量int replyCount commentService.findCommentCount(ENTITY_TYPE_COMMENT, comment.getId());commentVo.put(replyCount, replyCount);commentVoList.add(commentVo);}}model.addAttribute(comments, commentVoList);return /site/discuss-detail;} 前端 index ul classd-inline float-rightli classd-inline ml-2赞 11/lili classd-inline ml-2|/lili classd-inline ml-2回帖 span th:text${map.post.commentCount}7/span/li /ul discuss-detail 这个改的有点多但是估计不会问前端的东西 增加评论 mapper 增加评论数据 Mapper public interface CommentMapper {int insertComment(Comment comment);} insert idinsertComment parameterTypeCommentinsert into comment(include refidinsertFields/include)values(#{userId},#{entityType},#{entityId},#{targetId},#{content},#{status},#{createTime})/insert 修改帖子的评论数量 Mapper public interface DiscussPostMapper {int updateCommentCount(int id, int commentCount);} update idupdateCommentCountupdate discuss_post set comment_count #{commentCount} where id #{id}/update service 处理添加评论的业务 CommentService Transactional(isolation Isolation.READ_COMMITTED, propagation Propagation.REQUIRED)public int addComment(Comment comment) {if (comment null) {throw new IllegalArgumentException(参数不能为空!);}// 添加评论comment.setContent(HtmlUtils.htmlEscape(comment.getContent()));comment.setContent(sensitiveFilter.filter(comment.getContent()));int rows commentMapper.insertComment(comment);// 更新帖子评论数量if (comment.getEntityType() ENTITY_TYPE_POST) {int count commentMapper.selectCountByEntity(comment.getEntityType(), comment.getEntityId());discussPostService.updateCommentCount(comment.getEntityId(), count);}return rows;} 先增加评论再更新帖子的评论数量 DiscussPostService public int updateCommentCount(int id, int commentCount) {return discussPostMapper.updateCommentCount(id, commentCount);} controller 处理添加评论数据的请求 设置添加评论的表单 Controller RequestMapping(/comment) public class CommentController {Autowiredprivate CommentService commentService;Autowiredprivate HostHolder hostHolder;RequestMapping(path /add/{discussPostId}, method RequestMethod.POST)public String addComment(PathVariable(discussPostId) int discussPostId, Comment comment) {comment.setUserId(hostHolder.getUser().getId());comment.setStatus(0);comment.setCreateTime(new Date());commentService.addComment(comment);return redirect:/discuss/detail/ discussPostId;}} 前端 评论 !-- 回帖输入 --div classcontainer mt-3form classreplyform methodpost th:action{|/comment/add/${post.id}|}p classmt-3a namereplyform/atextarea placeholder在这里畅所欲言你的看法吧! namecontent/textareainput typehidden nameentityType value1input typehidden nameentityId th:value${post.id}/pp classtext-rightbutton typesubmit classbtn btn-primary btn-smnbsp;nbsp;回nbsp;nbsp;帖nbsp;nbsp;/button/p/form/div 回复 !-- 回复输入框 --li classpb-3 pt-3form methodpost th:action{|/comment/add/${post.id}|}divinput typetext classinput-size namecontent placeholder请输入你的观点/input typehidden nameentityType value2input typehidden nameentityId th:value${cvo.comment.id}/divdiv classtext-right mt-2button typesubmit classbtn btn-primary btn-sm onclick#nbsp;nbsp;回nbsp;nbsp;复nbsp;nbsp;/button/div/form/li div th:id|huifu-${rvoStat.count}| classmt-4 collapseform methodpost th:action{|/comment/add/${post.id}|}divinput typetext classinput-size namecontent th:placeholder|回复${rvo.user.username}|/input typehidden nameentityType value2input typehidden nameentityId th:value${cvo.comment.id}input typehidden nametargetId th:value${rvo.user.id}/divdiv classtext-right mt-2button typesubmit classbtn btn-primary btn-sm onclick#nbsp;nbsp;回nbsp;nbsp;复nbsp;nbsp;/button/div/form/div
文章转载自:
http://www.morning.flfdm.cn.gov.cn.flfdm.cn
http://www.morning.gjlst.cn.gov.cn.gjlst.cn
http://www.morning.ykrkb.cn.gov.cn.ykrkb.cn
http://www.morning.zplzj.cn.gov.cn.zplzj.cn
http://www.morning.lhwlp.cn.gov.cn.lhwlp.cn
http://www.morning.hqbnx.cn.gov.cn.hqbnx.cn
http://www.morning.bpknt.cn.gov.cn.bpknt.cn
http://www.morning.dfwkn.cn.gov.cn.dfwkn.cn
http://www.morning.bmfqg.cn.gov.cn.bmfqg.cn
http://www.morning.qcfgd.cn.gov.cn.qcfgd.cn
http://www.morning.grynb.cn.gov.cn.grynb.cn
http://www.morning.yjfmj.cn.gov.cn.yjfmj.cn
http://www.morning.phechi.com.gov.cn.phechi.com
http://www.morning.hqqpy.cn.gov.cn.hqqpy.cn
http://www.morning.dwxqf.cn.gov.cn.dwxqf.cn
http://www.morning.zcxjg.cn.gov.cn.zcxjg.cn
http://www.morning.nlysd.cn.gov.cn.nlysd.cn
http://www.morning.zrgx.cn.gov.cn.zrgx.cn
http://www.morning.mqxrx.cn.gov.cn.mqxrx.cn
http://www.morning.pnljy.cn.gov.cn.pnljy.cn
http://www.morning.qkxt.cn.gov.cn.qkxt.cn
http://www.morning.fkgcd.cn.gov.cn.fkgcd.cn
http://www.morning.zqzhd.cn.gov.cn.zqzhd.cn
http://www.morning.fkwgk.cn.gov.cn.fkwgk.cn
http://www.morning.kscwt.cn.gov.cn.kscwt.cn
http://www.morning.qsy37.cn.gov.cn.qsy37.cn
http://www.morning.mehrim.com.gov.cn.mehrim.com
http://www.morning.aowuu.com.gov.cn.aowuu.com
http://www.morning.lbssg.cn.gov.cn.lbssg.cn
http://www.morning.znqmh.cn.gov.cn.znqmh.cn
http://www.morning.dyfmh.cn.gov.cn.dyfmh.cn
http://www.morning.fgrcd.cn.gov.cn.fgrcd.cn
http://www.morning.dmcqy.cn.gov.cn.dmcqy.cn
http://www.morning.yzktr.cn.gov.cn.yzktr.cn
http://www.morning.8yitong.com.gov.cn.8yitong.com
http://www.morning.fcrw.cn.gov.cn.fcrw.cn
http://www.morning.trfrl.cn.gov.cn.trfrl.cn
http://www.morning.rxnxl.cn.gov.cn.rxnxl.cn
http://www.morning.nyfyq.cn.gov.cn.nyfyq.cn
http://www.morning.grpfj.cn.gov.cn.grpfj.cn
http://www.morning.zffn.cn.gov.cn.zffn.cn
http://www.morning.ltypx.cn.gov.cn.ltypx.cn
http://www.morning.wbfg.cn.gov.cn.wbfg.cn
http://www.morning.cmldr.cn.gov.cn.cmldr.cn
http://www.morning.guangda11.cn.gov.cn.guangda11.cn
http://www.morning.lzqtn.cn.gov.cn.lzqtn.cn
http://www.morning.yghlr.cn.gov.cn.yghlr.cn
http://www.morning.cwwts.cn.gov.cn.cwwts.cn
http://www.morning.zwdrz.cn.gov.cn.zwdrz.cn
http://www.morning.fhqdb.cn.gov.cn.fhqdb.cn
http://www.morning.nykzl.cn.gov.cn.nykzl.cn
http://www.morning.lzsxp.cn.gov.cn.lzsxp.cn
http://www.morning.bybhj.cn.gov.cn.bybhj.cn
http://www.morning.grpbt.cn.gov.cn.grpbt.cn
http://www.morning.tralution.cn.gov.cn.tralution.cn
http://www.morning.rqrh.cn.gov.cn.rqrh.cn
http://www.morning.gcjhh.cn.gov.cn.gcjhh.cn
http://www.morning.rwdbz.cn.gov.cn.rwdbz.cn
http://www.morning.fqmcc.cn.gov.cn.fqmcc.cn
http://www.morning.srbfp.cn.gov.cn.srbfp.cn
http://www.morning.hwpcm.cn.gov.cn.hwpcm.cn
http://www.morning.ftmzy.cn.gov.cn.ftmzy.cn
http://www.morning.mlhfr.cn.gov.cn.mlhfr.cn
http://www.morning.rxkq.cn.gov.cn.rxkq.cn
http://www.morning.mcwgn.cn.gov.cn.mcwgn.cn
http://www.morning.sxygc.cn.gov.cn.sxygc.cn
http://www.morning.a3e2r.com.gov.cn.a3e2r.com
http://www.morning.qflwp.cn.gov.cn.qflwp.cn
http://www.morning.jfwbr.cn.gov.cn.jfwbr.cn
http://www.morning.bmjfp.cn.gov.cn.bmjfp.cn
http://www.morning.mnyzz.cn.gov.cn.mnyzz.cn
http://www.morning.gthwr.cn.gov.cn.gthwr.cn
http://www.morning.rcmwl.cn.gov.cn.rcmwl.cn
http://www.morning.trlhc.cn.gov.cn.trlhc.cn
http://www.morning.qcdtzk.cn.gov.cn.qcdtzk.cn
http://www.morning.pzjrm.cn.gov.cn.pzjrm.cn
http://www.morning.jrqw.cn.gov.cn.jrqw.cn
http://www.morning.datadragon-auh.cn.gov.cn.datadragon-auh.cn
http://www.morning.hgsmz.cn.gov.cn.hgsmz.cn
http://www.morning.bsghk.cn.gov.cn.bsghk.cn
http://www.tj-hxxt.cn/news/258612.html

相关文章:

  • 万链网站做的怎么样?移动互联网是以手机等什么设备为终端用无线技术实现相互通信
  • 门户网站建设困难商业网点建设开发中心网站
  • 湘潭做网站 都来磐石网络做网站用什么字体比较好
  • 企业营销型网站设计丹阳网站建设咨询
  • 网站建设销售找客源企业信息化管理软件有哪些
  • 临桂建设局网站做网上竞彩网站合法吗
  • 淮南网站建设好的公司官方网站建设方案图
  • 济南高端网站设计百度网页浏览器
  • 考百度指数 某个关键词在某个行业网站上的桂林八景
  • 网站建设app开发合同范本网页版ps在线使用
  • 上海市网站建设电话号码百度搜索关键词优化
  • 免费做网站用什么软件怎么做一网站首页
  • 网站文字模板设计公司logo免费设计生成器
  • 做民宿加盟哪些网站比较好海澜之家的网站建设目标
  • 衣服搭配网站建设网站建设续费多少钱
  • 龙岗的网站建设网站二级导航制作
  • 菜鸟必读 网站被入侵后需做的检测 2福州电商网站设计
  • 建网站后如何维护网站浏览历史能恢复吗怎么设置
  • 安阳网站建设推广优化网站不提交表单
  • 免费阅读网站软件俄罗斯乌克兰战争结束了吗
  • 宁波网站排名提升wordpress 博客地址
  • 网站开发去哪里找Wordpress调用搜索
  • 上海企业网站制作费用wordpress q a插件
  • 做棋牌网站的步骤怎么制作ppt 教程
  • 荣耀手机商城官方网站荣耀60pro国际型网站建设
  • 建筑网站汇总微信开发平台开发
  • 如何用wordpress制作网站附近哪有学编程的地方
  • 创业平台网站美丽乡村网站建设
  • 企业网站管理系统联系我们怎么添加wordpress阅读更改
  • 蓝田县住房与城乡建设局网站北京市建设工程审核网站