Springboot + Vue 个人博客 后端交互样例

SpringBoot+vue练手项目---博客系统 SpringBoot+vue练手项目之博客系统,适合新手拿来练项目 阅读详情

Springboot + Vue 个人博客 后端交互样例

后端的样例 使用了ResultUtil来进一步封装返回数据
重点在于Comment 和 Reply查询返回的过程 实现楼中楼 评论的效果

目录

Springboot + Vue 个人博客 主目录
Springboot + Vue 个人博客 前端配置
Springboot + Vue 个人博客 后端配置
Springboot + Vue 个人博客 前端交换样例
Springboot + Vue 个人博客 后端交换样例

代码

Github 后端代码
Github 前端代码


1. Result数据的封装

//用于返回互联网数据
public class Result<T> {
    //状态码
    private Integer code;
    //消息
    private String message;
    //具体数据
    private T data;
    
    //省略 constructer getter setter toString
}
public enum ResultEnum {

    SUCCESS(200,"成功"),
    ERROR(404,"出错");

    //状态码
    private Integer code;
    //消息
    private String message;

    //省略 constructer getter setter toString
}    
//用于返回具体result对象
public class ResultUtil{

    //返回成功状态码和消息以及数据
    public static Result success(Object data){
        return new Result(ResultEnum.SUCCESS.getCode(),ResultEnum.SUCCESS.getMessage(),data);
    }

    //返回错误状态码和消息以及数据
    public static Result error(Object data){
        return new Result(ResultEnum.ERROR.getCode(),ResultEnum.ERROR.getMessage(),data);
    }
}



2. Comment(Servcie Controller Mapper)


2.1 com.example.demo.domain.Comment
public class Comment implements Serializable {
    private Integer id;         //评论id
    private Integer articleId;  //文章id
    private Integer userId;     //用户id
    private String content;     //文章内容
    private String time;        //时间
    private List<Reply> replyList; //回复列表
}

2.2 com.example.demo.mapper.CommentMapper
@Mapper
@Repository
public interface CommentMapper {
    //  增
    void addComment(Comment comment);
    //  删
    void delComment(Integer id);
    //  查
    Comment findeCommentById(Integer id);
    // 查询评论
    List<Comment> findCommentByArticleId(Integer articleId);
    //  改
    void saveComment(Comment comment);
}

2.3 com.example.demo.service.CommentService
public interface CommentService {
    //  增
    void addComment(Comment comment);
    //  删
    void delComment(Integer id);
    //  查
    Comment findeCommentById(Integer id);
    // 查询评论
    List<Comment> findCommentByArticleId(Integer pageNum,Integer pageSize,Integer articleId);
    //  改
    void saveComment(Comment comment);
}

2.4 com.example.demo.service.impl.CommentServiceImpl
@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentMapper commentMapper;

    @Autowired
    private ReplyService replyService;

    // 增
    @Override
    public void addComment(Comment comment) {
        commentMapper.addComment(comment);
    }

    // 删
    @Override
    public void delComment(Integer id) {
        commentMapper.delComment(id);
    }

    // 查
    @Override
    public Comment findeCommentById(Integer id) {
        Comment comment=commentMapper.findeCommentById(id);
        List<Reply> replyList=replyService.findAllReplyByCommentId(comment.getId());
        if(replyList!=null){
            comment.setReplyList(replyList);
        }
        return  comment;
    }

    // 查询评论
    @Override
    public List<Comment> findCommentByArticleId(Integer pageNum,Integer pageSize, Integer articleId) {
        PageHelper.startPage(pageNum,pageSize);
        List <Comment> commentList=commentMapper.findCommentByArticleId(articleId);
        List <Comment> updateList=new ArrayList<Comment>();
        //封装reply对象
        for(int i=0;i<commentList.size();i++){
            Comment comment=commentList.get(i);
            //调用replyService查询部分回复
            List<Reply> replyList=replyService.findPartReplyByCommentId(comment.getId());
            if(replyList!=null){
                comment.setReplyList(replyList);
            }
            updateList.add(comment);
        }
        //返回新的List
        return updateList;
    }

    // 改
    @Override
    public void saveComment(Comment comment) {
        commentMapper.saveComment(comment);
    }
}


