2024-06-12

This commit is contained in:
2024-06-12 13:11:58 +09:00
parent d2bb77ca33
commit a75a1dbd0f
31 changed files with 263 additions and 7 deletions

6
Writerside/c.list Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE categories
SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd">
<categories>
<category id="wrs" name="Writerside documentation" order="1"/>
</categories>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2024. Elex. All Rights Reesrved.
~ https://www.elex-project.com/
-->
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<variables></variables>
<build-profile instance="sb">
<variables>
<noindex-content>true</noindex-content>
</variables>
</build-profile>
</buildprofiles>

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

32
Writerside/sb.tree Normal file
View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2024. Elex. All Rights Reesrved.
- https://www.elex-project.com/
-->
<!DOCTYPE instance-profile
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">
<instance-profile id="sb"
name="Spring Boot"
start-page="starter-topic.md">
<toc-element topic="starter-topic.md">
<toc-element topic="Controller.md"/>
<toc-element topic="Database.md">
<toc-element topic="Modeling.md"/>
<toc-element topic="JPA.md">
<toc-element topic="Repository.md"/>
<toc-element topic="JPQL.md"/>
<toc-element topic="Paging.md"/>
</toc-element>
</toc-element>
<toc-element topic="Validation.md"/>
<toc-element topic="Testing.md"/>
<toc-element topic="Security.md">
<toc-element topic="JWT.md"/>
</toc-element>
<toc-element topic="Actuator.md"/>
<toc-element topic="Swagger.md"/>
</toc-element>
</instance-profile>

10
Writerside/sbe.tree Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE instance-profile
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">
<instance-profile id="sbe"
name="Spring Boot Explained"
start-page="starter-topic.md">
<toc-element topic="starter-topic.md"/>
</instance-profile>

View File

@@ -0,0 +1,3 @@
# Actuator
Start typing here...

View File

@@ -0,0 +1,19 @@
# Controller
## URI 맵핑
* @Controller
* @RestController
* @RequestMapping
* @GetMapping
* @PostMapping
* @PutMapping
* @DeleteMapping
## 매개변수
* @PathVariable
* @RequestParam
* @RequestBody

View File

@@ -0,0 +1,26 @@
# Database
## 설정
```yaml
spring:
datasource:
driverClassName: org.mariadb.jdbc.Driver
url: jdbc:mariadb://localhost:3306/mydb
username: root
password: password
jpa:
hibernate:
ddl-auto: create
show-sql: true
properties:
hibernate:
format_sql: true
```
### DDL Auto
* create : 애플리케이션이 실행되고, SessionFactory가 실행될 때, 기존의 테이블을 지우고 새로운 테이블을 생성합니다.
* create-drop : 'create'와 유사하지만, 애플리케이션 종료 시점에 테이블을 지웁니다.
* update : SessionFactory가 실행될 때, 객체를 검사한 다음, 변경된 스키마를 갱신합니다. 기존의 데이터는 유지됩니다.
* validate : 'update'와 유사하게 객체를 검사하지만, 스키마를 변경하지 않으며, 테이블 구조가 수정된 경우에는 에러가 발생합니다.
* none : dll-auto 기능을 사용하지 않습니다.

3
Writerside/topics/JPA.md Normal file
View File

@@ -0,0 +1,3 @@
# JPA
Start typing here...

View File

@@ -0,0 +1,3 @@
# JPQL
JPQL은 맵핑된 엔티티 객체를 대상으로 수행되므로, 쿼리문에는 엔티티의 이름과 필드의 이름을 사용합니다.

3
Writerside/topics/JWT.md Normal file
View File

@@ -0,0 +1,3 @@
# JWT
Start typing here...

View File

@@ -0,0 +1,32 @@
# Modeling
## 어노태이션
* @Entity : 해당 클래스가 엔티티임을 명시합니다.
* @Table : 클래스의 이름과 테이블의 이름을 다르게 지정해야 할 경우에 사용합니다.
* name
* @Id : 테이블의 기본키를 지정합니다. 모든 엔티티는 @Id가 필요합니다.
* @GeneratedValue : 일반적으로 @Id와 함께 사용됩니다. 해당 필드의 값을 자동으로 생성하는 방식을 지정합니다.
* strategy
* @Column : 테이블의 칼럼으로 맵핑됩니다.
* name : 데이터베이스의 칼럼명을 지정합니다.
* unique : 고유키로 지정합니다.
* nullable : 널 처리 가능여부를 지정합니다.
* insertable
* updatable
* columnDefinition
* table
* length : 데이터의 최대 길이를 지정합니다.
* precision
* scale
* @Transient : 클래스에는 선언되어 있지만, 데이터베이스에는 필요 없는 경우에 지정합니다.
### GenerationType
* AUTO : 사용하는 데이터베이스에 맞게 자동으로 생성합니다.
* IDENTITY : AUTI_INCREMENT를 사용해서, 데이터베이스가 알아서 생성하도록 합니다.
* SEQUENCE : @SequenceGenerator로 지정된 식별자 생성기를 통해서 값을 주입받습니다.
* TABLE : @TableGenerator를 사용해서 별도의 테이블에 값을 저장합니다.

View File

@@ -0,0 +1,3 @@
# Paging
Start typing here...

View File

@@ -0,0 +1,33 @@
# Repository
JpaRepository > PagingAndSortingRepository > CrudRepository > Repository
## JpaRepository
```java
@Repository
public interface MyRepository extends JpaRepository<MyEntity, Long> {
}
```
## 메서드 이름 규칙
* findBy, readBy, getBy, queryBu, searchBy, streamBy
* and, or
* isLike, isNotLike
* is, isNot
* startsWith, isStartingWith
* endsWith, isEndingWith
* contains, isContaining
* isNull, isNotNull
* isTrue, isFalse
* before, after
* isLessThan, isGreaterThan
* isBetween
* orderBy
* first, top
* countBy
* existsBy
* deleteBy, removeBy

View File

@@ -0,0 +1,3 @@
# Security
Start typing here...

View File

@@ -0,0 +1,38 @@
# Swagger
## 설정
### 의존성 추가
```kotlin
implementation("io.springfox:springfox-swagger2:2.9.2")
implementation("io.springfox:springfox-swagger-ui:2.9.2")
```
### 설정 코드 추가
```java
import jdk.javadoc.doclet.Doclet;
import java.beans.BeanProperty;
@Configuration
@EnableSwagger2
public class MyConfiguration {
@Bean
public Doclet api(){
return new Docket(DocumentationType.SWAGGER_2)
...
.build();
}
}
```
## 어노태이션
* @ApiOperation : 해당 API에 대한 설정을 작성합니다.
* value
* notes
* @ApiParam : 해당 API의 매개변수에 대한 설명 및 설정을 지정합니다.
* value
* required

View File

@@ -0,0 +1,3 @@
# Testing
Start typing here...

View File

@@ -0,0 +1,3 @@
# Validation
Start typing here...

View File

@@ -0,0 +1 @@
# Spring Boot

5
Writerside/v.list Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vars SYSTEM "https://resources.jetbrains.com/writerside/1.0/vars.dtd">
<vars>
<var name="product" value="Writerside"/>
</vars>

13
Writerside/writerside.cfg Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2024. Elex. All Rights Reesrved.
- https://www.elex-project.com/
-->
<!DOCTYPE ihp SYSTEM "https://resources.jetbrains.com/writerside/1.0/ihp.dtd">
<ihp version="2.0">
<topics dir="topics" web-path="topics"/>
<images dir="images" web-path="images"/>
<instance src="sb.tree"/>
</ihp>