随笔分类 - 微服务
摘要:@Configuration public class CorsConfig { @Bean public CorsWebFilter corsFilter() { CorsConfiguration config = new CorsConfiguration(); // cookie跨域 con
阅读全文
摘要:@GetMapping("/user/{id}")public User getUser(@PathVariable("id") Integer id) { User user = new User(); user.setId(id); Example<User> example = Example
阅读全文
摘要:这里使用的springboot2.2.2版本 没有报错发生也没有生成表 是yml的问题 下面有正确的yml 不需要 在启动类加 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoC
阅读全文
摘要:/** * @author wf.zhang */ @RestController public class HelloController { @Autowired JdbcTemplate jdbcTemplate; @GetMapping("/query") public Map<String
阅读全文
摘要:环境 idea2019.2 jdk1.8 数据库mysql 5.7 项目 结构 new ->Project 使用springboot快速搭建web项目 选好sdk next 填写项目信息 next 点Web-->勾选 Spring Web 点SQL->勾选 JDBC API 和 MySQL Driv
阅读全文
摘要:项目结构 pom文件 本项目使用的SpringBoot 1.5.9版本 需要更高的版本直接替换版本号即可 父项目中的版本号可以管理整个项目 下面的web的版本号可以省略 <parent> <groupId>org.springframework.boot</groupId> <artifactId>
阅读全文

浙公网安备 33010602011771号