diff --git a/app/kac-app/build.gradle b/app/kac-app/build.gradle index 6573ad8..23b13e9 100644 --- a/app/kac-app/build.gradle +++ b/app/kac-app/build.gradle @@ -1,5 +1,13 @@ +plugins { + id "org.asciidoctor.jvm.convert" version "3.3.2" +} - +configurations { + compileOnly { + extendsFrom annotationProcessor + } + asciidoctorExt +} dependencies { implementation "$boot:spring-boot-starter-web" // db @@ -14,12 +22,51 @@ dependencies { annotationProcessor "jakarta.annotation:jakarta.annotation-api" annotationProcessor "jakarta.persistence:jakarta.persistence-api" + asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor' + testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc' + testImplementation 'org.springframework.boot:spring-boot-starter-test' + implementation project(":common-core") implementation project(":web-api-com") // TDOO: 제거... compileOnly project(":data-com") } +ext { + snippetsDir = file('build/generated-snippets') +} + +test { + useJUnitPlatform() + outputs.dir snippetsDir +} +asciidoctor { + dependsOn test + inputs.dir snippetsDir +} + +bootJar { + dependsOn asciidoctor + from ("${asciidoctor.outputDir}/html5") { + into 'static/docs' + } +} + +asciidoctor.doFirst { + delete file('src/main/resources/static/docs') +} + +task copyDocument(type: Copy) { + dependsOn asciidoctor + from file("build/docs/asciidoc") + into file("src/main/resources/static/docs") +} + +build { + dependsOn copyDocument +} + + // querydsl def querydslDir = layout.buildDirectory.dir("generated/querydsl").get().asFile diff --git a/app/kac-app/src/docs/asciidoc/index.adoc b/app/kac-app/src/docs/asciidoc/index.adoc new file mode 100644 index 0000000..1751cce --- /dev/null +++ b/app/kac-app/src/docs/asciidoc/index.adoc @@ -0,0 +1,175 @@ +ifndef::snippets[] +:snippets: ./build/generated-snippets +endif::[] + += KAC App Docs +API 문서 +:doctype: book +:icons: font +:source-highlighter: highlightjs +:toc: left +:toclevels: 2 +:sectlinks: + +[[Common-Code-API]] +== Common-Code API + +[[Code-All]] +=== [Code 전체코드 조회] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/all/http-request.adoc[] +include::{snippets}/com/code/all/query-parameters.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/all/http-response.adoc[] + +include::{snippets}/com/code/all/response-fields.adoc[] + +*** + +=== [Code 코드목록 조회] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/code/http-request.adoc[] + +include::{snippets}/com/code/code/query-parameters.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/code/http-response.adoc[] + +include::{snippets}/com/code/code/response-fields.adoc[] + +*** + +=== [Code 그룹목록 조회] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/group/http-request.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/group/http-response.adoc[] + +include::{snippets}/com/code/group/response-fields.adoc[] + +*** + +=== [Code 그룹 등록] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/group/create/http-request.adoc[] + +include::{snippets}/com/code/group/create/request-fields.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/group/create/http-response.adoc[] + +include::{snippets}/com/code/group/create/response-fields.adoc[] + +*** + +=== [Code 코드 등록] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/code/create/http-request.adoc[] + +include::{snippets}/com/code/code/create/request-fields.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/code/create/http-response.adoc[] + +include::{snippets}/com/code/code/create/response-fields.adoc[] + +*** + +=== [Code 코드언어 등록] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/lang/create/http-request.adoc[] + +include::{snippets}/com/code/lang/create/request-fields.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/lang/create/http-response.adoc[] + +include::{snippets}/com/code/lang/create/response-fields.adoc[] + +*** + +=== [Code 그룹 수정] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/group/update/http-request.adoc[] + +include::{snippets}/com/code/group/update/request-fields.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/group/update/http-response.adoc[] + +include::{snippets}/com/code/group/update/response-fields.adoc[] + +*** + +=== [Code 코드 수정] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/code/update/http-request.adoc[] + +include::{snippets}/com/code/code/update/request-fields.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/code/update/http-response.adoc[] + +include::{snippets}/com/code/code/update/response-fields.adoc[] + +*** + +=== [Code 코드언어 수정] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/lang/update/http-request.adoc[] + +include::{snippets}/com/code/lang/update/request-fields.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/lang/update/http-response.adoc[] + +include::{snippets}/com/code/lang/update/response-fields.adoc[] + +*** + +=== [Code 그룹 삭제] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/group/delete/http-request.adoc[] + +include::{snippets}/com/code/group/delete/query-parameters.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/group/delete/http-response.adoc[] + +*** + +=== [Code 코드 삭제] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/code/delete/http-request.adoc[] + +include::{snippets}/com/code/code/delete/query-parameters.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/code/delete/http-response.adoc[] + +*** + +=== [Code 언어 삭제] + +==== [HTTP REQUEST INFO] +include::{snippets}/com/code/lang/delete/http-request.adoc[] + +include::{snippets}/com/code/lang/delete/query-parameters.adoc[] + +==== [HTTP RESPONSE INFO] +include::{snippets}/com/code/lang/delete/http-response.adoc[] + +*** \ No newline at end of file diff --git a/app/kac-app/src/main/resources/static/docs/index.html b/app/kac-app/src/main/resources/static/docs/index.html new file mode 100644 index 0000000..b3dc462 --- /dev/null +++ b/app/kac-app/src/main/resources/static/docs/index.html @@ -0,0 +1,1955 @@ + + + + + + + + +KAC App Docs + + + + + + +
+
+

Common-Code API

+
+
+

[Code 전체코드 조회]

+
+

[HTTP REQUEST INFO]

+
+
+
GET /v1/com/code/all?siteCd=KAC&langDivCd=ko_KR HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Host: localhost:8080
+
+
+ ++++ + + + + + + + + + + + + + + + + +
ParameterDescription

siteCd

사이트코드

langDivCd

언어코드

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+Content-Type: application/json;charset=UTF-8
+Content-Length: 1897
+
+[ {
+  "groupCd" : "8984",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP_1706059161",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP_1706061920",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP_1706061927",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP_1706061935",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP001",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : [ {
+    "groupCd" : "NEW_GROUP001",
+    "cdId" : "NEW_CODE001",
+    "cdNm" : null,
+    "upperCd" : null,
+    "sortOrdr" : 0,
+    "addInfoValue" : "추가!!",
+    "children" : null
+  }, {
+    "groupCd" : "NEW_GROUP001",
+    "cdId" : "NEW_CODE002",
+    "cdNm" : null,
+    "upperCd" : null,
+    "sortOrdr" : 0,
+    "addInfoValue" : "추가!!",
+    "children" : null
+  }, {
+    "groupCd" : "NEW_GROUP001",
+    "cdId" : "NEW_CODE170605827510",
+    "cdNm" : null,
+    "upperCd" : null,
+    "sortOrdr" : 0,
+    "addInfoValue" : "추가!!",
+    "children" : null
+  }, {
+    "groupCd" : "NEW_GROUP001",
+    "cdId" : "NEW_CODE170605829584",
+    "cdNm" : null,
+    "upperCd" : null,
+    "sortOrdr" : 0,
+    "addInfoValue" : "추가!!",
+    "children" : null
+  }, {
+    "groupCd" : "NEW_GROUP001",
+    "cdId" : "NEW_CODE170605916148",
+    "cdNm" : null,
+    "upperCd" : null,
+    "sortOrdr" : 0,
+    "addInfoValue" : "추가!!",
+    "children" : null
+  } ]
+}, {
+  "groupCd" : "NEW_GROUP002",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+} ]
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

