摘要: PostMan传参问题 传参给后端为Integer[] ids 实际场景:批量删除 传参方式: 阅读全文
posted @ 2021-10-11 00:23 acchris 阅读(86) 评论(0) 推荐(0)
摘要: 项目FAQ 做项目时出现的前后端问题如下。 1. SpringBoot 整合 Shiro 时出现错误 问题描述:进入登录页面时,未输入账号密码却报错,在我输入账号密码后,重启服务器后出现,如图: 解决方案:GetMapping("login")是接受页面请求的,此时返回登录界面;PostMappin 阅读全文
posted @ 2021-09-26 11:10 acchris 阅读(60) 评论(0) 推荐(0)
摘要: SpringBoot 开启热部署 热部署可以在保存后自动更新视图页面。 原本修改完项目 html,需要保存再重启,热部署节约了时间,加快了开发效率,避免无意义的时间消耗。 导入步骤 导入依赖到 pom.xml: <!-- SpringBoot工程实现热部署 --> <dependency> <gro 阅读全文
posted @ 2021-09-25 23:01 acchris 阅读(106) 评论(0) 推荐(0)
摘要: Spring 自动注入机制 ☀️ @Autowired (常用,最佳方式) 会根据注入的变量名字来寻找合适的 Bean。 ⭐ @Qualifier 用于解决注入冲突的,如下例子: @Component public class FooExample implenments Example(){ pu 阅读全文
posted @ 2021-09-25 14:53 acchris 阅读(173) 评论(0) 推荐(0)
摘要: Mybatis-plus 常见CURD select 如 实体类 User,映射类为 userMapper。 查询一行:selectOne(queryWrapper) 查询多行:selectList(null)、selectObjs() 查询数量:selectCount(queryWrapper) 阅读全文
posted @ 2021-09-24 23:40 acchris 阅读(122) 评论(0) 推荐(0)
摘要: 输出一个集合 List<Integer> list = Arrays.asList("AA", "BB"); 直接输出 for (int i = 0; i < list.size(); ++i){ System.out.println(list.get(i)); } foreach遍历输出 for 阅读全文
posted @ 2021-09-24 23:33 acchris 阅读(31) 评论(0) 推荐(0)
摘要: Mybatis-Plus 简介 Mybatis-plus 是为了简化开发效率而生。 整合 1. 新建一个SpringBoot项目 2. 导入其依赖(为简化开发,引入lombok 和 mysql 依赖) <!-- Mybati-Plus 依赖 --> <dependency> <groupId>com 阅读全文
posted @ 2021-09-24 20:48 acchris 阅读(78) 评论(0) 推荐(0)
摘要: 在数据库配置spring.datasource.url 后加上 serverTimezone=Asia/Shanghai即可 阅读全文
posted @ 2021-09-23 16:32 acchris 阅读(209) 评论(0) 推荐(0)
摘要: A 5838.检查字符串是否为数组前缀 问题描述: 给定字符串 s 和 字符串数组 word,请你检查 word 的前 k 个拼接字符串是否为 s。 解题: 先判断 word 头字符串的头个字符是否与 s 的头个字符相等,若不等则直接返回false。 用StringBuffer ans 拼接 wor 阅读全文
posted @ 2021-08-08 12:58 acchris 阅读(16) 评论(0) 推荐(0)
摘要: 原题 797. 所有可能的路径 问题 最后 ans.add(path),但是此时传的是引用,path后面还会remove(),所以要复制一个path。 dfs(...){ if (...){ ans.add(new ArrayList<>(path))// 错误答案ans.add(path); re 阅读全文
posted @ 2021-07-27 22:47 acchris 阅读(22) 评论(0) 推荐(0)