当前位置:网站首页>0614~ holiday self study
0614~ holiday self study
2022-07-24 17:47:00 【Life is so hard】
The previous content reviewed today , Some details have been modified ;
matters needing attention :
1. Alibaba cloud uploads pictures , Front page does not show , The back-end path splicing is written one less / ;
2. Payment callback results are not displayed , The intranet penetration path has not been changed ;
3. To configure json Global time format , Import can be used ;
package cn.itsource.config.date;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.boot.jackson.JsonComponent;
import org.springframework.context.annotation.Bean;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.TimeZone;/**
* @description: Date and time global formatting
* @auth: wujiangbo
* @date: 2022-03-09 17:38
*/
@JsonComponent
public class LocalDateTimeSerializerConfig {@Value("${spring.jackson.date-format:yyyy-MM-dd HH:mm:ss}")
private String pattern;/**
* Date Type global time formatting
*/
@Bean
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilder() {
return builder -> {
TimeZone tz = TimeZone.getTimeZone("Asia/Shanghai");// Get time zone
DateFormat df = new SimpleDateFormat(pattern);// Set format template
df.setTimeZone(tz);
builder.failOnEmptyBeans(false)
.failOnUnknownProperties(false)
.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.dateFormat(df);
}; }/**
* LocalDate Type global time formatting
*/
@Bean
public LocalDateTimeSerializer localDateTimeDeserializer() {
return new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(pattern));
}@Bean
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
return builder -> builder.serializerByType(LocalDateTime.class, localDateTimeDeserializer());
}
}
4. The payment function is done again , Familiar with the process ;
边栏推荐
- com.mysql.cj.jdbc.exceptions. MySQLTransactionRollbackException: Deadlock found when trying to get lo
- hcip第四天笔记
- 0613~自习
- C语言实现静态版本的通讯录
- Definition and storage of adjacency table and adjacency storage of directed graph and undirected graph
- DF2NET三维模型部署
- Ipaylinks, a cross-border payment integration service, won the 3A Asia Award of treasury
- 邻接表的定义和存储以及有向图无向图的邻接存储
- C language custom type explanation - structure
- 0621~ES&Lucene
猜你喜欢

OpenCV 图片旋转

0625~<config>-<bus>

Tensorflow introductory tutorial (37) -- DC Vnet

Array learning navigation

700. Search DFS method in binary search tree

生信常用分析图形绘制02 -- 解锁火山图真谛!

干货|值得收藏的三款子域名收集工具

Wrote a few small pieces of code, broke the system, and was blasted by the boss

ROC and AUC details of the recommended system

Interview assault 66: what is the difference between request forwarding and request redirection?
随机推荐
0630~职业素养课
Openlayers: point aggregation effect
C language custom type explanation - Consortium
0701~放假总结
How to remove the top picture of the bubble skin article details of solo blog
Scept: consistent and strategy based trajectory prediction for planned scenarios
Use prometheus+grafana to monitor MySQL performance indicators
Quickly complete the unit test junit4 setting of intelij idea
C语言编程训练题目:左旋字符串中的k个字符、小乐乐与欧几里得、打印箭型图案、公务员面试、杨树矩阵
仅需一个依赖给Swagger换上新皮肤,既简单又炫酷!
Is it safe for qiniu to open an account?
Get the data of Tongcheng (elong) Hotel
还在用命令行看日志?快用Kibana吧,可视化日志分析YYDS!
ansible自动化运维详解(五)ansible中变量的设定使用、JINJA2模板的使用以及ansible的加密控制
hcip第四天笔记
wallys/IPQ8074A 4x4 2.4G 8x8 5G 802.11ax
es(1)
C语言中的字符与字符串库函数的使用以及模拟实现
Wallys/3 × 3/2 × 2 MIMO 802.11ac Mini PCIe Wi-Fi Module, Dual Band, 2,4GHz / 5GHz/QCN9074
How does win11 enhance the microphone? Win11 enhanced microphone settings