Skip to content

Commit

Permalink
[KAN-109] fix(-): resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
hyo-nu committed Jul 8, 2024
2 parents 6774200 + 8682c52 commit f839708
Show file tree
Hide file tree
Showing 15 changed files with 631 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/BE_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Gradle Build
run: |
cd server
./gradlew build
./gradlew clean build
if: success()

- name: PR Test Result
Expand All @@ -63,4 +63,4 @@ jobs:
git checkout prod || git checkout -b prod
git add DEPLOY_FILE/server
git commit -m "release: $timestamp BE 배포 완료"
git push origin prod --force
git push origin prod --force
1 change: 1 addition & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion database/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ ENV MYSQL_PASSWORD=1004
CMD ["mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--skip-character-set-client-handshake"]

#SQL 복사
COPY init.sql /docker-entrypoint-initdb.d/
# COPY init.sql /docker-entrypoint-initdb.d/
79 changes: 58 additions & 21 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.3.1'
id 'io.spring.dependency-management' version '1.1.5'
id 'checkstyle'
// id 'checkstyle'
id 'org.asciidoctor.jvm.convert' version '3.3.2' // REST Docs
}

group = 'kr.or.kosa'
Expand All @@ -18,12 +19,17 @@ configurations {
compileOnly {
extendsFrom annotationProcessor
}
asciidoctorExtensions // REST Docs
}

repositories {
mavenCentral()
}

ext {
set('snippetsDir', file("build/generated-snippets")) // REST Docs
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand All @@ -46,12 +52,43 @@ dependencies {
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// REST Docs
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
}

tasks.named('test') {
test {
useJUnitPlatform()
outputs.dir snippetsDir // REST Docs
}

// REST Docs
asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExtensions'
dependsOn test
// source를 지정하면 특정 adoc만 HTML로 만듬
sources {
include("**/*.adoc")
}
// 경로를 baseDir로 맞춰줌
baseDirFollowsSourceFile()
}

// REST Docs
task copyDocs(type: Copy) {
dependsOn asciidoctor
from "${asciidoctor.outputDir}"
into "src/main/resources/static/docs" // src/main/resources/static/docs로 복사
}

// REST Docs
build {
dependsOn copyDocs
}

/**
Expand All @@ -73,22 +110,22 @@ clean.doLast {


// Lint
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

tasks.withType(Checkstyle).configureEach {
mustRunAfter 'compileJava'
reports {
xml.required = false
html.required = true
}
}

checkstyle {
configFile = file("config/checkstyle/naver-checkstyle-rules.xml")
configProperties = ["suppressionFile": "config/checkstyle/naver-checkstyle-suppressions.xml"]
sourceSets = [sourceSets.main] // CompileQuerydsl 오류 해결
}

checkstyleMain.source = fileTree('src/main/java')
//tasks.withType(JavaCompile).configureEach {
// options.encoding = 'UTF-8'
//}
//
//tasks.withType(Checkstyle).configureEach {
// mustRunAfter 'compileJava'
// reports {
// xml.required = false
// html.required = true
// }
//}
//
//checkstyle {
// configFile = file("config/checkstyle/naver-checkstyle-rules.xml")
// configProperties = ["suppressionFile": "config/checkstyle/naver-checkstyle-suppressions.xml"]
// sourceSets = [sourceSets.main] // CompileQuerydsl 오류 해결
//}
//
//checkstyleMain.source = fileTree('src/main/java')
1 change: 1 addition & 0 deletions server/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.jvmargs=-Dfile.encoding=UTF-8
119 changes: 119 additions & 0 deletions server/src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
ifndef::snippets[]
:snippets:build/generated-snippets
endif::[]

= CMS+ Application API Document
made by Sanghun.Kim
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4
:sectlinks:
:operation-http-request-title: REQUEST
:operation-http-response-title: RESPONSE

[[POST-API]]
== 1. 상품

=== 1.1. 상품 목록 조회

.Request Header Parameter
|===
|파라미터 |타입 |필수여부 |설명
|Authorization |String |필수 |ACCESS_TOKEN
|X-CSRF |String |필수 |CSRF_TOKEN
|===

.Request Query Parameter
|===
|파라미터 |타입 |필수여부 |설명
|page |Integer|필수 |페이지 번호
|offset |Integer|필수 |페이지당 오프셋
|sort |String|선택 |정렬 기준
|name |String|선택 |상품명으로 검색
|price |double|선택 |금액으로 검색
|contractCount |Integer|선택 |계약수로 검색
|createdAt |String|선택 |생성시기로 검색
|memo |String|선택 |비고로 검색
|===

operation::findAllProductByCondition[snippets='http-request,http-response']

=== 1.2. 상품 등록

.Request Header Parameter
|===
|파라미터 |타입 |필수여부 |설명
|Authorization |String |필수 |ACCESS_TOKEN
|X-CSRF |String |필수 |CSRF_TOKEN
|===

.Request Body Parameter
|===
|파라미터 |타입 |필수여부 |설명
|name |String|필수 |상품명
|price |double|필수 |금액
|memo |Stirng|필수 |비고
|===

operation::saveProduct[snippets='http-request,http-response']

=== 1.3. 상품 상세 조회

.Request Header Parameter
|===
|파라미터 |타입 |필수여부 |설명
|Authorization |String |필수 |ACCESS_TOKEN
|X-CSRF |String |필수 |CSRF_TOKEN
|===

.Request Path Parameter
|===
|파라미터 |타입 |필수여부 |설명
|PRODUCT_ID |Long|필수 |상품번호
|===

operation::findProductById[snippets='http-request,http-response']

=== 1.4. 상품 수정

.Request Header Parameter
|===
|파라미터 |타입 |필수여부 |설명
|Authorization |String |필수 |ACCESS_TOKEN
|X-CSRF |String |필수 |CSRF_TOKEN
|===

.Request Path Parameter
|===
|파라미터 |타입 |필수여부 |설명
|PRODUCT_ID |Long|필수 |상품번호
|===

.Request Body Parameter
|===
|파라미터 |타입 |필수여부 |설명
|name |String|선택 |상품명
|price |double|선택 |금액
|notes |Stirng|선택 |비고
|===

operation::updateProduct[snippets='http-request,http-response']

=== 1.5. 상품 삭제

.Request Header
|===
|파라미터 |타입 |필수여부 |설명
|Authorization |String |필수 |인증 키
|===

.Request Path Parameter
|===
|파라미터 |타입 |필수여부 |설명
|PRODUCT_ID |Long|필수 |상품번호
|===


operation::deleteProduct[snippets='http-request,http-response']
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public ResponseEntity<String> join(@RequestBody @Valid SignupDto signupDto) {
}
}

@GetMapping("/username-check")
@GetMapping("/check-username")
public ResponseEntity<Boolean> isExistUsername(@RequestParam String username) {
boolean isExist = vendorService.isExistUsername(username);
return ResponseEntity.ok(isExist);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public RefreshTokenRes refresh(HttpServletRequest request, HttpServletResponse r
try {
jwtUtil.isExpired(refreshToken);
} catch (ExpiredJwtException e) {
throw new IllegalArgumentException("invaild refresh token");
throw new IllegalArgumentException("Invaild refresh token");
}

String category = jwtUtil.getCategory(refreshToken);
Expand Down
Loading

0 comments on commit f839708

Please sign in to comment.