【全栈】SprintBoot+vue3迷你商城(1)

【全栈】SprintBoot+vue3迷你商城(1)

1.功能

开发之前,首先我们需要大致想好商城有哪些功能。

这里我先想出几点,以后增加功能时再补充。

  • 拥有用户与商品两个对象
  • 用户可以修改昵称与密码、上传与修改头像、购物、将商品加入购物车等等
  • 用户又分为普通用户和商家。普通用户无法添加商品,而商家可以添加自己的商品。
  • 主页为商品列表,有搜索功能与分页

2.使用工具

这只是大致能想到的,后面如果需要用到其他工具再加上去

  • 语言:Java,html,css,JavaScript,sql
  • 框架:SpingBoot,vue3
  • IDE:vscode,IDEA

3.起步

创建项目

在这里插入图片描述

加入所需要的依赖

先引入一些基本的依赖

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.3.4</version>
    <relativePath/> 
</parent>
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.mybatis.spring.boot</groupId>
        <artifactId>mybatis-spring-boot-starter</artifactId>
        <version>3.0.3</version>
    </dependency>

    <dependency>
        <groupId>com.mysql</groupId>
        <artifactId>mysql-connector-j</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mybatis.spring.boot</groupId>
        <artifactId>mybatis-spring-boot-starter-test</artifactId>
        <version>3.0.3</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
    </dependency>
    <dependency>
        <groupId>com.github.pagehelper</groupId>
        <artifactId>pagehelper-spring-boot-starter</artifactId>
        <version>1.4.7</version>
    </dependency>


</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <excludes>
                    <exclude>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok</artifactId>
                    </exclude>
                </excludes>
            </configuration>
        </plugin>
    </plugins>
</build>
解释

pom.xml 设置了项目的依赖管理和构建配置,确保了项目能够正确地使用 Spring Boot、MyBatis、MySQL、Lombok 和分页插件等功能。此外,它还配置了 Spring Boot Maven 插件以优化构建过程,并合理管理了各种依赖的作用域,确保了开发和测试环境下的依赖一致性。

搭框架

在这里插入图片描述

4.总结

万事开头难,既然想好做这件事,那么就立马行动。

本人在这方面也是尝试阶段,有很多不懂的地方,希望边做边记录边进步。对于不足的地方,我会虚心接受大家的建议。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值