会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
市丸银
知行合一
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
7
8
9
10
11
12
13
14
15
···
98
下一页
2025年5月14日
springboot 配置 时间格式和时区
摘要: 一、时间 1、注解(推荐) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date appointmentTime; 2、yaml spring: jackson: date-format: yyyy-MM-dd HH:mm:ss 二、时区
阅读全文
posted @ 2025-05-14 19:24 市丸银
阅读(158)
评论(0)
推荐(0)
2025年5月13日
springboot 返回 code
摘要: 1、创建result文件夹 2、创建ResultCodeEnum枚举 package com.wt.lease.common.result; import lombok.Getter; /** * 统一返回结果状态信息类 */ @Getter public enum ResultCodeEnum {
阅读全文
posted @ 2025-05-13 11:44 市丸银
阅读(61)
评论(0)
推荐(0)
2025年5月12日
springboot 属性 复制 A包含B的key,B的值赋值给A
摘要: BeanUtils.copyProperties(B, A)
阅读全文
posted @ 2025-05-12 21:20 市丸银
阅读(49)
评论(0)
推荐(0)
springboot 文件上传 使用 MultipartFile
摘要: @Autowired private FileService service; @Operation(summary = "上传文件") @PostMapping("upload") public Result<String> upload(@RequestParam MultipartFile f
阅读全文
posted @ 2025-05-12 10:23 市丸银
阅读(41)
评论(0)
推荐(0)
2025年5月11日
springboot 配置全局异常 处理
摘要: 一、依赖(基于springmvc) <!--spring-web--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </depend
阅读全文
posted @ 2025-05-11 23:17 市丸银
阅读(135)
评论(0)
推荐(0)
springboot 配置minio 保存图片
摘要: 一、注入依赖 <dependency> <groupId>io.minio</groupId> <artifactId>minio</artifactId> <version>8.5.17</version> </dependency> 二、创建配置类(配合yaml注入) package com.w
阅读全文
posted @ 2025-05-11 23:09 市丸银
阅读(67)
评论(0)
推荐(1)
springboot 配置文件注入 yaml 注入值
摘要: 一、yaml文件 minio: endpoint: http://<hostname>:<port> access-key: <access-key> secret-key: <secret-key> bucket-name: <bucket-name> 二、实体类(接收yaml注入值) packa
阅读全文
posted @ 2025-05-11 23:03 市丸银
阅读(76)
评论(0)
推荐(0)
2025年5月10日
springboot 枚举类的转换(converter)
摘要: 一、过程 1、前端传入:interage自动转换String类型 2、数据库枚存储举类对应的类型:tinyint 3、流程 请求: 前端传入string类型(code) -> 在controller层接收,转换成枚举类型 -> 转换成数据库类 响应:数据库tinyint -> 枚举类型 -> 前端的
阅读全文
posted @ 2025-05-10 16:46 市丸银
阅读(261)
评论(0)
推荐(0)
springboot 逻辑删除、创建时间、更新时间实现 返回值 忽略 逻辑删除字段、创建时间字段和更新时间字段 不同时区(越南)
摘要: 注意:创建实体类 父类 BaseEntity @Data public class BaseEntity implements Serializable { @Schema(description = "主键") @TableId(value = "id", type = IdType.AUTO)
阅读全文
posted @ 2025-05-10 15:56 市丸银
阅读(163)
评论(0)
推荐(0)
2025年5月8日
springboot3.4.5 配置Knife4j 官方推荐使用
摘要: 网址: http://localhost:8080/doc.html#/home 一、注入依赖 <!-- SpringDoc OpenAPI UI --> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-open
阅读全文
posted @ 2025-05-08 20:28 市丸银
阅读(836)
评论(0)
推荐(0)
上一页
1
···
7
8
9
10
11
12
13
14
15
···
98
下一页
公告