摘要: 项目结构 一、准备数据 创建数据库并创建表 二、在domain下新建City类 package com.uos.springboot.domain; import java.io.Serializable; /** * 城市实体类 */ public class City implements Se 阅读全文
posted @ 2019-12-17 11:31 红尘年少 阅读(1113) 评论(0) 推荐(0) 编辑
摘要: 发送纯文本邮件 一、在pom.xml中添加邮件服务的依赖启动器 <!--邮件服务依赖启动器--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifa 阅读全文
posted @ 2019-12-16 11:18 红尘年少 阅读(668) 评论(0) 推荐(1) 编辑
摘要: 一、添加ScheduledTaskService服务类 package com.uos.schedule.service; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.s 阅读全文
posted @ 2019-12-16 09:43 红尘年少 阅读(1410) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/my-program-life/p/12047396.html Spring Boot任务管理之无返回值异步任务调用 一、在OwnAsynService基础上添加 package com.uos.schedule.service; import org 阅读全文
posted @ 2019-12-16 09:28 红尘年少 阅读(579) 评论(1) 推荐(0) 编辑
摘要: 一、service层 package com.uos.schedule.service; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; /* 阅读全文
posted @ 2019-12-16 09:16 红尘年少 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 项目结构 一、创建Spring Boot项目,引入Thymeleaf依赖 二、编写配置文件application.properties # thymeleaf页面缓存设置(默认为true),开发中方便调试应设置为false,上线稳定后应保持默认true spring.thymeleaf.cache= 阅读全文
posted @ 2019-12-15 10:31 红尘年少 阅读(601) 评论(0) 推荐(0) 编辑
摘要: 项目结构 一、添加Spring Data JPA依赖启动器 另外,添加MySQL数据库依赖 <!--spring data jpa依赖启动器--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring- 阅读全文
posted @ 2019-12-13 11:13 红尘年少 阅读(297) 评论(2) 推荐(0) 编辑
摘要: 一、maven下载 地址 http://maven.apache.org/download.cgi 下载后解压到相应的路径 二、环境变量配置 此电脑→属性→高级系统设置→环境变量→系统变量→新建 MAVEN_HOME 在Path环境变量下添加%MAVEN_HOME%\bin 查看maven的版本,到 阅读全文
posted @ 2019-12-12 21:44 红尘年少 阅读(32337) 评论(0) 推荐(1) 编辑
摘要: 项目结构 一、添加Redis依赖 <!--redis依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <vers 阅读全文
posted @ 2019-12-12 16:52 红尘年少 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-12-12 14:15 红尘年少 阅读(697) 评论(0) 推荐(0) 编辑