This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class WebConfig extends WebMvcConfigurationSupport { | |
@Override | |
public void configureMessageConverters(List> converters) { | |
final Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder(); | |
final MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); | |
final ObjectMapper objectMapper = new ObjectMapper(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'org.springframework.boot' version '2.1.3.RELEASE' | |
id 'java' | |
id "io.spring.dependency-management" version "1.0.6.RELEASE" | |
} | |
dependencyManagement { | |
imports { | |
mavenBom "io.projectreactor:reactor-bom:Bismuth-RELEASE" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Mapper | |
public interface EmployeeMapper { | |
@Mappings({ | |
@Mapping(target="employeeId", source="entity.id"), | |
@Mapping(target="employeeName", source="entity.name"), | |
@Mapping(target = "employeeStartDt", source = "entity.startDt", dateFormat = "dd-MM-yyyy HH:mm:ss") | |
}) | |
EmployeeDto employeeToEmployeeDTO(Employee entity); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Profile("dev") | |
@Bean("theConfiguredDate") | |
public Instant theConfiguredFixedDate(){ | |
return Instant.ofEpochMilli(1527854742); | |
} | |
@Profile("!dev") | |
@Bean | |
public Instant theConfiguredDate(){ | |
return Instant.now(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<T> aa; | |
List<T> filterAa(List<T> arr, aaPredicate p){ | |
for(){ | |
if(p.test(aa)){ | |
result.add(app); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class SecurityConfig extends WebSecurityConfigurerAdapter { | |
@Override protected void configure(HttpSecurity http) throws Exception { | |
http.httpBasic().and() | |
.authorizeRequests() | |
.requestMatchers(EndpointRequest.to("info", "health")).permitAll() | |
.requestMatchers(EndpointRequest.toAnyEndpoint()).hasRole("SYSTEM") | |
.antMatchers("/**").hasRole("USER"); } | |
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HeaderMapArgumentResolver implements HandlerMethodArgumentResolver{ | |
@Override | |
public boolean supportsParameter(MethodParameter parameter) { | |
return parameter.getParameterType() == HeaderInfo.class; | |
} | |
@Override | |
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, | |
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String ar[]){ | |
String serializeString = "😂\uD83D\uDE4F😁제목😁\uD83D\uDE35\uD83D\uDE01"; | |
System.out.println("init" + serializeString); | |
String ret = serializeString.replaceAll("[\\uD83C-\\uDBFF\\uDC00-\\uDFFF]", ""); | |
System.out.println("ret" + ret); | |
System.out.println(System.getProperty("java.io.tmpdir")); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_jquery.default.ajax({ | |
url: url, | |
xhrFields: { | |
withCredentials: true | |
}, | |
complete: function complete(response) { | |
if (cb) { | |
cb(JSON.parse(response.responseText)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
repositories { | |
mavenCentral() | |
maven { | |
url 'http://xuggle.googlecode.com/svn/trunk/repo/share/java/' | |
} | |
} | |
dependencies { |
NewerOlder