springboot:整合其它项目

news2025/7/6 22:15:09

目录

一、集成Druid

application.yml

二、集成redis之非注解式开发

pom.xml

application.yml

RedisConfig 

ClazzBizImpl.java

三、集成redis之注解缓存开发

RedisConfig 

 RedisConfig 


一、集成Druid

在昨天的基础上

参考网址

https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter

添加pom依赖

     <!--添加druid相关的依赖-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.1.10</version>
        </dependency>

配置

application.yml

mybatis:
    mapper-locations: classpath:mappers/*xml
    type-aliases-package: com.cdl.springboot04.model
server:
    port: 8080
    servlet:
        context-path: /springboot04
spring:
    application:
        name: springboot04
    datasource:
        driver-class-name: com.mysql.jdbc.Driver
        name: defaultDataSource
        password: 123456
        url: jdbc:mysql://localhost:3306/mysql?useUnicode=true&characterEncoding=UTF-8&useSSL=false
        username: root
        type: com.alibaba.druid.pool.DruidDataSource
        druid:
            #2.连接池配置
            #初始化连接池的连接数量 大小,最小,最大
            initial-size: 5
            min-idle: 5
            max-active: 20
            #配置获取连接等待超时的时间
            max-wait: 60000
            #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
            time-between-eviction-runs-millis: 60000
            # 配置一个连接在池中最小生存的时间,单位是毫秒
            min-evictable-idle-time-millis: 30000
            validation-query: SELECT 1 FROM DUAL
            test-while-idle: true
            test-on-borrow: true
            test-on-return: false
            # 是否缓存preparedStatement,也就是PSCache  官方建议MySQL下建议关闭   个人建议如果想用SQL防火墙 建议打开
            pool-prepared-statements: true
            max-pool-prepared-statement-per-connection-size: 20
            # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
            filter:
                stat:
                    merge-sql: true
                    slow-sql-millis: 5000
            #3.基础监控配置
            web-stat-filter:
                enabled: true
                url-pattern: /*
                #设置不统计哪些URL
                exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
                session-stat-enable: true
                session-stat-max-count: 100
            stat-view-servlet:
                enabled: true
                url-pattern: /druid/*
                reset-enable: true
                #设置监控页面的登录名和密码
                login-username: admin
                login-password: admin
                allow: 127.0.0.1
                #deny: 192.168.1.100
    freemarker:
        cache: false
        charset: utf-8
        expose-request-attributes: true
        expose-session-attributes: true
        suffix: .ftl
        template-loader-path: classpath:/templates/
#    resources:
#       static-locations: classpath:/static/# 应用服务 WEB 访问端口
    mvc:
        static-path-pattern: classpath:/static/
pagehelper:
    reasonable: true
    supportMethodsArguments: true
    page-size-zero: true
    helper-dialect: mysql
    logging:
        level:
            com.cdl.springboot04: debug

运行启动类

打开我们的班级列表

 通过手动输入druid的登录界面

 登录之后

 当我们对班级列表进行操作时,例如增加

 此时SQL监控,URL监控

若增加一个重复的id 则URL监控就显示error

 

二、集成redis之非注解式开发

添加需要的pom依赖

<!--添加redis集成相关依赖-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.cdl</groupId>
    <artifactId>springboot04</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>springboot04</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-boot.version>2.3.7.RELEASE</spring-boot.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <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>2.1.4</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.44</version>
        </dependency>
        <!--支持aop-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>5.0.2.RELEASE</version>
        </dependency>
        <!--支持  pageHelper-->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.2.3</version>
        </dependency>
        <!--添加druid相关的依赖-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.1.10</version>
        </dependency>
        <!--添加redis集成相关依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </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>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>

    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.3.7.RELEASE</version>
                <configuration>
                    <mainClass>com.cdl.springboot04.Springboot04Application</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <id>repackage</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

配置

application.yml

mybatis:
    mapper-locations: classpath:mappers/*xml
    type-aliases-package: com.cdl.springboot04.model
server:
    port: 8080
    servlet:
        context-path: /springboot04
spring:
    application:
        name: springboot04
    datasource:
        driver-class-name: com.mysql.jdbc.Driver
        name: defaultDataSource
        password: 123456
        url: jdbc:mysql://localhost:3306/mysql?useUnicode=true&characterEncoding=UTF-8&useSSL=false
        username: root
        type: com.alibaba.druid.pool.DruidDataSource
        druid:
            #2.连接池配置
            #初始化连接池的连接数量 大小,最小,最大
            initial-size: 5
            min-idle: 5
            max-active: 20
            #配置获取连接等待超时的时间
            max-wait: 60000
            #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
            time-between-eviction-runs-millis: 60000
            # 配置一个连接在池中最小生存的时间,单位是毫秒
            min-evictable-idle-time-millis: 30000
            validation-query: SELECT 1 FROM DUAL
            test-while-idle: true
            test-on-borrow: true
            test-on-return: false
            # 是否缓存preparedStatement,也就是PSCache  官方建议MySQL下建议关闭   个人建议如果想用SQL防火墙 建议打开
            pool-prepared-statements: true
            max-pool-prepared-statement-per-connection-size: 20
            # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
            filter:
                stat:
                    merge-sql: true
                    slow-sql-millis: 5000
            #3.基础监控配置
            web-stat-filter:
                enabled: true
                url-pattern: /*
                #设置不统计哪些URL
                exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
                session-stat-enable: true
                session-stat-max-count: 100
            stat-view-servlet:
                enabled: true
                url-pattern: /druid/*
                reset-enable: true
                #设置监控页面的登录名和密码
                login-username: admin
                login-password: admin
                allow: 127.0.0.1
                #deny: 192.168.1.100
    freemarker:
        cache: false
        charset: utf-8
        expose-request-attributes: true
        expose-session-attributes: true
        suffix: .ftl
        template-loader-path: classpath:/templates/
#    resources:
#       static-locations: classpath:/static/# 应用服务 WEB 访问端口
    mvc:
        static-path-pattern: classpath:/static/
    redis:
        host: 192.168.26.128
        port: 6379
        database: 0
        password: 123456
pagehelper:
    reasonable: true
    supportMethodsArguments: true
    page-size-zero: true
    helper-dialect: mysql
    logging:
        level:
            com.cdl.springboot04: debug

新建一个包 config 配置类

RedisConfig 

package com.cdl.springboot04.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;

/**
 * @author CDL
 * @site www.cdl.com
 *
 * @Configuration:凡是被@Configuration注解所标记,就代表当前这个类为配置类
 * 而配置类等价于ssm阶段中spring-*.xml这一类的配置文件
 *
 * spring-*.xml中:
 * @Bean:<bean  id="" class=""></bean>代表某个类交给spring进行管理
 *
 *
 *
 */
