上一页 1 ··· 46 47 48 49 50 51 52 53 54 ··· 68 下一页
摘要: ⒈处理用户信息获取逻辑 用户信息的获取逻辑是被SpringSecurity封装到UserDetailsService接口里面的 因为SpringSecurity5以后的版本密码默认是加密的,所以我想你需要声明一下。 ⒉处理用户检验逻辑 ⒊处理用户密码加密解密 阅读全文
posted @ 2019-03-28 18:22 SpringCore 阅读(903) 评论(0) 推荐(0)
摘要: ⒈下载WireMock独立运行程序 http://wiremock.org/docs/running-standalone/ ⒉运行 ⒊项目中导入WireMock依赖 ⒋添加模拟请求映射 阅读全文
posted @ 2019-03-28 12:25 SpringCore 阅读(1506) 评论(0) 推荐(0)
摘要: ⒈添加pom依赖 ⒉在主程序启动类上添加@EnableSwagger2注解 ⒊对系统的资源进行说明 1.控制器 2.实体类 3.Action方法 4.Action方法参数 ⒋访问http://localhost:8080/swagger-ui.html 阅读全文
posted @ 2019-03-28 11:14 SpringCore 阅读(987) 评论(0) 推荐(0)
摘要: ⒈使用Runnable异步处理Rest服务 Runnable的这种形式并不能满足所有的应用场景,使用Runnable异步处理的时候,副线程必须是由主线程调起的,在实际开发的过程中,有些场景是非常复杂的。 例如,如下场景: 我们可以使用DeferredResult来解决上面复杂的场景 ⒉使用Defer 阅读全文
posted @ 2019-03-28 09:36 SpringCore 阅读(396) 评论(0) 推荐(0)
摘要: ⒈文件实体类 ⒉控制器代码 ⒊测试 阅读全文
posted @ 2019-03-27 21:32 SpringCore 阅读(2571) 评论(0) 推荐(0)
摘要: ⒈使用Filter(过滤器) 当然,如果是你自己写的Filter一般都会这样,别人的Filter就没有办法使用@Component注解了,那么你可以使用Web.xml,当然SpringBoot没有这个,可以使用SpringBoot独有的方式。 遗憾的是,Filter是Servlet提供的,Sprin 阅读全文
posted @ 2019-03-27 18:22 SpringCore 阅读(643) 评论(0) 推荐(0)
摘要: ⒈编写校验逻辑类 ⒉自定义校验注解并使用校验逻辑类 ⒊使用(略) 阅读全文
posted @ 2019-03-26 22:50 SpringCore 阅读(1307) 评论(0) 推荐(0)
摘要: 1 /** 2 * 添加用户,使用@RequestBody将请求体映射到Action方法参数中 3 * 使用@Valid注解验证请求参数的合法性 4 * 使用BindingResult处理校验结果 5 * @param user 6 * @param result 7 * @return 8 */ 9... 阅读全文
posted @ 2019-03-26 19:58 SpringCore 阅读(666) 评论(0) 推荐(0)
摘要: 建议使用时间戳来避免日期格式带来的前后端问题,使用时间戳可以避免前后端、平台等问题。 阅读全文
posted @ 2019-03-26 18:49 SpringCore 阅读(398) 评论(0) 推荐(0)
摘要: 1 @PostMapping("/user") 2 public User create(@RequestBody User user){ 3 System.out.println(user.toString()); 4 user.setId(5l); 5 return user; 6 } 1 @Test 2 ... 阅读全文
posted @ 2019-03-26 14:44 SpringCore 阅读(1041) 评论(0) 推荐(0)
上一页 1 ··· 46 47 48 49 50 51 52 53 54 ··· 68 下一页