mirror of
				https://github.com/vran-dev/databasir.git
				synced 2025-11-04 16:26:10 +08:00 
			
		
		
		
	Merge pull request #13 from vran-dev/feature/vran
feature: update time pattern
This commit is contained in:
		@@ -1,10 +1,16 @@
 | 
				
			|||||||
package com.databasir.api.config;
 | 
					package com.databasir.api.config;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
 | 
				
			||||||
 | 
					import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
 | 
				
			||||||
 | 
					import org.springframework.context.annotation.Bean;
 | 
				
			||||||
import org.springframework.context.annotation.Configuration;
 | 
					import org.springframework.context.annotation.Configuration;
 | 
				
			||||||
import org.springframework.data.web.config.EnableSpringDataWebSupport;
 | 
					import org.springframework.data.web.config.EnableSpringDataWebSupport;
 | 
				
			||||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
 | 
					import org.springframework.web.servlet.config.annotation.CorsRegistry;
 | 
				
			||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 | 
					import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.time.format.DateTimeFormatter;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Configuration
 | 
					@Configuration
 | 
				
			||||||
@EnableSpringDataWebSupport
 | 
					@EnableSpringDataWebSupport
 | 
				
			||||||
public class WebConfig extends WebMvcConfigurerAdapter {
 | 
					public class WebConfig extends WebMvcConfigurerAdapter {
 | 
				
			||||||
@@ -15,4 +21,14 @@ public class WebConfig extends WebMvcConfigurerAdapter {
 | 
				
			|||||||
                .allowedOrigins("*")
 | 
					                .allowedOrigins("*")
 | 
				
			||||||
                .allowedMethods("GET", "POST", "DELETE", "PATCH", "PUT");
 | 
					                .allowedMethods("GET", "POST", "DELETE", "PATCH", "PUT");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Bean
 | 
				
			||||||
 | 
					    public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
 | 
				
			||||||
 | 
					        final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
 | 
				
			||||||
 | 
					        return builder -> {
 | 
				
			||||||
 | 
					            builder.simpleDateFormat(dateTimeFormat);
 | 
				
			||||||
 | 
					            builder.serializers(new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(dateTimeFormat)));
 | 
				
			||||||
 | 
					            builder.deserializers(new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(dateTimeFormat)));
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1 +1 @@
 | 
				
			|||||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir-frontend</title><link href="/css/chunk-04ac1c26.a5cbc9e6.css" rel="prefetch"><link href="/css/chunk-7e394785.ab54ac4c.css" rel="prefetch"><link href="/css/chunk-7fa689fe.a79c1787.css" rel="prefetch"><link href="/css/chunk-edaa964e.a5b9f9ad.css" rel="prefetch"><link href="/js/chunk-04ac1c26.b03a6105.js" rel="prefetch"><link href="/js/chunk-2d0cc811.feb081c8.js" rel="prefetch"><link href="/js/chunk-48cebeac.b43a95b4.js" rel="prefetch"><link href="/js/chunk-7e394785.b93f6d8c.js" rel="prefetch"><link href="/js/chunk-7fa689fe.e971bfe1.js" rel="prefetch"><link href="/js/chunk-abb10c56.4c323350.js" rel="prefetch"><link href="/js/chunk-edaa964e.33c5721d.js" rel="prefetch"><link href="/js/chunk-fffb1b64.df1e960f.js" rel="prefetch"><link href="/css/app.df19208c.css" rel="preload" as="style"><link href="/css/chunk-vendors.d4aa889d.css" rel="preload" as="style"><link href="/js/app.88f6fdf6.js" rel="preload" as="script"><link href="/js/chunk-vendors.8b5336af.js" rel="preload" as="script"><link href="/css/chunk-vendors.d4aa889d.css" rel="stylesheet"><link href="/css/app.df19208c.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but databasir-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.8b5336af.js"></script><script src="/js/app.88f6fdf6.js"></script></body></html>
 | 
					<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir-frontend</title><link href="/css/chunk-04ac1c26.a5cbc9e6.css" rel="prefetch"><link href="/css/chunk-4fd080e4.a5b9f9ad.css" rel="prefetch"><link href="/css/chunk-7e394785.ab54ac4c.css" rel="prefetch"><link href="/css/chunk-7fa689fe.a79c1787.css" rel="prefetch"><link href="/js/chunk-04ac1c26.b03a6105.js" rel="prefetch"><link href="/js/chunk-2d0cc811.feb081c8.js" rel="prefetch"><link href="/js/chunk-48cebeac.b43a95b4.js" rel="prefetch"><link href="/js/chunk-4fd080e4.d40c8d0d.js" rel="prefetch"><link href="/js/chunk-7e394785.b93f6d8c.js" rel="prefetch"><link href="/js/chunk-7fa689fe.e971bfe1.js" rel="prefetch"><link href="/js/chunk-abb10c56.4c323350.js" rel="prefetch"><link href="/js/chunk-fffb1b64.df1e960f.js" rel="prefetch"><link href="/css/app.df19208c.css" rel="preload" as="style"><link href="/css/chunk-vendors.d4aa889d.css" rel="preload" as="style"><link href="/js/app.943c1753.js" rel="preload" as="script"><link href="/js/chunk-vendors.8b5336af.js" rel="preload" as="script"><link href="/css/chunk-vendors.d4aa889d.css" rel="stylesheet"><link href="/css/app.df19208c.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but databasir-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.8b5336af.js"></script><script src="/js/app.943c1753.js"></script></body></html>
 | 
				
			||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										1
									
								
								api/src/main/resources/static/js/app.943c1753.js.map
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								api/src/main/resources/static/js/app.943c1753.js.map
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user