@Configuration
public class RedisConfig {
    @Bean
    public RedisTemplate<String,Object> getRedisTemplate(RedisConnectionFactory connectionFactory){
        RedisTemplate<String,Object> redisTemplate = new RedisTemplate<>();

        //配置序列化器  针对于key 针对于value
        redisTemplate.setKeySerializer(new StringRedisSerializer());
        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
        redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
        redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
//        redisTemplate.afterPropertiesSet();根据redis的版本考虑要不要让其生效

        //ConnectionFactory是包含了redis的连接信息
        redisTemplate.setConnectionFactory(connectionFactory);
        return redisTemplate;
    }
}

在service层ClazzBizImpl.java使用

ClazzBizImpl.java

package com.cdl.springboot04.biz.impl;

import com.cdl.springboot04.biz.ClazzBiz;
import com.cdl.springboot04.mapper.ClazzMapper;
import com.cdl.springboot04.model.Clazz;
import com.cdl.springboot04.util.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author CDL
 * @site www.cdl.com
 * @company xxx公司
 * @create  2022-08-17 15:13
 */
@Service
public class ClazzBizImpl implements ClazzBiz {
    @Autowired
    private ClazzMapper clazzMapper;
    @Autowired
    private RedisTemplate<String,Object> redisTemplate;
    @Override
    public int deleteByPrimaryKey(Integer cid) {
//        System.out.println("不做任何操作...");
        return clazzMapper.deleteByPrimaryKey(cid);
//        return 0;
    }

