李森的博客
首页 归档 留言 友链 广告合作 壁纸
更多
美女主播
1 博瑞GE车机升级/降级 5,610 阅读 2 Mac打印机设置黑白打印 4,952 阅读 3 修改elementUI中el-table树形结构图标 4,896 阅读 4 Mac客户端添加腾讯企业邮箱方法 4,675 阅读 5 intelliJ Idea 2022.2.X破解 4,358 阅读
后端开发 HarmonyOS Next Web前端 微信开发 开发辅助 App开发 数据库 随笔日记
登录 / 注册
标签搜索
  • Spring Boot
  • Java
  • Vue
  • Spring Cloud
  • Mac
  • MyBatis
  • WordPress
  • MacOS
  • asp.net
  • Element UI
  • Nacos
  • .Net
  • Spring Cloud Alibaba
  • MySQL
  • Mybatis-Plus
  • Typecho
  • jQuery
  • Java Script
  • IntelliJ IDEA
  • 微信小程序
侧边栏壁纸
博主昵称
Laughing

  • 累计撰写 627 篇文章
  • 累计收到 1,421 条评论
  • 首页
  • 栏目
    • 后端开发
    • HarmonyOS Next
    • Web前端
    • 微信开发
    • 开发辅助
    • App开发
    • 数据库
    • 随笔日记
  • 页面
    • 归档
    • 留言
    • 友链
    • 广告合作
    • 壁纸
    • 美女主播
搜索到 1 篇与 的结果
  • SpringBoot 使用Gson 2021-06-06
    SpringBoot 使用Gson 添加依赖需要排除web自带的jackson<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> </dependency>增加配置文件@Configuration public class GsonConfig { @Bean @ConditionalOnMissingBean public GsonHttpMessageConverter gsonHttpMessageConverter() { GsonHttpMessageConverter gsonHttpMessageConverter = new GsonHttpMessageConverter(); gsonHttpMessageConverter.setDefaultCharset(StandardCharsets.UTF_8); GsonBuilder gsonBuilder = new GsonBuilder(); //设置日期格式 gsonBuilder.setDateFormat("yyyy-MM-dd"); //设置忽略的字段 gsonBuilder.excludeFieldsWithModifiers(Modifier.PROTECTED); Gson gson = gsonBuilder.create(); gsonHttpMessageConverter.setGson(gson); return gsonHttpMessageConverter; } }增加测试类@Data public class Person { protected Integer age; private String name; private Date birthday; }测试 @GetMapping("test") public Person test() { Person person = new Person(); person.setAge(30); person.setBirthday(new Date()); person.setName("张三"); return person; }
    • 2021年06月06日
    • 1,148 阅读
    • 0 评论
    • 0 点赞
博主栏壁纸
博主头像 Laughing

627 文章数
1,421 评论量
  • Sublime Text插件安装方法
  • 使用Linq判断DataTable数据是否重复
  • 火狐浏览器不支持click、focusin、focusout方法
人生倒计时
那年今日
  • 2018/05/24 ngrok服务器搭建
热门文章
  1. 1 博瑞GE车机升级/降级
    博瑞GE车机升级/降级
    5610 阅读 - 08/12
  2. 2 Mac打印机设置黑白打印
    Mac打印机设置黑白打印
    4952 阅读 - 05/16
  3. 3 修改elementUI中el-table树形结构图标
    修改elementUI中el-table树形结构图标
    4896 阅读 - 05/19
最新回复
  • lawbridge
    lawbridge
    2025-04-26
    为何更新文章后自动翻译功能不起作用(更新前已经自动翻译为英文)?
  • 丢塔游戏网
    丢塔游戏网
    2025-04-18
    我在官网下载了一个win7的,安装上就是没有网卡驱动,曹丹啊
  • 金镶玉
    金镶玉
    2025-03-17
    学习了
  • 1
    1
    2025-02-25
    牛逼
  • WanLum
    WanLum
    2025-02-14
    so beautiful....
| | | |
又拍云CDN 站点地图