2.5 com.example.demo.controller.CommentController
@RestController
@RequestMapping(path="/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;

    //添加评论
    @PostMapping("/add")
    public Result addComment(@RequestBody  Comment comment){
        System.out.println(comment);
        //commentService.addComment(comment);
        return ResultUtil.success(null);
    }

    //id查询评论
    @GetMapping("/find/{id}")
    public Result findCommentById(@PathVariable("id") Integer id){
        Comment comment=commentService.findeCommentById(id);
        return ResultUtil.success(comment);
    }

    //查询评论
    @GetMapping("/{articleId}/{pageNum}/{pageSize}")
    public Result findComment(@PathVariable("articleId") Integer articleId,
                                     @PathVariable("pageNum") Integer pageNum,
                                     @PathVariable("pageSize") Integer pageSize){
        List<Comment> commentList=commentService.findCommentByArticleId(pageNum,pageSize,articleId);


        return ResultUtil.success(commentList);
    }

    //使用 qs 添加评论
    @PostMapping("/add2")
    public Result addComment(@RequestParam("articleId") Integer articleId,
                             @RequestParam("userId") Integer userId,
                             @RequestParam("time") String time,
                             @RequestParam("content") String content){
        System.out.println(articleId+" "+userId+" "+time+" "+content);
        //commentService.addComment(comment);
        return ResultUtil.success(null);
    }
}

2.6 rescources.mapper.CommentMapper.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.example.demo.mapper.CommentMapper">
    <resultMap id="commentMap" type="com.example.demo.domain.Comment">
        <id property="id" column="id"></id>
        <result property="articleId" column="article_id"></result>
        <result property="userId" column="user_id"></result>
        <result property="articleId" column="article_id"></result>
        <result property="time" column="time"></result>
    </resultMap>


<!--    //  增-->
<!--    void addComment(Comment comment); insert into comment(xxx,xxx) values(xxx,xxx)-->
    <insert id="addComment" parameterType="com.example.demo.domain.Comment">
        insert into comment
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="articleId!=null">
                article_id,
            </if>
            <if test="userId!=null">
                user_id,
            </if>
            <if test="content!=null">
                content,
            </if>
            <if test="time!=null">
                time,
            </if>
        </trim>
        <trim prefix="values(" suffix=")" suffixOverrides=",">
            <if test="articleId!=null">
                #{articleId},
            </if>
            <if test="userId!=null">
                #{userId},
            </if>
            <if test="content!=null">
                #{content},
            </if>
            <if test="time!=null">
                #{time},
            </if>
        </trim>
    </insert>

<!--    //  删-->
<!--    void delComment(Integer id);-->
    <delete id="delComment" parameterType="java.lang.Integer">
        delete from comment where id = #{id}
    </delete>

<!--    //  查-->
<!--    Comment findeCommentById(Integer id);-->
    <select id="findeCommentById" parameterType="java.lang.Integer" resultType="com.example.demo.domain.Comment">
        select * from comment where id = #{id}
    </select>

<!--    // 查询评论 List<Comment> findCommentByArticleId(Integer ArticleId);-->
    <select id="findCommentByArticleId" parameterType="java.lang.Integer" resultType="com.example.demo.domain.Comment">
        select * from comment where article_id = #{articleId}
    </select>

<!--    //  改-->
<!--    void saveComment(Comment comment); update comment set xx=xx,xx=xx where id = xx-->
    <update id="saveComment" parameterType="com.example.demo.domain.Comment">
        update comment
        <trim prefix="set" suffixOverrides=",">
            <if test="articleId!=null">
                article_id = #{articleId},
            </if>
            <if test="userId!=null">
                user_id = #{userId},
            </if>
            <if test="content!=null">
                content = #{content},
            </if>
            <if test="time!=null">
                time = #{time},
            </if>
        </trim>
        where id = #{id}
    </update>
</mapper>
SpringBoot+Vue前后端分离项目实战:个人博客系统 MyBlog主要是基于 SpringBoot + Vue 前后端分离开发的一款动态个人博客系统,后台和前台均通过JSON数据做交互,主要功能有文章管理、分类管理、标签管理、附件管理、评论管理、友链管理、个人资料/博客信息管理等。 阅读详情

相关推荐

Springboot+Vue快速搭建个人博客系统

文章目录前言一、SpringBoot实现后端二、Vue.js实现前端1.Header和Footer实现:2.Vue其他配置总结 前言 本篇博客讲解如何使用SpringBoot和Vue如何快速搭建自己个人博客系统,功能比较少,但是作为一个期末小作业应该够了。本篇博客默认你已经有了SpringBoot和Vue的基础啦!后端还是用了MyBatis-Plus 完成数据库增删改查,我会分别从前后端介绍如何实现。同时呢,代码也会上传到GitHub上。 内容 地址 GitHub 链接 项目演示地址

