从零开始搭建一个SpringBoot项目

news2025/3/15 19:46:02

目录

  • Spring Boot
    • Spring Boot 项目开发环境
      • 1、快速创建SpringBoot项目
      • 2、pom.xml 添加 Meavn 依赖
      • 3、配置application.yml
      • 4、验证数据库是否连接成功
      • 5、配置 Druid 数据源
    • Spring Boot 整合 MyBatis
      • 1、准备依赖
      • 2、application-dev.yml 配置
      • 3、启动类添加Mapper接口扫描器
      • 4、设置日志log
      • 5、实现 MyBatis 进行增删改查操作
        • 1、数据库创建表格
        • 2、新建实体类和 Mapper 接口
        • 3、创建 Mapper 接口的映射文件
        • 4、新建 UserController
        • 5、功能测试
    • Spring Boot 整合 Lombok
    • Spring Boot 整合 Swagger
      • 1、添加依赖文件
      • 2、创建 Swagger 配置类
      • 3、Swagger 接口测试
    • 接口参数处理和统一响应结果
    • 接口参数处理和统一响应结果

Spring Boot

Spring Boot 项目开发环境

1、快速创建SpringBoot项目

1、打开idea 选择 File => New => Project 选中 Spring Boot 快速创建。

如果是创建JAVA8 需要把 Server URL 地址修改为 阿里云地址 https://start.aliyun.com

在这里插入图片描述
2、Dependencies 依赖 可以直接在这里先勾选,但我们先不选后面通过pom.xml Maven加载
在这里插入图片描述
3、创建后的项目结构如下
在这里插入图片描述

2、pom.xml 添加 Meavn 依赖

1、添加 spring-boot-start-web
使用SpringMVC构建web(包括RESTful)应用程序。使用Apache Tomcat作为默认的嵌入式容器。

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

运行项目后,浏览器输入localhost:8080 Web服务正常
在这里插入图片描述
2、添加 Lambok 依赖
Lombok依赖可在编译时,自动添加JavaBean结构。例如常用的getter、setter、toString、构造器和equals等方法。

<!-- lombok 依赖 -->
<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
</dependency>

3、单元测试
对单元测试的支持在于提供了一系列注解和工具的集成

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
</dependency>

4、数据库连接依赖

 <!-- mysql驱动包 -->
 <dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
     <version>8.0.28</version>
 </dependency>
 <!-- druid -->
 <dependency>
     <groupId>com.alibaba</groupId>
     <artifactId>druid-spring-boot-starter</artifactId>
     <version>1.2.14</version>
 </dependency>
 <!-- JDBC数据库连接 -->
 <dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-jdbc</artifactId>
 </dependency>

3、配置application.yml

将默认 application.properties 修改为 application.yml 添加配置更加直观
在这里插入图片描述
在这里插入图片描述

# application.yml
spring:
  application:
    name: SpringBootDemo
  profiles:
    # 使用 application-dev.yml 配置文件启动项目
    active: dev
# application-dev.yml
spring:
  datasource:
    url: jdbc:mysql://localhost:3306/springboot_db?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
    driver-class-name: com.mysql.cj.jdbc.Driver
    username: root
    password: Hu903157935
server:
  # 修改启动端口号
  port: 8080

4、验证数据库是否连接成功

在这里插入图片描述

// ApplicationTests.java 
package com.learning.springbootdemo;


import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

@SpringBootTest
public class ApplicationTests {
    // 注入数据源对象
    @Resource
    private DataSource dataSource;

    @Test
    public void dataSourceTest() throws SQLException {
        System.out.println("==============================================================");
        // 获取数据源类型
        System.out.println("默认数据源为:" + dataSource.getClass());
        // 获取数据库连接对象
        Connection connection = dataSource.getConnection();
        // 判断连接对象是否为空
        System.out.println(connection != null);
        assert connection != null;
        connection.close();
    }
}

5、配置 Druid 数据源

默认数据源-Hikari
在springboot2.0之后 , 采用的默认连接池就是Hikari, 号称"史上最快的连接池", 所以我们没有添加依赖也能直接用, springboot的自动配置中含有DataSourceAutoConfiguration配置类, 会先检查容器中是否已经有连接池对象, 没有则会使用默认的连接池, 并根据特定的属性来自动配置连接池对象, 用到的属性值来源于DataSourceProperties对象。

