随笔分类 - SpringBoot
摘要:如果在工作中经常需要调用 WebService 接口,可以使用 Apache CXF 工具进行代码的生成,可以极大简化编码时间。这里将描述如何使用该工具,以及在调用 WebService 中遇到的一些问题和这些问题的解决方法。 基本操作 一、下载 Apache CXF :https://cxf.ap
阅读全文
摘要:源码:https://gitee.com/antia11/excel-data-import-demo 背景:客户需要每周会将上传一个 Excel 数据文件,数据量单次为 20W 以上,作为其他模块和报表的基础数据。 客户需求分析: 数据量为 20W 条左右。 数据需要去重。 等待时间不能太长。 文
阅读全文
摘要:SpringBoot文件上传 1.单文件上传 FileUploadController.java package com.zhuantai.fileupload.controller; import org.springframework.web.bind.annotation.PostMappin
阅读全文
摘要:SpringBoot 自定义异常处理 1.自定义异常数据 HelloController.java package com.zhuantai.exception.controller; import org.springframework.web.bind.annotation.GetMapping
阅读全文
摘要:SpringBoot 三种跨域方式梳理 概念: 域 :协议 + 域名 / IP + 端口 1.跨域现象 首先制造一个跨域的问题: cros01/HelloController.java - localhost:8080 package com.zhuantai.cors01.controller
阅读全文
摘要:SpringBoot 配置拦截器 用途: 日志记录 权限检查 性能监控 直接上代码: MyInterceptor.java package com.zhuantai.interceptor; import org.springframework.web.servlet.HandlerIntercep
阅读全文
摘要:SpringBoot 动态切换数据源 概述:利用上次搭建的MySQL主从复制来实验动态切换数据源。用master来写,用slave用来读。 GITHUB:https://github.com/baomidou/dynamic-datasource-spring-boot-starter 1.搭建一个
阅读全文
摘要:CommandLineRunner 系统启动任务 1.CommandLineRunner MyCommandLineRunner.java package com.zhuantai.commandlinerunner; import org.springframework.boot.CommandL
阅读全文
摘要:SpringBoot @ControllerAdvice的三种使用场景 1.概述 @ControllerAdvice 有三个方面的功能: 全局异常处理 全局数据绑定 全局数据预处理 2.全局异常处理 (一)返回字符串 MyGlobalException.java package com.zhuant
阅读全文
摘要:SpringSecurity 动态配置权限 gitee源码:https://gitee.com/antia11/spring-security-demos/tree/master/security-dynamic 1.搭建一个简单 SpringSecurity 环境 secruity.sql /*
阅读全文
摘要:引入SpringSecurity对已有项目进行权限控制 1.引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </de
阅读全文
摘要:如何优化网站性能 1.本地缓存 Caffeine <dependency> <groupId>com.github.ben-manes.caffeine</groupId> <artifactId>caffeine</artifactId> <version>2.7.0</version> </de
阅读全文
摘要:人力资源管理系统 一、登录细节整理 前端 Login.vue <template> <div> <el-form :rules="rules" ref="loginForm" :model="loginForm" class="loginContainer"> <h3 class="loginTit
阅读全文
摘要:Community论坛项目 此项目代码已上传至 Gitee:https://gitee.com/antia11/fake_nowcoder 1. 环境与架构 1.1 项目整体架构图 1.2 技术环境 开发框架:SpringBoot2.3.x 整合 SpringMVC + Mybatis 版本控制:M
阅读全文
摘要:Kafka学习笔记 一、Windows下配置kafka环境 1.下载 https://www.apache.org/dyn/closer.cgi?path=/kafka/2.8.0/kafka_2.12-2.8.0.tgz 如果在windows下kafka出现问题,将kafka目录中的kafka-l
阅读全文
摘要:Elasticsearch学习笔记 1.Elasticsearch术语 <6.0 Elasticsearch MySQL 索引 DB 类型 TABLE 文档 ROW 字段 CLOUMN 6.0> Elasticsearch MySQL 索引 TABLE 类型(废弃) _doc 文档 ROW 字段 C
阅读全文
摘要:Quartz分布式定时任务执行和调度 0.创建数据库表 # # In your Quartz properties file, you'll need to set # org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjob
阅读全文
摘要:1.敏感词过滤工具类 SensitiveFilter.java /** * 敏感词过滤工具类 * @Author: ANTIA1 * @Date: 2021/2/13 14:43 */ @Component public class SensitiveFilter { private static
阅读全文
摘要:本笔记整理自 B站UP主 狂神说:https://www.bilibili.com/video/BV1PE411i7CV 相关代码:https://gitee.com/antia11/MyStudy/tree/master/Java/SpringBoot-Study 1、SpringBoot简介 1
阅读全文

浙公网安备 33010602011771号