__不想写代码__的博客 5093

基于springboot+vue的博客项目(适合练手)

blog 介绍 基于spring boot+vue的博客项目,项目分为博客前台和博客后台两部分,因为本人对前端不怎么熟练,前台界面比较简洁甚至丑陋,后台功能比较完善,非常适合学习完spring boot和vue,又想自己动手做一个前后端分离项目的同学用来练手。本来是想部署到服务器上面的,但是后台打包完成后在命令行中运行之后用postman测试登录接口报错,在idea中运行之后却能正常登录,一直找不到解决办法,再加上本人快期末考试了,实在没有精力解决这个问题,附上报错图片,希望有知道的小伙伴指点迷津。项目地址

qq_53521351的博客 4131

基于Spring Boot + Vue 前后端分离个人博客网站设计

个人博客网站摘要一、绪论1.1 课题背景、目的、意义1.2 国内外研究现状1.3 技术介绍1.3.1 Spring Boot1.3.2 MyBatisPlus1.3.3 Shiro1.3.4 Redis1.3.5 Jwt1.3.6 Vue1.3.7 Element-ui1.3.8 Axios1.3.9 前后端分离二、可行性分析2.1 技术可行性分析2.2 时间和资源可行性三、需求分析3.1 用户分析3.2 功能需求分析3.3 流程分析四、结构设计4.1 实体e-r图4.2 数据库设计五、详细设计六、系统测试

Lv Zejiang 1万+

spring boot 测试用例

普通环境下的测试用例 运行速度很快因为没有加载额外的代码 package com.ruoyi.app; import com.alibaba.fastjson.JSONObject; import com.easemob.im.server.EMService; import com.easemob.im.server.api.user.UserApi; import com.easemob.im.server.model.EMUser; import com.ruoyi.app.config.E..

卡伦啊 3090

springboot+vue前后端完整demo.zip

springboot+vue前后端完整demo.zip

S32K144(14)ADC

1、简介 开发板S32K144+S32DS+JLINK,裸机版的程序编写 S32K14x包含两个12位ADC模块,ADC0和ADC1 应用程序可能需要ADC的连续采样(4K采样/秒),这可能对CPU有相当大的负载。虽然使用可编程延迟块(PDB)来触发ADC可能会减少一些CPU负载,但当ADC以非常高的速率采样或PDB被绕过时,ADC支持DMA请求功能以获得更高的性能。ADC可以在转换完成时触发DMA(通过DMA请求)。TRGMUX会根据不同的应用需求,使用软件为用户提供更灵活的DMA触发方案,例如,可

朗朗上口就行啦的博客 1万+

springboot+vue博客项目(码神之路博客项目)

这几天在学习b站码神之路的博客项目,记个笔记。 视频地址:https://www.bilibili.com/video/BV1Gb4y1d7zb?spm_id_from=333.337.search-card.all.click 博客界面实现 博客后台权限界面实现 技术栈 springboot+vue+springbootSecurity+jwt+redis+ThreaLocal spring boot 练手实战项目说明 码神之路网站所使用的博客,项目简单,需求明确,容易上手,非常适合.做为练手级

hwp_ing的博客 6146

cadence virtuoso 激励信号源

vpulse,vpwl,vsin,vsource信号源介绍

努力学习的IC小白 3万+

SpringBoot+Vue 博客系统(四):博客后端开发

以上便是从0创建项目、上传项目到码云、整合MybatisPlus生成代码、统一异常处理、封装统一返回结果工具类、以及用户模块的开发和接口测试的整套后台开发流程。

YangCunle的博客 755

APS生产排程系统——ERP、MES、APS系统的关联和区别

APS生产排程系统——ERP、MES、APS系统的关联和区别

这里有一只小马吖 2万+

成分数据的闭合效应对地球化学数据的影响及其解决方案

封闭效应 (Closure Effect),也称为常数和效应 (Constant Sum Effect),是地球化学数据分析中一个需要特别注意的统计现象。它的产生是由于我们通常使用成分数据 (Compositional Data)百分比 (%)百万分率 (ppm)由于这些数据表示的是各组分占总体的比例,它们的总和必然是一个常数 (例如 100% 或 1,000,000 ppm)。这意味着每个元素的含量不是独立的,而是与其他元素的含量相互制约。改变其中一个元素的含量必然会影响其他元素的相对比例。