需要添加依赖和配置yml 此时加的是Druid的springboot自动配置包, 里面包含了DruidDataSourceAutoConfigure自动配置类,会自动创建druid的连接池对象, 所以springboot发现已经有连接池对象了,则不会再使用Hikari。(前面配置了,没有自行添加)

<!-- pom.xml -->
<!-- druid -->
<dependency>
  <groupId>com.alibaba</groupId>
  <artifactId>druid-spring-boot-starter</artifactId>
  <version>1.2.14</version>
</dependency>
# application-dev.yml
spring:
  datasource:
	type: com.alibaba.druid.pool.DruidDataSource

Spring Boot 整合 MyBatis

1、准备依赖

<!--mybatis集成到SpringBoot中的依赖-->
<dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>3.0.3</version>
</dependency>

2、application-dev.yml 配置

Spring Boot 整合 MyBatis 时几个比较需要注意的配置参数:

mybatis.config-location

配置 mybatis-config.xml 路径,mybatis-config.xml 中配置 MyBatis 基础属性,如果项目中配置了 mybatis-config.xml文件需要设置该参数。

mybatis.mapper-locations

配置 Mapper 文件对应的 XML 文件路径。

mybatis.type-aliases-package

配置项目中实体类包路径

我们只配置 mapper-locations 即可,最终的 application-dev.yml文件如下:

mybatis:
#  config-location: classpath:mybatis-config.xml
mapper-locations: classpath:mapper/*Dao.xml
#  type-aliases-package: com.learning.springboot.springbootdemo

3、启动类添加Mapper接口扫描器

在启动类中添加对 Mapper 包扫描 @MapperScan,Spring Boot 启动的时候会自动加载包路径下的 Mapper 接口:

@SpringBootApplication
@MapperScan("com.learning.springbootdemo.dao") // 添加 @Mapper 注解
public class SpringBootDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootDemoApplication.class, args);
    }
}

当然也可以直接在每个 Mapper 接口上面添加 @Mapper 注解,但是如果 Mapper 接口数量较多,在每个 Mapper 加注解是挺繁琐的,建议使用扫描注解。

4、设置日志log

logging:
  level: 
    root: info
  file:
    name:
      springboot-site.log

5、实现 MyBatis 进行增删改查操作

1、数据库创建表格

首先创建了springboot_db 的数据库,之后在数据库中新建了一个名称为 tb_user 的数据表,表中有 id , name , password 三个字段,在测试时可以直接将以上 SQL 拷贝到 MySQL 中执行即可。

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `springboot_db` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `springboot_db`;
DROP TABLE IF EXISTS `tb_user`;
CREATE TABLE `tb_user` (
  `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '登录名',
  `password` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '密码',
  PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
2、新建实体类和 Mapper 接口

1、在 entity 包下新建 User 类,将 tb_user 中的字段映射到该实体类中:

package com.learning.springbootdemo.entity;

public class User {

    private Integer id;
    private String name;
    private String password;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}

2、在 dao 包中新建 UserDao 接口,并定义增删改查四个接口:

package com.learning.springbootdemo.dao;

import com.learning.springbootdemo.entity.User;

import java.util.List;

public interface UserDao {
    /**
     * 返回数据列表
     */
    List<User> findAllUsers();

    /**
     * 添加
     */
    int insertUser(User User);

    /**
     * 修改
     */
    int updUser(User User);

    /**
     * 删除
     */
    int delUser(Integer id);
}
3、创建 Mapper 接口的映射文件

在 resources/mapper 目录下新建 Mapper 接口的映射文件 UserDao.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" 必须匹配 DOCTYPE"null"-->
<!-- 1、首先,定义映射文件与 Mapper 接口的对应关系,比如该示例中,需要将 UserDao.xml 的与对应的 UserDao 接口类之间的关系定义出来: -->
<mapper namespace="com.learning.springbootdemo.dao.UserDao">

<!-- 2、配置表结构和实体类的对应关系:-->
    <resultMap type="com.learning.springbootdemo.entity.User" id="UserResult">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="password" column="password"/>
    </resultMap>

