![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
丨404 NotFound
世上本没有路, 有了腿也便有了路.
展开
-
手把手教你实现Java微信JSAPI支付
需求想在微信浏览器里面实现微信支付. 查看微信支付文档, 发现要用微信JSAPI公众号支付, 微信H5支付是不能实现的.自己在实现的时候踩了许多坑, 花费了很多时间. 特此记录, 希望能帮助到看到该文章的开发者.开发环境后端SpringBoot, 前端VUE准备工作1.首先我们要在微信公众号平台和微信商户平台 注册账号2.准备JSAPI支付, 和调用微信统一下单的时候, 所需要的信息.appid: 这个appid是公众号的appId.重要的一步. 这里appid如果想使用, 必需要在微信原创 2021-06-23 17:40:14 · 2531 阅读 · 4 评论 -
RedisException: java.io.IOException: Connection reset by peer
SpringBoot + redis. 程序隔一段时间会莫名其妙的报Redis的错误. 报错如下:org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: java.io.IOException: Connection reset by peer...原创 2021-06-22 14:24:24 · 6874 阅读 · 0 评论 -
@validated 自定义校验注解
需求在使用validated校验的时候, 大部分需求是可以满足的. 但是某一些场景是不能实现的, 比如对状态的校验: status: 1或者2. 所以需要我们自定义注解.废话不多说, 直接上代码实现 (其它校验方式, 同理)代码实现自定义注解/** * 使用方式: * @IncludeValid(value = {"0","1"}, message = "状态值必须为0,1") * private Integer status * * @ Description : 校验值是否为指定原创 2021-02-26 10:20:05 · 1935 阅读 · 1 评论 -
HttpServletRequest修改header值
默认HttpServletRequest是没有修改Header值得方法, 不过我们可以自定义类继承HttpServletRequestWrapper具体代码如下:import lombok.extern.slf4j.Slf4j;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletRequestWrapper;import java.util.*;@Slf4jpublic cla原创 2021-01-28 18:21:16 · 3754 阅读 · 3 评论 -
LocalDateTime 格式化显示问题
问题:在使用LocalDateTime 的时候, 获取到的时间格式事一个json串, 这样不利于前端对接. 接口数据格式如下:{略..."name":"zhangsan""createTime": { "month": "DECEMBER", "year": 2020, "dayOfMonth": 24, "hour": 15, "minute": 5, "monthValue": 12, "nano": 0, "second": 1原创 2021-01-28 18:19:56 · 623 阅读 · 0 评论 -
objectMapper.convertValue() 报错
报错信息如下:com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of java.time.LocalDateTime (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)at [So原创 2020-11-24 18:20:44 · 1538 阅读 · 0 评论