qq_59349063的博客 1553

Springboot + Vue 个人博客 前端交互样例

Springboot + Vue 个人博客 前端交互样例 对于前端的布局 不会详细去展开 毕竟本人前端功底并不是特别扎实 但使用ElementUi也基本上可以加快开发不少了 在这篇文章中 简单过一下Vue Element的基础点 主要是讲解axios和后端的交换样例 Github 后端代码 Github 前端代码 1. 基础 1.1 Vue组件的结构 (xxx.vue) <templat...

Process_ing的博客 684

智能测试策略优化:平衡覆盖率、时间和资源

在软件开发过程中,测试是确保软件质量的关键环节。然而,测试工作往往面临着诸多挑战,其中如何在保证测试覆盖率的前提下,合理分配时间和资源是一个核心问题。本文章的目的在于探讨智能测试策略的优化方法,帮助软件测试团队在有限的时间和资源条件下,实现尽可能高的测试覆盖率。文章的范围涵盖了智能测试策略的核心概念、算法原理、数学模型、实际应用案例以及相关工具和资源等方面。本文将按照以下结构进行组织:首先介绍智能测试策略优化的背景和相关概念,包括核心术语和缩略词的定义;

AIGC应用创新大全的博客 629

手把手教你基于Springboot+Vue搭建个人博客网站

Hello,你好呀,我是灰小猿,一个超会写bug的程序猿! 利用国庆期间做了一个基于springboot+vue的前后端分离的个人博客网站,今天在这里将开发过程和大家分享一下,手把手教你搭建一个自己专属的个人博客。 完整源码放置在Gitee上了,【源码链接】 小伙伴们记得⭐star⭐哟! 小伙伴们一键三连➕关注!灰小猿带你上高速啦????????????! 先看一下博客网站的演示视频: ⚡项目目录⚡ 个人博客网站项目整体思路 Java后端接口开发 (1)数据库设计 ​(2)整合My

累计发表博客60余万字,CSDN 博客专家、Java 领域优质创作者、华为云享专家、阿里云专家博主。专注分享 Java 优质文章,毕设实战项目开发,全网粉丝10W+ 4万+

Xilinx DDR3 MIG IP核设计--汇总导航

快速上手Xilinx DDR3 IP核----汇总篇

孤独的单刀 2万+

「自然语言驱动生产力」17. 秒出端子图:DeepSeek+EPLAN实现机柜布线自动化——电气工程设计的效率革命

摘要:在电气工程设计领域,机柜布线与端子图绘制长期依赖人工操作,存在效率低、易出错等痛点。本文提出基于DeepSeek大模型与EPLAN软件的集成方案,通过自然语言指令驱动自动化设计流程。实验表明,该方案可将PLC柜端子图绘制从传统3小时压缩至2分钟,线号标注准确率达100%,BOM表实现实时导出。文中详细阐述了系统架构、IO配置解析算法、端子排自动生成逻辑及线缆优化策略,提供了完整的Python实现代码与污水处理厂鼓风机控制柜的实际应用案例,验证了自然语言驱动技术在电气工程设计中的实用价值。

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 2153

基于springboot + vue 的个人博客搭建过程

写在最前面的完结感言 目前整个流程已经走完,项目也已经成功部署上线。 项目地址: raxcl.cn(已被重构) -----欢迎访问~~(后续域名备案成功后会替换成域名)~~ 后端代码仓库:github.com/Raxcl/blog-parent 前端代码仓库:github.com/Raxcl/blog-app 恭喜自己成功走出新手村,但后面还有茫茫星辰大海要走,比如如何把博客管理系统部署上线,如何把其他项目也部署上去,如何优化等等等等…期待我们后续的相遇。 2022.03.15 目前博客已经重构,重构后代码

RAXCL的博客 3653

Xilinx系FPGA学习笔记(三)Vivado的仿真及ILA使用

接着学习vivado的使用方法。

贾saisai的博客 2556

基于springboot+vue个人博客搭建

springboot+vue个人博客系统: 基于springboot+vue个人博客系统接入QQ,微博第三方登录,接入腾讯云人机验证、websocket博客作为新手入门项目是十分不错的,项目所用的技术栈覆盖的也比较广,适合初学者学习。主要难点在于权限管理、第三方登录、websocket这块。做的不好的地方请大家见谅,有问题的或者有好的建议可以私聊联系我。......

