0
点赞
收藏
分享

微信扫一扫

基于javaweb+SpringBoot+MyBatis个人博客管理系统

探头的新芽 2022-04-14 阅读 85
javamysql

基于javaweb+SpringBoot+MyBatis个人博客管理系统

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

     *                of this $coll followed by all elements of `that`.
     * 
     *  @usecase def ++:[B](that: TraversableOnce[B]): $Coll[B]
     *  
     *  @return       a new $coll which contains all elements of this $coll
     *                followed by all elements of `that`.
     */
    def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
      val b = bf(repr)
      if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.size)
      b ++= that
      b ++= thisCollection
      b.result
    }

    /** This overload exists because: for the implementation of ++: we should reuse
     *  that of ++ because many collections override it with more efficient versions.
     *  Since TraversableOnce has no '++' method, we have to implement that directly,
     *  but Traversable and down can use the overload.
     */
    def ++:[B >: A, That](that: Traversable[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
      (that ++ seq)(breakOut)

    def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
            {
                text = "<hr style=\"page-break-after:always;\" class=\"page-break editormd-page-break\" />";
            }
            
            return text;
        };

        markedRenderer.paragraph = function(text) {
            var isTeXInline     = /\$\$(.*)\$\$/g.test(text);
            var isTeXLine       = /^\$\$(.*)\$\$$/.test(text);
            var isTeXAddClass   = (isTeXLine)     ? " class=\"" + editormd.classNames.tex + "\"" : "";
            var isToC           = (settings.tocm) ? /^(\[TOC\]|\[TOCM\])$/.test(text) : /^\[TOC\]$/.test(text);
            var isToCMenu       = /^\[TOCM\]$/.test(text);
            
            if (!isTeXLine && isTeXInline) 
            {
                text = text.replace(/(\$\$([^\$]*)\$\$)+/g, function($1, $2) {
                    return "<span class=\"" + editormd.classNames.tex + "\">" + $2.replace(/\$/g, "") + "</span>";
}

package com.demo.controller.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.ModelAndView;

         */
        
        setToolbarAutoFixed : function(fixed) {
            
            var state    = this.state;
            var editor   = this.editor;
            var toolbar  = this.toolbar;
            var settings = this.settings;
            
            if (typeof fixed !== "undefined")
            {
                settings.toolbarAutoFixed = fixed;
            }
            
            var autoFixedHandle = function(){
                var $window = $(window);
                var top     = $window.scrollTop();
                
                if (!settings.toolbarAutoFixed)
                {
                    return false;
                }

                if (top - editor.offset().top > 10 && top < editor.height())
                {
                    toolbar.css({
                        position : "fixed",
                        width    : editor.width() + "px",
        var expression = filters.split("|");
        var filterTags = expression[0].split(",");
        var attrs      = expression[1];

        for (var i = 0, len = filterTags.length; i < len; i++)
        {
            var tag = filterTags[i];

            html = html.replace(new RegExp("\<\s*" + tag + "\s*([^\>]*)\>([^\>]*)\<\s*\/" + tag + "\s*\>", "igm"), "");
        }

        if (typeof attrs !== "undefined")
        {
            var htmlTagRegex = /\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/ig;

            if (attrs === "*")
            {
                html = html.replace(htmlTagRegex, function($1, $2, $3, $4, $5) {
                    return "<" + $2 + ">" + $4 + "</" + $5 + ">";
                });         
            }
            else if (attrs === "on*")
            {
                html = html.replace(htmlTagRegex, function($1, $2, $3, $4, $5) {

            var moveAction = function (e) {
                e = e || window.event;  //IE

                var left, top, nowLeft = parseInt(dialog[0].style.left), nowTop = parseInt(dialog[0].style.top);

                if( nowLeft >= 0 ) {
                    if( nowLeft + dialog.width() <= $(window).width()) {
                        left = e.clientX - posX;
                    } else {	
                        left = $(window).width() - dialog.width();
                        document.onmousemove = null;
                    }
                } else {
                    left = 0;
                    document.onmousemove = null;
                }

                if( nowTop >= 0 ) {
                    top = e.clientY - posY;
                } else {
                    top = 0;
                    document.onmousemove = null;
                }


                document.onselectstart = function() {
        "F10"              : "preview",
        "F11"              : "fullscreen",
    };
    
    /**
     * 清除字符串两边的空格
     * Clear the space of strings both sides.
     * 
     * @param   {String}    str            string
     * @returns {String}                   trimed string    
     */
    
    var trim = function(str) {
        return (!String.prototype.trim) ? str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "") : str.trim();
    };
    
    editormd.trim = trim;
    
    /**
     * 所有单词首字母大写
     * Words first to uppercase
     * 
     * @param   {String}    str            string
     * @returns {String}                   string
     */
    
    var ucwords = function (str) {
        return str.toLowerCase().replace(/\b(\w)|\s(\w)/g, function($1) {  
            return $1.toUpperCase();
                <a href="animations.html">


                    Animations

                </a>



        </li>

        <li class="chapter " data-level="1.4.2" data-path="layout.html">

                <a href="layout.html">

            }

            return this;
        },
        
        /**
         * 配置和初始化工具栏
         * Set toolbar and Initialization
         * 
         * @returns {editormd}  返回editormd的实例对象
         */
        
        setToolbar : function() {
            var settings    = this.settings;  
            
            if(settings.readOnly) {
                return this;
            }
            
            var editor      = this.editor;
            var preview     = this.preview;
            var classPrefix = this.classPrefix;
            
            var toolbar     = this.toolbar = editor.children("." + classPrefix + "toolbar");
            
            if (settings.toolbar &amp;&amp; toolbar.length &lt; 1)
            {            
                var toolbarHTML = "&lt;div class=\"" + classPrefix + "toolbar\">&lt;div class=\"" + classPrefix + "toolbar-container\">&lt;ul class=\"" + classPrefix + "menu\">&lt;/ul>&lt;/div>&lt;/div>";




        <li class="chapter " data-level="1.1" data-path="../">

                <a href="../">


                    Chart.js

                </a>



        </li>

        <li class="chapter " data-level="1.2" data-path="../getting-started/">

                <a href="../getting-started/">


                    Getting Started

                </a>
                    }
                    
                    $.proxy(settings.onpreviewscroll, _this)(event);
                });

            };

            var previewUnbindScroll = function() {
                preview.unbind(mouseOrTouch("scroll", "touchmove"));
            }; 

			codeMirror.bind({
				mouseover  : cmBindScroll,
				mouseout   : cmUnbindScroll,
				touchstart : cmBindScroll,
                </a>



        </li>

        <li class="chapter " data-level="1.4.5" data-path="../configuration/tooltip.html">

                <a href="../configuration/tooltip.html">


                    Tooltip

                </a>



        </li>

        <li class="chapter " data-level="1.4.6" data-path="../configuration/elements.html">

                <a href="../configuration/elements.html">
        </li>




    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>


    </div>

    <div class="book-body">

            <div class="body-inner">



            ].join("\n");
            
            editor.append(appendElements).addClass(classPrefix + "vertical");
            
            this.mask          = editor.children("." + classPrefix + "mask");    
            this.containerMask = editor.children("." + classPrefix  + "container-mask");
            
            if (settings.markdown !== "")
            {
                markdownTextarea.val(settings.markdown);
            }
            
            if (settings.appendMarkdown !== "")
            {
                markdownTextarea.val(markdownTextarea.val() + settings.appendMarkdown);
            }
            
            this.htmlTextarea     = editor.children("." + classNames.textarea.html);            
            this.preview          = editor.children("." + classPrefix + "preview");
            this.previewContainer = this.preview.children("." + classPrefix + "preview-container");
                    return ;
                }
                
                _this.activeIcon = icon;

                if (typeof toolbarIconHandlers[name] !== "undefined") 
                {
                    $.proxy(toolbarIconHandlers[name], _this)(cm);
                }
                else 
                {
                    if (typeof settings.toolbarHandlers[name] !== "undefined") 
                    {
                        $.proxy(settings.toolbarHandlers[name], _this)(cm, icon, cursor, selection);
                    }
                }
                
                if (name !== "link" &amp;&amp; name !== "reference-link" &amp;&amp; name !== "image" &amp;&amp; name !== "code-block" &amp;&amp; 
                    name !== "preformatted-text" &amp;&amp; name !== "watch" &amp;&amp; name !== "preview" &amp;&amp; name !== "search" &amp;&amp; name !== "fullscreen" &amp;&amp; name !== "info") 
                {
                    cm.focus();
                }

                return false;

            });

                    }
                }
            };

            if (!editor.hasClass(fullscreenClass)) 
            {
                state.fullscreen = true;

                $("html,body").css("overflow", "hidden");
                
                editor.css({
                    position : "fixed", 
                    top      : 0, 
                    left     : 0, 
                    margin   : 0, 
                    border   : "none",
                position   : "absolute",
                width      : editor.width() / 2,
                height     : (settings.autoHeight &amp;&amp; !this.state.fullscreen) ? "auto" : editor.height() - toolbar.height(),
                top        : (settings.toolbar)    ? toolbar.height() : 0
            });

            if (this.state.loaded)
            {
                $.proxy(settings.onpreviewed, this)();
            }
            
            return this;
        },
        
        /**
         * 编辑器全屏显示
         * Fullscreen show
         * 
         * @returns {editormd}         返回editormd的实例对象
         */
        
        fullscreen : function() {
            
            var _this            = this;
            var state            = this.state;
            var editor           = this.editor;
            var preview          = this.preview;
            var toolbar          = this.toolbar;
            var settings         = this.settings;
     * @param blogId      博客id
     * @param commentPage 评论页
     * @return java.lang.String
     */
    @GetMapping({"/blog/{blogId}", "/article/{blogId}"})
    public String detail(HttpServletRequest request, @PathVariable("blogId") Long blogId, @RequestParam(value = "commentPage", required = false, defaultValue = "1") Integer commentPage) {
        BlogDetailVO blogDetailVO = blogService.getBlogDetail(blogId);
        if (blogDetailVO != null) {
            request.setAttribute("blogDetailVO", blogDetailVO);
            request.setAttribute("commentPageResult", commentService.getCommentPageByBlogIdAndPageNum(blogId, commentPage));
        }
        request.setAttribute("pageName", "详情");
        request.setAttribute("configurations", configService.getAllConfigs());
        return "blog/" + theme + "/detail";
    }

    /**
     * 标签列表页
     *
     * @param request http请求
     * @param tagName 标签名称
         * @returns {editormd}              返回editormd的实例对象
         */
        
        height : function(height) {
                
            this.editor.css("height", (typeof height === "number")  ? height  + "px" : height);            
            this.resize();
            
            return this;
        },
        
        /**
         * 调整编辑器的尺寸和布局
         * Resize editor layout
         * 
         * @param   {Number|String} [width=null]  编辑器宽度值
         * @param   {Number|String} [height=null] 编辑器高度值
         * @returns {editormd}                    返回editormd的实例对象
         */
        
        resize : function(width, height) {
            
            width  = width  || null;
            height = height || null;
            
     *  @return  a $coll consisting of all elements of this $coll
     *           except the first one.
     *  @throws `UnsupportedOperationException` if the $coll is empty.
     */ 
    override def tail: Repr = {
      if (isEmpty) throw new UnsupportedOperationException("empty.tail")
      drop(1)
    }

    /** Selects the last element.
      * $orderDependent
      * @return The last element of this $coll.
      * @throws NoSuchElementException If the $coll is empty.
      */
    def last: A = {
      var lst = head
      for (x <- this)
        lst = x
      lst
    }

    /** Optionally selects the last element.
     *  $orderDependent
     *  @return  the last element of this $coll$ if it is nonempty, `None` if it is empty.
     */
    def lastOption: Option[A] = if (isEmpty) None else Some(last)


运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

技术框架

Springboot SpringMVC MyBatis ThymeLeaf HTML JavaScript JQuery Ajax maven

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

文章的发表,分类,评论,收搜索,后台管理的的文章新 增,分类新增,评论审核,标签管理,评论管理,分类管 理,博客管理,系统管理等等功能

20220322125738

20220322125739

20220322125754

20220322125808

20220322130038

20220322130329

20220322130336

20220322130350

20220322130414

20220322130425

20220322130433

20220322130456

20220322131257


举报

相关推荐

0 条评论