first commit
This commit is contained in:
37
.gitignore
vendored
Normal file
37
.gitignore
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
HELP.md
|
||||
.gradle
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
3
IssueRecode.txt
Normal file
3
IssueRecode.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
Swagger 추가 시 404 에러 사항
|
||||
- Security 사용 시, Config파일에서 url 제외 시켜줘야 함 (antMatchers에서 requestMatcher로 변경됨)
|
||||
- SpringBoot 3.x 버전 이상 사용 시, openapi gradle starter-webmvc-ui 붙은걸로 써야함.
|
||||
20
README.md
Normal file
20
README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
<div align="center">
|
||||
<img src="https://capsule-render.vercel.app/api?type=waving&color=0:58D68D,100:239B56&height=300§ion=header&text=New%20Ssak%20🌱&fontSize=90&fontColor=fff" />
|
||||
|
||||
|
||||
<h2>✨ NEW SSAK TECH STACK ✨</h2>
|
||||
<img src="https://img.shields.io/badge/Linux-FCC624?style=flat&logo=linux&logoColor=white" />
|
||||
<img src="https://img.shields.io/badge/Ubuntu-E95420?style=flat&logo=ubuntu&logoColor=white" />
|
||||
<br>
|
||||
<img src="https://img.shields.io/badge/Mysql-4479A1?style=flat&logo=mysql&logoColor=white" />
|
||||
<br>
|
||||
<img src="https://img.shields.io/badge/Java-e17205?style=flat&logoColor=white" />
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-6DB33F?style=flat&logo=Spring%20Boot&logoColor=white" />
|
||||
<img src="https://img.shields.io/badge/JPA-6DB33F?style=flat&logoColor=white" />
|
||||
<img src="https://img.shields.io/badge/Query%20DSL-3785c4?style=flat&logoColor=white" />
|
||||
<img src="https://img.shields.io/badge/Swagger-85EA2D?style=flat&logo=swagger&logoColor=white" />
|
||||
<img src="https://img.shields.io/badge/LOG4J-e05347?style=flat&logoColor=white" />
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
68
build.gradle
Normal file
68
build.gradle
Normal file
@@ -0,0 +1,68 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.1.2'
|
||||
id 'io.spring.dependency-management' version '1.1.2'
|
||||
}
|
||||
|
||||
group = 'com.krt'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
|
||||
java {
|
||||
sourceCompatibility = '17'
|
||||
}
|
||||
|
||||
configurations {
|
||||
compileOnly {
|
||||
extendsFrom annotationProcessor
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
|
||||
//SpringBoot 3.x버전 이상에서는 gradle openapi starter-webmvc 붙은걸로 써야 함
|
||||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
|
||||
|
||||
//jwt
|
||||
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
|
||||
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
|
||||
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'
|
||||
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
runtimeOnly 'com.mysql:mysql-connector-j'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
|
||||
// ⭐ Spring boot 3.x이상에서 QueryDsl 패키지를 정의하는 방법
|
||||
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
|
||||
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
|
||||
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
|
||||
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
|
||||
// -- QueryDSL ---
|
||||
|
||||
//poi 엑셀 라이브러리
|
||||
implementation group: 'org.apache.poi', name: 'poi', version: '5.0.0'
|
||||
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.0.0'
|
||||
|
||||
// -- WebSocket --
|
||||
implementation 'org.springframework.boot:spring-boot-starter-websocket' // 스프링에서 제공하는 웹소켓
|
||||
// implementation 'org.webjars:sockjs-client:1.1.2' // sockjs
|
||||
// implementation 'org.webjars:stomp-websocket:2.3.3-1' // stomp
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
clean {
|
||||
delete file('src/main/generated')
|
||||
}
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
248
gradlew
vendored
Normal file
248
gradlew
vendored
Normal file
@@ -0,0 +1,248 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
92
gradlew.bat
vendored
Normal file
92
gradlew.bat
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
1
settings.gradle
Normal file
1
settings.gradle
Normal file
@@ -0,0 +1 @@
|
||||
rootProject.name = 'seed'
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.krt.newssak.Interceptor;
|
||||
|
||||
import com.krt.newssak.service.IpAccessControlService;
|
||||
import com.krt.newssak.util.IpUtil;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
public class IpAccessControlInterceptor implements HandlerInterceptor {
|
||||
private final IpAccessControlService ipAccessControlService;
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
System.out.println(IpUtil.getClientIp(request));
|
||||
String clientIpAddress = IpUtil.getClientIp(request); // 추가
|
||||
if (!ipAccessControlService.isAccessible(clientIpAddress)) {
|
||||
String requestURI = request.getRequestURI();
|
||||
response.sendError(HttpServletResponse.SC_FORBIDDEN);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
30
src/main/java/com/krt/newssak/NewssakApplication.java
Normal file
30
src/main/java/com/krt/newssak/NewssakApplication.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.krt.newssak;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.filter.HiddenHttpMethodFilter;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
//(exclude = SecurityAutoConfiguration.class)
|
||||
@SpringBootApplication
|
||||
public class NewssakApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(NewssakApplication.class, args);
|
||||
}
|
||||
@Bean
|
||||
public HiddenHttpMethodFilter hiddenHttpMethodFilter() {
|
||||
return new HiddenHttpMethodFilter();
|
||||
}
|
||||
// @Bean
|
||||
// public WebMvcConfigurer corsConfigurer() {
|
||||
// return new WebMvcConfigurer() {
|
||||
// @Override
|
||||
// public void addCorsMappings(CorsRegistry registry) {
|
||||
// registry.addMapping("/**").allowedOrigins("*");
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
}
|
||||
21
src/main/java/com/krt/newssak/config/QueryDslConfig.java
Normal file
21
src/main/java/com/krt/newssak/config/QueryDslConfig.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.krt.newssak.config;
|
||||
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
||||
|
||||
@EnableJpaAuditing
|
||||
@Configuration
|
||||
public class QueryDslConfig {
|
||||
|
||||
@PersistenceContext
|
||||
private EntityManager entityManager;
|
||||
|
||||
@Bean
|
||||
public JPAQueryFactory jpaQueryFactory() {
|
||||
return new JPAQueryFactory(this.entityManager);
|
||||
}
|
||||
}
|
||||
70
src/main/java/com/krt/newssak/config/SecurityConfig.java
Normal file
70
src/main/java/com/krt/newssak/config/SecurityConfig.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.krt.newssak.config;
|
||||
|
||||
import com.krt.newssak.jwt.JwtAuthenticationFilter;
|
||||
import com.krt.newssak.jwt.JwtTokenProvider;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.Customizer;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.config.annotation.web.configurers.HttpBasicConfigurer;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@RequiredArgsConstructor
|
||||
public class SecurityConfig {
|
||||
|
||||
private final JwtTokenProvider jwtTokenProvider;
|
||||
|
||||
@Bean
|
||||
public WebSecurityCustomizer webSecurityCustomizer() {
|
||||
return (web) -> web.ignoring().requestMatchers("/v2/api-docs", "/v3/api-docs/**", "/configuration/ui",
|
||||
"/swagger-resources/**", "/configuration/security",
|
||||
"/swagger-ui/**", "/webjars/**","/swagger/**");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PasswordEncoder passwordEncoder() {
|
||||
return PasswordEncoderFactories.createDelegatingPasswordEncoder();
|
||||
}
|
||||
|
||||
|
||||
//Security 6 이상은 꼭 커스텀해야함. 이전에 쓰던 코드들은 스프링 시큐리티 지원 중단됨.
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.httpBasic(HttpBasicConfigurer::disable)
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
.cors(Customizer.withDefaults())
|
||||
.sessionManagement((sessionManagement) ->
|
||||
sessionManagement.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||
)
|
||||
.authorizeHttpRequests((authorizeRequests) ->
|
||||
authorizeRequests.requestMatchers("api/v1/member/login","files/**","ws/api/**","api/v1/list/downloadList","api/v1/kiwi/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.addFilterBefore(new JwtAuthenticationFilter(jwtTokenProvider), UsernamePasswordAuthenticationFilter.class);
|
||||
return http.build();
|
||||
}
|
||||
|
||||
// @Bean
|
||||
// public CorsConfigurationSource corsConfigurationSource() {
|
||||
// CorsConfiguration configuration = new CorsConfiguration();
|
||||
// configuration.setAllowedOrigins(Arrays.asList("*"));
|
||||
// configuration.setAllowedMethods(Arrays.asList("*"));
|
||||
// configuration.setAllowedHeaders(Arrays.asList("Authorization", "Cache-Control", "Content-Type"));
|
||||
// configuration.setAllowCredentials(true);
|
||||
// UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
// source.registerCorsConfiguration("/**", configuration);
|
||||
// return source;
|
||||
// }
|
||||
|
||||
}
|
||||
47
src/main/java/com/krt/newssak/config/SwaggerConfig.java
Normal file
47
src/main/java/com/krt/newssak/config/SwaggerConfig.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package com.krt.newssak.config;
|
||||
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.core.context.SecurityContext;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
//http://localhost:7000/swagger-ui/index.html
|
||||
@Configuration
|
||||
public class SwaggerConfig {
|
||||
|
||||
|
||||
@Bean
|
||||
public OpenAPI newSsakOpenAPI() {
|
||||
Info info = new Info()
|
||||
.version("v1.0.0")
|
||||
.title("새싹 씨앗 API")
|
||||
.description("새싹 구동을 위한 세팅과 관련된 API");
|
||||
|
||||
// SecuritySecheme명
|
||||
String jwtSchemeName = "jwtAuth";
|
||||
// API 요청헤더에 인증정보 포함
|
||||
SecurityRequirement securityRequirement = new SecurityRequirement().addList(jwtSchemeName);
|
||||
// SecuritySchemes 등록
|
||||
Components components = new Components()
|
||||
.addSecuritySchemes(jwtSchemeName, new SecurityScheme()
|
||||
.name(jwtSchemeName)
|
||||
.type(SecurityScheme.Type.HTTP) // HTTP 방식
|
||||
.scheme("bearer")
|
||||
.bearerFormat("JWT")); // 토큰 형식을 지정하는 임의의 문자(Optional)
|
||||
|
||||
return new OpenAPI()
|
||||
.info(info)
|
||||
.addServersItem(new Server().url("/"))
|
||||
.addSecurityItem(securityRequirement)
|
||||
.components(components);
|
||||
}
|
||||
}
|
||||
35
src/main/java/com/krt/newssak/config/WebConfig.java
Normal file
35
src/main/java/com/krt/newssak/config/WebConfig.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.krt.newssak.config;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import com.krt.newssak.Interceptor.IpAccessControlInterceptor;
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@RequiredArgsConstructor
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
private final IpAccessControlInterceptor ipAccessControlInterceptor;
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOriginPatterns("*")
|
||||
.allowedMethods("*")
|
||||
.allowedHeaders("*")
|
||||
.allowCredentials(true)
|
||||
.maxAge(3000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
|
||||
registry.addInterceptor(ipAccessControlInterceptor)
|
||||
.order(1)
|
||||
.addPathPatterns("/swagger-ui/**", "/v3/api-docs/**");
|
||||
}
|
||||
}
|
||||
44
src/main/java/com/krt/newssak/config/WebSocketConfig.java
Normal file
44
src/main/java/com/krt/newssak/config/WebSocketConfig.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.krt.newssak.config;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
||||
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
||||
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSocketMessageBroker
|
||||
@RequiredArgsConstructor
|
||||
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer{
|
||||
@Override
|
||||
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||
//웹소켓 연결 URL
|
||||
registry.addEndpoint("/ws/api")
|
||||
.setAllowedOriginPatterns("*")
|
||||
.withSockJS();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureMessageBroker(MessageBrokerRegistry registry) {
|
||||
//구독자들에게 보낼 URL
|
||||
registry.setApplicationDestinationPrefixes("/pub")
|
||||
//서버로 보낼 URL
|
||||
.enableSimpleBroker("/sub")
|
||||
//.setHeartbeatValue(new long[]{10000, 20000})
|
||||
//.setTaskScheduler(heartBeatScheduler())
|
||||
;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TaskScheduler heartBeatScheduler(){
|
||||
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
|
||||
scheduler.setPoolSize(1);
|
||||
scheduler.setThreadNamePrefix("websocket-heartbeat-thread-");
|
||||
scheduler.initialize();
|
||||
return scheduler;
|
||||
}
|
||||
}
|
||||
110
src/main/java/com/krt/newssak/controller/CapiController.java
Normal file
110
src/main/java/com/krt/newssak/controller/CapiController.java
Normal file
@@ -0,0 +1,110 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.capi.*;
|
||||
import com.krt.newssak.dto.project.ProjectDto;
|
||||
import com.krt.newssak.service.CapiService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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 java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Tag(name = "CAPI", description = "면접원 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/capi")
|
||||
@RequiredArgsConstructor
|
||||
public class CapiController {
|
||||
|
||||
private final CapiService capiService;
|
||||
|
||||
@Operation(summary = "프로젝트 리스트 불러오기", description = "프로젝트 리스트 불러오기")
|
||||
@PostMapping("/getProjectList")
|
||||
public ResponseEntity<?> getProjectList(){
|
||||
|
||||
List<ProjectDto> projectDtoList = capiService.getProjectList();
|
||||
|
||||
return ResponseEntity.ok(projectDtoList);
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 저장 및 수정", description = "면접원 저장 및 수정")
|
||||
@PostMapping("/saveInterviewer")
|
||||
public ResponseEntity<?> saveInterviewer(@RequestBody List<SaveInterviewerRequestDto> saveInterviewerRequestDtos) throws Exception {
|
||||
|
||||
capiService.saveInterviewer(saveInterviewerRequestDtos);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 리스트 불러오기", description = "면접원 리스트 불러오기")
|
||||
@PostMapping("/getInterviewers")
|
||||
public ResponseEntity<?> saveInterviewer() throws Exception {
|
||||
|
||||
return ResponseEntity.ok(capiService.getInterviewers());
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 리스트 삭제하기", description = "면접원 리스트 삭제하기")
|
||||
@PostMapping("/deleteInterviewers")
|
||||
public ResponseEntity<?> deleteInterviewers(@RequestBody DeleteInterviewerRequestDto deleteInterviewerRequestDto) throws Exception {
|
||||
|
||||
capiService.deleteInterviewer(deleteInterviewerRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 배정 현황", description = "면접원 배정 현황")
|
||||
@PostMapping("/getInterviewerAllocationStatus")
|
||||
public ResponseEntity<?> getInterviewerAllocationStatus(@RequestBody GetInterviewerAllocationStatusRequestDto getInterviewerAllocationStatusRequestDto) throws Exception {
|
||||
|
||||
Map<String, Object> allocationStatusList = capiService.getInterviewerAllocationStatus(getInterviewerAllocationStatusRequestDto);
|
||||
|
||||
return ResponseEntity.ok(allocationStatusList);
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 배정 저장", description = "면접원 배정 저장")
|
||||
@PostMapping("/saveInterviewerAllocation")
|
||||
public ResponseEntity<?> saveInterviewerAllocation(@RequestBody SaveInterviewerAllocationRequestDto saveInterviewerAllocationRequestDto) throws Exception {
|
||||
|
||||
capiService.saveInterviewerAllocation(saveInterviewerAllocationRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 현황", description = "면접원 현황")
|
||||
@PostMapping("/getInterviewerSurveyStatus")
|
||||
public ResponseEntity<?> getInterviewerSurveyStatus(@RequestBody GetInterviewerSurveyStatusRequestDto getInterviewerSurveyStatusRequestDto) throws Exception {
|
||||
|
||||
return ResponseEntity.ok(capiService.getInterviewerSurveyStatus(getInterviewerSurveyStatusRequestDto));
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 데이터 삭제 요청 리스트 조회", description = "면접원 데이터 삭제 요청 리스트 조회")
|
||||
@PostMapping("/surveyDataDeleteRequest")
|
||||
public ResponseEntity<?> getSurveyDataDeleteRequestList(@RequestBody GetDeleteSurveyReqDataRequestDto getDeleteSurveyReqDataRequestDto) throws Exception {
|
||||
|
||||
return ResponseEntity.ok(capiService.getSurveyDataDeleteRequestList(getDeleteSurveyReqDataRequestDto));
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 데이터 삭제 요청 승인", description = "면접원 데이터 삭제 요청 승인")
|
||||
@PostMapping("/surveyDataDeleteAccept")
|
||||
public ResponseEntity<?> surveyDataDeleteAccept(@RequestBody SurveyDataDeleteAcceptRequestDto surveyDataDeleteAcceptRequestDto) throws Exception {
|
||||
|
||||
capiService.surveyDataDeleteAccept(surveyDataDeleteAcceptRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 리스트 다운로드", description = "면접원 리스트 다운로드")
|
||||
@PostMapping("/interviewerDownloadList")
|
||||
public ResponseEntity<?> interviewerDownloadList(HttpServletResponse response, @RequestBody GetInterviewerSurveyStatusRequestDto listDownloadGetRequestDto) throws Exception {
|
||||
|
||||
capiService.interviewerDownloadList(response, listDownloadGetRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.datamange.*;
|
||||
import com.krt.newssak.service.DataManageService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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 java.util.List;
|
||||
|
||||
@Tag(name = "DataManage", description = "데이터관리 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/dataManage")
|
||||
@RequiredArgsConstructor
|
||||
public class DataManageController {
|
||||
|
||||
private final DataManageService dataManageService;
|
||||
|
||||
@Operation(summary = "데이터 조회")
|
||||
@PostMapping("/getData")
|
||||
public ResponseEntity<?> getData(@RequestBody GetDataRequestDto getDataRequestDto) throws Exception {
|
||||
|
||||
List<AnswerQuestionDto> answerQuestionDtoList = dataManageService.getAllData(getDataRequestDto);
|
||||
|
||||
return ResponseEntity.ok(answerQuestionDtoList);
|
||||
}
|
||||
|
||||
@Operation(summary = "데이터 수정")
|
||||
@PostMapping("/modifyData")
|
||||
public ResponseEntity<?> modifyData(@RequestBody ModifyDataRequestDto modifyDataRequestDto) throws Exception {
|
||||
|
||||
long result = dataManageService.modifyData(modifyDataRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "데이터 삭제")
|
||||
@PostMapping("/deleteData")
|
||||
public ResponseEntity<?> deleteData(@RequestBody DeleteDataRequestDto deleteDataRequestDto) throws Exception {
|
||||
|
||||
long result = dataManageService.deleteData(deleteDataRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "응답자 목록 조회")
|
||||
@PostMapping("/getAnswerUser")
|
||||
public ResponseEntity<?> getAnswerUser(@RequestBody GetAnswerUserRequestDto getAnswerUserRequestDto) throws Exception {
|
||||
|
||||
List<GetAnswerUserResponseDto> getAnswerUserResponseDtoList = dataManageService.getAnswerUser(getAnswerUserRequestDto);
|
||||
|
||||
return ResponseEntity.ok(getAnswerUserResponseDtoList);
|
||||
}
|
||||
|
||||
@Operation(summary = "응답자 데이터 상태 변경")
|
||||
@PostMapping("/changeAnswerStatus")
|
||||
public ResponseEntity<?> changeAnswerStatus(@RequestBody ChangeStatusRequestDto changeStatusRequestDto) throws Exception {
|
||||
|
||||
long result = dataManageService.changeAnswerStatus(changeStatusRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.hardcode.HardCodeAndHistoryDto;
|
||||
import com.krt.newssak.dto.hardcode.HardCodeDto;
|
||||
import com.krt.newssak.dto.hardcode.HardCodeRequestInfoDto;
|
||||
import com.krt.newssak.service.HardCodeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Tag(name = "HardCode", description = "하드코딩 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/hardcode")
|
||||
@RequiredArgsConstructor
|
||||
public class HardCodeController {
|
||||
|
||||
private final HardCodeService hardCodeService;
|
||||
|
||||
@Operation(summary = "하드코딩 저장", description = "하드코딩과 히스토리 동시 저장")
|
||||
@PostMapping("/saveHardCode")
|
||||
public ResponseEntity<?> saveHardCode(@RequestBody HardCodeDto hardCodeDto) throws Exception {
|
||||
|
||||
hardCodeService.saveHardCode(hardCodeDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "하드코딩과 히스토리 가져오기")
|
||||
@GetMapping("/getHardCode")
|
||||
public ResponseEntity<?> getHardCode(HardCodeRequestInfoDto hardCodeRequestInfoDto) throws Exception {
|
||||
|
||||
HardCodeAndHistoryDto hardCodeAndHistoryDto = hardCodeService.getHardCode(hardCodeRequestInfoDto);
|
||||
|
||||
return ResponseEntity.ok(hardCodeAndHistoryDto);
|
||||
}
|
||||
}
|
||||
61
src/main/java/com/krt/newssak/controller/KiwiController.java
Normal file
61
src/main/java/com/krt/newssak/controller/KiwiController.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.kiwi.request.AllProjectCodeList;
|
||||
import com.krt.newssak.dto.kiwi.request.DelSurveyDataInfo;
|
||||
import com.krt.newssak.dto.kiwi.response.exampleListByKpKey;
|
||||
import com.krt.newssak.service.KiwiService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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 java.util.List;
|
||||
|
||||
@Tag(name = "KIWI", description = "키위 연동 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/kiwi")
|
||||
@RequiredArgsConstructor
|
||||
public class KiwiController {
|
||||
|
||||
private final KiwiService kiwiService;
|
||||
|
||||
@Operation(summary = "프로젝트 전체 조회", description = "새싹 설문 프로젝트 조회")
|
||||
@PostMapping("/getAllProjectList")
|
||||
public ResponseEntity<?> getAllProjectList(AllProjectCodeList allProjectCodeList) throws Exception {
|
||||
|
||||
return ResponseEntity.ok(kiwiService.getAllProjectList(allProjectCodeList));
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 정보 조회", description = "프로젝트 정보 조회")
|
||||
@PostMapping("/getProjectInfo")
|
||||
public ResponseEntity<?> getProjectInfo(String pkey) throws Exception {
|
||||
|
||||
return ResponseEntity.ok(kiwiService.getProjectInfo(pkey));
|
||||
}
|
||||
|
||||
@Operation(summary = "문항 전체 조회", description = "문항 전체 조회")
|
||||
@PostMapping("/getAllQuestionList")
|
||||
public ResponseEntity<?> getAllQuestionList(String pkey) throws Exception {
|
||||
List<exampleListByKpKey> exampleListByKpKeyList = kiwiService.getAllQuestionList(pkey);
|
||||
|
||||
return ResponseEntity.ok(exampleListByKpKeyList);
|
||||
}
|
||||
|
||||
@Operation(summary = "설문 진행 평균 소요 시간 조회", description = "설문 진행 평균 소요 시간 조회")
|
||||
@PostMapping("/getSurveyAnswerAvgTime")
|
||||
public ResponseEntity<?> getSurveyAnswerAvgTime(String pkey) throws Exception {
|
||||
|
||||
return ResponseEntity.ok(kiwiService.getSurveyAnswerAvgTime(pkey));
|
||||
}
|
||||
|
||||
@Operation(summary = "회원 설문 참여 데이터 삭제", description = "회원 설문 참여 데이터 삭제")
|
||||
@PostMapping("/delSurveyData")
|
||||
public ResponseEntity<?> delSurveyData(@RequestBody DelSurveyDataInfo delSurveyDataInfo) throws Exception {
|
||||
|
||||
return ResponseEntity.ok(kiwiService.delSurveyData(delSurveyDataInfo));
|
||||
}
|
||||
}
|
||||
97
src/main/java/com/krt/newssak/controller/ListController.java
Normal file
97
src/main/java/com/krt/newssak/controller/ListController.java
Normal file
@@ -0,0 +1,97 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.list.*;
|
||||
import com.krt.newssak.service.ListService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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 java.util.List;
|
||||
|
||||
@Tag(name = "LIST", description = "리스트 관리 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/list")
|
||||
@RequiredArgsConstructor
|
||||
public class ListController {
|
||||
|
||||
private final ListService listService;
|
||||
|
||||
@Operation(summary = "리스트 헤더 저장 및 수정", description = "리스트 헤더 저장 및 수정")
|
||||
@PostMapping("/saveListHeader")
|
||||
public ResponseEntity<?> saveListHeader(@RequestBody ListHeaderSaveRequestDto listHeaderSaveRequestDto) throws Exception {
|
||||
|
||||
listService.saveListHeader(listHeaderSaveRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 헤더 불러오기", description = "리스트 헤더 불러오기")
|
||||
@PostMapping("/getListHeader")
|
||||
public ResponseEntity<?> getListHeader(@RequestBody ListHeaderGetRequestDto listHeaderGetRequestDto) throws Exception {
|
||||
|
||||
List<ListHeaderResponseDto> listHeaderResponseDtoList = listService.getListHeader(listHeaderGetRequestDto);
|
||||
|
||||
return ResponseEntity.ok(listHeaderResponseDtoList);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 헤더 삭제", description = "리스트 헤더 삭제")
|
||||
@PostMapping("/deleteHeader")
|
||||
public ResponseEntity<?> deleteHeader(@RequestBody ListHeaderDeleteRequestDto listHeaderDeleteRequestDto) throws Exception {
|
||||
|
||||
listService.deleteHeader(listHeaderDeleteRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 내용 저장", description = "리스트 내용 저장")
|
||||
@PostMapping("/saveListContents")
|
||||
public ResponseEntity<?> saveListContents(@RequestBody ListContentSaveRequestDto listContentSaveRequestDto) throws Exception {
|
||||
|
||||
listService.saveListContents(listContentSaveRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 내용 가져오기", description = "리스트 내용 가져오기")
|
||||
@PostMapping("/getListContents")
|
||||
public ResponseEntity<?> getListContents(@RequestBody ListContentGetRequestDto listContentGetRequestDto) throws Exception {
|
||||
|
||||
List<ListContentGetResponseDto> listContentGetResponseDtoList = listService.getListContents(listContentGetRequestDto);
|
||||
|
||||
return ResponseEntity.ok(listContentGetResponseDtoList);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 내용 수정", description = "리스트 내용 수정")
|
||||
@PostMapping("/modifyListContents")
|
||||
public ResponseEntity<?> modifyListContents(@RequestBody ListContentModifyRequestDto listContentModifyRequestDto) throws Exception {
|
||||
|
||||
listService.modifyListContents(listContentModifyRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 내용 삭제", description = "리스트 내용 삭제")
|
||||
@PostMapping("/deletesListContents")
|
||||
public ResponseEntity<?> deletesListContents(@RequestBody ListContentDeleteRequestDto listContentDeleteRequestDto) throws Exception {
|
||||
|
||||
listService.deleteListContents(listContentDeleteRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 다운로드", description = "리스트 다운로드")
|
||||
@PostMapping("/downloadList")
|
||||
public ResponseEntity<?> downloadList(HttpServletResponse response, @RequestBody ListDownloadGetRequestDto listDownloadGetRequestDto) throws Exception {
|
||||
|
||||
listService.downloadList(response, listDownloadGetRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.common.TokenInfo;
|
||||
import com.krt.newssak.dto.member.MemberDto;
|
||||
import com.krt.newssak.dto.member.MemberLoginDto;
|
||||
import com.krt.newssak.service.MemberService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.security.Principal;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "Member", description = "멤버 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/member")
|
||||
@RequiredArgsConstructor
|
||||
public class MemberController {
|
||||
|
||||
private final MemberService memberService;
|
||||
|
||||
@Operation(summary = "Login 요청", description = "ID와 PW로 로그인 하는 API")
|
||||
@PostMapping("/login")
|
||||
public ResponseEntity<?> login(@RequestBody MemberLoginDto memberLoginDto) {
|
||||
TokenInfo tokenInfo = memberService.login(memberLoginDto.getId(), memberLoginDto.getPassword());
|
||||
return ResponseEntity.ok(tokenInfo);
|
||||
}
|
||||
|
||||
@GetMapping("/getInfo")
|
||||
public ResponseEntity<?> getInfo(Authentication authentication) {
|
||||
LinkedHashMap details = (LinkedHashMap)authentication.getDetails();
|
||||
MemberDto member = memberService.getInfoWithDetails(details);
|
||||
|
||||
return ResponseEntity.ok(member);
|
||||
}
|
||||
|
||||
@GetMapping("/getAllList")
|
||||
public ResponseEntity<?> getAllList(){
|
||||
List<MemberDto> memberList = memberService.getAllList();
|
||||
|
||||
return ResponseEntity.ok(memberList);
|
||||
}
|
||||
}
|
||||
169
src/main/java/com/krt/newssak/controller/ProjectController.java
Normal file
169
src/main/java/com/krt/newssak/controller/ProjectController.java
Normal file
@@ -0,0 +1,169 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.project.*;
|
||||
import com.krt.newssak.service.ProjectService;
|
||||
import com.krt.newssak.util.SecurityUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "Project", description = "프로젝트 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/project")
|
||||
@RequiredArgsConstructor
|
||||
public class ProjectController {
|
||||
|
||||
private final ProjectService projectService;
|
||||
|
||||
@Operation(summary = "PKEY 암호화")
|
||||
@GetMapping("/skey")
|
||||
public ResponseEntity<?> getSkey(@Parameter(name = "project_code") String project_code) throws Exception {
|
||||
String skey = URLEncoder.encode(SecurityUtil.encrypt(project_code), "UTF-8");
|
||||
return ResponseEntity.ok(skey);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 리스트 불러오기")
|
||||
@GetMapping("/getProjectList")
|
||||
public ResponseEntity<?> getProjectList(@ModelAttribute ProjectSearchDto projectSearchDto,
|
||||
@PageableDefault(size = 6) Pageable pageable) {
|
||||
|
||||
Page<ProjectWithHashtagDto> list = projectService.getProjectList(projectSearchDto, pageable);
|
||||
|
||||
return ResponseEntity.ok(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 파라미터 불러오기")
|
||||
@GetMapping("/getParameter")
|
||||
public ResponseEntity<?> getProjectParameter(@Parameter(name = "project_code") String project_code){
|
||||
List<ProjectParameterDto> projectParameterDto = projectService.getProjectParameter(project_code);
|
||||
return ResponseEntity.ok(projectParameterDto);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 리다이렉트 정보 불러오기")
|
||||
@GetMapping("/getRedirect")
|
||||
public ResponseEntity<?> getProjectRedirect(@Parameter(name = "project_code") String project_code){
|
||||
List<ProjectRedirectDto> projectRedirectDto = projectService.getProjectRedirect(project_code);
|
||||
return ResponseEntity.ok(projectRedirectDto);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 중복 체크")
|
||||
@GetMapping("/getDuplicate")
|
||||
public ResponseEntity<?> getDuplicate(@Parameter(name = "project_code") String project_code){
|
||||
int isDuplicate = projectService.checkDuplicateProjectCode(project_code);
|
||||
return ResponseEntity.ok(isDuplicate);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 등록 및 수정")
|
||||
@PostMapping("/setProject")
|
||||
public ResponseEntity<?> upsertProject(@RequestBody ProjectUpsertDto projectUpsertDto){
|
||||
long upsertCount = projectService.upsertProject(projectUpsertDto);
|
||||
|
||||
return ResponseEntity.ok(upsertCount);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 상태값 변경")
|
||||
@PostMapping("/setProjectState")
|
||||
public ResponseEntity<?> updateProjectState(@RequestBody ProjectStateDto projectStateDto){
|
||||
long updateCount = 0;
|
||||
updateCount = projectService.updateProjectState(projectStateDto);
|
||||
|
||||
return ResponseEntity.ok(updateCount);
|
||||
}
|
||||
|
||||
@Operation(summary = "특정 프로젝트 삭제")
|
||||
@PostMapping("/deleteProject")
|
||||
public ResponseEntity<?> deleteProject(@RequestBody ProjectDeleteDto projectDeleteDto){
|
||||
long deleteCount = 0;
|
||||
deleteCount = projectService.deleteProject(projectDeleteDto.getProject_code());
|
||||
|
||||
return ResponseEntity.ok(deleteCount);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 파라미터 등록")
|
||||
@PostMapping("/insertParameter")
|
||||
public ResponseEntity<?> insertProjectParameter(@RequestBody ProjectParameterDto projectParameterDto){
|
||||
boolean isInsert = projectService.insertProjectParameter(projectParameterDto);
|
||||
return ResponseEntity.ok(isInsert);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 파라미터 삭제")
|
||||
@PostMapping("/deleteParameter")
|
||||
public ResponseEntity<?> deleteProjectParameter(@RequestBody ProjectParameterDeleteDto projectParameterDeleteDto){
|
||||
long deleteCount = projectService.deleteProjectParameter(projectParameterDeleteDto);
|
||||
return ResponseEntity.ok(deleteCount);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 리다이렉트 정보 등록 및 수정")
|
||||
@PostMapping("/setRedirect")
|
||||
public ResponseEntity<?> upsertProjectRedirect(@RequestBody ProjectRedirectDto projectRedirectDto){
|
||||
boolean isInsert = projectService.upsertProjectRedirect(projectRedirectDto);
|
||||
return ResponseEntity.ok(isInsert);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 리다이렉트 정보 삭제")
|
||||
@PostMapping("/deleteRedirect")
|
||||
public ResponseEntity<?> deleteProjectRedirect(@RequestBody ProjectRedirectDeleteDto projectRedirectDeleteDto){
|
||||
long deleteCount = projectService.deleteProjectRedirect(projectRedirectDeleteDto);
|
||||
return ResponseEntity.ok(deleteCount);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 정보 불러오기")
|
||||
@GetMapping("/getProjectInfo")
|
||||
public ResponseEntity<?> getProjectInfo(@Parameter(name = "project_code") String project_code){
|
||||
ProjectInfoDto projectInfoDto = projectService.getProjectInfo(project_code);
|
||||
return ResponseEntity.ok(projectInfoDto);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 응답 옵션 불러오기")
|
||||
@GetMapping("/getResponse")
|
||||
public ResponseEntity<?> getProjectResponse(@Parameter(name = "project_code") String project_code){
|
||||
ProjectOptionDto projectOptionDto = projectService.getProjectResponse(project_code);
|
||||
return ResponseEntity.ok(projectOptionDto);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 응답 옵션 수정")
|
||||
@PostMapping("/setResponse")
|
||||
public ResponseEntity<?> upsertProjectResponse(@RequestBody ProjectOptionDto projectOptionDto){
|
||||
boolean isInsert = projectService.upsertProjectResponse(projectOptionDto);
|
||||
return ResponseEntity.ok(isInsert);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 스타일 불러오기")
|
||||
@GetMapping("/getStyle")
|
||||
public ResponseEntity<?> getProjectStyle(@Parameter(name = "project_code") String project_code){
|
||||
ProjectOptionDto projectOptionDto = projectService.getProjectStyle(project_code);
|
||||
return ResponseEntity.ok(projectOptionDto);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 스타일 수정")
|
||||
@PostMapping("/setStyle")
|
||||
public ResponseEntity<?> upsertProjectStyle(@RequestBody ProjectOptionDto projectOptionDto){
|
||||
boolean isInsert = projectService.upsertProjectStyle(projectOptionDto);
|
||||
return ResponseEntity.ok(isInsert);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 상태별 데이터 부수")
|
||||
@GetMapping("/getStatusByCount")
|
||||
public ResponseEntity<?> getStatusByCount(@Parameter(name = "project_code") String project_code){
|
||||
|
||||
return ResponseEntity.ok(projectService.getStatusByCount(project_code));
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 복사")
|
||||
@PostMapping("/copyProject")
|
||||
public ResponseEntity<?> copyProject(@RequestBody ProjectCopyRequestDto projectCopyRequestDto) throws Exception {
|
||||
|
||||
projectService.copyProject(projectCopyRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
}
|
||||
161
src/main/java/com/krt/newssak/controller/QuestionController.java
Normal file
161
src/main/java/com/krt/newssak/controller/QuestionController.java
Normal file
@@ -0,0 +1,161 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.autorecode.GetAutoRecodeRequestDto;
|
||||
import com.krt.newssak.dto.autorecode.GetAutoRecodeResponseDto;
|
||||
import com.krt.newssak.dto.autorecode.SaveAutoRecodeRequestDto;
|
||||
import com.krt.newssak.dto.common.ErrorMessageDto;
|
||||
import com.krt.newssak.dto.question.*;
|
||||
import com.krt.newssak.service.QuestionService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "Question", description = "문항 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/question")
|
||||
@RequiredArgsConstructor
|
||||
public class QuestionController {
|
||||
private final QuestionService questionService;
|
||||
|
||||
@Operation(summary = "문항ID 중복 체크")
|
||||
@GetMapping("/getDuplicateQuestionID")
|
||||
public ResponseEntity<?> getDuplicateQuestionID(
|
||||
@Parameter(name = "project_code") String project_code
|
||||
, @Parameter(name = "question_unique_key") int question_unique_key
|
||||
, @Parameter(name = "question_id") String question_id
|
||||
) {
|
||||
boolean isDuplicate = questionService.getDuplicateQuestionID(project_code, question_unique_key, question_id);
|
||||
|
||||
return ResponseEntity.ok(isDuplicate);
|
||||
}
|
||||
|
||||
@Operation(summary = "문항 정보 저장")
|
||||
@PostMapping("/setQuestionInfo")
|
||||
public ResponseEntity<?> setQuestionInfo(@RequestBody QuestionUpsertDto questionUpsertDto) {
|
||||
int upsertQuestionUniqueKey = questionService.upsertQuestion(questionUpsertDto);
|
||||
|
||||
return ResponseEntity.ok(upsertQuestionUniqueKey);
|
||||
}
|
||||
|
||||
@Operation(summary = "문항 정보 삭제")
|
||||
@PostMapping("/deleteQuestionInfo")
|
||||
public ResponseEntity<?> deleteQuestionInfo(@RequestBody QuestionDeleteDto questionDeleteDto) {
|
||||
long deleteCount = questionService.deleteQuestion(questionDeleteDto);
|
||||
|
||||
return ResponseEntity.ok(deleteCount);
|
||||
}
|
||||
|
||||
@Operation(summary = "문항 정보 복사")
|
||||
@PostMapping("/copyQuestionInfo")
|
||||
public ResponseEntity<?> copyQuestionInfo(@RequestBody QuestionCopyDto questionCopyDto) {
|
||||
long copyCount = questionService.copyQuestion(questionCopyDto);
|
||||
|
||||
return ResponseEntity.ok(copyCount);
|
||||
}
|
||||
|
||||
@Operation(summary = "문항 순서 변경")
|
||||
@PostMapping("/reorderQuestionInfo")
|
||||
public ResponseEntity<?> reorderQuestionInfo(@RequestBody QuestionReorderDto questionReorderDto) {
|
||||
boolean isReorder = questionService.reorderQuestion(questionReorderDto);
|
||||
|
||||
return ResponseEntity.ok(isReorder);
|
||||
}
|
||||
|
||||
@Operation(summary = "로직 정보 저장")
|
||||
@PostMapping("/setQuestionLogic")
|
||||
public ResponseEntity<?> setQuestionLogic(@RequestBody QuestionLogicDto questionLogicDto){
|
||||
long upsertCount = questionService.upsertQuestionLogic(questionLogicDto);
|
||||
|
||||
return ResponseEntity.ok(upsertCount);
|
||||
}
|
||||
|
||||
@Operation(summary = "로직 정보 가져오기")
|
||||
@GetMapping("/getQuestionLogic")
|
||||
public ResponseEntity<?> getQuestionLogic(@Parameter(name = "project_code") String project_code, @Parameter(name = "question_unique_key") int question_unique_key){
|
||||
return ResponseEntity.ok(questionService.getQuestionLogic(project_code,question_unique_key));
|
||||
}
|
||||
|
||||
@Operation(summary = "로직 구문 검증")
|
||||
@PostMapping("/doLogicVerify")
|
||||
public ResponseEntity<?> logicVerify(@RequestBody QuestionLogicDto questionLogicDto) {
|
||||
String projectCode = questionLogicDto.getProject_code();
|
||||
String logicPosition = "";
|
||||
int logicPointer = 0;
|
||||
try {
|
||||
logicPosition = "사전";
|
||||
logicPointer = 1;
|
||||
List<QuestionLogicJsonDto> beforeLogicList = questionLogicDto.getBefore_logic();
|
||||
for(QuestionLogicJsonDto beforeLogic : beforeLogicList){
|
||||
questionService.logicVerify(projectCode, beforeLogic.getLogic());
|
||||
logicPointer++;
|
||||
}
|
||||
|
||||
logicPosition = "사후";
|
||||
logicPointer = 1;
|
||||
List<QuestionLogicJsonDto> afterLogicList = questionLogicDto.getAfter_logic();
|
||||
for(QuestionLogicJsonDto afterLogic : afterLogicList) {
|
||||
questionService.logicVerify(projectCode, afterLogic.getLogic());
|
||||
logicPointer++;
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
catch (Exception ex){
|
||||
HttpHeaders resHeaders = new HttpHeaders();
|
||||
resHeaders.add("Content-Type", "application/json;charset=UTF-8");
|
||||
return new ResponseEntity<>(new ErrorMessageDto(logicPosition + "로직의 " + logicPointer + "번째 로직 구문 오류"), resHeaders, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "블록 추가 및 수정")
|
||||
@PostMapping("/setBlockQuestion")
|
||||
public ResponseEntity<?> setBlockQuestion(@RequestBody QuestionBlockRequestDto questionBlockRequestDto){
|
||||
|
||||
int result = questionService.setBlockQuestion(questionBlockRequestDto);
|
||||
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "블록 가져오기")
|
||||
@GetMapping("/getBlockQuestion")
|
||||
public ResponseEntity<?> getBlockQuestion(@Parameter(name = "project_code") String project_code){
|
||||
|
||||
List<QuestionBlockResponseDto> questionBlockList = questionService.getBlockQuestion(project_code);
|
||||
|
||||
return ResponseEntity.ok(questionBlockList);
|
||||
}
|
||||
|
||||
@Operation(summary = "블록 삭제")
|
||||
@PostMapping("/deleteBlockQuestion")
|
||||
public ResponseEntity<?> deleteBlockQuestion(@RequestBody QuestionBlockDeleteRequestDto questionBlockDeleteRequestDto){
|
||||
|
||||
int result = questionService.deleteBlockQuestion(questionBlockDeleteRequestDto);
|
||||
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "오토리코드 저장 및 수정")
|
||||
@PostMapping("/saveAutoRecode")
|
||||
public ResponseEntity<?> saveAutoRecode(@RequestBody List<SaveAutoRecodeRequestDto> saveAutoRecodeRequestDto){
|
||||
|
||||
int result = questionService.saveAutoRecode(saveAutoRecodeRequestDto);
|
||||
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "오토리코드 가져오기")
|
||||
@PostMapping("/getAutoRecode")
|
||||
public ResponseEntity<?> getAutoRecode(@RequestBody GetAutoRecodeRequestDto GetAutoRecodeRequestDto){
|
||||
|
||||
List<GetAutoRecodeResponseDto> getAutoRecodeResponseDtoList = questionService.getAutoRecode(GetAutoRecodeRequestDto);
|
||||
|
||||
return ResponseEntity.ok(getAutoRecodeResponseDtoList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.quota.QuotaDeleteDto;
|
||||
import com.krt.newssak.dto.quota.QuotaListDto;
|
||||
import com.krt.newssak.dto.quota.QuotaUpsertDto;
|
||||
import com.krt.newssak.service.QuotaService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "Quota", description = "쿼터 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/quota")
|
||||
@RequiredArgsConstructor
|
||||
public class QuotaController {
|
||||
private final QuotaService quotaService;
|
||||
@Operation(summary = "쿼터 정보 가져오기")
|
||||
@GetMapping("/getQuotaInfo")
|
||||
public ResponseEntity<?> getQuotaList(@Parameter(name = "project_code") String project_code) {
|
||||
return ResponseEntity.ok(quotaService.getQuotaList(project_code));
|
||||
}
|
||||
|
||||
@Operation(summary = "쿼터 상세 정보 가져오기")
|
||||
@GetMapping("/getQuotaCellInfo")
|
||||
public ResponseEntity<?> getQuotaCellInfo(
|
||||
@Parameter(name = "project_code") String project_code
|
||||
, @Parameter(name = "quota_code") int quota_code
|
||||
) {
|
||||
return ResponseEntity.ok(quotaService.getQuotaInfo(project_code, quota_code));
|
||||
}
|
||||
|
||||
@Operation(summary = "쿼터 정보 저장")
|
||||
@PostMapping("/setQuotaInfo")
|
||||
public ResponseEntity<?> setQuotaInfo(@RequestBody QuotaUpsertDto quotaDto) {
|
||||
return ResponseEntity.ok(quotaService.setQuota(quotaDto));
|
||||
}
|
||||
|
||||
@Operation(summary = "쿼터 삭제")
|
||||
@PostMapping("/deleteQuotaInfo")
|
||||
public ResponseEntity<?> deleteQuotaInfo(@RequestBody QuotaDeleteDto quotaDeleteDto) {
|
||||
return ResponseEntity.ok(quotaService.deleteQuota(quotaDeleteDto));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.krt.newssak.controller;
|
||||
|
||||
import com.krt.newssak.dto.websocket.QuestionSettingWSInfo;
|
||||
import com.krt.newssak.service.WebSocketService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.messaging.handler.annotation.DestinationVariable;
|
||||
import org.springframework.messaging.handler.annotation.MessageMapping;
|
||||
import org.springframework.messaging.simp.SimpMessagingTemplate;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Tag(name = "WebSocket", description = "웹소켓 API")
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class WebSocketController {
|
||||
|
||||
private final SimpMessagingTemplate simpMessagingTemplate;
|
||||
private final WebSocketService webSocketService;
|
||||
|
||||
//방 구독
|
||||
@MessageMapping("/connection/{projectCode}")
|
||||
public void connection(@DestinationVariable String projectCode) {
|
||||
ArrayList<QuestionSettingWSInfo> setUserList = webSocketService.sessionGet(projectCode);
|
||||
// System.out.println(setUserList + "<<<연결 리스트");
|
||||
|
||||
simpMessagingTemplate.convertAndSend("/sub/connection/" + projectCode, setUserList);
|
||||
}
|
||||
|
||||
@MessageMapping("/questionChange")
|
||||
public void questionChange(QuestionSettingWSInfo questionSettingWSInfo) {
|
||||
ArrayList<QuestionSettingWSInfo> setUserList = webSocketService.questionChange(questionSettingWSInfo);
|
||||
|
||||
// System.out.println(setUserList + "<<<문항변경 리스트");
|
||||
|
||||
simpMessagingTemplate.convertAndSend("/sub/connection/" + questionSettingWSInfo.getProjectCode(), setUserList);
|
||||
}
|
||||
|
||||
@MessageMapping("/messageChange")
|
||||
public void messageChange(QuestionSettingWSInfo questionSettingWSInfo) {
|
||||
ArrayList<QuestionSettingWSInfo> setUserList = webSocketService.messageChange(questionSettingWSInfo);
|
||||
|
||||
// System.out.println(setUserList + "<<<상태값 변경 리스트");
|
||||
|
||||
simpMessagingTemplate.convertAndSend("/sub/connection/" + questionSettingWSInfo.getProjectCode(), setUserList);
|
||||
|
||||
webSocketService.listStatusReset(questionSettingWSInfo);
|
||||
|
||||
// System.out.println(setUserList + "<<<상태값 변경 최종 리스트");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.krt.newssak.dto.autorecode;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetAutoRecodeRequestDto {
|
||||
private String projectCode;
|
||||
private int questionUniqueKey;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.krt.newssak.dto.autorecode;
|
||||
|
||||
import com.krt.newssak.entity.autorecode.AutoRecodeEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetAutoRecodeResponseDto {
|
||||
private int idx;
|
||||
private String projectCode;
|
||||
private int questionUniqueKey;
|
||||
private int recodeValue;
|
||||
private String recodeCondition;
|
||||
private int regMember;
|
||||
|
||||
public static GetAutoRecodeResponseDto of(AutoRecodeEntity autoRecodeEntity){
|
||||
return GetAutoRecodeResponseDto.builder()
|
||||
.idx(autoRecodeEntity.getIdx())
|
||||
.projectCode(autoRecodeEntity.getProjectCode())
|
||||
.questionUniqueKey(autoRecodeEntity.getQuestionUniqueKey())
|
||||
.recodeValue(autoRecodeEntity.getRecodeValue())
|
||||
.recodeCondition(autoRecodeEntity.getRecodeCondition())
|
||||
.regMember(autoRecodeEntity.getRegMember())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.autorecode;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SaveAutoRecodeRequestDto {
|
||||
private int idx;
|
||||
private String projectCode;
|
||||
private int questionUniqueKey;
|
||||
private int recodeValue;
|
||||
private String recodeCondition;
|
||||
private String regDate;
|
||||
private int regMember;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeleteInterviewerRequestDto {
|
||||
private List<Long> deleteIdxList;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeleteSurveyDataRequestDto {
|
||||
private String interviewerId;
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
private String reason;
|
||||
private int result;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetDeleteSurveyDataResponseDto {
|
||||
private int idx;
|
||||
private String answerId;
|
||||
private String answerEndTime;
|
||||
private int answerStatus;
|
||||
private String reason;
|
||||
private int result;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetDeleteSurveyReqDataRequestDto {
|
||||
private String projectCode;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetInterviewerAllocationStatusRequestDto {
|
||||
private String projectCode;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetInterviewerAllocationStatusResponseDto {
|
||||
private int idx;
|
||||
private String interviewerCode;
|
||||
private String projectCode;
|
||||
|
||||
// public static GetInterviewerAllocationStatusResponseDto of(InterviewerInfoEntity interviewerInfoEntity){
|
||||
// return GetInterviewerAllocationStatusResponseDto.builder()
|
||||
// .idx(interviewerInfoEntity.getIdx())
|
||||
// .code(interviewerInfoEntity.getCode())
|
||||
// .id(interviewerInfoEntity.getInterviewerId())
|
||||
// .pwd(interviewerInfoEntity.getInterviewerPwd())
|
||||
// .name(interviewerInfoEntity.getInterviewerName())
|
||||
// .build();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetInterviewerAssignProjectRequestDto {
|
||||
private String interviewerCode;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import com.krt.newssak.entity.capi.InterviewerAssignEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetInterviewerAssignResponseDto {
|
||||
private int idx;
|
||||
private String interviewerCode;
|
||||
private String projectCode;
|
||||
|
||||
public static GetInterviewerAssignResponseDto of(InterviewerAssignEntity interviewerAssignEntity){
|
||||
return GetInterviewerAssignResponseDto.builder()
|
||||
.idx(interviewerAssignEntity.getIdx())
|
||||
.interviewerCode(interviewerAssignEntity.getInterviewerId())
|
||||
.projectCode(interviewerAssignEntity.getProjectCode())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import com.krt.newssak.entity.capi.InterviewerInfoEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetInterviewerResponseDto {
|
||||
private int idx;
|
||||
private String code;
|
||||
private String id;
|
||||
private String pwd;
|
||||
private String name;
|
||||
private String info;
|
||||
|
||||
public static GetInterviewerResponseDto of(InterviewerInfoEntity interviewerInfoEntity){
|
||||
return GetInterviewerResponseDto.builder()
|
||||
.idx(interviewerInfoEntity.getIdx())
|
||||
.code(interviewerInfoEntity.getCode())
|
||||
.id(interviewerInfoEntity.getInterviewerId())
|
||||
.pwd(interviewerInfoEntity.getInterviewerPwd())
|
||||
.name(interviewerInfoEntity.getInterviewerName())
|
||||
.info(interviewerInfoEntity.getInterviewerInfo())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetInterviewerSurveyStatusRequestDto {
|
||||
private String projectCode;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetInterviewerSurveyStatusResponseDto {
|
||||
private String interviewerCode;
|
||||
private String interviewerId;
|
||||
private int progressCount;
|
||||
private int successCount;
|
||||
private int screenCount;
|
||||
private int quotaCount;
|
||||
|
||||
public List<String> fieldValuesList(){
|
||||
List<String> valuesList = new ArrayList<>();
|
||||
|
||||
valuesList.add(interviewerCode);
|
||||
valuesList.add(interviewerId);
|
||||
valuesList.add(String.valueOf(progressCount));
|
||||
valuesList.add(String.valueOf(successCount));
|
||||
valuesList.add(String.valueOf(screenCount));
|
||||
valuesList.add(String.valueOf(quotaCount));
|
||||
|
||||
return valuesList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import com.krt.newssak.entity.survey.SurveyRespondentEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetSurveyDetailResponseDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
private int surveyTypeCode;
|
||||
private int answerState;
|
||||
private String answerStartDate;
|
||||
private String answerEndQuestionId;
|
||||
private String answerEndDate;
|
||||
|
||||
public static GetSurveyDetailResponseDto of(SurveyRespondentEntity surveyRespondentEntity){
|
||||
return GetSurveyDetailResponseDto.builder()
|
||||
.projectCode(surveyRespondentEntity.getProjectCode())
|
||||
.answerId(surveyRespondentEntity.getAnswerId())
|
||||
.surveyTypeCode(surveyRespondentEntity.getSurveyTypeCode())
|
||||
.answerState(surveyRespondentEntity.getAnswerState())
|
||||
.answerStartDate(surveyRespondentEntity.getAnswerStartDate().toString())
|
||||
.answerEndDate(surveyRespondentEntity.getAnswerEndDate().toString())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import com.krt.newssak.entity.survey.SurveyRespondentEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetSurveyStatusCountResponseDto {
|
||||
private int totalCount;
|
||||
private int progressCount;
|
||||
private int successCount;
|
||||
private int screenCount;
|
||||
private int quotaCount;
|
||||
|
||||
public void filteringCount(List<SurveyRespondentEntity> surveyRespondentEntityList){
|
||||
|
||||
this.totalCount = surveyRespondentEntityList.size();
|
||||
|
||||
for(SurveyRespondentEntity surveyRespondentEntity : surveyRespondentEntityList){
|
||||
switch (surveyRespondentEntity.getAnswerState()){
|
||||
case 1 ->{
|
||||
this.progressCount += 1;
|
||||
}
|
||||
case 10 ->{
|
||||
this.successCount += 1;
|
||||
}
|
||||
case 99 ->{
|
||||
this.screenCount += 1;
|
||||
}
|
||||
case 98 ->{
|
||||
this.quotaCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SaveAllocationRequestDto {
|
||||
private String interviewerCode;
|
||||
private String projectCode;
|
||||
private int regMember;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SaveInterviewerAllocationRequestDto {
|
||||
private List<SaveAllocationRequestDto> saveAllocationList;
|
||||
private List<Long> deleteIdxList;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SaveInterviewerRequestDto {
|
||||
private int idx;
|
||||
private String code;
|
||||
private String id;
|
||||
private String pwd;
|
||||
private String info;
|
||||
private int regMember;
|
||||
private String regDate;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.krt.newssak.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SurveyDataDeleteAcceptRequestDto {
|
||||
private int idx;
|
||||
private int result;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.newssak.dto.common;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ErrorMessageDto {
|
||||
private String errorMessage;
|
||||
}
|
||||
19
src/main/java/com/krt/newssak/dto/common/TokenInfo.java
Normal file
19
src/main/java/com/krt/newssak/dto/common/TokenInfo.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.krt.newssak.dto.common;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class TokenInfo {
|
||||
|
||||
//grantType은 JWT 대한 인증 타입으로 Bearer 사용할 것.
|
||||
private String grantType;
|
||||
|
||||
private String accessToken;
|
||||
|
||||
private String refreshToken;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.newssak.dto.datamange;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AnswerDataDto {
|
||||
// Todo : SurveyEntity에서 of 삭제 가능하다면 해당 파일 삭제
|
||||
private int loopId;
|
||||
private List<SurveyDataStructureDto> surveyDataStructureDtoList = null;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.datamange;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AnswerQuestionDto {
|
||||
private String questionID;
|
||||
private int questionUniqueKey;
|
||||
private int questionOrder;
|
||||
private int loopId;
|
||||
private List<SurveyDataStructureDto> surveyDataStructureDtoList = null;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.krt.newssak.dto.datamange;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter @Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ChangeStatusRequestDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
private int surveyStatus;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.datamange;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeleteDataRequestDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
private int afterQuestionOrder;
|
||||
private List<Integer> questionUniqueKeyList;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.newssak.dto.datamange;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetAnswerUserRequestDto {
|
||||
private String projectCode;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.datamange;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetAnswerUserResponseDto {
|
||||
private String answerId;
|
||||
private int surveyTypeCode;
|
||||
private int answerState;
|
||||
private String answerStartDate;
|
||||
private int endUniqueKey;
|
||||
private int endLoopId;
|
||||
private String answerEndTime;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.datamange;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter @Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetDataRequestDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.krt.newssak.dto.datamange;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ModifyDataRequestDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
private int questionUniqueKey;
|
||||
private int loopId;
|
||||
private List<SurveyDataStructureDto> surveyDataStructureDtoList;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.newssak.dto.datamange;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SurveyDataStructureDto {
|
||||
private int t;
|
||||
private int m;
|
||||
private int s;
|
||||
private int r;
|
||||
private String o;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.newssak.dto.hardcode;
|
||||
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HardCodeAndHistoryDto {
|
||||
private HardCodeDto hardCodeDto;
|
||||
private List<HardCodeHistoryDto> hardCodeHistoryDtoList;
|
||||
}
|
||||
34
src/main/java/com/krt/newssak/dto/hardcode/HardCodeDto.java
Normal file
34
src/main/java/com/krt/newssak/dto/hardcode/HardCodeDto.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.krt.newssak.dto.hardcode;
|
||||
|
||||
import com.krt.newssak.entity.hardcode.HardCodeEntity;
|
||||
import com.krt.newssak.util.Common;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HardCodeDto {
|
||||
|
||||
private long id;
|
||||
private int questionUniqueKey;
|
||||
private String projectCode;
|
||||
private int hardCodeType;
|
||||
private String content;
|
||||
private int regMember;
|
||||
private String regDate;
|
||||
|
||||
public HardCodeEntity toEntity(HardCodeDto hardCodeDto) {
|
||||
return HardCodeEntity.builder()
|
||||
.id(hardCodeDto.getId())
|
||||
.questionUniqueKey(hardCodeDto.getQuestionUniqueKey())
|
||||
.projectCode(hardCodeDto.getProjectCode())
|
||||
.hardCodeType(hardCodeDto.getHardCodeType())
|
||||
.content(hardCodeDto.getContent())
|
||||
.regMember(hardCodeDto.getRegMember())
|
||||
.regDate(Common.getNow(null))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.krt.newssak.dto.hardcode;
|
||||
|
||||
import com.krt.newssak.entity.hardcode.HardCodeHistoryEntity;
|
||||
import com.krt.newssak.util.Common;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HardCodeHistoryDto {
|
||||
|
||||
private int questionUniqueKey;
|
||||
private String projectCode;
|
||||
private int hardCodeType;
|
||||
private String content;
|
||||
private int regMember;
|
||||
private String regDate;
|
||||
|
||||
public HardCodeHistoryDto toHardCodeDto(HardCodeDto hardCodeDto) {
|
||||
return HardCodeHistoryDto.builder()
|
||||
.questionUniqueKey(hardCodeDto.getQuestionUniqueKey())
|
||||
.projectCode(hardCodeDto.getProjectCode())
|
||||
.hardCodeType(hardCodeDto.getHardCodeType())
|
||||
.content(hardCodeDto.getContent())
|
||||
.regMember(hardCodeDto.getRegMember())
|
||||
.build();
|
||||
}
|
||||
|
||||
public HardCodeHistoryEntity toEntity(HardCodeHistoryDto hardCodeHistoryDto) {
|
||||
return HardCodeHistoryEntity.builder()
|
||||
.questionUniqueKey(hardCodeHistoryDto.getQuestionUniqueKey())
|
||||
.projectCode(hardCodeHistoryDto.getProjectCode())
|
||||
.hardCodeType(hardCodeHistoryDto.getHardCodeType())
|
||||
.content(hardCodeHistoryDto.getContent())
|
||||
.regMember(hardCodeHistoryDto.getRegMember())
|
||||
.regDate(Common.getNow(null))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.hardcode;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HardCodeRequestInfoDto {
|
||||
private String projectCode;
|
||||
private int questionUniqueKey;
|
||||
private int type;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.kiwi.request;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AllProjectCodeList {
|
||||
private List<String> code;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.kiwi.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DelSurveyDataInfo {
|
||||
private String pkey;
|
||||
private String sid;
|
||||
private String token;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.kiwi.response;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AllSurveyNotInKiwi {
|
||||
private String kpKey;
|
||||
private String kpName;
|
||||
private int qNumber;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.krt.newssak.dto.kiwi.response;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetResponseProjectInfo {
|
||||
private int id;
|
||||
private String projectKey;
|
||||
private String groupKey;
|
||||
private String memberKey;
|
||||
private String title;
|
||||
private int surveyClass;
|
||||
private String createDate;
|
||||
private int qNumber;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.krt.newssak.dto.kiwi.response;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class exampleListByKpKey {
|
||||
private String pkey;
|
||||
private String projectTitle;
|
||||
private String variable;
|
||||
private String questionTitle;
|
||||
private String explain;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.krt.newssak.dto.kiwi.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class surveyAnswerTime {
|
||||
private String answerStartTime;
|
||||
private String answerEndTime;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListContentDeleteRequestDto {
|
||||
private List<Long> idx;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.krt.newssak.entity.list.ListContentEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListContentDetailSaveRequestDto {
|
||||
private String projectCode;
|
||||
private String listId;
|
||||
private List<LinkedHashMap<String, Object>> listContent;
|
||||
private int regMember;
|
||||
|
||||
public static ListContentEntity toEntity(ListContentDetailSaveRequestDto listContentSaveRequestDto){
|
||||
Gson gson = new Gson();
|
||||
|
||||
return ListContentEntity.builder()
|
||||
.projectCode(listContentSaveRequestDto.getProjectCode())
|
||||
.listId(listContentSaveRequestDto.getListId())
|
||||
.listInfo(gson.toJson(listContentSaveRequestDto.getListContent()))
|
||||
.regMember(listContentSaveRequestDto.getRegMember())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListContentGetRequestDto {
|
||||
private String projectCode;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.krt.newssak.entity.list.ListContentEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListContentGetResponseDto {
|
||||
private int idx;
|
||||
private String projectCode;
|
||||
private String listId;
|
||||
private List<LinkedHashMap<String, Object>> listContent;
|
||||
|
||||
public static ListContentGetResponseDto of(ListContentEntity listContentEntity){
|
||||
Gson gson = new Gson();
|
||||
Type listContentType = new TypeToken<List<LinkedHashMap<String, Object>>>(){}.getType();
|
||||
|
||||
return ListContentGetResponseDto.builder()
|
||||
.idx(listContentEntity.getIdx())
|
||||
.projectCode(listContentEntity.getProjectCode())
|
||||
.listId(listContentEntity.getListId())
|
||||
.listContent(gson.fromJson(listContentEntity.getListInfo(), listContentType))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListContentModifyRequestDto {
|
||||
private int idx;
|
||||
private List<LinkedHashMap<String, Object>> listContent;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListContentSaveRequestDto {
|
||||
private List<ListContentDetailSaveRequestDto> listContent;
|
||||
private int addUpdateCount;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListDownloadGetRequestDto {
|
||||
private String projectCode;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListHeaderDeleteRequestDto {
|
||||
private List<Long> deleteIdxList;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListHeaderGetRequestDto {
|
||||
private String projectCode;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import com.krt.newssak.entity.list.ListHeaderEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListHeaderResponseDto {
|
||||
private int idx;
|
||||
private String projectCode;
|
||||
private int orderNo;
|
||||
private String headerName;
|
||||
private String headerType;
|
||||
|
||||
public static ListHeaderResponseDto of(ListHeaderEntity listHeaderEntity){
|
||||
return ListHeaderResponseDto.builder()
|
||||
.idx(listHeaderEntity.getIdx())
|
||||
.projectCode(listHeaderEntity.getProjectCode())
|
||||
.orderNo(listHeaderEntity.getOrderNo())
|
||||
.headerName(listHeaderEntity.getName())
|
||||
.headerType(listHeaderEntity.getType())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.krt.newssak.dto.list;
|
||||
|
||||
import com.krt.newssak.entity.list.ListHeaderEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ListHeaderSaveRequestDto {
|
||||
private int idx;
|
||||
private String projectCode;
|
||||
private int orderNo;
|
||||
private String headerName;
|
||||
private String headerType;
|
||||
private int regMember;
|
||||
|
||||
public static ListHeaderEntity toEntity(ListHeaderSaveRequestDto listHeaderSaveRequestDto){
|
||||
return ListHeaderEntity.builder()
|
||||
.idx(listHeaderSaveRequestDto.getIdx())
|
||||
.projectCode(listHeaderSaveRequestDto.getProjectCode())
|
||||
.orderNo(listHeaderSaveRequestDto.getOrderNo())
|
||||
.name(listHeaderSaveRequestDto.getHeaderName())
|
||||
.type(listHeaderSaveRequestDto.getHeaderType())
|
||||
.regMember(listHeaderSaveRequestDto.getRegMember())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.krt.newssak.dto.member;
|
||||
|
||||
import com.krt.newssak.entity.member.MemberEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public class CustomUserDetails implements UserDetails {
|
||||
private String username;// DB의 P.K
|
||||
private String password;// DB의 비밀번호
|
||||
private boolean accountNonLocked =true;// 계정 잠금 여부
|
||||
private boolean accountNonExpired =true ;// 사용자 계정 만료 없음
|
||||
private boolean credentialsNonExpired =true ;// 비밀번호 만료 없음
|
||||
private boolean enabled =true;// 사용자 활성화 여부
|
||||
private Collection<? extends GrantedAuthority> authorities; // 사용자 권한 목록
|
||||
|
||||
private String member_id;
|
||||
private String member_name;
|
||||
private int member_code;
|
||||
private MemberTeamInfoDto team_info;
|
||||
private int is_admin;
|
||||
|
||||
public CustomUserDetails(MemberEntity member, PasswordEncoder passwordEncoder) {
|
||||
this.username = member.getId();
|
||||
this.password = passwordEncoder.encode(member.getPassword());
|
||||
this.member_code = member.getCode();
|
||||
this.member_id = member.getId();
|
||||
this.member_name = member.getName();
|
||||
this.team_info = MemberTeamInfoDto.of(member.getMemberTeamInfo());
|
||||
this.is_admin = 999;
|
||||
|
||||
if(!"R".equals(member.getMemberTeamInfo().getDivisionCode())){
|
||||
this.is_admin = 1;
|
||||
}else{
|
||||
this.is_admin = 0;
|
||||
}
|
||||
|
||||
Collection<GrantedAuthority> roles = Arrays.stream("ADMIN".split(","))
|
||||
.map(role -> new SimpleGrantedAuthority(username))
|
||||
.collect(Collectors.toList());
|
||||
this.authorities = roles;
|
||||
}
|
||||
}
|
||||
40
src/main/java/com/krt/newssak/dto/member/MemberDto.java
Normal file
40
src/main/java/com/krt/newssak/dto/member/MemberDto.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.krt.newssak.dto.member;
|
||||
|
||||
import com.krt.newssak.entity.member.MemberEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MemberDto {
|
||||
|
||||
private int member_code;
|
||||
private String member_id;
|
||||
private String member_name;
|
||||
private MemberTeamInfoDto teamInfo;
|
||||
private int is_admin = 999;
|
||||
|
||||
public static MemberDto of(MemberEntity member) {
|
||||
return MemberDto.builder()
|
||||
.member_code(member.getCode())
|
||||
.member_id(member.getId())
|
||||
.member_name(member.getName())
|
||||
.teamInfo(MemberTeamInfoDto.of(member.getMemberTeamInfo()))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static MemberDto of(LinkedHashMap details){
|
||||
return MemberDto.builder()
|
||||
.member_code((int)details.get("member_code"))
|
||||
.member_id((String)details.get("member_id"))
|
||||
.member_name((String)details.get("member_name"))
|
||||
.teamInfo(MemberTeamInfoDto.of((LinkedHashMap) details.get("teamInfo")))
|
||||
.is_admin((int)details.get("is_admin"))
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
21
src/main/java/com/krt/newssak/dto/member/MemberLoginDto.java
Normal file
21
src/main/java/com/krt/newssak/dto/member/MemberLoginDto.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.krt.newssak.dto.member;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MemberLoginDto {
|
||||
|
||||
@Schema(description = "아이디", defaultValue = "jspark")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "패스워드", defaultValue = "1")
|
||||
private String password;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.krt.newssak.dto.member;
|
||||
|
||||
import com.krt.newssak.entity.member.MemberTeamInfoEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MemberTeamInfoDto {
|
||||
|
||||
private int code;
|
||||
private String name;
|
||||
private String groupCode;
|
||||
private String groupName;
|
||||
|
||||
public static MemberTeamInfoDto of(MemberTeamInfoEntity memberTeamInfo) {
|
||||
return MemberTeamInfoDto.builder()
|
||||
.code(memberTeamInfo.getCode())
|
||||
.name(memberTeamInfo.getName())
|
||||
.groupCode(memberTeamInfo.getDivisionCode())
|
||||
.groupName(memberTeamInfo.getDivisionName())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static MemberTeamInfoDto of(LinkedHashMap detailsTeam){
|
||||
return MemberTeamInfoDto.builder()
|
||||
.code((int)detailsTeam.get("code"))
|
||||
.name((String)detailsTeam.get("name"))
|
||||
.groupCode((String)detailsTeam.get("groupCode"))
|
||||
.groupName((String)detailsTeam.get("groupName"))
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import com.krt.newssak.entity.project.ProjectResponseEntity;
|
||||
import com.krt.newssak.entity.project.ProjectStyleEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OptionElementDto {
|
||||
@Schema(description = "옵션 코드")
|
||||
private int option_code;
|
||||
@Schema(description = "옵션 값")
|
||||
private String option_value;
|
||||
|
||||
public static OptionElementDto of(ProjectResponseEntity responseEntity){
|
||||
return OptionElementDto.builder()
|
||||
.option_code(responseEntity.getOptionCode())
|
||||
.option_value(responseEntity.getOptionValue())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static OptionElementDto of(ProjectStyleEntity styleEntity){
|
||||
return OptionElementDto.builder()
|
||||
.option_code(styleEntity.getStyleCode())
|
||||
.option_value(styleEntity.getStyleValue())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectByAnswerIdByCountDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
private int surveyTypeCode;
|
||||
private int answerState;
|
||||
private int dataCount;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectByStatusByCountDto {
|
||||
private int successCount;
|
||||
private int notSuccessCount;
|
||||
private int testCount;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectCopyRequestDto {
|
||||
|
||||
private String copyProjectCode;
|
||||
private String changeProjectCode;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectDeleteDto {
|
||||
|
||||
@Schema(description = "프로젝트 코드", defaultValue = "")
|
||||
private String project_code;
|
||||
|
||||
}
|
||||
45
src/main/java/com/krt/newssak/dto/project/ProjectDto.java
Normal file
45
src/main/java/com/krt/newssak/dto/project/ProjectDto.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import com.krt.newssak.entity.project.ProjectEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectDto {
|
||||
|
||||
private int project_idx;
|
||||
private String project_code;
|
||||
private String project_title;
|
||||
private String survey_title;
|
||||
private int project_state;
|
||||
private String own_team;
|
||||
private int project_company;
|
||||
private int reg_member;
|
||||
private String reg_date;
|
||||
private int is_delete;
|
||||
private String delete_date;
|
||||
|
||||
public static ProjectDto of(ProjectEntity project) {
|
||||
return ProjectDto.builder()
|
||||
.project_idx(project.getIdx())
|
||||
.project_code(project.getCode())
|
||||
.project_title(project.getProjectTitle())
|
||||
.survey_title(project.getSurveyTitle())
|
||||
.project_state(project.getState())
|
||||
.own_team(project.getOwnTeam())
|
||||
.project_company(project.getCompany())
|
||||
.reg_member(project.getRegMember())
|
||||
.reg_date(project.getRegDate())
|
||||
.is_delete(project.getIsDelete())
|
||||
.delete_date(project.getDeleteDate())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import com.krt.newssak.entity.project.ProjectEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@ToString
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectInfoDto {
|
||||
|
||||
private String project_code;
|
||||
private String project_title;
|
||||
private String survey_title;
|
||||
private String own_team;
|
||||
private int project_company;
|
||||
|
||||
private List<ProjectManagerDto> pm_list;
|
||||
private List<String> hashtag_list;
|
||||
|
||||
public static ProjectInfoDto of(ProjectEntity projectEntity) {
|
||||
return ProjectInfoDto.builder()
|
||||
.project_code(projectEntity.getCode())
|
||||
.project_title(projectEntity.getProjectTitle())
|
||||
.survey_title(projectEntity.getSurveyTitle())
|
||||
.own_team(projectEntity.getOwnTeam())
|
||||
.project_company(projectEntity.getCompany())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectListDto {
|
||||
|
||||
private String project_code;
|
||||
private String project_title;
|
||||
private String survey_title;
|
||||
private int project_state;
|
||||
private String own_team;
|
||||
private String own_team_nm;
|
||||
private int project_company;
|
||||
private int reg_member;
|
||||
private String reg_member_nm;
|
||||
private String reg_date;
|
||||
private long hashtag_count;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@ToString
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectManagerDto {
|
||||
|
||||
private int member_code;
|
||||
private String member_name;
|
||||
private String team_name;
|
||||
private int role_code;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectOptionDto {
|
||||
@Schema(description = "프로젝트 코드")
|
||||
private String project_code;
|
||||
|
||||
@Schema(description = "옵션 정보")
|
||||
private List<OptionElementDto> optionList;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectParameterDeleteDto {
|
||||
@Schema(description = "프로젝트 코드")
|
||||
private String project_code;
|
||||
@Schema(description = "파라미터명")
|
||||
private String parameter_name;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import com.krt.newssak.entity.project.ProjectParameterEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectParameterDto {
|
||||
|
||||
@Schema(description = "프로젝트 코드")
|
||||
private String project_code;
|
||||
@Schema(description = "파라미터명")
|
||||
private String parameter_name;
|
||||
@Schema(description = "디폴트 여부", defaultValue = "0")
|
||||
private int is_default = 0;
|
||||
@Schema(description = "등록자")
|
||||
private int reg_member;
|
||||
|
||||
public static ProjectParameterDto of(ProjectParameterEntity projectParameterEntity){
|
||||
return ProjectParameterDto.builder()
|
||||
.project_code(projectParameterEntity.getProjectCode())
|
||||
.parameter_name(projectParameterEntity.getParameterName())
|
||||
.is_default(projectParameterEntity.getIsDefault())
|
||||
.reg_member(projectParameterEntity.getRegMember())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectRedirectDeleteDto {
|
||||
@Schema(description = "프로젝트 코드")
|
||||
private String project_code;
|
||||
@Schema(description = "패널사 코드")
|
||||
private String panel_code;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import com.krt.newssak.entity.project.ProjectRedirectEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectRedirectDto {
|
||||
@Schema(description = "프로젝트 코드")
|
||||
private String project_code;
|
||||
@Schema(description = "패널사 코드")
|
||||
private String panel_code;
|
||||
@Schema(description = "패널사 명")
|
||||
private String panel_name;
|
||||
@Schema(description = "성공 리다이렉트 url")
|
||||
private String complete_url;
|
||||
@Schema(description = "쿼터풀 리다이렉트 url")
|
||||
private String quota_url;
|
||||
@Schema(description = "스크린 아웃 리다이렉트 url")
|
||||
private String screen_url;
|
||||
@Schema(description = "등록자")
|
||||
private int reg_member;
|
||||
|
||||
public static ProjectRedirectDto of(ProjectRedirectEntity projectRedirectEntity){
|
||||
return ProjectRedirectDto.builder()
|
||||
.project_code(projectRedirectEntity.getProjectCode())
|
||||
.panel_code(projectRedirectEntity.getPanelCode())
|
||||
.panel_name(projectRedirectEntity.getPanelName())
|
||||
.complete_url(projectRedirectEntity.getCompleteUrl())
|
||||
.quota_url(projectRedirectEntity.getQuotaUrl())
|
||||
.screen_url(projectRedirectEntity.getScreenUrl())
|
||||
.reg_member(projectRedirectEntity.getRegMember())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Setter @Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectSearchDto {
|
||||
|
||||
@Schema(description = "부서코드", defaultValue = "")
|
||||
private String group;
|
||||
|
||||
@Schema(description = "검색어", defaultValue = "")
|
||||
private String keyword;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectStateDto {
|
||||
|
||||
@Schema(description = "프로젝트 코드", defaultValue = "")
|
||||
private String project_code;
|
||||
|
||||
@Schema(description = "프로젝트 상태", defaultValue = "")
|
||||
private int project_state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectStyleDto {
|
||||
@Schema(description = "프로젝트 코드")
|
||||
private String project_code;
|
||||
@Schema(description = "스타일 코드")
|
||||
private int style_code;
|
||||
@Schema(description = "스타일 세팅 값")
|
||||
private String style_value;
|
||||
@Schema(description = "등록자")
|
||||
private int reg_member;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.krt.newssak.dto.project;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectUpsertDto {
|
||||
|
||||
private String project_code;
|
||||
private String project_title;
|
||||
private String survey_title;
|
||||
private String own_team;
|
||||
private int project_company;
|
||||
private int reg_member;
|
||||
private int is_update;
|
||||
List<ProjectManagerDto> pm_list;
|
||||
List<String> hashtag_list;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user