    @Override
    public int insert(Clazz record) {
        return clazzMapper.insert(record);
    }

    @Override
    public int insertSelective(Clazz record) {
        return clazzMapper.insertSelective(record);
    }

    @Override
    public Clazz selectByPrimaryKey(Integer cid) {
        return clazzMapper.selectByPrimaryKey(cid);
    }

    @Override
    public int updateByPrimaryKeySelective(Clazz record) {
        return clazzMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Clazz record) {
        return clazzMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Clazz> listPager(Clazz clazz, PageBean pageBean) {
        //将班级缓存到redis中
        List<Clazz> clzs = clazzMapper.listPager(clazz);
       // redisTemplate.opsForValue().set("clz:1",clzs.get(0));
        redisTemplate.opsForValue().set("clzs",clzs);
       // redisTemplate.opsForHash().entries();
        return clzs;
    }

    @Override
    public List<Map> listMapPager(Clazz clazz, PageBean pageBean) {
        if(true)
            throw new RuntimeException("查询班级信息异常,异常存在于ClazzBizImpl.list。。。。");
        return clazzMapper.listMapPager(clazz);
    }
}

运行:

 此时:可见已经缓存进去了

三、集成redis之注解缓存开发

还要在配置类配置缓存管理器

RedisConfig 

package com.cdl.springboot04.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.StringRedisSerializer;

import java.time.Duration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * @author CDL
 * @site www.cdl.com
 *
 * @Configuration:凡是被@Configuration注解所标记,就代表当前这个类为配置类
 * 而配置类等价于ssm阶段中spring-*.xml这一类的配置文件
 *
 * spring-*.xml中:
 * @Bean:<bean  id="" class=""></bean>代表某个类交给spring进行管理
 *
 *
 *
 */
@Configuration
public class RedisConfig {

    private final int defaultExpireTime = 600;//默认的缓存槽

    private final int userCacheExpireTime = 60;//用来缓存用户的槽

    private final String userCacheName = "test";//用户槽的名称

    @Bean
    public RedisTemplate<String,Object> getRedisTemplate(RedisConnectionFactory connectionFactory){
        RedisTemplate<String,Object> redisTemplate = new RedisTemplate<>();

        //配置序列化器  针对于key 针对于value
        redisTemplate.setKeySerializer(new StringRedisSerializer());
        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
        redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
        redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
//        redisTemplate.afterPropertiesSet();根据redis的版本考虑要不要让其生效

        //ConnectionFactory是包含了redis的连接信息
        redisTemplate.setConnectionFactory(connectionFactory);
        return redisTemplate;
    }

    @Bean//配置缓存管理器
    public RedisCacheManager redis(RedisConnectionFactory connectionFactory){
        RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig();
        // 设置缓存管理器管理的缓存的默认过期时间
        defaultCacheConfig = defaultCacheConfig.entryTtl(Duration.ofSeconds(defaultExpireTime))
                // 设置 key为string序列化
                .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
                // 设置value为json序列化
                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()))
                // 不缓存空值
                .disableCachingNullValues();

        Set<String> cacheNames = new HashSet<>();
        cacheNames.add(userCacheName);

        // 对每个缓存空间应用不同的配置
        Map<String, RedisCacheConfiguration> configMap = new HashMap<>();
        configMap.put(userCacheName, defaultCacheConfig.entryTtl(Duration.ofSeconds(userCacheExpireTime)));