<!-- 3、针对对应的接口方法,编写具体的 SQL 语句,最终的 UserDao.xml 文件如下: -->
    <select id="findAllUsers" resultMap="UserResult">
        select id,name,password from tb_user
        order by id desc
    </select>
    <insert id="insertUser" parameterType="com.learning.springbootdemo.entity.User">
        insert into tb_user(name,password)
        values(#{name},#{password})
    </insert>
    <update id="updUser" parameterType="com.learning.springbootdemo.entity.User">
        update tb_user
        set
        name=#{name},password=#{password}
        where id=#{id}
    </update>
    <delete id="delUser" parameterType="int">
        delete from tb_user where id=#{id}
    </delete>
</mapper>
4、新建 UserController

为了对 MyBatis 进行功能测试,在 controller 包下新建 UserController 类,并新增 4 个方法分别接收对于 tb_user 表的增删改查请求,代码如下:

package com.learning.springbootdemo.controller;

import com.alibaba.druid.util.StringUtils;
import com.learning.springbootdemo.dao.UserDao;
import com.learning.springbootdemo.entity.User;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Resource
    UserDao userDao;

    // 查询所有记录
    @GetMapping("/users/mybatis/queryAll")
    public List<User> queryAll() {
        return userDao.findAllUsers();
    }

    // 新增一条记录
    @GetMapping("/users/mybatis/insert")
    public Boolean insert(String name, String password) {
        if (StringUtils.isEmpty(name) || StringUtils.isEmpty(password)) {
            return false;
        }
        User user = new User();
        user.setName(name);
        user.setPassword(password);
        return userDao.insertUser(user) > 0;
    }

    // 修改一条记录
    @GetMapping("/users/mybatis/update")
    public Boolean insert(Integer id, String name, String password) {
        if (id == null || id < 1 || StringUtils.isEmpty(name) || StringUtils.isEmpty(password)) {
            return false;
        }
        User user = new User();
        user.setId(id);
        user.setName(name);
        user.setPassword(password);
        return userDao.updUser(user) > 0;
    }

    // 删除一条记录
    @GetMapping("/users/mybatis/delete")
    public Boolean insert(Integer id) {
        if (id == null || id < 1) {
            return false;
        }
        return userDao.delUser(id) > 0;
    }
}

5、功能测试

1、启动 Spring Boot 项目
2、浏览器输入测试地址

查询:http://localhost:8080/users/mybatis/queryAll
新增:http://localhost:8080/users/mybatis/insert?name=mybatis1&password=1233333
修改:http://localhost:8080/users/mybatis/update?id=3&name=mybatis2&password=1233222
删除:http://localhost:8080/users/mybatis/delete?id=3

Spring Boot 整合 Lombok

Lombok 项目是一个第三方的 Java 工具库,它会自动插入编辑器和构建工具中,Lombok 提供了一组非常有用的注释,用来消除 Java 类中的大量样板代码,比如 setter getter 方法、构造方法等等, 仅仅在原来的 JavaBean 类上使用 @Data 注解就可以替换数百行代码从而使代码变得更加清爽、简洁且易于维护。

注意:Lombok 它并不是一个必要的插件。暂时先跳过。

Spring Boot 整合 Swagger

Swagger 是一款 RESTful 接口的文档在线自动生成+功能测试功能软件

它可以轻松的整合到 Spring Boot 中并生成 RESTful API 文档,既可以减少我们创建文档的工作量,同时说明内容又整合入实现代码中,让维护文档和修改代码整合为一体,可以让我们在修改代码逻辑的同时方便的修改文档说明,另外 Swagger 也提供了强大的页面测试功能来调试每个 API 接口。

1、添加依赖文件

首先,在 pom.xml 中加入 Swagger 的依赖信息,如下:

<!-- swagger -->
 <dependency>
     <groupId>org.springdoc</groupId>
     <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
     <version>2.0.2</version>
 </dependency>

2、创建 Swagger 配置类

新建 config 包,在 config 包中新增 Swagger2Config.java,代码如下:

