유용한 단축키 모음입니다. 계속해서 추가로 작성할 예정입니다.Eclipse메서드 참조 찾기 : Ctrl+Shitf+G미사용 메서드 삭제 : Ctrl+Shitf+O소스 정렬 : Ctrl+Shitf+F소스이동 : Alt+방향키 IntelliJ소스정렬 : Ctrl+Alt+L미사용 메서드 삭제 : Ctrl+Alt+O전체바꾸기 : Ctrl+Shift+R전체검색 : Ctrl+Shift+F메서드 참조 찾기 : Alt+F7소스이동 : Ctrl+Alt+방향키
Postman 을 사용하다보면 Body 에 주석을 달고 싶을때가 있습니다. 그럴땐 Pre-req 탭을 통해 아래 스크립트를 작성하면 됩니다.if (pm?.request?.body?.options?.raw?.language === 'json') { const rawData = pm.request.body.toString(); const strippedData = rawData.replace( /\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (m, g) => g ? "" : m ); pm.request.body.update(JSON.stringify(JSON.parse(strippedData)));} 아래처럼 reque..
Spring + Mybatis 사용 시, @Mapper를 사용해 Auto Commit을 한다면 1 row를 insert 할 때, 1번의 Transaction 이 발생하게 됩니다. 이는 DB의 과도한 Transaction을 발생시켜 문제를 야기하기도 합니다. 이를 해결하기 위해 1,000건씩 잘라 Update 하는 방법에 대해 간략히 알아보겠습니다. 1. SqlSessionFactory 주입@Autowiredprivate SqlSessionFactory sqlSessionFactory; 2. ExcutorType 작성SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); 3. 1000건씩 Batch Updateint cursor..
객체 지향(Object-Oriented Programming) 설계와 특징에 대해 기록한 페이지입니다.◆ SOLID 원칙 : 객체지행 프로그래밍의 5가지 설계 원칙1. 단일 책임 원칙(SRP, Single Responsibility Principle) -> 하나의 모듈은 하나의 책임을 가져야 한다는 원칙 2. 개방 폐쇄 원칙(OCP, Open Closed Principle) -> 확장은 열려있고, 수정은 닫혀있어야 한다는 원칙 3. 리스코프 치환 원칙(LSP, Liskov Substitution Principle) -> 하위 타입은 상위 타입을 대체할 수 있어야 한다는 원칙 4. 인터페이스 분리 원칙(ISP, Interface Segregation Principle) -> 용도에 맞는 ..
본인이 만들어둔 프로젝트를 Git 에 올리고 싶다면, 아래와 같은 순서로 입력하면 됩니다.git init --initial-branch=maingit remote add origin http://ip:port/경로/프로젝트.gitgit add .git commit -m "init"git push --set-upstream origin main 혹시 아래와 같은 오류가 발생한다면, Git 에선 관련기록이 없던 두 프로젝트를 병합할 때, 기본적으로 merge 를 거부하기 때문에 발생합니다.fatal: refusing to merge unrelated histories따라서 아래 명령어를 이용하여 병합 허용 설정을 해주어야 합니다.git pull origin main --allow-unrelated-his..
Tomcat 으로 웹 서버 구동 시, Controller 를 통하지 않고 resource 에 바로 접근 하는 방법이 있습니다. Tomcat 의 docBase 설정입니다. 설정 방법은 아래와 같습니다. 1. Tomcat 설치경로이동 -> server.xml -> Context 태그 추가 위 처럼 /image 로 URL 을 접근했다면 자동으로 /nas/image 경로의 파일 불러오는 설정입니다. 인터셉터 설정이 되어 있다면 해당 경로는 exclude 설정이 필요합니다. 2. 인터셉터 exclude 설정public class WebConfig implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry reg..
Enum 은 'Enumeration' 의 약자로 열거, 목록 이라는 뜻을 가지고 있습니다. Enum 을 사용하면 코드가 단순해지고 인스턴스의 생성과 상속을 방지하여 상수값의 안전성이 보장이 됩니다. 아래는 인증방식을 Enum 으로 구현한 소스입니다.@RequiredArgsConstructorpublic enum LoginType { GOOGLE("googleLogin"), NAVER("naverLogin"), KAKAO("kakaoLogin"); public final String value; // 파라미터 주입 public static LoginType getValue(final String type){ if(StringUtils.isEmpty(type)){ return null..
SpringBoot 에서 application.yml 파일을 이용하여 멀티 프로필 설정 하는법을 작성하였습니다.server: port: 1234 servlet: encoding: charset: UTF-8mybatis: config-location: classpath:config/mybatis-config.xml mapper-locations: classpath:mapper/*.xml---spring: config: activate: on-profile: "local" datasource: driver-class-name: org.mariadb.jdbc.Driver url: jdbc:mariadb://localhost:3306/test?useUnicode..
- Total
- Today
- Yesterday