        RedisCacheManager cacheManager = RedisCacheManager.builder(connectionFactory)
                .cacheDefaults(defaultCacheConfig)
                .initialCacheNames(cacheNames)
                .withInitialCacheConfigurations(configMap)
                .build();

        return cacheManager;
    }
}

将非注解式缓存的Java代码注掉

 RedisConfig 

package com.cdl.springboot04.config;

import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.StringRedisSerializer;

import java.time.Duration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * @author CDL
 * @site www.cdl.com
 *
 * @Configuration:凡是被@Configuration注解所标记,就代表当前这个类为配置类
 * 而配置类等价于ssm阶段中spring-*.xml这一类的配置文件
 *
 * spring-*.xml中:
 * @Bean:<bean  id="" class=""></bean>代表某个类交给spring进行管理
 *
 *
 *@EnableCaching 替代了下面的配置
 *  <cache:annotation-driven cache-manager="redisCacheManager" key-generator="cacheKeyGenerator"/>
 */
@EnableCaching//开启缓存
@Configuration
public class RedisConfig {

    private final int defaultExpireTime = 600;//默认的缓存槽

    private final int userCacheExpireTime = 60;//用来缓存用户的槽

    private final String userCacheName = "test";//用户槽的名称

    @Bean
    public RedisTemplate<String,Object> getRedisTemplate(RedisConnectionFactory connectionFactory){
        RedisTemplate<String,Object> redisTemplate = new RedisTemplate<>();

        //配置序列化器  针对于key 针对于value
        redisTemplate.setKeySerializer(new StringRedisSerializer());
        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
        redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
        redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
//        redisTemplate.afterPropertiesSet();根据redis的版本考虑要不要让其生效

        //ConnectionFactory是包含了redis的连接信息
        redisTemplate.setConnectionFactory(connectionFactory);
        return redisTemplate;
    }

    @Bean//配置缓存管理器
    public RedisCacheManager redis(RedisConnectionFactory connectionFactory){
        RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig();
        // 设置缓存管理器管理的缓存的默认过期时间
        defaultCacheConfig = defaultCacheConfig.entryTtl(Duration.ofSeconds(defaultExpireTime))
                // 设置 key为string序列化
                .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
                // 设置value为json序列化
                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()))
                // 不缓存空值
                .disableCachingNullValues();

        Set<String> cacheNames = new HashSet<>();
        cacheNames.add(userCacheName);

        // 对每个缓存空间应用不同的配置
        Map<String, RedisCacheConfiguration> configMap = new HashMap<>();
        configMap.put(userCacheName, defaultCacheConfig.entryTtl(Duration.ofSeconds(userCacheExpireTime)));

        RedisCacheManager cacheManager = RedisCacheManager.builder(connectionFactory)
                .cacheDefaults(defaultCacheConfig)
                .initialCacheNames(cacheNames)
                .withInitialCacheConfigurations(configMap)
                .build();

        return cacheManager;
    }
}

 测试查询单个能不能缓存进去

给查询单个的方法添加注解

 在ClazzController中添加一个查询单个的方法

  @ResponseBody
    @RequestMapping("/load")
    public Clazz load(Clazz clazz, HttpServletRequest request){
        return clazzBiz.selectByPrimaryKey(clazz.getCid());
    }

启动前先将redis中的数据清空

 访问数据

 缓存成功

 换个槽看下 时间

 查看单个

 缓存

 

 

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

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

相关文章

C---指针

目录指针偏移问题&#xff1a;为什么用指针&#xff1f;1.强制给指针选地址&#xff1a;2.交换两个变量的值指针与数组1.指针数组&#xff1a;数组中的每一项都是个指针2. 指针数组的用法数组指针&#xff1a;一个指向数组的指针函数指针&#xff1a;malloc内存泄露&#xff08…

洛谷千题详解 | P1005 [NOIP2007 提高组] 矩阵取数游戏【C++、 Java、Python语言】