package com.learning.springbootdemo.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SpringDocConfig {

    // 扫描路径
    private static final String basePackage = "com.learning.springbootdemo.controller";
    // 请求头名称
    private static final String headerName = "token";

    @Bean
    public GroupedOpenApi group01() {
        return GroupedOpenApi.builder()
                .group("group01")
                .addOperationCustomizer((operation, handlerMethod) -> {
                    operation.addSecurityItem(new SecurityRequirement().addList(headerName));
                    return operation;
                })
                .packagesToScan(basePackage)
                .build();
    }

    @Bean
    public OpenAPI customOpenAPI() {
        Components components = new Components();
        //添加右上角的统一安全认证
        components.addSecuritySchemes(headerName,
                new SecurityScheme()
                        .type(SecurityScheme.Type.APIKEY)
                        .scheme("basic")
                        .name(headerName)
                        .in(SecurityScheme.In.HEADER)
                        .description("请求头")
        );
        return new OpenAPI()
                .components(components)
                .info(apiInfo());
    }

    private Info apiInfo() {
        Contact contact = new Contact();
        contact.setName("Wannaer");
        return new Info()
                .title("Swagger文档")
                .version("1.0")
                .contact(contact)
                .license(new License().name("Apache 2.0").url("http://springdoc.org"));
    }
}

group01() 方法用于返回生成 Swagger API 时的接口摘要信息,也是在该方法中指定需要扫描的控制器包路径,只有此路径下的 Controller 类才会自动生成 Swagger API 文档。如果想要根据不同的包对 API 文档进行分组,可以配置多个 GroupedOpenApi 实例,比如再写一个方法 group02,扫描的包是 cn.lanqiao.springboot3.controller2。

apiInfo() 方法中主要是配置一些基础信息,包括配置页面展示的基本信息包括,标题、描述、版本、服务条款、联系方式等。

配置完成之后启动项目,在浏览器中输入网址 /swagger-ui/index.html,即可看到 Swagger 页面,效果如下:
在这里插入图片描述
此时只有基础的配置信息,并没有文档信息,接下来我们需要在我们的 Controller 类。

@Tag(name = "用户模块接口")
@RestController
public class UserController {
	// 查询所有记录
    @Operation(summary = "查询所有记录")
    @GetMapping("/users/mybatis/queryAll")
    public List<User> queryAll() {
        return userDao.findAllUsers();
    }
}

在项目启动成功后,查看swagger接口文档页面 包括参数信息、请求方法、注意事项等等我们已经在代码中定义的信息都会在接口文档中显示。
在这里插入图片描述

// 完整 UserController 代码
package com.learning.springbootdemo.controller;

import com.alibaba.druid.util.StringUtils;
import com.learning.springbootdemo.dao.UserDao;
import com.learning.springbootdemo.entity.User;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "用户模块接口")
@RestController
public class UserController {
    @Resource
    UserDao userDao;

    // 查询所有记录
    @Operation(summary = "查询所有记录")
    @GetMapping("/users/mybatis/queryAll")
    public List<User> queryAll() {
        return userDao.findAllUsers();
    }

    // 新增一条记录
    @Operation(summary = "新增用户", description = "根据User对象新增用户")
    @GetMapping("/users/mybatis/insert")
    public Boolean insert(String name, String password) {
        if (StringUtils.isEmpty(name) || StringUtils.isEmpty(password)) {
            return false;
        }
        User user = new User();
        user.setName(name);
        user.setPassword(password);
        return userDao.insertUser(user) > 0;
    }

    // 修改一条记录
    @GetMapping("/users/mybatis/update")
    public Boolean insert(Integer id, String name, String password) {
        if (id == null || id < 1 || StringUtils.isEmpty(name) || StringUtils.isEmpty(password)) {
            return false;
        }
        User user = new User();
        user.setId(id);
        user.setName(name);
        user.setPassword(password);
        return userDao.updUser(user) > 0;
    }

    // 删除一条记录
    @GetMapping("/users/mybatis/delete")
    public Boolean insert(Integer id) {
        if (id == null || id < 1) {
            return false;
        }
        return userDao.delUser(id) > 0;
    }
}

3、Swagger 接口测试

