技术栈

springboot接收时间类型参数的方式

各位别卷了2024-08-30 5:07

参数直接跟在url上面用@DateTimeFormat接收

参数写在实体类中 用@JsonFormat接收

注意: pattern 中的表达式要和接受的数据类型格式一致。不然会报错。例如表达式是 yyyy-MM-dd 就只能匹配LocalDate ,不能用 LocalDateTime去接收。即使LocalDateTime是更细化的时间类型。

上一篇:flutter 手写时钟
下一篇:【Zookeeper】Windows下安装Zookeeper(全面)
相关推荐
2601_94981772
1 天前
Spring Boot3.3.X整合Mybatis-Plus
spring boot·后端·mybatis
uNke DEPH
1 天前
Spring Boot的项目结构
java·spring boot·后端
zhenxin0122
1 天前
Spring Boot 3.x 系列【3】Spring Initializr快速创建Spring Boot项目
spring boot·后端·spring
zhenxin0122
1 天前
【wiki知识库】07.用户管理后端SpringBoot部分
spring boot·后端·状态模式
SeSs IZED
1 天前
SSM与Springboot是什么关系? -----区别与联系
java·spring boot·后端
勿忘,瞬间
1 天前
SpringBoot配置文件
java·spring boot·后端
2601_94981449
1 天前
Spring Boot中使用Server-Sent Events (SSE) 实现实时数据推送教程
java·spring boot·后端
wellc
1 天前
SpringBoot集成Flowable
java·spring boot·后端
tongxh423
1 天前
Spring Boot 3.X:Unable to connect to Redis错误记录
spring boot·redis·后端
hERS EOUS
1 天前
Spring Boot + Spring AI快速体验
人工智能·spring boot·spring
热门推荐
012026年4月技术前沿:AI大模型爆发、智能体革命与量子安全新纪元02GitHub 镜像站点032026年4月AI大事件深度解读:大模型竞争进入“深水区“04近期有什么ai的新消息,新动态? 2026.4月052026 年 AI 编程助手全面对比评测:Cursor vs Copilot vs Claude Code vs GitHub Copilot Free06codex app每次打开重连5次Reconnecting问题解决07AI Weekly | 2026年4月第二周 · GitHub热门项目与AI发展趋势深度解析08CC-Switch & Claude 基于 Linux 服务器安装使用指南09从限购到畅通:GLM-5.1 Coding Plan接入攻略10LLM Wiki:让大模型替你打理知识库的完整指南