博主主页&#xff1a;Yu仙笙 专栏地址&#xff1a;洛谷千题详解 目录 题目描述 输入格式 输出格式 输入输出样例 解析&#xff1a; C源码&#xff1a; Java源码&#xff1a; Python源码&#xff1a; ----------------------------------------------------------------------…

论文阅读之RETHINKING POSITIONAL ENCODING IN LANGUAGE PRE-TRAINING

文章目录论文阅读总结参考论文阅读 文章大概提出了两个问题&#xff1a; 1.对于原来的transformer或者bert的embedding中&#xff0c;直接将word embedding&#xff08;词向量&#xff09;和positional embedding &#xff08;位置编码&#xff09;相加是不合理的&#xff0c;…

Netty入门——组件(Channel)一

目录一、channel的主要作用二、EventLoop处理io任务代码示例2.1、服务端代码示例2.2、客户端代码示例2.3、服务端和客户端查看控制台输出结果三、ChannelFuture连接问题代码示例3.1、服务端代码示例3.2、客户端代码示例3.3、服务端和客户端查看控制台输出结果3.4、ChannelFutur…

MyBatis的二级缓存

MyBatis的二级缓存 二级缓存是SqlSessionFactory级别&#xff0c;通过同一个SqlSessionFactory创建的SqlSession查询的结果会被缓存&#xff1b;此后若再次执行相同的查询语句&#xff0c;结果就会从缓存中获取。 二级缓存开启的条件&#xff1a; 1.在核心配置文件中&#x…

软件测试:写一个好的测试用例

测试场景&#xff1a; 为登录功能设计测试用例 测试员为什么要会编测试用例 测试员的目标是要保证系统在各种场景下的功能是符合设计要求的。而测试用例就是测试员想到的测试场景。&#xff08;这也是高级别的测试员即使不会代码也能找到较好工作的原因&#xff09; 编写测试…

数据库2,DQL数据查询语言,表关联关系

目录 DQL数据查询语言 简单查询语句 计算列 别名 distinct消除重复行 条件查询 条件运算符 null值判断 枚举查询 模糊查询 分支查询 函数 字符串函数 聚合函数 排序查询 分组查询Group by 分页查询Limit 表关联关系 一对一关联 一对多与多对一 多对多关联 …

[CKA备考实验][ingress-nginx] 4.2 集群外访问POD

1.创建Deployments 部署方法请参照&#xff1a; https://blog.csdn.net/qq_33868661/article/details/127505429?spm1001.2014.3001.5501 apiVersion: apps/v1 kind: Deployment metadata:labels:name: deploy1annotations:name: deploy1name: deploy1namespace: default sp…

要么干要么滚!推特开始裁员了;深度学习产品应用·随书代码;可分离各种乐器音源的工具包;Transformer教程;前沿论文 | ShowMeAI资讯日报

&#x1f440;日报合辑 | &#x1f4c6;电子月刊 | &#x1f369;韩信子 &#x1f4e2; 解散Twitter董事会&#xff0c;代码审查&#xff0c;裁员25%&#xff0c;收每月20美元认证费马斯克那些骚操作 埃隆马斯克 (Elon Musk) 抱着洗手池入主 Twitter 后&#xff0c;狂风骤雨已…

STM32入门——uKeil5 MDK 的使用(基于固件库)

文章目录1 Keil uVision5 MDK 是什么2 建立一个标准库函数工程2.1 前期准备2.2 建立工程2.3 建立组文件夹2.4 添加文件2.4 配置“魔术棒”选项卡2.5 建立 main 函数1 Keil uVision5 MDK 是什么 Keil 软件是一种统称&#xff0c;它包含编辑器、编译器、链接器、调试器等众多工具…

冰冰学习笔记:二叉搜索树

欢迎各位大佬光临本文章&#xff01;&#xff01;&#xff01; 还请各位大佬提出宝贵的意见&#xff0c;如发现文章错误请联系冰冰&#xff0c;冰冰一定会虚心接受&#xff0c;及时改正。 本系列文章为冰冰学习编程的学习笔记&#xff0c;如果对您也有帮助&#xff0c;还请各位…