首先我们点进列表接口,接口的右上方有 Try it out 按钮,点击它来尝试发送请求。
在这里插入图片描述
之后页面上会出现 Execute 按钮,点击它之后会实际的向后端发送用户列表请求,请求成功后可以在页面中看到请求信息,以及返回数据,在 Response body 信息框中我们可以看到两条用户数据,接口请求成功且数据如预期中的数据一致,证明这个接口是没有问题的,结果如下图所示。
在这里插入图片描述

接口参数处理和统一响应结果

关于传参的规范和返回结果的统一,尽可能的使得控制层业务层处理的数据格式统一化,保证了接口和编码规范的统一性。
规范的参数定义和结果响应极大程度的降低了开发成本及沟通成本。

接口参数处理和统一响应结果

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1695108.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【Python搞定车载自动化测试】——Python基于Pytest框架实现UDS诊断自动化(含Python源码)

系列文章目录 【Python搞定车载自动化测试】系列文章目录汇总 文章目录 系列文章目录&#x1f4af;&#x1f4af;&#x1f4af; 前言&#x1f4af;&#x1f4af;&#x1f4af;一、环境搭建1.软件环境2.硬件环境 二、目录结构三、源码展示1.诊断基础函数方法2.诊断业务函数方法…

09.自注意力机制

文章目录 输入输出运行如何运行解决关联性attention score额外的Q K V Multi-head self-attentionPositional EncodingTruncated Self-attention影像处理vs CNNvs RNN图上的应用 输入 输出 运行 链接&#xff08;Attention Is All You Need&#xff09; 如何运行 解决关联性 a…

Iphone自动化指令每隔固定天数打开闹钟关闭闹钟

1.业务需求&#xff1a;小z每隔五天有一个夜班&#xff0c;然后下午会有三个小时的休息时间&#xff0c;如果闹钟不响就会错过交班日期&#xff0c;但是如果设置闹钟&#xff0c;iPhone的闹钟只能设定固定循环日期闹钟&#xff0c;或者一次的闹钟&#xff0c;导致要么忘记设闹钟…

【网络安全】社会工程学攻击与防范

一、社会工程学概述 1、社会工程学的定义 通过利用人们的心理弱点、本能反应、好奇心、信任、贪婪等一些心理陷阱进行的诸如欺骗、伤害、信息盗取、利益谋取等对社会及人类带来危害的行为或方法。 当网络恶意攻击者无法通过纯粹的计算机技术达到目的时&#xff0c;高超的情商…

【Text2SQL】WikiSQL 数据集与 Seq2SQL 模型

论文&#xff1a;Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning ⭐⭐⭐⭐⭐ ICLR 2018 Dataset: github.com/salesforce/WikiSQL Code&#xff1a;Seq2SQL 模型实现 一、论文速读 本文提出了 Text2SQL 方向的一个经典数据集 —…

Amesim应用篇-电芯等效电路模型标定

前言 为了使计算模型更加准确,在有电芯实验测试数据的情况下,依据现有的实验数据对Amesim中的电池等效电路模型进行标定。标定的目的是为了获得更加符合项目实际情况的电芯等效电路模型,标定完的电芯可以用于搭建PACK模型,也可以用于其他虚拟实验。本文以充电标定为例,进…

ideal 启动 多个 相同 工程

spring相同项目在idea多次运行 点击IDEA右上角项目的隐藏下拉框&#xff0c;出现下拉列表&#xff0c;点击Edit Configurations 弹出Run/Debug Configuration对话框&#xff0c;勾选Allow parallel run

vue实战 ---- 社交媒体---黑马头条项目

vue基础 1.介绍 为什么会有Vuex ? ​ Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式。它采用集中式存储管理应用的所有组件的状态&#xff0c;并以相应的规则保证状态以一种可预测的方式发生变化。 vuex是采用集中式管理组件依赖的共享数据的一个工具&#xff0c;可以解…

21-信号集处理函数

屏蔽信号集 屏蔽某些信号 手动自动 未处理信号集 信号如果被屏蔽&#xff0c;则记录在未处理信号集中 非实时信号&#xff08;1~31&#xff09;&#xff0c;不排队&#xff0c;只留一个实时信号&#xff08;34~64&#xff09;&#xff0c;排队&#xff0c;保留全部 信号集…

7. Spring MVC面试题汇总