m0_54853465的博客 3295

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Vue3 + Springboot入门交互学习

1.后端 API 开发在 Spring Boot 项目中开发 RESTful API,用于处理前端发送的请求并返回数据。确保 API 能够响应标准的 HTTP 请求,包括 GET、POST、PUT、DELETE 等。对于需要验证用户身份的操作,可以实现用户认证和授权机制,例如使用 Spring Security。2.前端 Vue 3 项目开发在 Vue 3 项目中使用 Axios 或 Fetch 等工具发送 HTTP 请求到后端 API。

2301_76679920的博客 2742

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

【Vue+SpringBoot】超详细!一周开发一个SpringBoot + Vue+MybatisPlus+Shiro+JWT+Redis前后端分离个人博客项目!!!【项目完结】

项目目录资源准备前后端分离项目技术栈Java后端接口开发1、前言2、新建Springboot项目3、整合mybatis plus3、统一结果封装4、整合shiro+jwt,并会话共享ShiroConfigAccountRealmJwtTokenAccountProfileJwtFilter5、异常处理6、实体校验7、跨域问题Swagger2配置8、登录接口开发9、博客接口开发10、后端总结Vue前端页面开发1、前言2、项目演示3、环境准备4、新建项目5、安装element-ui6、安装axios7、页面路由

胡毛毛的博客 1万+

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

免费分享一套Springboot+Vue前后端分离的个人博客系统,挺漂亮的

进入二十一世纪,以Internet为核心的现代网络积水和通信技术已经得到了飞速的发展和广泛的应用,各种网络交流互动工具也应运而生。其中以论坛、博客、社区、空间最为受广大网民朋友的欢迎,也是目前为止发展的比较成熟的信息交流工具。在网络技术逐渐渗入社会生活各个层面的今天,传统的交流方式也面临着变革,而网络博客则是一个很重要的方向。基于Web技术的网络考试系统可以借助于遍布全球的Internet进行,因此交流既可以是本地进行,也可以是异地进行,大大拓展了沟通与交流的灵活性。

java1234的博客 2729

基于SpringBoot + Vue的个人博客

基于Springboot + Vue 开发的前后端分离博客在线地址|目录结构|项目特点|技术介绍|运行环境|开发环境|项目截图|快速开始|注意事项|项目总结|交流群接入QQ、微博、Gitee、Github第三方登录自己花了大概三个多月的时间写完这个项目,经历各种Bug以及项目部署,总得来说太不容易了。X1192176811 (风丶宇)RuoYi-Vue: 🎉 基于SpringBoot,Spring Security,JWT,Vue & Element 的前后端分离权限管理系统。

qq_46706269的博客 3537

[附源码]超简洁个人博客网站搭建+SpringBoot+Vue前后端分离

角色权限分为:管理员账号+游客账号(管理员可以管理文章,评论等)评论系统(可以评论图片,链接等)富文本编辑器(边写边预览)博客文章的增删改查分类+标签+时间归档热门推荐。

wwxx_hadluo的博客 1917

【自研+视频演示】超简洁个人博客+SpringBoot+Vue前后端分离

一款基于Vue+SpringBoot的个人博客系统源码分享。系统采用前后端分离架构,包含文章管理、富文本编辑器、评论系统等功能,支持管理员和游客角色。技术栈包括Vue、SpringBoot、MyBatis、MySQL8.0和Redis。提供完整的部署指南,需安装MySQL、Redis和NodeJS环境。系统支持文章增删改查、分类标签管理、时间归档等实用功能,适合个人博客搭建。获取源码需关注指定公众号。

吉他程序员的博客 3210

SpringBoot搭建个人博客

前言 一直觉得有个自己的博客是件很酷的事情,而且在搭建的过程能够提升的自己的编程能力,所以趁着暑假的时候完成了这个目标,前前后后花了半个月的时间吧,目前还是最简易的版本,后面会持续更新 本次所用到的技术和框架 SpringBoot Mysql Mybatis Thymeleaf SpringSecurity PageHelper Druid redis 页面与展示使用的是:AmazeUI 后台...

林北 1万+
上一篇: Springboot + Vue 个人博客 前端交互样例
下一篇: Centos7.6 部署 JavaWeb项目
Mr丶LuoT4
博客等级 码龄9年 18粉丝 12原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值