[].groupCd

String

그룹 코드

[].siteCd

String

사이트 코드

[].groupCdNm

String

그룹 명

[].rm

String

비고

[].codeList

Array

그룹에 포함된 코드 리스트

[].codeList[].groupCd

String

코드의 그룹

[].codeList[].cdId

String

코드의 ID

[].codeList[].cdNm

String

코드의 이름

[].codeList[].upperCd

String

상위 코드의 이름

[].codeList[].sortOrdr

Number

코드의 정렬순서

[].codeList[].addInfoValue

String

코드의 추가 밸류

[].codeList[].children

String

코드의 하위요소

+
+
+
+
+

[Code 코드목록 조회]

+
+

[HTTP REQUEST INFO]

+
+
+
GET /v1/com/code/code?groupCd=NEW_GROUP001&langDivCd=ko_KR HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Host: localhost:8080
+
+
+ ++++ + + + + + + + + + + + + + + + + +
ParameterDescription

groupCd

그룹코드

langDivCd

언어코드

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+Content-Type: application/json;charset=UTF-8
+Content-Length: 864
+
+[ {
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE001",
+  "cdNm" : null,
+  "upperCd" : null,
+  "sortOrdr" : 0,
+  "addInfoValue" : "추가!!",
+  "children" : null
+}, {
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE002",
+  "cdNm" : null,
+  "upperCd" : null,
+  "sortOrdr" : 0,
+  "addInfoValue" : "추가!!",
+  "children" : null
+}, {
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE170605827510",
+  "cdNm" : null,
+  "upperCd" : null,
+  "sortOrdr" : 0,
+  "addInfoValue" : "추가!!",
+  "children" : null
+}, {
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE170605829584",
+  "cdNm" : null,
+  "upperCd" : null,
+  "sortOrdr" : 0,
+  "addInfoValue" : "추가!!",
+  "children" : null
+}, {
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE170605916148",
+  "cdNm" : null,
+  "upperCd" : null,
+  "sortOrdr" : 0,
+  "addInfoValue" : "추가!!",
+  "children" : null
+} ]
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

[].groupCd

String

코드의 그룹

