티스토리 뷰

2023/6월

23-6-27

parkrams 2023. 6. 27. 17:44
728x90

스프링 단축키 꿀팁

alt 두번 누르면 그 창 이

alt +1 프로젝트 창 키고 끄기

▶ 인덴트 : Tab(인덴트), Shift+Tab(인덴트 취소)

인덴트는 들여쓰기를 말한다. Tab키는 들여쓰기를 Shift+Tab은 들여쓰기 취소를 할 때 눌러주면 된다.

▶ 자동 인덴트 : Ctrl+Alt+I

코드 전체에 자동 인덴트를 적용하고 싶다면 Ctrl+A키를 눌러 코드 전체 영역을 선택해 주고 그 다음 Ctrl+Alt+I키를 눌러주면 된다.

▶ 사용처 찾기 : Alt+F7(찾기), Ctrl+B(빠른 찾기)

함수를 사용하고 있는 사용처를 찾을 때 Alt+F7(찾기)키 혹은 Ctrl+B(빠른 찾기)키를 눌러주면 된다.

Alt + insert -> 겟셋 같은 소스 검색

▶ 꿀 팁 : Ctrl + shift + enter ( 자동 닫기, 괄호 완성 기능? 애매 하다 싶을 때 눌러주면 자동 마무리)

▶ 세팅 창 : Ctrl + alt + s

▶ 변수명 한번에 바꾸기 : shift + f6

▶ 메소드 안에 들어갈 변수명 확인 : Ctrl + p

▶ 람다로 변환 : alt + enter -> Replace with lambda

▶ Refactor This : Shift + Ctrl + alt + T

▶ lnline Method : Ctrl + alt + N

▶ Test 클래스 생성 : Ctrl + Shift + T

▶ 값 일괄 변경 : Ctrl + Shift + R

함수 합치는 메서드?

오늘 한 것

공부

리액트를 다루는 기술
프로젝트 대비
server.port=9090
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=js
spring.mvc.static-path-pattern=/resources/**

// 용량
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB

//디비 연결
spring.datasource.url=jdbc:mysql://localhost:3307/testproject?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# mysql 사용
spring.jpa.database=mysql
# 콘솔에 sql 출력 여부
spring.jpa.show-sql=true  
  • 부트 리액트 연결
  • pom.xml 플러그인 수정
  • package.json 에 proxy 추가
build 로 스프링부트랑 리액트 연결 하는 방법 --!
  • 같은 화면단에서 열 수 있음
  • 스프링부트 run 하면 리액트 실행
  • 9090 으로 리액트랑 제대로 연결 하려면 build 파일 안에 있는 것들을 static 경로로 이동해줘야 함
  • \target\classes\static 경로 기억!!

다시하는 중에 계속 연결 안돼서... 이유 확인하니

  • properties 에 설정된 경로 때문에 계속 그쪽으로 갔음... ㅠㅠ
  • plugin 에 입력
<!--            리액트 스프링부트 연결하기 위한 -->
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.10.3</version>
                <configuration>
                    <workingDirectory></workingDirectory> // 리액트 프로젝트 경로로 맞춰야함 
                    <installDirectory>target</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v18.16.0</nodeVersion>   // 본인 버전하고 맞춰야 함 
                            <npmVersion>9.5.1</npmVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm run build</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run build</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/classes/static</outputDirectory>
                            <resources>
                                <resource>
                                    <directory></directory>  // 중요부분 리액트 프로젝트 경로로 맞춰야함 
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

운동

궁금한 것

  • Dirty checking - Spring Data JPA

내일 할 것

공부

프로젝트

운동

해결하려고 노력 중

-- 더 공부할 것

-- 모르는 것

728x90

'2023 > 6월' 카테고리의 다른 글

23-6-29 木  (0) 2023.07.07
23-6-28 水  (0) 2023.06.28
23-6-26 月  (0) 2023.06.26
23-6-25 日  (0) 2023.06.25
23-06-23 金  (0) 2023.06.23
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함