Skip to content

Instantly share code, notes, and snippets.

View arahansa's full-sized avatar

arahansa arahansa

  • Seoul, South Korea
View GitHub Profile
@arahansa
arahansa / moneygenerator.html
Created November 29, 2015 18:07
돈 검증
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8" />
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
</head>
<body>
@arahansa
arahansa / build.gradle
Created December 31, 2015 16:42
스프링 rest docs 를 위한 그래들 파일
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE'
}
}
@arahansa
arahansa / build.gradle
Created December 31, 2015 17:06
restDocs 추가
dependencies {
testCompile "org.springframework.restdocs:spring-restdocs-mockmvc:$springRestdocsVersion"
}
plugins {
id "org.asciidoctor.convert" version "1.5.2"
}
ext {
snippetsDir = file('build/generated-snippets')

댓글달기 [post]

댓글 생성하는데 사용 합니다.

/comment [POST]

POST 요청은 댓글을 생성하는 것을 보여줍니다.

@Aspect
public class LucyAspect4BoardArticle{
private static final Logger LOGGER = LoggerFactory.getLogger(LucyAspect4BoardArticle.class);
//TODO 이 부분은 좀 더 세련되게 바꿔야한다.
//@Pointcut("execution(* com.example.service.BoardArticleService.create(..))")
private void profileTarget() {
LOGGER.debug("컨트롤러 프로필 설정");
}
@arahansa
arahansa / Korean3byte.java
Created March 2, 2016 01:52
한글 3바이트 처리하는 자바처리
@Test
public void koreanCheck2() throws Exception {
String msg ="일이>삼사오육칠팔구십";
byte[] test = msg.getBytes("UTF-8");
System.out.println("총길이 :"+test.length);
int lastPosition = 0;
for(int i=0;i<20;i++){
int iChar = (int) test[i];
if ((iChar > 127) || (iChar < 0)) {
// 한글의 경우(2byte 통과처리)
@Test
public void beanRegistryTest() throws Exception{
log.info("beanRegistryTest");
BeanDefinitionRegistry bdr = new DefaultListableBeanFactory();
Properties p = new Properties();
p.setProperty("kerry.class", "org.springframework.beans.TestBean");
p.setProperty("kerry.age", "35");
(new PropertiesBeanDefinitionReader(bdr)).registerBeanDefinitions(p);
final BeanDefinition kerry = bdr.getBeanDefinition("kerry");
log.info("Kerry : {} ", kerry);
@arahansa
arahansa / ArticlePageInfo.java
Last active May 11, 2016 17:04
예전에 잠깐 쓰던 페이지 도우미 4 JPA
package com.example.domain;
import java.util.Arrays;
import java.util.List;
import org.springframework.data.domain.Page;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@arahansa
arahansa / DTO.java
Last active July 26, 2016 19:38
커스텀 밸리데이션
@PasswordsNotEqual(
passwordFieldName = "password",
passwordVerificationFieldName = "passwordVerification"
)
@Bean
/*@Profile({"default", "test"})*/
public MessageSource messageSource() {
return messageSourcePrivate(seconds);
}
private ResourceBundleMessageSource messageSourcePrivate(int seconds){
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
messageSource.setBasenames("i18n/messages", "i18n/category" , "i18n/main", "i18n/intro", "i18n/customer");