[].cdId

String

코드의 ID

[].cdNm

String

코드의 이름

[].upperCd

String

상위 코드의 이름

[].sortOrdr

Number

코드의 정렬순서

[].addInfoValue

String

코드의 추가 밸류

[].children

String

코드의 하위요소

+
+
+
+
+

[Code 그룹목록 조회]

+
+

[HTTP REQUEST INFO]

+
+
+
GET /v1/com/code/group HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Host: localhost:8080
+
+
+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+Content-Type: application/json;charset=UTF-8
+Content-Length: 957
+
+[ {
+  "groupCd" : "8984",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP_1706059161",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP_1706061920",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP_1706061927",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP_1706061935",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP001",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+}, {
+  "groupCd" : "NEW_GROUP002",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "codeList" : null
+} ]
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

[].groupCd

String

그룹 코드

[].siteCd

String

사이트 코드

[].groupCdNm

String

그룹 명

[].rm

String

비고

[].codeList

Array

그룹에 포함된 코드 리스트

+
+
+
+
+

[Code 그룹 등록]

+
+

[HTTP REQUEST INFO]

+
+
+
POST /v1/com/code/group HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Content-Length: 118
+Host: localhost:8080
+
+{
+  "groupCd" : "NEW_GROUP_1706068307",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고...."
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

siteCd

String

사이트코드

groupCdNm

String

그룹이름

rm

String

비고

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+Content-Type: application/json;charset=UTF-8
+Content-Length: 276
+
+{
+  "groupCd" : "NEW_GROUP_1706068307",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "createUserId" : "CREATE_USER",
+  "createDt" : "2024-01-24T12:51:47.097899",
+  "updateUserId" : "CREATE_USER",
+  "updateDt" : "2024-01-24T12:51:47.097907"
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

siteCd

String

사이트코드

groupCdNm

String

그룹이름

rm

String

비고

createUserId

String

등록한 유저 아이디

createDt

String

등록일시

updateUserId

String

수정한 유저 아이디

updateDt

String

수정일시

+
+
+
+
+

[Code 코드 등록]

+
+

[HTTP REQUEST INFO]

+
+
+
POST /v1/com/code/code HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Content-Length: 133
+Host: localhost:8080
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE170606830704",
+  "sortOrdr" : 0,
+  "addInfoValue" : "추가!!",
+  "useYn" : "Y"
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

cdId

String

코드 아이디

sortOrdr

Number

정렬순서

addInfoValue

String

추가사항

useYn

String

사용여부

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+Content-Type: application/json;charset=UTF-8
+Content-Length: 311
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE170606830704",
+  "upperCd" : null,
+  "sortOrdr" : 0,
+  "addInfoValue" : "추가!!",
+  "useYn" : "Y",
+  "createUserId" : "CREATE_USER",
+  "createDt" : "2024-01-24T12:51:47.054488",
+  "updateUserId" : "CREATE_USER",
+  "updateDt" : "2024-01-24T12:51:47.054496"
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

cdId

String

코드 아이디

upperCd

String

상위 아이디

sortOrdr

Number

정렬순서

addInfoValue

String

추가사항

useYn

String

사용여부

createUserId

String

등록한 유저 아이디

createDt

String

등록일시

updateUserId

String

수정한 유저 아이디

updateDt

String

수정일시

+
+
+
+
+

[Code 코드언어 등록]

+
+

[HTTP REQUEST INFO]

+
+
+
POST /v1/com/code/lang HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Content-Length: 136
+Host: localhost:8080
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE001",
+  "langDivCd" : "ko_KR",
+  "cdNm" : "신규코드001",
+  "rm" : "비고...."
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

cdId

String

코드 아이디

langDivCd

String

언어코드

cdNm

String

코드이름[언어별]

rm

String

비고

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+Content-Type: application/json;charset=UTF-8
+Content-Length: 294
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE001",
+  "langDivCd" : "ko_KR",
+  "cdNm" : "신규코드001",
+  "rm" : "비고....",
+  "createUserId" : "CREATE_USER",
+  "createDt" : "2024-01-24T12:51:46.948454",
+  "updateUserId" : "CREATE_USER",
+  "updateDt" : "2024-01-24T12:51:46.948463"
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

cdId

String

코드 아이디

langDivCd

String

언어코드

cdNm

String

코드이름[언어별]

rm

String

비고

createUserId

String

등록한 유저 아이디

createDt

String

등록일시

updateUserId

String

수정한 유저 아이디

updateDt

String

수정일시

+
+
+
+
+

[Code 그룹 수정]

+
+

[HTTP REQUEST INFO]

+
+
+
PUT /v1/com/code/group HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Content-Length: 110
+Host: localhost:8080
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고...."
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

siteCd

String

사이트코드

groupCdNm

String

그룹이름

rm

String

비고

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+Content-Type: application/json;charset=UTF-8
+Content-Length: 261
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "siteCd" : "KAC",
+  "groupCdNm" : "신규그룹001",
+  "rm" : "비고....",
+  "createUserId" : "CREATE_USER",
+  "createDt" : "2024-01-23T14:14:10",
+  "updateUserId" : "UPDATE_USER",
+  "updateDt" : "2024-01-24T12:51:46.997949"
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

siteCd

String

사이트코드

groupCdNm

String

그룹이름

rm

String

비고

createUserId

String

등록한 유저 아이디

createDt

String

등록일시

updateUserId

String

수정한 유저 아이디

updateDt

String

수정일시

+
+
+
+
+

[Code 코드 수정]

+
+

[HTTP REQUEST INFO]

+
+
+
PUT /v1/com/code/code HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Content-Length: 124
+Host: localhost:8080
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE001",
+  "sortOrdr" : 0,
+  "addInfoValue" : "추가!!",
+  "useYn" : "Y"
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

cdId

String

코드 아이디

sortOrdr

Number

정렬순서

addInfoValue

String

추가사항

useYn

String

사용여부

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+Content-Type: application/json;charset=UTF-8
+Content-Length: 295
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE001",
+  "upperCd" : null,
+  "sortOrdr" : 0,
+  "addInfoValue" : "추가!!",
+  "useYn" : "Y",
+  "createUserId" : "CREATE_USER",
+  "createDt" : "2024-01-23T14:14:25",
+  "updateUserId" : "UPDATE_USER",
+  "updateDt" : "2024-01-24T12:51:46.801854"
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

cdId

String

코드 아이디

upperCd

String

상위 아이디

sortOrdr

Number

정렬순서

addInfoValue

String

추가사항

useYn

String

사용여부

createUserId

String

등록한 유저 아이디

createDt

String

등록일시

updateUserId

String

수정한 유저 아이디

updateDt

String

수정일시

+
+
+
+
+

[Code 코드언어 수정]

+
+

[HTTP REQUEST INFO]

+
+
+
PUT /v1/com/code/lang HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Content-Length: 136
+Host: localhost:8080
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE001",
+  "langDivCd" : "en_CA",
+  "cdNm" : "신규코드001",
+  "rm" : "비고...."
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

cdId

String

코드 아이디

langDivCd

String

언어코드

cdNm

String

코드이름[언어별]

rm

String

비고

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+Content-Type: application/json;charset=UTF-8
+Content-Length: 286
+
+{
+  "groupCd" : "NEW_GROUP001",
+  "cdId" : "NEW_CODE001",
+  "langDivCd" : "en_CA",
+  "cdNm" : "신규코드001",
+  "rm" : "비고....",
+  "createUserId" : "CREATE_USER",
+  "createDt" : "2024-01-24T10:55:17",
+  "updateUserId" : "UPDATE_USER",
+  "updateDt" : "2024-01-24T12:51:46.91922"
+}
+
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

groupCd

String

그룹코드

cdId

String

코드 아이디

langDivCd

String

언어코드

cdNm

String

코드이름[언어별]

rm

String

비고

createUserId

String

등록한 유저 아이디

createDt

String

등록일시

updateUserId

String

수정한 유저 아이디

updateDt

String

수정일시

+
+
+
+
+

[Code 그룹 삭제]

+
+

[HTTP REQUEST INFO]

+
+
+
DELETE /v1/com/code/group?groupCd=NEW_Group_1706003812 HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Host: localhost:8080
+
+
+ ++++ + + + + + + + + + + + + +
ParameterDescription

groupCd

그룹 아이디

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+
+
+
+
+
+
+

[Code 코드 삭제]

+
+

[HTTP REQUEST INFO]

+
+
+
DELETE /v1/com/code/code?groupCd=NEW_GROUP001&cdId=NEW_CODE170605841699 HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Host: localhost:8080
+
+
+ ++++ + + + + + + + + + + + + + + + + +
ParameterDescription

groupCd

그룹 아이디

cdId

코드 아이디

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+
+
+
+
+
+
+

[Code 언어 삭제]

+
+

[HTTP REQUEST INFO]

+
+
+
DELETE /v1/com/code/lang?groupCd=NEW_GROUP001&cdId=NEW_CODE170605841699&langDivCd=ko_KR HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Host: localhost:8080
+
+
+ ++++ + + + + + + + + + + + + + + + + + + + + +
ParameterDescription

groupCd

그룹 아이디

cdId

코드 아이디

langDivCd

삭제할 언어코드

+
+
+

[HTTP RESPONSE INFO]

+
+
+
HTTP/1.1 200 OK
+
+
+
+
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/app/kac-app/src/test/java/kr/co/palnet/kac/BaseTest.java b/app/kac-app/src/test/java/kr/co/palnet/kac/BaseTest.java new file mode 100644 index 0000000..0d7995e --- /dev/null +++ b/app/kac-app/src/test/java/kr/co/palnet/kac/BaseTest.java @@ -0,0 +1,39 @@ +package kr.co.palnet.kac; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.BeforeEach; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.restdocs.RestDocumentationContextProvider; +import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.filter.CharacterEncodingFilter; + +import static org.springframework.restdocs.operation.preprocess.Preprocessors.modifyUris; +import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint; + +public class BaseTest { + + @Autowired + protected WebApplicationContext webApplicationContext; + + public MockMvc mockMvc; + + @BeforeEach + public void setUpAll(RestDocumentationContextProvider restDocumentationContextProvider){ + this.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext) // @Autowired로 빈주입 받은 context + .addFilter(new CharacterEncodingFilter("UTF-8", true)) // UTF-8 인코딩 필터 + .apply( + MockMvcRestDocumentation.documentationConfiguration(restDocumentationContextProvider) + .operationPreprocessors() + .withRequestDefaults( + modifyUris().scheme("http").host("localhost").port(8080), prettyPrint() // URL 정보를 넣어주시면 됩니다. + ) + .withResponseDefaults( + prettyPrint() + ) + ) + .build(); + } +} diff --git a/app/kac-app/src/test/java/kr/co/palnet/kac/com/code/ComnCodeControllerTest.java b/app/kac-app/src/test/java/kr/co/palnet/kac/com/code/ComnCodeControllerTest.java new file mode 100644 index 0000000..6fb138d --- /dev/null +++ b/app/kac-app/src/test/java/kr/co/palnet/kac/com/code/ComnCodeControllerTest.java @@ -0,0 +1,493 @@ +package kr.co.palnet.kac.com.code; + +import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document; +import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessResponse; +import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint; +import static org.springframework.restdocs.payload.PayloadDocumentation.*; +import static org.springframework.restdocs.request.RequestDocumentation.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import kr.co.palnet.kac.BaseTest; +import lombok.RequiredArgsConstructor; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTestContextBootstrapper; +import org.springframework.http.MediaType; +import org.springframework.restdocs.RestDocumentationExtension; +import org.springframework.restdocs.payload.JsonFieldType; +import org.springframework.test.context.BootstrapWith; + +import kr.co.palnet.kac.api.v1.com.code.controller.ComCodeController; +import kr.co.palnet.kac.app.KacAppApplication; + +@SpringBootTest(classes = KacAppApplication.class) +@ExtendWith({RestDocumentationExtension.class}) +@RequiredArgsConstructor +public class ComnCodeControllerTest extends BaseTest { + + + + private final String BASE_URL = "/v1/com/code"; + + @Test + public void deleteLang() throws Exception{ + String groupCd = "NEW_GROUP001"; + String cdId = "NEW_CODE170605841699"; + String langDivCd = "ko_KR"; + + this.mockMvc.perform( + delete(this.BASE_URL + "/lang?groupCd=" + groupCd + "&cdId=" + cdId + "&langDivCd=" + langDivCd) + .contentType(MediaType.APPLICATION_JSON_VALUE) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/lang/delete", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + queryParameters( + parameterWithName("groupCd").description("그룹 아이디"), + parameterWithName("cdId").description("코드 아이디"), + parameterWithName("langDivCd").description("삭제할 언어코드") + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void deleteCode() throws Exception{ + + String groupCd = "NEW_GROUP001"; + String cdId = "NEW_CODE170605841699"; + + this.mockMvc.perform( + delete(this.BASE_URL + "/code?groupCd=" + groupCd + "&cdId=" + cdId) + .contentType(MediaType.APPLICATION_JSON_VALUE) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/code/delete", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + queryParameters( + parameterWithName("groupCd").description("그룹 아이디"), + parameterWithName("cdId").description("코드 아이디") + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void deleteCodeGroup() throws Exception { + String deleteGroupCd = "NEW_Group_1706003812"; + + this.mockMvc.perform( + delete(this.BASE_URL + "/group?groupCd=" + deleteGroupCd) + .contentType(MediaType.APPLICATION_JSON_VALUE) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/group/delete", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + queryParameters( + parameterWithName("groupCd").description("그룹 아이디") + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void updateCodeLang() throws Exception{ + String jsonRQ = """ + { + "groupCd": "NEW_GROUP001", + "cdId": "NEW_CODE001", + "langDivCd": "en_CA", + "cdNm": "신규코드001", + "rm": "비고...." + } + """; + + this.mockMvc.perform( + put(this.BASE_URL + "/lang") + .contentType(MediaType.APPLICATION_JSON_VALUE) + .content(jsonRQ) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/lang/update", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + requestFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("cdId").type(JsonFieldType.STRING).description("코드 아이디"), + fieldWithPath("langDivCd").type(JsonFieldType.STRING).description("언어코드"), + fieldWithPath("cdNm").type(JsonFieldType.STRING).description("코드이름[언어별]"), + fieldWithPath("rm").type(JsonFieldType.STRING).description("비고") + ), + responseFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("cdId").type(JsonFieldType.STRING).description("코드 아이디"), + fieldWithPath("langDivCd").type(JsonFieldType.STRING).description("언어코드"), + fieldWithPath("cdNm").type(JsonFieldType.STRING).description("코드이름[언어별]"), + fieldWithPath("rm").type(JsonFieldType.STRING).description("비고"), + fieldWithPath("createUserId").type(JsonFieldType.STRING).description("등록한 유저 아이디"), + fieldWithPath("createDt").type(JsonFieldType.STRING).description("등록일시"), + fieldWithPath("updateUserId").type(JsonFieldType.STRING).description("수정한 유저 아이디"), + fieldWithPath("updateDt").type(JsonFieldType.STRING).description("수정일시") + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void updateCode() throws Exception{ + String jsonRQ = """ + { + "groupCd": "NEW_GROUP001", + "cdId": "NEW_CODE001", + "sortOrdr": 0, + "addInfoValue": "추가!!", + "useYn": "Y" + } + """; + + this.mockMvc.perform( + put(this.BASE_URL + "/code") + .contentType(MediaType.APPLICATION_JSON_VALUE) + .content(jsonRQ) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/code/update", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + requestFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("cdId").type(JsonFieldType.STRING).description("코드 아이디"), + fieldWithPath("sortOrdr").type(JsonFieldType.NUMBER).description("정렬순서"), + fieldWithPath("addInfoValue").type(JsonFieldType.STRING).description("추가사항"), + fieldWithPath("useYn").type(JsonFieldType.STRING).description("사용여부") + ), + responseFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("cdId").type(JsonFieldType.STRING).description("코드 아이디"), + fieldWithPath("upperCd").type(JsonFieldType.STRING).description("상위 아이디").optional(), + fieldWithPath("sortOrdr").type(JsonFieldType.NUMBER).description("정렬순서"), + fieldWithPath("addInfoValue").type(JsonFieldType.STRING).description("추가사항"), + fieldWithPath("useYn").type(JsonFieldType.STRING).description("사용여부"), + fieldWithPath("createUserId").type(JsonFieldType.STRING).description("등록한 유저 아이디"), + fieldWithPath("createDt").type(JsonFieldType.STRING).description("등록일시"), + fieldWithPath("updateUserId").type(JsonFieldType.STRING).description("수정한 유저 아이디"), + fieldWithPath("updateDt").type(JsonFieldType.STRING).description("수정일시") + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void updateCodeGroup() throws Exception{ + String jsonRQ = """ + { + "groupCd": "NEW_GROUP001", + "siteCd": "KAC", + "groupCdNm": "신규그룹001", + "rm": "비고...." + } + """; + + this.mockMvc.perform( + put(this.BASE_URL + "/group") + .contentType(MediaType.APPLICATION_JSON_VALUE) + .content(jsonRQ) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/group/update", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + requestFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("siteCd").type(JsonFieldType.STRING).description("사이트코드"), + fieldWithPath("groupCdNm").type(JsonFieldType.STRING).description("그룹이름"), + fieldWithPath("rm").type(JsonFieldType.STRING).description("비고") + ), + responseFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("siteCd").type(JsonFieldType.STRING).description("사이트코드"), + fieldWithPath("groupCdNm").type(JsonFieldType.STRING).description("그룹이름"), + fieldWithPath("rm").type(JsonFieldType.STRING).description("비고"), + fieldWithPath("createUserId").type(JsonFieldType.STRING).description("등록한 유저 아이디"), + fieldWithPath("createDt").type(JsonFieldType.STRING).description("등록일시"), + fieldWithPath("updateUserId").type(JsonFieldType.STRING).description("수정한 유저 아이디"), + fieldWithPath("updateDt").type(JsonFieldType.STRING).description("수정일시") + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void createCodeLang() throws Exception{ + + String langDivCd = "ko_KR"; + + String jsonRQ = """ + { + "groupCd": "NEW_GROUP001", + "cdId": "NEW_CODE001", + "langDivCd": "%s", + "cdNm": "신규코드001", + "rm": "비고...." + } + """.formatted(langDivCd); + + this.mockMvc.perform( + post(this.BASE_URL + "/lang") + .contentType(MediaType.APPLICATION_JSON_VALUE) + .content(jsonRQ) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/lang/create", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + requestFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("cdId").type(JsonFieldType.STRING).description("코드 아이디"), + fieldWithPath("langDivCd").type(JsonFieldType.STRING).description("언어코드"), + fieldWithPath("cdNm").type(JsonFieldType.STRING).description("코드이름[언어별]"), + fieldWithPath("rm").type(JsonFieldType.STRING).description("비고") + ), + responseFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("cdId").type(JsonFieldType.STRING).description("코드 아이디"), + fieldWithPath("langDivCd").type(JsonFieldType.STRING).description("언어코드"), + fieldWithPath("cdNm").type(JsonFieldType.STRING).description("코드이름[언어별]"), + fieldWithPath("rm").type(JsonFieldType.STRING).description("비고"), + fieldWithPath("createUserId").type(JsonFieldType.STRING).description("등록한 유저 아이디"), + fieldWithPath("createDt").type(JsonFieldType.STRING).description("등록일시"), + fieldWithPath("updateUserId").type(JsonFieldType.STRING).description("수정한 유저 아이디"), + fieldWithPath("updateDt").type(JsonFieldType.STRING).description("수정일시") + ) + ) + ) + .andExpect(status().isOk()); + + } + + @Test + public void createCode() throws Exception{ + String codeNm = "NEW_CODE" + System.currentTimeMillis(); + codeNm = codeNm.substring(0, 20); + + String jsonRQ = """ + { + "groupCd": "NEW_GROUP001", + "cdId": "%s", + "sortOrdr": 0, + "addInfoValue": "추가!!", + "useYn": "Y" + } + """.formatted(codeNm); + + this.mockMvc.perform( + post(this.BASE_URL + "/code") + .contentType(MediaType.APPLICATION_JSON_VALUE) + .content(jsonRQ) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/code/create", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + requestFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("cdId").type(JsonFieldType.STRING).description("코드 아이디"), + fieldWithPath("sortOrdr").type(JsonFieldType.NUMBER).description("정렬순서"), + fieldWithPath("addInfoValue").type(JsonFieldType.STRING).description("추가사항"), + fieldWithPath("useYn").type(JsonFieldType.STRING).description("사용여부") + ), + responseFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("cdId").type(JsonFieldType.STRING).description("코드 아이디"), + fieldWithPath("upperCd").type(JsonFieldType.STRING).description("상위 아이디").optional(), + fieldWithPath("sortOrdr").type(JsonFieldType.NUMBER).description("정렬순서"), + fieldWithPath("addInfoValue").type(JsonFieldType.STRING).description("추가사항"), + fieldWithPath("useYn").type(JsonFieldType.STRING).description("사용여부"), + fieldWithPath("createUserId").type(JsonFieldType.STRING).description("등록한 유저 아이디"), + fieldWithPath("createDt").type(JsonFieldType.STRING).description("등록일시"), + fieldWithPath("updateUserId").type(JsonFieldType.STRING).description("수정한 유저 아이디"), + fieldWithPath("updateDt").type(JsonFieldType.STRING).description("수정일시") + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void createCodeGroup() throws Exception{ + + String randomNm = "NEW_GROUP_" + System.currentTimeMillis(); + randomNm = randomNm.substring(0, 20); + + String jsonRQ = """ + { + "groupCd": "%s", + "siteCd": "KAC", + "groupCdNm": "신규그룹001", + "rm": "비고...." + } + """.formatted(randomNm); + + this.mockMvc.perform( + post(this.BASE_URL + "/group") + .contentType(MediaType.APPLICATION_JSON_VALUE) + .content(jsonRQ) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/group/create", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + requestFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("siteCd").type(JsonFieldType.STRING).description("사이트코드"), + fieldWithPath("groupCdNm").type(JsonFieldType.STRING).description("그룹이름"), + fieldWithPath("rm").type(JsonFieldType.STRING).description("비고") + ), + responseFields( + fieldWithPath("groupCd").type(JsonFieldType.STRING).description("그룹코드"), + fieldWithPath("siteCd").type(JsonFieldType.STRING).description("사이트코드"), + fieldWithPath("groupCdNm").type(JsonFieldType.STRING).description("그룹이름"), + fieldWithPath("rm").type(JsonFieldType.STRING).description("비고"), + fieldWithPath("createUserId").type(JsonFieldType.STRING).description("등록한 유저 아이디"), + fieldWithPath("createDt").type(JsonFieldType.STRING).description("등록일시"), + fieldWithPath("updateUserId").type(JsonFieldType.STRING).description("수정한 유저 아이디"), + fieldWithPath("updateDt").type(JsonFieldType.STRING).description("수정일시") + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void getAllCodeByGroup() throws Exception{ + String groupCd = "NEW_GROUP001"; + String langDivCd = "ko_KR"; + + this.mockMvc.perform( + get(this.BASE_URL + "/code") + .param("groupCd", groupCd) + .param("langDivCd", langDivCd) + .contentType(MediaType.APPLICATION_JSON_VALUE) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/code", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + queryParameters( + parameterWithName("groupCd").description("그룹코드"), + parameterWithName("langDivCd").description("언어코드") + ), + responseFields( + fieldWithPath("[].groupCd").type(JsonFieldType.STRING).description("코드의 그룹"), + fieldWithPath("[].cdId").type(JsonFieldType.STRING).description("코드의 ID"), + fieldWithPath("[].cdNm").type(JsonFieldType.STRING).description("코드의 이름").optional(), + fieldWithPath("[].upperCd").type(JsonFieldType.STRING).description("상위 코드의 이름").optional(), + fieldWithPath("[].sortOrdr").type(JsonFieldType.NUMBER).description("코드의 정렬순서").optional(), + fieldWithPath("[].addInfoValue").type(JsonFieldType.STRING).description("코드의 추가 밸류").optional(), + fieldWithPath("[].children").type(JsonFieldType.STRING).description("코드의 하위요소").optional() + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void getAllGroupCode() throws Exception{ + this.mockMvc.perform( + get(this.BASE_URL + "/group") + .contentType(MediaType.APPLICATION_JSON_VALUE) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/group", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + responseFields( + fieldWithPath("[].groupCd").type(JsonFieldType.STRING).description("그룹 코드"), + fieldWithPath("[].siteCd").type(JsonFieldType.STRING).description("사이트 코드"), + fieldWithPath("[].groupCdNm").type(JsonFieldType.STRING).description("그룹 명"), + fieldWithPath("[].rm").type(JsonFieldType.STRING).description("비고"), + fieldWithPath("[].codeList").type(JsonFieldType.ARRAY).description("그룹에 포함된 코드 리스트").optional() + ) + ) + ) + .andExpect(status().isOk()); + } + + @Test + public void getAllGroup() throws Exception{ + + String siteCd = "KAC"; + String langDivCd = "ko_KR"; + + this.mockMvc.perform( + get(this.BASE_URL + "/all") + .param("siteCd", siteCd) + .param("langDivCd", langDivCd) + .contentType(MediaType.APPLICATION_JSON_VALUE) + .accept(MediaType.APPLICATION_JSON_VALUE) + ) + .andDo(print()) + .andDo( + document( + "com/code/all", // gradle build를 하게 되면 generated-snippets에 만들어질 폴더이름 + preprocessResponse(prettyPrint()), + queryParameters( + parameterWithName("siteCd").description("사이트코드"), + parameterWithName("langDivCd").description("언어코드") + ), + responseFields( + fieldWithPath("[].groupCd").type(JsonFieldType.STRING).description("그룹 코드"), + fieldWithPath("[].siteCd").type(JsonFieldType.STRING).description("사이트 코드"), + fieldWithPath("[].groupCdNm").type(JsonFieldType.STRING).description("그룹 명"), + fieldWithPath("[].rm").type(JsonFieldType.STRING).description("비고"), + fieldWithPath("[].codeList").type(JsonFieldType.ARRAY).description("그룹에 포함된 코드 리스트").optional(), + fieldWithPath("[].codeList[].groupCd").type(JsonFieldType.STRING).description("코드의 그룹"), + fieldWithPath("[].codeList[].cdId").type(JsonFieldType.STRING).description("코드의 ID"), + fieldWithPath("[].codeList[].cdNm").type(JsonFieldType.STRING).description("코드의 이름").optional(), + fieldWithPath("[].codeList[].upperCd").type(JsonFieldType.STRING).description("상위 코드의 이름").optional(), + fieldWithPath("[].codeList[].sortOrdr").type(JsonFieldType.NUMBER).description("코드의 정렬순서").optional(), + fieldWithPath("[].codeList[].addInfoValue").type(JsonFieldType.STRING).description("코드의 추가 밸류").optional(), + fieldWithPath("[].codeList[].children").type(JsonFieldType.STRING).description("코드의 하위요소").optional() + ) + ) + ) + .andExpect(status().isOk()); + } + +} diff --git a/data/com/src/test/java/kr/co/palnet/kac/data/com/DataComApplicationTestApp.java b/data/com/src/test/java/kr/co/palnet/kac/data/com/DataComApplicationTestApp.java index 958bf66..ed4a020 100644 --- a/data/com/src/test/java/kr/co/palnet/kac/data/com/DataComApplicationTestApp.java +++ b/data/com/src/test/java/kr/co/palnet/kac/data/com/DataComApplicationTestApp.java @@ -15,12 +15,12 @@ public class DataComApplicationTestApp { @Configuration @ComponentScan("kr.co.palnet.kac.data.com") - @EnableJpaRepositories(basePackages = { - "kr.co.palnet.kac.data.com.repository" - }) - @EntityScan(basePackages = { - "kr.co.palnet.kac.data.com.domain" - }) + // @EnableJpaRepositories(basePackages = { + // "kr.co.palnet.kac.data.com.repository" + // }) + // @EntityScan(basePackages = { + // "kr.co.palnet.kac.data.com.domain" + // }) public class Config { } diff --git a/data/user/build.gradle b/data/user/build.gradle new file mode 100644 index 0000000..6875d3b --- /dev/null +++ b/data/user/build.gradle @@ -0,0 +1,6 @@ + + +dependencies { + +} + diff --git a/web/api-user/build.gradle b/web/api-user/build.gradle new file mode 100644 index 0000000..6875d3b --- /dev/null +++ b/web/api-user/build.gradle @@ -0,0 +1,6 @@ + + +dependencies { + +} +