개발 공부는 어려워
반응형
자바스크립트 div 안의 내용 클립보드 복사하기
study/js 2024. 7. 17. 13:35

let selection = window.getSelection(); // 선택 영역 변수로 선언let content = "";// 선택된 영역이 존재한다면if (selection.rangeCount > 0) { let range = selection.getRangeAt(0); // 선택된 영역 중 첫 번째 영역을 가져옴 let selectedContent = range.cloneContents(); // 선택된 내용을 복제(clone)하여 새로운 DocumentFragment로 만듦 let div = document.createElement('div'); // 임시 div 요소를 생성 div.appendChild(selectedContent); // 복제된 내용을 임시 div 요소..

article thumbnail
Spring Boot에서 커스텀 어노테이션 작성법
study/spring 2024. 6. 13. 16:31

swagger 설정을 하던 도중 ApiResponse, ApiResponses라는 어노테이션을 사용하게 되었다. 해당 어노테이션의 사용 방법은 responseCode = "200", description="OK" 이러한 방식으로 특정 responseCode가 응답될 경우 설명을 보여주는 코드인데 원래 코드에서 사용하던 내용은 아래와 같다. @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "400", description = "BAD REQUEST"), @ApiResponse(responseCode = "404", description = "NOT FOUND")..

article thumbnail
Spring Boot 3.0에서 Redis 사용하기
study/etc 2024. 6. 12. 13:46

Redis를 Spring Boot에서 사용하는 방법은 어렵지 않다. /** Redis **/ implementation 'org.springframework.boot:spring-boot-starter-data-redis' implementation 'redis.clients:jedis:3.7.1' 먼저 application에 있는 build.gradle 파일에 해당 내용을 작성한다.. 그 이후 기본 application.properties 파일에 작성한 포트와 ip를 넣어줘야 하는데 나는 application.yml 파일이기 때문에 #redis data: redis: host: localhost port: 6379 위와 같이 설정해주었다. Redis를 사용하는 방법..

article thumbnail
Redis 명령어 정리
study/etc 2024. 6. 12. 13:24

Redis 명령어 Redis도 NoSQL이기는 하지만 본질은 데이터 저장이다.  결국 우리가 알고 있는 RDBMS와 동일하게 삽입, 수정, 삭제, 조회같은 명령어가 존재한다. Redis 설치 폴더에 들어가서 redis-cli.exe  파일읋 실행시킨다. [전체 조회]KEYS *  [추가]SET {KEY} {VALUE} [Key로 데이터 조회]get KeyTest1※ 위에서 확인할 수 있는건 get으로 데이터를 가져올때 Key값의 대소문자를 구별한다는 것이다. [많은 데이터 저장]mset {key1] {value1} {key2} {value2} [많은 데이터 조회]mget {key1] {value1} {key2} {value2} [데이터 특정 시간까지만 저장하기]setex {key {seconde} {va..

article thumbnail
Redis Window에서 설치하기
study/etc 2024. 6. 11. 11:09

Redis 설치아래 링크에 접속하여 Asserts에 있는 설치 파일을 다운로드 한다.https://github.com/microsoftarchive/redis/releases Releases · microsoftarchive/redisRedis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes - microsoftarchive/redisgithub.com  정상 설치가 된다면 작업관리자 서비스 탭에서 Redis가 실행중인것을 확인할 수 있다. 이제 redis..

반응형