Java全栈面试题汇总目录-CSDN博客 1. 什么是Spring MVC&#xff0c;简单介绍下你对Spring MVC的理解? Spring MVC是一个基于Java的实现了MVC设计模式的请求驱动类型的轻量级Web框架&#xff0c;通过把Model&#xff0c;View&#xff0c;Controller分离&#xff0c;将web层进…

Jenkins安装部署--图文详细

Jenkins–从入门到入土 文章目录 Jenkins--从入门到入土一、Jenkins安装部署1、什么是Jenkins?2、Jenkins在开发过程中所属位置3、安装硬件环境和知识储备4、安装4.1、下载war启动4.2、Docker启动4.3、windows使用驱动安装 5、使用插件自定义 Jenkins6、创建第一个管理员用户 …

1+x(Java)中级题库易混淆理论题

<ALL表示小于最小 小于最高等同于小于ANY 使用USING子句&#xff0c;在使用连接字段时&#xff0c;都不能在前面加上表的前缀&#xff0c;因为此时这个字段已经是连接字段&#xff0c;不再属于某个单独的表。 数据库提供的自动将提供的数据类型数据转换为期望的数据类…

SpringBoot3笔记(一)SpringBoot3-核心特性

快速学习 SpringBoot 看官方文档&#xff1a; Spring Boot Reference Documentation 计划三天学完 笔记&#xff1a;https://www.yuque.com/leifengyang/springboot3 代码&#xff1a;https://gitee.com/leifengyang/spring-boot-3 一、SpringBoot3 - 快速入门 1.1 简介 …

深入解析:如何高效地更新Python字典

新书上架~&#x1f447;全国包邮奥~ python实用小工具开发教程http://pythontoolsteach.com/3 欢迎关注我&#x1f446;&#xff0c;收藏下次不迷路┗|&#xff40;O′|┛ 嗷~~ 目录 一、引言 二、修改字典中的值 三、向字典中添加键值对 四、更新字典的两种方法总结 五、…

Re72:读论文 XLM Cross-lingual Language Model Pretraining

诸神缄默不语-个人CSDN博文目录 诸神缄默不语的论文阅读笔记和分类 论文名&#xff1a;Cross-lingual Language Model Pretraining 模型简称&#xff1a;XLM ArXiv地址&#xff1a;https://arxiv.org/abs/1901.07291 这是2019年NeurIPS的论文&#xff0c;主要做到就是跨语言…

第十一届蓝桥杯物联网试题(国赛)

国赛题目看着简单其实还是挺复杂的&#xff0c;所以说不能掉以轻心&#xff0c;目前遇到的问日主要有以下几点&#xff1a; 本次题主要注重的是信息交互&#xff0c;与A板通信的有电脑主机和B板&#xff0c;所以处理好这里面的交互过程很重要 国赛中避免不了会收到其他选手的…

【Linux设备驱动】1.字符设备驱动程序框架及相关结构体

目录 程序总体框架模块加载函数模块卸载函数具体操作函数 相关结构体cdev结构体file_oparations结构体 设备号分配设备号注销设备号创建设备文件 程序总体框架 /* 包含相关头文件 */ #include <linux/module.h> #include <linux/fs.h> #include <linux/init.h&…

智慧校园的建设思路

智慧校园建设的一个主要目的就是要打破学校内的信息孤岛&#xff0c;其核心是在人、流程和信息三个层面的全面整合。智慧校园应该能够为全校师生员工及校外用户提供统一的、一站式的服务渠道&#xff1b;能够将学校各种业务流程连接起来&#xff0c;实现各种应用系统的互联互通…

设计新境界:大数据赋能UI的创新美学

设计新境界&#xff1a;大数据赋能UI的创新美学 引言 随着大数据技术的蓬勃发展&#xff0c;它已成为推动UI设计创新的重要力量。大数据不仅为界面设计提供了丰富的数据资源&#xff0c;还赋予了设计师以全新的视角和工具来探索美学的新境界。本文将探讨大数据如何赋能UI设计…

linux系统——终止进程命令

linux进程&#xff0c;有所谓进程树的概念&#xff0c;在此之上&#xff0c;有父进程与子进程 pgrep进程名可以查看进程信息 同时&#xff0c;此命令也可以使用参数进行调节 关于kill有一系列命令参数 echo $?可以输出上次命令执行的情况