From 7ab18d7c02bd10190bc73b0e37ce598e738f2604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Mon, 13 Nov 2023 12:04:20 +0900 Subject: [PATCH] =?UTF-8?q?front=20=20-=20http-proxy-middleware=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80.=20=EC=9E=91=EC=97=85=EC=A4=91.=20end=20=20-?= =?UTF-8?q?=20prod=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80.=20=20-=20ser?= =?UTF-8?q?vice=20=ED=81=B4=EB=9E=98=EC=8A=A4=EC=97=90=20=EC=A0=84?= =?UTF-8?q?=EC=9E=90=EC=A0=95=EB=B6=80=20extends=20=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../package-lock.json | 1 + .../package.json | 4 +- .../standardCode/StandardCodeController.java | 11 ++---- .../mapper/StandardCodeMapper.java | 2 +- .../service/StandardCodeService.java | 8 ++-- .../main/resources/application-dev.properties | 9 +++-- .../resources/application-prod.properties | 37 +++++++++++++++++++ .../resources/application-test.properties | 9 +++-- .../src/main/resources/application.properties | 3 -- 9 files changed, 59 insertions(+), 25 deletions(-) create mode 100644 kcsc-back-end/src/main/resources/application-prod.properties diff --git a/egovframe-template-simple-react-contribution/package-lock.json b/egovframe-template-simple-react-contribution/package-lock.json index bfc4faa..5b13d91 100644 --- a/egovframe-template-simple-react-contribution/package-lock.json +++ b/egovframe-template-simple-react-contribution/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "dependencies": { "bootstrap": "^5.3.2", + "http-proxy-middleware": "^2.0.6", "qs": "^6.11.0", "react": "^18.2.0", "react-bootstrap": "^2.9.0", diff --git a/egovframe-template-simple-react-contribution/package.json b/egovframe-template-simple-react-contribution/package.json index b2cf660..fbf2850 100644 --- a/egovframe-template-simple-react-contribution/package.json +++ b/egovframe-template-simple-react-contribution/package.json @@ -4,6 +4,7 @@ "private": true, "dependencies": { "bootstrap": "^5.3.2", + "http-proxy-middleware": "^2.0.6", "qs": "^6.11.0", "react": "^18.2.0", "react-bootstrap": "^2.9.0", @@ -44,6 +45,5 @@ "last 1 firefox version", "last 1 safari version" ] - }, - "proxy": "http://localhost:8080" + } } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java index b711a1b..3128d29 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java @@ -17,10 +17,7 @@ import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.HashMap; @@ -47,7 +44,6 @@ public class StandardCodeController extends BaseController { @Resource(name = "propertiesService") protected EgovPropertyService propertyService; - private final StandardCodeService standardCodeService; @@ -61,9 +57,8 @@ public class StandardCodeController extends BaseController { @ApiResponse(responseCode = "200", description = "조회 성공"), @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님") }) - @PostMapping(value = "/getCodeTree.do", consumes = MediaType.APPLICATION_JSON_VALUE) - public ResultVO getCodeTree(@RequestBody StandardCodeVO param, @AuthenticationPrincipal LoginVO user) - throws Exception { + @RequestMapping(method = RequestMethod.POST, value = "/getCodeTree.do", consumes = MediaType.APPLICATION_JSON_VALUE) + public ResultVO getCodeTree() throws Exception { ResultVO resultVO = new ResultVO(); Map resultMap = new HashMap<>(); resultMap.put("codeTree", standardCodeService.selectStandardCodeTree()); diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/mapper/StandardCodeMapper.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/mapper/StandardCodeMapper.java index 8e257d9..90f65bc 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/mapper/StandardCodeMapper.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/mapper/StandardCodeMapper.java @@ -14,7 +14,7 @@ public interface StandardCodeMapper { Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo); - List selectStandardCodeRevisionhistoryList(Integer groupseq); + List selectStandardCodeRevisionhistoryList(Integer groupseq); List selectStandardcodelist(String code); } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java index 3621a53..23ad92e 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java @@ -6,6 +6,7 @@ import com.dbnt.kcscbackend.standardCode.mapper.StandardCodeMapper; import com.dbnt.kcscbackend.standardCode.repository.TnDocumentContentRepository; import com.dbnt.kcscbackend.standardCode.repository.TnDocumentGroupRepository; import lombok.RequiredArgsConstructor; +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -14,7 +15,8 @@ import java.util.List; @Service @Transactional @RequiredArgsConstructor -public class StandardCodeService { +public class StandardCodeService extends EgovAbstractServiceImpl { + private final TnDocumentGroupRepository tnDocumentGroupRepository; private final TnDocumentContentRepository tnDocumentContentRepository; private final StandardCodeMapper standardCodeMapper; @@ -27,10 +29,6 @@ public class StandardCodeService { return tnDocumentContentRepository.getRecentFullContextByContent(param.getDocCode(), param.getDocPart()); } - public List selectStandardCodeList(TnDocumentInfo tnDocumentInfo) { - return standardCodeMapper.selectStandardCodeList(tnDocumentInfo); - } - public Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo) { return standardCodeMapper.selectStandardCodeListCnt(tnDocumentInfo); } diff --git a/kcsc-back-end/src/main/resources/application-dev.properties b/kcsc-back-end/src/main/resources/application-dev.properties index 695b292..7765e87 100644 --- a/kcsc-back-end/src/main/resources/application-dev.properties +++ b/kcsc-back-end/src/main/resources/application-dev.properties @@ -1,4 +1,7 @@ +# Access-Control-Allow-Origin +Globals.Allow.Origin = http://localhost:3000 + spring.devtools.livereload.enabled=true #Datasource Configuration spring.sql.init.encoding=utf-8 @@ -6,9 +9,9 @@ spring.sql.init.encoding=utf-8 spring.datasource.hikari.maximum-pool-size=4 #postgresql spring.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy -spring.datasource.url=jdbc:log4jdbc:postgresql://218.36.126.201:5432/kcscdb -spring.datasource.username=postgres -spring.datasource.password=rhksflwk12!@ +spring.datasource.url=jdbc:log4jdbc:postgresql://118.219.150.34:50654/kcsc +spring.datasource.username=kcsc +spring.datasource.password=dbnt0928! #jpa spring.jpa.show-sql=true diff --git a/kcsc-back-end/src/main/resources/application-prod.properties b/kcsc-back-end/src/main/resources/application-prod.properties new file mode 100644 index 0000000..7ba68e1 --- /dev/null +++ b/kcsc-back-end/src/main/resources/application-prod.properties @@ -0,0 +1,37 @@ + +# Access-Control-Allow-Origin +Globals.Allow.Origin = http://118.219.150.34:50680/ + +server.port=50688 + +spring.devtools.livereload.enabled=false +server.error.path=/errors + +logging.level.org.apache.tomcat: info +logging.level.org.apache.catalina: info + +#Datasource Configuration +spring.sql.init.encoding=utf-8 +#maximum-pool-size: CPU core count +spring.datasource.hikari.maximum-pool-size=4 +#postgresql +spring.datasource.driverClassName=org.postgresql.Driver +spring.datasource.url=jdbc:postgresql://localhost/kcsc +spring.datasource.username=kcsc +spring.datasource.password=dbnt0928! + +#jpa +spring.jpa.show-sql=false +spring.jpa.generate-ddl=false +spring.jpa.hibernate.naming.physical-strategy = org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl + +# MyBatis +mybatis.mapper-locations: mybatisMapper/*.xml +mybatis.configuration.map-underscore-to-camel-case=true +mybatis.type-aliases-package=com.dbnt.kcscbackend.**.entity +logging.level.com.atoz_develop.mybatissample.repository=info + +# File Config +Globals.posblAtchFileSize=5242880 +Globals.fileStorePath=C:\\kcsc_web\\uploadedFile +Globals.addedOptions=false \ No newline at end of file diff --git a/kcsc-back-end/src/main/resources/application-test.properties b/kcsc-back-end/src/main/resources/application-test.properties index 1fe701e..fd9132b 100644 --- a/kcsc-back-end/src/main/resources/application-test.properties +++ b/kcsc-back-end/src/main/resources/application-test.properties @@ -1,4 +1,7 @@ +# Access-Control-Allow-Origin +Globals.Allow.Origin = http://118.219.150.34:50590/ + server.port=8088 spring.devtools.livereload.enabled=false @@ -13,9 +16,9 @@ spring.sql.init.encoding=utf-8 spring.datasource.hikari.maximum-pool-size=4 #postgresql spring.datasource.driverClassName=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://218.36.126.201:5432/kcscdb -spring.datasource.username=postgres -spring.datasource.password=rhksflwk12!@ +spring.datasource.url=jdbc:postgresql://localhost/kcsc +spring.datasource.username=kcsc +spring.datasource.password=dbnt0928! #jpa spring.jpa.show-sql=false diff --git a/kcsc-back-end/src/main/resources/application.properties b/kcsc-back-end/src/main/resources/application.properties index e2bf8dc..a7048d4 100644 --- a/kcsc-back-end/src/main/resources/application.properties +++ b/kcsc-back-end/src/main/resources/application.properties @@ -4,8 +4,5 @@ spring.mvc.pathmatch.matching-strategy=ant_path_matcher Globals.pageUnit=10 Globals.pageSize=10 -# Access-Control-Allow-Origin -Globals.Allow.Origin = http://localhost:3000 - #JWT secret key Globals.jwt.secret = egovframe