Merge pull request #14 from miniplugin/contribution
윈도우 시스템에서도 다국어 메세지 경로를 사용 및 포털사이트의 묻고답하기 신규 등록시 첨부파일 업로드의 post 테이블에 attachmentCode 누락되는 부분 처리
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -56,8 +56,10 @@ HELP.md
|
||||
**/out/
|
||||
|
||||
# production
|
||||
**/build
|
||||
!**/build/
|
||||
**/build/*
|
||||
**/dist
|
||||
!backend/module-common/build/libs/
|
||||
|
||||
# misc
|
||||
**.DS_Store
|
||||
|
||||
@@ -28,8 +28,8 @@ ext {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// implementation files('../../module-common/build/libs/module-common-0.1.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation files('../module-common/build/libs/module-common-4.1.0-plain.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
// implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation('org.egovframe.rte:org.egovframe.rte.fdl.cmmn:4.1.0') {
|
||||
exclude group: 'org.egovframe.rte', module: 'org.egovframe.rte.fdl.logging'
|
||||
}
|
||||
|
||||
BIN
backend/module-common/build/libs/module-common-4.1.0-plain.jar
Normal file
BIN
backend/module-common/build/libs/module-common-4.1.0-plain.jar
Normal file
Binary file not shown.
BIN
backend/module-common/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
backend/module-common/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
backend/module-common/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
backend/module-common/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -8,6 +8,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
@@ -41,6 +42,7 @@ public class MessageSourceConfig {
|
||||
@Value("${spring.profiles.active:default}")
|
||||
private String profile;
|
||||
|
||||
private static final String FILE_SEPARATOR = File.separator;
|
||||
@Bean
|
||||
public MessageSource messageSource() {
|
||||
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
|
||||
@@ -48,6 +50,9 @@ public class MessageSourceConfig {
|
||||
if ("default".equals(profile)) {
|
||||
Path fileStorageLocation = Paths.get(messagesDirectory).toAbsolutePath().normalize();
|
||||
String dbMessages = StringUtils.cleanPath("file://" + fileStorageLocation + MESSAGES);
|
||||
if(FILE_SEPARATOR.equals("\\")) {//윈도우기반 자바시스템일 때 Could not parse properties file 에러방지
|
||||
dbMessages = StringUtils.cleanPath("file:///" + fileStorageLocation + MESSAGES);
|
||||
}
|
||||
messageSource.setBasenames(dbMessages);
|
||||
} else {
|
||||
messageSource.setBasenames(messagesDirectory + MESSAGES);
|
||||
|
||||
@@ -28,8 +28,8 @@ ext {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// implementation files('../../module-common/build/libs/module-common-0.1.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation files('../module-common/build/libs/module-common-4.1.0-plain.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
// implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation('org.egovframe.rte:org.egovframe.rte.fdl.cmmn:4.1.0') {
|
||||
exclude group: 'org.egovframe.rte', module: 'org.egovframe.rte.fdl.logging'
|
||||
}
|
||||
|
||||
@@ -51,10 +51,16 @@ public class FileStorageUtils implements StorageUtils {
|
||||
private final Path fileStorageLocation;
|
||||
private final Environment environment;
|
||||
private final MessageUtil messageUtil;
|
||||
|
||||
private static final String FILE_SEPARATOR = File.separator;
|
||||
|
||||
public FileStorageUtils(Environment environment, MessageUtil messageUtil) {
|
||||
this.environment = environment;
|
||||
this.fileStorageLocation = Paths.get(environment.getProperty("file.directory")).toAbsolutePath().normalize();
|
||||
String envFileDir = "";
|
||||
envFileDir = environment.getProperty("file.directory");
|
||||
if(FILE_SEPARATOR.equals("\\")) {//윈도우기반 자바시스템일 때 경로 에러방지
|
||||
envFileDir = envFileDir.replaceAll("/", "\\\\");
|
||||
}
|
||||
this.fileStorageLocation = Paths.get(envFileDir).toAbsolutePath().normalize();
|
||||
this.messageUtil = messageUtil;
|
||||
}
|
||||
|
||||
@@ -185,8 +191,9 @@ public class FileStorageUtils implements StorageUtils {
|
||||
|
||||
Path path = getStorePath(basePath);
|
||||
Path target = path.resolve(filename);
|
||||
Files.copy(file.getInputStream(), target, StandardCopyOption.REPLACE_EXISTING);
|
||||
|
||||
InputStream inputStream = file.getInputStream();
|
||||
Files.copy(inputStream, target, StandardCopyOption.REPLACE_EXISTING);
|
||||
inputStream.close(); //윈도우 시스템에서도 업로드 시 Temp폴더의 delete file 에러방지코드 추가
|
||||
return filename;
|
||||
} catch (IOException ex) {
|
||||
log.error("Could not stored file", ex);
|
||||
|
||||
@@ -25,8 +25,8 @@ ext {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// implementation files('../../module-common/build/libs/module-common-0.1.jar') // @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation files('../module-common/build/libs/module-common-4.1.0-plain.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
// implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation('org.egovframe.rte:org.egovframe.rte.fdl.cmmn:4.1.0') {
|
||||
exclude group: 'org.egovframe.rte', module: 'org.egovframe.rte.fdl.logging'
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ ext {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// implementation files('../../module-common/build/libs/module-common-0.1.jar') // @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation files('../module-common/build/libs/module-common-4.1.0-plain.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
// implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation('org.egovframe.rte:org.egovframe.rte.fdl.cmmn:4.1.0') {
|
||||
exclude group: 'org.egovframe.rte', module: 'org.egovframe.rte.fdl.logging'
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ ext {
|
||||
|
||||
|
||||
dependencies {
|
||||
// implementation files('../../module-common/build/libs/module-common-0.1.jar') // @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation files('../module-common/build/libs/module-common-4.1.0-plain.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
// implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation('org.egovframe.rte:org.egovframe.rte.fdl.cmmn:4.1.0') {
|
||||
exclude group: 'org.egovframe.rte', module: 'org.egovframe.rte.fdl.logging'
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ ext {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// implementation files('../../module-common/build/libs/module-common-0.1.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation files('../module-common/build/libs/module-common-4.1.0-plain.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
|
||||
// implementation 'org.egovframe.cloud:module-common:0.1'
|
||||
implementation('org.egovframe.rte:org.egovframe.rte.fdl.cmmn:4.1.0') {
|
||||
exclude group: 'org.egovframe.rte', module: 'org.egovframe.rte.fdl.logging'
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"npm": "6.14.7"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev": "ts-node --transpile-only --project tsconfig.server.json server/index.ts",
|
||||
"dev:sm": "SITE_ID=3 npm run dev",
|
||||
"dev:lg": "SITE_ID=2 npm run dev",
|
||||
"dev:smWin": "set SITE_ID=3&&npm run dev",
|
||||
|
||||
@@ -1137,6 +1137,7 @@ footer div > span a {
|
||||
font-size: 32px;
|
||||
line-height: 32px;
|
||||
text-shadow: 10px 10px 10px rgba(0, 0, 0, 0.5);
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
/* overflow: hidden;
|
||||
white-space: break-spaces;
|
||||
word-break: keep-all; */
|
||||
@@ -1147,6 +1148,7 @@ footer div > span a {
|
||||
left: 6vw;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
font-size: 1.7vw;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
#main .slideBox a:before {
|
||||
content: '╋';
|
||||
@@ -1185,7 +1187,7 @@ footer div > span a {
|
||||
|
||||
#main .slide .reservBox {
|
||||
position: absolute;
|
||||
top: 600px;
|
||||
top: 650px;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
|
||||
@@ -1140,7 +1140,8 @@ footer div > span a {
|
||||
overflow: hidden;
|
||||
}
|
||||
#main .slide div.slide-title p {
|
||||
height: 12vw;
|
||||
/* height: 12vw; */
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
color: #fff;
|
||||
font-size: 2.7vw;
|
||||
font-weight: 600;
|
||||
@@ -1171,6 +1172,7 @@ footer div > span a {
|
||||
left: 6vw;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
font-size: 1.7vw;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
#main .slide a:before {
|
||||
content: '╋';
|
||||
|
||||
30
frontend/portal/server/index.ts
Normal file
30
frontend/portal/server/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { loadEnvConfig } from '@next/env'
|
||||
import express, { Request, Response } from 'express'
|
||||
import next from 'next'
|
||||
loadEnvConfig('./', process.env.NODE_ENV !== 'production')
|
||||
|
||||
const port = process.env.PORT || 3000
|
||||
const dev = process.env.NODE_ENV !== 'production'
|
||||
const app = next({ dev })
|
||||
const handle = app.getRequestHandler()
|
||||
|
||||
const startServer = async () => {
|
||||
try {
|
||||
await app.prepare()
|
||||
const server = express()
|
||||
|
||||
server.all('*', (req: Request, res: Response) => {
|
||||
return handle(req, res)
|
||||
})
|
||||
|
||||
server.listen(port, (err?: any) => {
|
||||
if (err) throw err
|
||||
console.log(`> Ready on localhost:${port} - env ${process.env.NODE_ENV}`)
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
startServer()
|
||||
@@ -146,14 +146,17 @@ const BoardEdit = (props: BoardEditProps) => {
|
||||
data = produce(data, draft => {
|
||||
draft.attachmentCode = result
|
||||
})
|
||||
save(data)
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
save(data)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
save(data)
|
||||
}
|
||||
|
||||
save(data)
|
||||
}
|
||||
}, [postData, attachList])
|
||||
|
||||
|
||||
9
frontend/portal/tsconfig.server.json
Normal file
9
frontend/portal/tsconfig.server.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json", // 기본설정을 포함한다
|
||||
"compilerOptions": {
|
||||
"module": "commonjs", // commonJs 사용하도록 override
|
||||
"outDir": "dist", // 빌드 파일 경로 (production mode)
|
||||
"noEmit": false // 서버에 대한 결과 파일을 내보내지 않음 (production mode)
|
||||
},
|
||||
"include": ["server"] // server/ 디렉토리 아래에 있는 파일만 컴파일 (production mode)
|
||||
}
|
||||
Reference in New Issue
Block a user