堆外内存和堆内内存及虚引用的应用

目录 内存区域划分&#xff1a; 元空间 程序计数器 直接内存 对象的创建 对象的访问定位 判断对象是否存活 堆外内存 堆内内存的缺点以及引入堆外内存 为什么需要堆外内存&#xff1f; 如何分配堆外内存&#xff1f; 如何回收堆外内存&#xff1f; 1) System.gc()…

C语言函数章--第二弹(让冤种室友用你的函数,但不给他看函数源码)

前言 &#x1f496;作者&#xff1a;龟龟不断向前 ✨简介&#xff1a;宁愿做一只不停跑的慢乌龟&#xff0c;也不想当一只三分钟热度的兔子。 &#x1f47b;专栏&#xff1a;C初阶知识点 &#x1f47b;工具分享&#xff1a; 刷题&#xff1a; 牛客网 leetcode笔记软件&#xff…

Error注入攻击

&#x1f4aa;&#x1f4aa;Error注入攻击1.创建漏洞环境2.漏洞攻击2.1判断是否有注入2.2信息收集2.3注入获取数据库名2.4注入获取表名2.5注入获取列名2.6注入获取信息3.sql靶场实战1.创建漏洞环境 &#x1f4aa;&#x1f4aa;第一步创建sql环境&#xff0c;直接再mysql下运行 …

Flutter——软件安装与环境配置

Flutter入门官网Flutter SDK下载创建Flutter项目在ios上运行第一个Flutter项目效果图代码总结官网 Flutter开发手册网址如下 Flutter SDK下载 下载地址 第一步&#xff1a;进入官网&#xff0c;选择自己相对应的系统 第二步&#xff1a;选择对应版本SDK并下载到本地 创建Flu…

electron调用dll文件

Electron 对系统层能力的使用可能比较弱&#xff0c;此时需要求助 Python、C、C# 等语言&#xff0c;通过 ffi-napi 库可以让 Node.js 使用 C dll&#xff0c;通过 electron-edge-js 库可以让 Node.js 使用 C# dll 1. 先确定dll文件是用什么语言写的. 使用peid 应用查看- 这个…

【Transformers】第 2 章:主题的实践介绍

&#x1f50e;大家好&#xff0c;我是Sonhhxg_柒&#xff0c;希望你看完之后&#xff0c;能对你有所帮助&#xff0c;不足请指正&#xff01;共同学习交流&#x1f50e; &#x1f4dd;个人主页&#xff0d;Sonhhxg_柒的博客_CSDN博客 &#x1f4c3; &#x1f381;欢迎各位→点赞…

Node.js | 基于 MongoDB 的简易用户管理系统

&#x1f5a5;️ NodeJS专栏&#xff1a;Node.js从入门到精通 &#x1f5a5;️ 博主的前端之路&#xff08;源创征文一等奖作品&#xff09;&#xff1a;前端之行&#xff0c;任重道远&#xff08;来自大三学长的万字自述&#xff09; &#x1f5a5;️ TypeScript知识总结&…

C++秋招经验贴

文章目录一、个人背景及秋招情况1.个人背景2.秋招情况二、求职C强相关开发岗位的准备过程以及一些建议1. 八股2. 力扣刷题3. 实习4. 项目三、总结一、个人背景及秋招情况 1.个人背景 本科&#xff1a;二本&#xff0c;材料专业   硕士&#xff1a;211硕&#xff0c;光学工程…

TI IWR1642毫米波雷达使用串口原始数据采集与分析

本文编辑&#xff1a;调皮哥的小助理 1.引言 如果文章能够给你带来价值&#xff0c;希望能够关注我。 如果文章能够让你学习到知识&#xff0c;希望你能够点个赞&#xff01; 好了下面开始今天的学习内容吧。 今天给大家分享的是 《TI 的IWR1642毫米波雷达使用串口原始数据…