first commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package com.krt.sun.Interceptor;
|
||||
|
||||
import com.krt.sun.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;
|
||||
import com.krt.sun.service.IpAccessControlService;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
public class IpAccessControlInterceptor implements HandlerInterceptor {
|
||||
private final IpAccessControlService ipAccessControlService;
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
|
||||
String clientIpAddress = IpUtil.getClientIp(request); // 추가
|
||||
if (!ipAccessControlService.isAccessible(clientIpAddress)) {
|
||||
String requestURI = request.getRequestURI();
|
||||
response.sendError(HttpServletResponse.SC_FORBIDDEN);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
19
src/main/java/com/krt/sun/SunApplication.java
Normal file
19
src/main/java/com/krt/sun/SunApplication.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.krt.sun;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.filter.HiddenHttpMethodFilter;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SunApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SunApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HiddenHttpMethodFilter hiddenHttpMethodFilter() {
|
||||
return new HiddenHttpMethodFilter();
|
||||
}
|
||||
}
|
||||
20
src/main/java/com/krt/sun/config/QueryDslConfig.java
Normal file
20
src/main/java/com/krt/sun/config/QueryDslConfig.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.krt.sun.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);
|
||||
}
|
||||
}
|
||||
37
src/main/java/com/krt/sun/config/SecurityConfig.java
Normal file
37
src/main/java/com/krt/sun/config/SecurityConfig.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.krt.sun.config;
|
||||
|
||||
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.web.SecurityFilterChain;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@RequiredArgsConstructor
|
||||
public class SecurityConfig {
|
||||
@Bean
|
||||
public WebSecurityCustomizer webSecurityCustomizer() {
|
||||
return (web) -> web.ignoring().requestMatchers("/v2/api-docs", "/configuration/ui",
|
||||
"/swagger-resources/**", "/configuration/security",
|
||||
"/webjars/**","/swagger/**", "/");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.httpBasic(HttpBasicConfigurer::disable)
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
.cors(Customizer.withDefaults())
|
||||
.sessionManagement((sessionManagement) ->
|
||||
sessionManagement.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||
);
|
||||
return http.build();
|
||||
}
|
||||
}
|
||||
26
src/main/java/com/krt/sun/config/SwaggerConfig.java
Normal file
26
src/main/java/com/krt/sun/config/SwaggerConfig.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.krt.sun.config;
|
||||
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class SwaggerConfig {
|
||||
@Bean
|
||||
public OpenAPI newSsakOpenAPI() {
|
||||
Info info = new Info()
|
||||
.version("v1.0.0")
|
||||
.title("새싹 햇님 API")
|
||||
.description("새싹 설문진행 로직과 관련된 API");
|
||||
|
||||
/*
|
||||
Components components = new Components();
|
||||
*/
|
||||
return new OpenAPI()
|
||||
.info(info)
|
||||
.addServersItem(new Server().url("/"));
|
||||
//.components(components);
|
||||
}
|
||||
}
|
||||
33
src/main/java/com/krt/sun/config/WebConfig.java
Normal file
33
src/main/java/com/krt/sun/config/WebConfig.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.krt.sun.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.sun.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/**");
|
||||
}
|
||||
}
|
||||
84
src/main/java/com/krt/sun/controller/CapiController.java
Normal file
84
src/main/java/com/krt/sun/controller/CapiController.java
Normal file
@@ -0,0 +1,84 @@
|
||||
package com.krt.sun.controller;
|
||||
|
||||
import com.krt.sun.dto.capi.*;
|
||||
import com.krt.sun.dto.project.response.ProjectDto;
|
||||
import com.krt.sun.service.CapiService;
|
||||
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 = "Capi", description = "면접원 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/capi")
|
||||
@RequiredArgsConstructor
|
||||
public class CapiController {
|
||||
|
||||
private final CapiService capiService;
|
||||
|
||||
@Operation(summary = "면접원 로그인")
|
||||
@PostMapping("/capiLogin")
|
||||
public ResponseEntity<?> capiLogin(@RequestBody CapiLoginRequestDto capiLoginRequestDto) {
|
||||
|
||||
CapiLoginResponseDto capiInfo = capiService.capiLogin(capiLoginRequestDto);
|
||||
|
||||
return ResponseEntity.ok(capiInfo);
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원별 프로젝트 리스트 불러오기", description = "면접원별 프로젝트 리스트 불러오기")
|
||||
@PostMapping("/getProjectList")
|
||||
public ResponseEntity<?> getProjectList(@RequestBody GetInterviewerAssignProjectRequestDto getInterviewerAssignProjectRequestDto){
|
||||
|
||||
List<ProjectDto> projectDtoList = capiService.getProjectList(getInterviewerAssignProjectRequestDto);
|
||||
|
||||
return ResponseEntity.ok(projectDtoList);
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 개인별 현황", description = "상태별 카운트 / 진행 데이터 조회")
|
||||
@PostMapping("/getInterviewerSurveyDetail")
|
||||
public ResponseEntity<?> getInterviewerSurveyDetail(@RequestBody GetInterviewerSurveyDetailRequestDto getInterviewerSurveyDetailRequestDto) throws Exception {
|
||||
|
||||
return ResponseEntity.ok(capiService.getInterviewerSurveyDetail(getInterviewerSurveyDetailRequestDto));
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 데이터 삭제 요청", description = "면접원 데이터 삭제 요청")
|
||||
@PostMapping("/surveyDataDeleteRequest")
|
||||
public ResponseEntity<?> surveyDataDeleteRequest(@RequestBody DeleteSurveyDataRequestDto deleteSurveyDataRequestDto) throws Exception {
|
||||
|
||||
capiService.surveyDataDeleteRequest(deleteSurveyDataRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "면접원 데이터 삭제 요청취소", description = "면접원 데이터 삭제 요청취소")
|
||||
@PostMapping("/surveyDataDeleteCancel")
|
||||
public ResponseEntity<?> surveyDataDeleteCancel(@RequestBody SurveyDataDeleteCancelRequestDto surveyDataDeleteCancelRequestDto) throws Exception {
|
||||
|
||||
capiService.surveyDataDeleteCancel(surveyDataDeleteCancelRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "할당된 프로젝트 쿼터 현황", description = "쿼터 있을 시, 개인별 쿼터 보여주기")
|
||||
@GetMapping("/getProgressQuota")
|
||||
public ResponseEntity<?> getProgressQuota(@Parameter(name = "project_code") String project_code) throws Exception {
|
||||
|
||||
capiService.getProgressQuota(project_code);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "재진행 데이터 초기화", description = "재진행 데이터 초기화")
|
||||
@PostMapping("/setDataRestart")
|
||||
public ResponseEntity<?> setDataRestart(@RequestBody GetRestartDataRequestDto getRestartDataRequestDto) throws Exception {
|
||||
|
||||
capiService.setDataRestart(getRestartDataRequestDto);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
}
|
||||
52
src/main/java/com/krt/sun/controller/HardCodeController.java
Normal file
52
src/main/java/com/krt/sun/controller/HardCodeController.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.krt.sun.controller;
|
||||
|
||||
import com.krt.sun.dto.hardcode.AnswerUserInfoDto;
|
||||
import com.krt.sun.dto.hardcode.HardCodeDto;
|
||||
import com.krt.sun.dto.hardcode.HardCodeRequestInfoDto;
|
||||
import com.krt.sun.dto.survey.response.SurveyDataStructureDto;
|
||||
import com.krt.sun.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.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Tag(name = "HardCode", description = "하드코딩 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/hardcode")
|
||||
@RequiredArgsConstructor
|
||||
public class HardCodeController {
|
||||
|
||||
private final HardCodeService hardCodeService;
|
||||
|
||||
@Operation(summary = "하드코딩 가져오기")
|
||||
@PostMapping("/getHardCode")
|
||||
public ResponseEntity<?> getHardCode(@RequestBody HardCodeRequestInfoDto hardCodeRequestInfoDto) throws Exception {
|
||||
HardCodeDto hardCodeDto = hardCodeService.getHardCode(hardCodeRequestInfoDto);
|
||||
|
||||
return ResponseEntity.ok(hardCodeDto);
|
||||
}
|
||||
|
||||
@Operation(summary = "응답값 가져오기", description = "함수")
|
||||
@PostMapping("/getValue")
|
||||
public ResponseEntity<?> getValue(@RequestBody AnswerUserInfoDto answerUserInfoDto) throws Exception {
|
||||
|
||||
List<SurveyDataStructureDto> answerDataList = hardCodeService.getValue(answerUserInfoDto);
|
||||
|
||||
return ResponseEntity.ok(answerDataList);
|
||||
}
|
||||
|
||||
@Operation(summary = "응답값(라벨명) 가져오기", description = "함수")
|
||||
@PostMapping("/getLabel")
|
||||
public ResponseEntity<?> getLabel(@RequestBody AnswerUserInfoDto answerUserInfoDto) throws Exception {
|
||||
|
||||
Set<String> answerLabelList = hardCodeService.getLabel(answerUserInfoDto);
|
||||
|
||||
return ResponseEntity.ok(answerLabelList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
57
src/main/java/com/krt/sun/controller/ProjectController.java
Normal file
57
src/main/java/com/krt/sun/controller/ProjectController.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.krt.sun.controller;
|
||||
|
||||
import com.krt.sun.dto.project.response.ProjectOptionDto;
|
||||
import com.krt.sun.dto.project.response.ProjectSurveyInfoDto;
|
||||
import com.krt.sun.service.ProjectService;
|
||||
import com.krt.sun.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.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@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("/getSurveyInfo")
|
||||
public ResponseEntity<?> getSurveyInfo(@Parameter(name = "security_code") String security_code) throws Exception {
|
||||
String projectCode = SecurityUtil.decrypt(URLDecoder.decode(security_code, StandardCharsets.UTF_8));
|
||||
ProjectSurveyInfoDto projectSurveyInfoDto = projectService.getSurveyInfo(projectCode);
|
||||
|
||||
return ResponseEntity.ok(projectSurveyInfoDto);
|
||||
}
|
||||
|
||||
@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 = "프로젝트 응답 옵션 불러오기")
|
||||
@GetMapping("/getResponse")
|
||||
public ResponseEntity<?> getProjectResponse(@Parameter(name = "project_code") String project_code){
|
||||
ProjectOptionDto projectOptionDto = projectService.getProjectResponse(project_code);
|
||||
return ResponseEntity.ok(projectOptionDto);
|
||||
}
|
||||
|
||||
}
|
||||
54
src/main/java/com/krt/sun/controller/QuestionController.java
Normal file
54
src/main/java/com/krt/sun/controller/QuestionController.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.krt.sun.controller;
|
||||
|
||||
import com.krt.sun.dto.question.response.QuestionInfoDto;
|
||||
import com.krt.sun.dto.question.response.QuestionNavigationDto;
|
||||
import com.krt.sun.service.QuestionService;
|
||||
import com.krt.sun.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.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "Question", description = "문항 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/question")
|
||||
@RequiredArgsConstructor
|
||||
public class QuestionController {
|
||||
private final QuestionService questionService;
|
||||
|
||||
@Operation(summary = "문항 List 가져오기")
|
||||
@GetMapping("/getQuestionList")
|
||||
public ResponseEntity<?> getQuestionList(@Parameter(name = "security_code") String security_code) throws Exception {
|
||||
String projectCode = SecurityUtil.decrypt(URLDecoder.decode(security_code, StandardCharsets.UTF_8));
|
||||
|
||||
List<QuestionInfoDto> questionInfoList = questionService.getQuestionInfoList(projectCode);
|
||||
|
||||
return ResponseEntity.ok(questionInfoList);
|
||||
}
|
||||
|
||||
@Operation(summary = "문항정보 가져오기")
|
||||
@GetMapping("/getQuestionInfo")
|
||||
public ResponseEntity<?> getQuestionInfo(@Parameter(name = "security_code") String security_code, @Parameter(name = "question_unique_key") int question_unique_key) throws Exception {
|
||||
String projectCode = SecurityUtil.decrypt(URLDecoder.decode(security_code, StandardCharsets.UTF_8));
|
||||
|
||||
List<QuestionInfoDto> questionInfoList = questionService.getQuestionInfo(projectCode, question_unique_key);
|
||||
|
||||
return ResponseEntity.ok(questionInfoList);
|
||||
}
|
||||
|
||||
@Operation(summary = "Test용 데이터와 문항 리스트 가져오기")
|
||||
@GetMapping("/getQuestionNavigation")
|
||||
public ResponseEntity<?> getQuestionNavigation(@Parameter(name = "security_code") String security_code) throws Exception {
|
||||
String projectCode = SecurityUtil.decrypt(URLDecoder.decode(security_code, StandardCharsets.UTF_8));
|
||||
|
||||
List<QuestionNavigationDto> questionNavigationList = questionService.getQuestionNavigation(projectCode);
|
||||
|
||||
return ResponseEntity.ok(questionNavigationList);
|
||||
}
|
||||
}
|
||||
119
src/main/java/com/krt/sun/controller/SurveyController.java
Normal file
119
src/main/java/com/krt/sun/controller/SurveyController.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.krt.sun.controller;
|
||||
|
||||
import com.krt.sun.dto.list.ListContentGetResponseDto;
|
||||
import com.krt.sun.dto.question.response.QuestionInfoDto;
|
||||
import com.krt.sun.dto.survey.common.SurveyInfo;
|
||||
import com.krt.sun.dto.survey.request.DataSaveDto;
|
||||
import com.krt.sun.dto.survey.request.GangLoginRequestDto;
|
||||
import com.krt.sun.dto.survey.request.IndexParameterDto;
|
||||
import com.krt.sun.dto.survey.response.*;
|
||||
import com.krt.sun.service.SurveyService;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "Survey", description = "설문진행 API")
|
||||
@RestController
|
||||
@RequestMapping("api/v1/survey")
|
||||
@RequiredArgsConstructor
|
||||
public class SurveyController {
|
||||
private final SurveyService surveyService;
|
||||
|
||||
@Operation(summary = "INDEX 페이지 가져오기")
|
||||
@GetMapping("/getIndexPage")
|
||||
public ResponseEntity<?> getIndexPage(SurveyInfo SurveyInfo) throws Exception{
|
||||
|
||||
IndexFormSetupDto indexPageInfo = surveyService.getIndexPage(SurveyInfo);
|
||||
|
||||
return ResponseEntity.ok(indexPageInfo);
|
||||
}
|
||||
|
||||
@Operation(summary = "설문 진입")
|
||||
@PostMapping("/getStartSurvey")
|
||||
public ResponseEntity<?> getStartQuestion(@RequestBody IndexParameterDto indexParameterDto) throws Exception {
|
||||
|
||||
SurveyFormSetupDto startQuestionInfo = surveyService.startSurvey(indexParameterDto);
|
||||
|
||||
return ResponseEntity.ok(startQuestionInfo);
|
||||
}
|
||||
|
||||
@Operation(summary = "응답 데이터 검증")
|
||||
@PostMapping("/doSurveyDataVerify")
|
||||
public ResponseEntity<?> surveyDataVerify(@RequestBody List<DataSaveDto> dataSaveDtoList) throws Exception{
|
||||
|
||||
//옵션 검증
|
||||
boolean optionVerifyFlag = surveyService.surveyDataVerify(dataSaveDtoList);
|
||||
|
||||
//Numeric 검증
|
||||
boolean numericVerifyFlag = surveyService.numericVerify(dataSaveDtoList);
|
||||
|
||||
return ResponseEntity.ok(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "응답 데이터 저장")
|
||||
@PostMapping("/setSaveData")
|
||||
public ResponseEntity<?> saveSurveyData(@RequestBody List<DataSaveDto> dataSaveDtoList) throws Exception {
|
||||
|
||||
SurveyFormSetupDto nextQuestionInfo = surveyService.saveSurveyData(dataSaveDtoList);
|
||||
|
||||
return ResponseEntity.ok(nextQuestionInfo);
|
||||
}
|
||||
|
||||
@Operation(summary = "설문 진행용 문항정보 가져오기")
|
||||
@GetMapping("/getQuestionInfo")
|
||||
public ResponseEntity<?> getQuestionInfo(SurveyInfo SurveyInfo) throws Exception {
|
||||
|
||||
List<QuestionInfoDto> questionInfoList = surveyService.getQuestionInfo(SurveyInfo);
|
||||
|
||||
return ResponseEntity.ok(questionInfoList);
|
||||
}
|
||||
|
||||
@Operation(summary = "오토 체크 값 가져오기")
|
||||
@GetMapping("/getAutoCheckAnswerData")
|
||||
public ResponseEntity<?> getAutoCheckAnswerData(SurveyInfo SurveyInfo) throws Exception {
|
||||
|
||||
List<SurveyDataStructureDto> dataList = surveyService.getAutoCheckAnswerData(SurveyInfo);
|
||||
|
||||
return ResponseEntity.ok(dataList);
|
||||
}
|
||||
|
||||
// @Operation(summary = "응답값 리스트 가져오기")
|
||||
// @GetMapping("/getSavedDataList")
|
||||
// public ResponseEntity<?> getSavedDataList(SurveyInfo SurveyInfo) throws Exception {
|
||||
//
|
||||
// List<QuestionUniqueKeyAndDataDto> savedDataList = surveyService.getSavedDataList(SurveyInfo);
|
||||
//
|
||||
// return ResponseEntity.ok(savedDataList);
|
||||
// }
|
||||
|
||||
@Operation(summary = "리다이렉트 URL 가져오기")
|
||||
@PostMapping("/getRedirectUrl")
|
||||
public ResponseEntity<?> getRedirectUrl(@RequestBody SurveyInfo surveyInfo) throws Exception {
|
||||
|
||||
String redirectUrl = surveyService.getRedirectUrl(surveyInfo);
|
||||
|
||||
return ResponseEntity.ok(redirectUrl);
|
||||
}
|
||||
|
||||
@Operation(summary = "응답값 라벨 리스트 가져오기")
|
||||
@GetMapping("/getSavedDataLabelList")
|
||||
public ResponseEntity<?> getSavedDataLabelList(SurveyInfo SurveyInfo) throws Exception {
|
||||
|
||||
List<QuestionUniqueKeyAndLabelDto> savedDataLabelList = surveyService.getSavedDataLabelList(SurveyInfo);
|
||||
|
||||
return ResponseEntity.ok(savedDataLabelList);
|
||||
}
|
||||
|
||||
@Operation(summary = "Gang 로그인")
|
||||
@PostMapping("/gangLogin")
|
||||
public ResponseEntity<?> gangLogin(@RequestBody GangLoginRequestDto gangLoginRequestDto) throws Exception {
|
||||
|
||||
ListContentGetResponseDto listInfo = surveyService.gangLogin(gangLoginRequestDto);
|
||||
|
||||
return ResponseEntity.ok(listInfo);
|
||||
}
|
||||
}
|
||||
13
src/main/java/com/krt/sun/dto/capi/CapiLoginRequestDto.java
Normal file
13
src/main/java/com/krt/sun/dto/capi/CapiLoginRequestDto.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.krt.sun.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CapiLoginRequestDto {
|
||||
private String loginId;
|
||||
private String loginPwd;
|
||||
}
|
||||
25
src/main/java/com/krt/sun/dto/capi/CapiLoginResponseDto.java
Normal file
25
src/main/java/com/krt/sun/dto/capi/CapiLoginResponseDto.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.krt.sun.dto.capi;
|
||||
|
||||
import com.krt.sun.entity.capi.InterviewerInfoEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CapiLoginResponseDto {
|
||||
private String code;
|
||||
private String loginId;
|
||||
private String name;
|
||||
private String info;
|
||||
|
||||
public static CapiLoginResponseDto of(InterviewerInfoEntity interviewerInfoEntity){
|
||||
return CapiLoginResponseDto.builder()
|
||||
.code(interviewerInfoEntity.getCode())
|
||||
.loginId(interviewerInfoEntity.getInterviewerId())
|
||||
.name(interviewerInfoEntity.getInterviewerName())
|
||||
.info(interviewerInfoEntity.getInterviewerInfo())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.sun.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,12 @@
|
||||
package com.krt.sun.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetInterviewerAssignProjectRequestDto {
|
||||
private String interviewerCode;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.krt.sun.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetInterviewerSurveyDetailRequestDto {
|
||||
private String projectCode;
|
||||
private String interviewerId;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.krt.sun.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GetRestartDataRequestDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.krt.sun.dto.capi;
|
||||
|
||||
import com.krt.sun.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 int answerEndQuestionUniqueKey;
|
||||
private String answerEndQuestionId;
|
||||
private String answerEndDate;
|
||||
private int deleteRequest;
|
||||
|
||||
public static GetSurveyDetailResponseDto of(SurveyRespondentEntity surveyRespondentEntity){
|
||||
return GetSurveyDetailResponseDto.builder()
|
||||
.projectCode(surveyRespondentEntity.getProjectCode())
|
||||
.answerId(surveyRespondentEntity.getAnswerId())
|
||||
.surveyTypeCode(surveyRespondentEntity.getSurveyTypeCode())
|
||||
.answerState(surveyRespondentEntity.getAnswerState())
|
||||
.answerStartDate(surveyRespondentEntity.getAnswerStartDate())
|
||||
.answerEndDate(surveyRespondentEntity.getAnswerEndDate())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.krt.sun.dto.capi;
|
||||
|
||||
import com.krt.sun.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<GetSurveyDetailResponseDto> surveyRespondentEntityList){
|
||||
|
||||
this.totalCount = surveyRespondentEntityList.size();
|
||||
|
||||
for(GetSurveyDetailResponseDto getSurveyDetailResponseDto : surveyRespondentEntityList){
|
||||
switch (getSurveyDetailResponseDto.getAnswerState()){
|
||||
case 1 ->{
|
||||
this.progressCount += 1;
|
||||
}
|
||||
case 10 ->{
|
||||
this.successCount += 1;
|
||||
}
|
||||
case 99 ->{
|
||||
this.screenCount += 1;
|
||||
}
|
||||
case 98 ->{
|
||||
this.quotaCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.krt.sun.dto.capi;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SurveyDataDeleteCancelRequestDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.sun.dto.hardcode;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AnswerUserInfoDto {
|
||||
private String securityCode;
|
||||
private String answerId;
|
||||
private String questionId;
|
||||
private int questionUniqueKey;
|
||||
private String questionDimension;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.sun.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/sun/dto/hardcode/HardCodeDto.java
Normal file
34
src/main/java/com/krt/sun/dto/hardcode/HardCodeDto.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.krt.sun.dto.hardcode;
|
||||
|
||||
import com.krt.sun.entity.hardcode.HardCodeEntity;
|
||||
import com.krt.sun.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.sun.dto.hardcode;
|
||||
|
||||
import com.krt.sun.entity.hardcode.HardCodeHistoryEntity;
|
||||
import com.krt.sun.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.sun.dto.hardcode;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HardCodeRequestInfoDto {
|
||||
private String securityCode;
|
||||
private int questionUniqueKey;
|
||||
private int type;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.krt.sun.dto.list;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.krt.sun.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, String>> listContent;
|
||||
|
||||
public static ListContentGetResponseDto of(ListContentEntity listContentEntity){
|
||||
Gson gson = new Gson();
|
||||
Type listContentType = new TypeToken<List<LinkedHashMap<String, String>>>(){}.getType();
|
||||
|
||||
return ListContentGetResponseDto.builder()
|
||||
.idx(listContentEntity.getIdx())
|
||||
.projectCode(listContentEntity.getProjectCode())
|
||||
.listId(listContentEntity.getListId())
|
||||
.listContent(gson.fromJson(listContentEntity.getListInfo(), listContentType))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
15
src/main/java/com/krt/sun/dto/parameter/ParameterDto.java
Normal file
15
src/main/java/com/krt/sun/dto/parameter/ParameterDto.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.krt.sun.dto.parameter;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ParameterDto {
|
||||
private String parameterKey;
|
||||
private String parameterValue;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.krt.sun.dto.project.common;
|
||||
|
||||
import com.krt.sun.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 ProjectOptionElementDto {
|
||||
@Schema(description = "스타일 코드")
|
||||
private int option_code;
|
||||
@Schema(description = "스타일 세팅 값")
|
||||
private String option_value;
|
||||
|
||||
public ProjectOptionElementDto of(ProjectStyleEntity projectStyleEntity){
|
||||
return ProjectOptionElementDto.builder()
|
||||
.option_code(projectStyleEntity.getStyleCode())
|
||||
.option_value(projectStyleEntity.getStyleValue())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.krt.sun.dto.project.response;
|
||||
|
||||
import com.krt.sun.entity.project.ProjectResponseEntity;
|
||||
import com.krt.sun.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,45 @@
|
||||
package com.krt.sun.dto.project.response;
|
||||
|
||||
import com.krt.sun.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,21 @@
|
||||
package com.krt.sun.dto.project.response;
|
||||
|
||||
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,56 @@
|
||||
package com.krt.sun.dto.project.response;
|
||||
|
||||
import com.krt.sun.dto.project.common.ProjectOptionElementDto;
|
||||
import com.krt.sun.entity.project.ProjectParameterEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectSurveyInfoDto {
|
||||
|
||||
@Schema(description = "프로젝트 코드")
|
||||
private String project_code;
|
||||
|
||||
@Schema(description = "설문타이틀")
|
||||
private String survey_title;
|
||||
|
||||
@Schema(description = "프로젝트 상태")
|
||||
private int status;
|
||||
|
||||
@Schema(description = "회사 코드")
|
||||
private int company;
|
||||
|
||||
@Schema(description = "뒤로가기 허용 여부")
|
||||
private boolean accept_back;
|
||||
|
||||
@Schema(description = "파라미터명")
|
||||
private List<String> parameter_list;
|
||||
|
||||
@Schema(description = "허용 디바이스")
|
||||
private List<Integer> accept_device;
|
||||
|
||||
@Schema(description = "프로젝트 스타일")
|
||||
private List<ProjectOptionElementDto> style_list;
|
||||
|
||||
|
||||
|
||||
public static ProjectSurveyInfoDto of(String projectCode, String surveyTitle, int status, int company, boolean acceptBack, List<String>parameterList, List<Integer> projectAcceptDevice, List<ProjectOptionElementDto> projectStyleList){
|
||||
return ProjectSurveyInfoDto.builder()
|
||||
.project_code(projectCode)
|
||||
.survey_title(surveyTitle)
|
||||
.status(status)
|
||||
.company(company)
|
||||
.accept_back(acceptBack)
|
||||
.parameter_list(parameterList)
|
||||
.accept_device(projectAcceptDevice)
|
||||
.style_list(projectStyleList)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.sun.dto.question.common;
|
||||
|
||||
import com.krt.sun.entity.question.QuestionLogicEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionLogicJsonDto {
|
||||
public String logic;
|
||||
public String page;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.krt.sun.dto.question.common;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter @Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionOptionValueJsonDto {
|
||||
private String option_code;
|
||||
private String type_code;
|
||||
private String detail_code;
|
||||
private String value;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.krt.sun.dto.question.label;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter @Setter
|
||||
@NoArgsConstructor
|
||||
public class QuestionLabelInfoDto {
|
||||
private int order;
|
||||
private int value;
|
||||
private String label;
|
||||
|
||||
//String, Numeic에서만 사용
|
||||
private int open_type = 0;
|
||||
private int decimal_point = 0;
|
||||
private int not_duplicate = 0;
|
||||
private String prefix = "";
|
||||
private String range = "";
|
||||
private String placeholder = "";
|
||||
private String suffix = "";
|
||||
//String, Numeic에서만 사용
|
||||
|
||||
private int is_etc = 0;
|
||||
private int is_not = 0;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.krt.sun.dto.question.label;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
public class QuestionLabelJsonDto {
|
||||
private List<QuestionLabelInfoDto> label_info = null;
|
||||
private QuestionLabelOptionDto label_option = null;
|
||||
|
||||
public QuestionLabelJsonDto(List<QuestionLabelInfoDto> labelInfo, QuestionLabelOptionDto labelOption){
|
||||
this.label_info = labelInfo;
|
||||
this.label_option = labelOption;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.krt.sun.dto.question.label;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@ToString
|
||||
@Builder
|
||||
public class QuestionLabelOptionApplyDto {
|
||||
private String project_code;
|
||||
private String answerId;
|
||||
private String accept_question;
|
||||
private String except_question;
|
||||
private List<QuestionLabelInfoDto> label_info;
|
||||
|
||||
public QuestionLabelOptionApplyDto(String project_code, String answerId, String accept_question, String except_question, List<QuestionLabelInfoDto> label_info) {
|
||||
this.project_code = project_code;
|
||||
this.answerId = answerId;
|
||||
this.accept_question = accept_question;
|
||||
this.except_question = except_question;
|
||||
this.label_info = label_info;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.krt.sun.dto.question.label;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.krt.sun.entity.question.QuestionLabelEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@ToString
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionLabelOptionDto {
|
||||
private String accept_question = "";
|
||||
private String except_question = "";
|
||||
private int use_rotation = 0;
|
||||
private QuestionLabelRotationDto rotation_info = null;
|
||||
|
||||
public QuestionLabelOptionDto of(QuestionLabelEntity questionLabelEntity){
|
||||
Gson gson = new Gson();
|
||||
Type entityType = new TypeToken<QuestionLabelOptionDto>(){}.getType();
|
||||
if(questionLabelEntity == null || gson.fromJson(questionLabelEntity.getLabelOption(), entityType) == null){
|
||||
return new QuestionLabelOptionDto();
|
||||
}else{
|
||||
return gson.fromJson(questionLabelEntity.getLabelOption(), entityType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.krt.sun.dto.question.label;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class QuestionLabelRotationDto {
|
||||
private String fixed_top = "";
|
||||
private String fixed_bottom = "";
|
||||
private int use_group = 0;
|
||||
private String group = "";
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.krt.sun.dto.question.response;
|
||||
|
||||
import com.krt.sun.dto.question.common.QuestionOptionValueJsonDto;
|
||||
import com.krt.sun.dto.question.label.QuestionLabelJsonDto;
|
||||
import com.krt.sun.entity.question.QuestionEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@ToString
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionInfoDto {
|
||||
private int question_unique_key;
|
||||
private int question_order;
|
||||
private String question_id;
|
||||
private String question_name;
|
||||
private int question_dimension;
|
||||
private int auto_type;
|
||||
private int question_type;
|
||||
private String question_title;
|
||||
private String question_description;
|
||||
private List<QuestionOptionValueJsonDto> question_option;
|
||||
private List<QuestionOptionValueJsonDto> question_block_option;
|
||||
private String question_hardcode;
|
||||
private QuestionLabelJsonDto scalar_label;
|
||||
private QuestionLabelJsonDto matrix_label;
|
||||
private QuestionLabelJsonDto tensor_label;
|
||||
private int block_id;
|
||||
private int loop_id;
|
||||
|
||||
public static QuestionInfoDto of(QuestionEntity questionEntity){
|
||||
int questionType = questionEntity.getQuestionType();
|
||||
int autoType = 0;
|
||||
|
||||
if(questionType > 100){
|
||||
autoType = questionType / 100;
|
||||
questionType = questionType % 100;
|
||||
}
|
||||
|
||||
return QuestionInfoDto.builder()
|
||||
.question_unique_key(questionEntity.getQuestionUniqueKey())
|
||||
.question_order(questionEntity.getQuestionOrder())
|
||||
.question_id(questionEntity.getQuestionID())
|
||||
.question_name(questionEntity.getQuestionName())
|
||||
.question_dimension(questionEntity.getQuestionDimension())
|
||||
.auto_type(autoType)
|
||||
.question_type(questionType)
|
||||
.question_title(questionEntity.getQuestionTitle())
|
||||
.question_description(questionEntity.getQuestionDescription())
|
||||
.question_option(new ArrayList<>())
|
||||
.question_block_option(new ArrayList<>())
|
||||
.question_hardcode("")
|
||||
.scalar_label(null)
|
||||
.matrix_label(null)
|
||||
.tensor_label(null)
|
||||
.block_id(0)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.krt.sun.dto.question.response;
|
||||
|
||||
import com.krt.sun.dto.question.common.QuestionLogicJsonDto;
|
||||
import com.krt.sun.entity.question.QuestionEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@ToString
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionNavigationDto {
|
||||
private int question_unique_key;
|
||||
private int question_order;
|
||||
private int progress_percent;
|
||||
private String question_id;
|
||||
private String question_name;
|
||||
private String block_id;
|
||||
private List<QuestionLogicJsonDto> before_logic;
|
||||
private List<QuestionLogicJsonDto> after_logic;
|
||||
|
||||
public static QuestionNavigationDto of(QuestionEntity questionEntity){
|
||||
return QuestionNavigationDto.builder()
|
||||
.question_unique_key(questionEntity.getQuestionUniqueKey())
|
||||
.question_order(questionEntity.getQuestionOrder())
|
||||
.progress_percent(questionEntity.getQuestionOrder())
|
||||
.question_id(questionEntity.getQuestionID())
|
||||
.question_name(questionEntity.getQuestionName())
|
||||
.block_id("")
|
||||
.before_logic(null)
|
||||
.after_logic(null)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.krt.sun.dto.question.response;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionOptionDto {
|
||||
private String option_code;
|
||||
private String type_code;
|
||||
private String detail_code;
|
||||
private String value;
|
||||
|
||||
public String getTypeTotalCode() {
|
||||
return option_code + type_code + detail_code;
|
||||
}
|
||||
|
||||
public String getTotalCode() {
|
||||
return option_code + type_code + detail_code + "||" + value;
|
||||
}
|
||||
}
|
||||
35
src/main/java/com/krt/sun/dto/quota/QuotaCellDto.java
Normal file
35
src/main/java/com/krt/sun/dto/quota/QuotaCellDto.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.krt.sun.dto.quota;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.krt.sun.entity.quota.QuotaCellEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuotaCellDto {
|
||||
private long quotaCellIdx;
|
||||
private int quotaCount;
|
||||
private int viewCount;
|
||||
private List<QuotaCellJsonDto> quotaInfo;
|
||||
private int isUse;
|
||||
|
||||
public static QuotaCellDto of(QuotaCellEntity quotaCellEntity){
|
||||
Gson gson = new Gson();
|
||||
Type listType = new TypeToken<List<QuotaCellJsonDto>>() {}.getType();
|
||||
|
||||
return QuotaCellDto.builder()
|
||||
.quotaCellIdx(quotaCellEntity.getIdx())
|
||||
.quotaCount(quotaCellEntity.getQuotaCount())
|
||||
.viewCount(quotaCellEntity.getViewCount())
|
||||
.quotaInfo(gson.fromJson(quotaCellEntity.getQuotaInfo(),listType))
|
||||
.isUse(quotaCellEntity.getIsUse())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
15
src/main/java/com/krt/sun/dto/quota/QuotaCellJsonDto.java
Normal file
15
src/main/java/com/krt/sun/dto/quota/QuotaCellJsonDto.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.krt.sun.dto.quota;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuotaCellJsonDto {
|
||||
private int quk;
|
||||
private int val;
|
||||
}
|
||||
35
src/main/java/com/krt/sun/dto/quota/QuotaListDto.java
Normal file
35
src/main/java/com/krt/sun/dto/quota/QuotaListDto.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.krt.sun.dto.quota;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.krt.sun.entity.quota.QuotaEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuotaListDto {
|
||||
private int quotaCode;
|
||||
private List<Integer> rowQuestionList;
|
||||
private List<Integer> colQuestionList;
|
||||
private String quotaTitle;
|
||||
private int regMember;
|
||||
|
||||
public static QuotaListDto of(QuotaEntity quotaEntity){
|
||||
Gson gson = new Gson();
|
||||
Type listType = new TypeToken<List<Integer>>() {}.getType();
|
||||
|
||||
return QuotaListDto.builder()
|
||||
.quotaCode(quotaEntity.getQuotaCode())
|
||||
.rowQuestionList(gson.fromJson(quotaEntity.getRowQuestionUniqueKey(), listType))
|
||||
.colQuestionList(gson.fromJson(quotaEntity.getColQuestionUniqueKey(), listType))
|
||||
.quotaTitle(quotaEntity.getQuotaTitle())
|
||||
.regMember(quotaEntity.getRegMember())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
30
src/main/java/com/krt/sun/dto/redirect/RedirectDto.java
Normal file
30
src/main/java/com/krt/sun/dto/redirect/RedirectDto.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.krt.sun.dto.redirect;
|
||||
|
||||
import com.krt.sun.entity.project.ProjectRedirectEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RedirectDto {
|
||||
private String projectCode;
|
||||
private String panelCode;
|
||||
private String panelName;
|
||||
private String completeUrl;
|
||||
private String quotaUrl;
|
||||
private String screenUrl;
|
||||
|
||||
|
||||
public static RedirectDto of(ProjectRedirectEntity projectRedirectEntity){
|
||||
return RedirectDto.builder()
|
||||
.projectCode(projectRedirectEntity.getProjectCode())
|
||||
.panelCode(projectRedirectEntity.getPanelCode())
|
||||
.panelName(projectRedirectEntity.getPanelName())
|
||||
.completeUrl(projectRedirectEntity.getCompleteUrl())
|
||||
.quotaUrl(projectRedirectEntity.getQuotaUrl())
|
||||
.screenUrl(projectRedirectEntity.getScreenUrl())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.sun.dto.survey.common;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ErrorMessageDto {
|
||||
private String errorMessage;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.krt.sun.dto.survey.common;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SurveyDataDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
private int questionUniqueKey;
|
||||
private String answerData;
|
||||
private String answerDate;
|
||||
}
|
||||
18
src/main/java/com/krt/sun/dto/survey/common/SurveyInfo.java
Normal file
18
src/main/java/com/krt/sun/dto/survey/common/SurveyInfo.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.krt.sun.dto.survey.common;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SurveyInfo {
|
||||
private String security_code;
|
||||
private String answer_id;
|
||||
private int question_unique_key;
|
||||
private int loop_id;
|
||||
private String survey_type;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.sun.dto.survey.common;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SurveyRespondentDto {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
private int surveyTypeCode;
|
||||
private int answerState;
|
||||
private String answerStartDate;
|
||||
private int answerEndQuestionUniqueKey;
|
||||
private String answerEndDate;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.krt.sun.dto.survey.request;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.krt.sun.dto.question.label.QuestionLabelInfoDto;
|
||||
import com.krt.sun.dto.quota.QuotaCellJsonDto;
|
||||
import com.krt.sun.dto.survey.response.SurveyDataStructureDto;
|
||||
import com.krt.sun.entity.survey.SurveyDataEntity;
|
||||
import lombok.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DataSaveDto {
|
||||
private String security_code;
|
||||
private String answer_id;
|
||||
private int question_unique_key;
|
||||
private int block_id;
|
||||
private int loop_id;
|
||||
private List<SurveyDataStructureDto> surveyDataList;
|
||||
|
||||
//랭크 필수순위 응답 체크
|
||||
public boolean rankAnswerCheck(int t, int m, int rank, List<QuestionLabelInfoDto> isNotList){
|
||||
long answerCount = 0;
|
||||
|
||||
//랭크 필수 응답
|
||||
if(surveyDataList.stream().anyMatch(data -> data.getT() == t && data.getM() == m && data.getR() == rank)) answerCount = rank;
|
||||
|
||||
//{N} 응답 시, 패스
|
||||
if(surveyDataList.stream().anyMatch(data -> isNotList.stream().anyMatch(isNot -> data.getT() == t && data.getM() == m && isNot.getValue() == data.getS())) && answerCount != rank) answerCount = rank;
|
||||
|
||||
return answerCount >= rank;
|
||||
}
|
||||
|
||||
//파일 업로드 개수 체크
|
||||
public boolean fileUploadCheck(int t, int m, int uploadOptionCount){
|
||||
long uploadCount = surveyDataList.stream().filter(data -> data.getT() == t && data.getM() == m).count();
|
||||
|
||||
return uploadCount >= uploadOptionCount;
|
||||
}
|
||||
|
||||
public static DataSaveDto of(SurveyDataEntity surveyDataEntity){
|
||||
Gson gson = new Gson();
|
||||
Type listType = new TypeToken<List<SurveyDataStructureDto>>() {}.getType();
|
||||
|
||||
return DataSaveDto.builder()
|
||||
.security_code(surveyDataEntity.getProjectCode())
|
||||
.answer_id(surveyDataEntity.getAnswerId())
|
||||
.question_unique_key(surveyDataEntity.getQuestionUniqueKey())
|
||||
.surveyDataList(gson.fromJson(surveyDataEntity.getAnswerData(), listType))
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.krt.sun.dto.survey.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GangLoginRequestDto {
|
||||
private String projectCode;
|
||||
private String loginId;
|
||||
private String loginPwd;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.krt.sun.dto.survey.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class IndexParameterDto {
|
||||
private String security_code;
|
||||
private String answer_id;
|
||||
private List<HashMap<String, String>> parameter_info;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.krt.sun.dto.survey.response;
|
||||
|
||||
|
||||
import com.krt.sun.dto.question.response.QuestionInfoDto;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class IndexFormSetupDto {
|
||||
private String security_code;
|
||||
private String answer_id;
|
||||
private int progress_percent;
|
||||
private List<QuestionInfoDto> question_info;
|
||||
public static IndexFormSetupDto of(String securityCode, String answerId, int progressPercent, List<QuestionInfoDto> indexInfoList) {
|
||||
return IndexFormSetupDto.builder()
|
||||
.security_code(securityCode)
|
||||
.answer_id(answerId)
|
||||
.progress_percent(progressPercent)
|
||||
.question_info(indexInfoList)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.krt.sun.dto.survey.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class NextLoopInfo {
|
||||
private int nextUniqueKey;
|
||||
private int loopId;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.krt.sun.dto.survey.response;
|
||||
|
||||
import com.krt.sun.dto.question.response.QuestionInfoDto;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionUniqueKeyAndDataDto {
|
||||
int question_unique_key;
|
||||
int loopId;
|
||||
private List<SurveyDataStructureDto> saved_data_list;
|
||||
|
||||
public static QuestionUniqueKeyAndDataDto of(int questionUniqueKey, int loopId, List<SurveyDataStructureDto> surveyDataDtoList){
|
||||
return QuestionUniqueKeyAndDataDto.builder()
|
||||
.question_unique_key(questionUniqueKey)
|
||||
.loopId(loopId)
|
||||
.saved_data_list(surveyDataDtoList)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.krt.sun.dto.survey.response;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionUniqueKeyAndLabelDto {
|
||||
private int question_unique_key;
|
||||
private int loopId;
|
||||
private String saved_data_list;
|
||||
|
||||
public static QuestionUniqueKeyAndLabelDto of(int questionUniqueKey, int loopId, String dataLabel){
|
||||
return QuestionUniqueKeyAndLabelDto.builder()
|
||||
.question_unique_key(questionUniqueKey)
|
||||
.loopId(loopId)
|
||||
.saved_data_list(dataLabel)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.krt.sun.dto.survey.response;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.krt.sun.dto.question.response.QuestionInfoDto;
|
||||
import com.krt.sun.entity.question.QuestionEntity;
|
||||
import com.krt.sun.entity.survey.SurveyDataEntity;
|
||||
import lombok.*;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SurveyDataStructureDto {
|
||||
private int t;
|
||||
private int m;
|
||||
private int s;
|
||||
private int r;
|
||||
private String o;
|
||||
|
||||
public static List<SurveyDataStructureDto> answerDataToList(SurveyDataEntity surveyDataEntity){
|
||||
Gson gson = new Gson();
|
||||
Type surveyDataType = new TypeToken<List<SurveyDataStructureDto>>(){}.getType();
|
||||
return gson.fromJson(surveyDataEntity.getAnswerData(), surveyDataType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.krt.sun.dto.survey.response;
|
||||
|
||||
|
||||
import com.krt.sun.dto.question.response.QuestionInfoDto;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SurveyFormSetupDto {
|
||||
private String security_code;
|
||||
private String answer_id;
|
||||
private int progress_percent;
|
||||
private List<Integer> question_unique_key_list;
|
||||
private int loop_id;
|
||||
|
||||
public static SurveyFormSetupDto of(String securityCode, String answerId, int progressPercent, List<Integer> questionUniqueKeyList) {
|
||||
return SurveyFormSetupDto.builder()
|
||||
.security_code(securityCode)
|
||||
.answer_id(answerId)
|
||||
.progress_percent(progressPercent)
|
||||
.question_unique_key_list(questionUniqueKeyList)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.krt.sun.entity.autorecode;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "auto_recode")
|
||||
public class AutoRecodeEntity {
|
||||
|
||||
@Id
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private int idx;
|
||||
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Column(name = "Q_UK")
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Column(name = "R_VAL")
|
||||
private int recodeValue;
|
||||
|
||||
@Column(name = "R_CON")
|
||||
private String recodeCondition;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false)
|
||||
private String regDate;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.krt.sun.entity.capi;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "interviewer_assign")
|
||||
public class InterviewerAssignEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "IDX")
|
||||
private int idx;
|
||||
|
||||
@Column(name = "IV_CD")
|
||||
private String interviewerId;
|
||||
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Column(name = "REG_MBR", updatable = false)
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
|
||||
// public static InterviewerAssignEntity toEntity(SaveAllocationRequestDto saveAllocationRequestDto){
|
||||
// return InterviewerAssignEntity.builder()
|
||||
// .interviewerId(saveAllocationRequestDto.getInterviewerCode())
|
||||
// .projectCode(saveAllocationRequestDto.getProjectCode())
|
||||
// .regMember(saveAllocationRequestDto.getRegMember())
|
||||
// .build();
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.krt.sun.entity.capi;
|
||||
|
||||
|
||||
import com.krt.sun.dto.capi.DeleteSurveyDataRequestDto;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "interviewer_delete_request")
|
||||
public class InterviewerDeleteRequestEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "IDX")
|
||||
private int idx;
|
||||
|
||||
@Column(name = "IV_CD")
|
||||
private String interviewerId;
|
||||
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Column(name = "ANSWER_ID")
|
||||
private String answerId;
|
||||
|
||||
@Column(name = "REASON")
|
||||
private String reason;
|
||||
|
||||
@Column(name = "RESULT")
|
||||
private int result;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
|
||||
public static InterviewerDeleteRequestEntity toEntity(DeleteSurveyDataRequestDto deleteSurveyDataRequestDto){
|
||||
return InterviewerDeleteRequestEntity.builder()
|
||||
.interviewerId(deleteSurveyDataRequestDto.getInterviewerId())
|
||||
.projectCode(deleteSurveyDataRequestDto.getProjectCode())
|
||||
.answerId(deleteSurveyDataRequestDto.getAnswerId())
|
||||
.reason(deleteSurveyDataRequestDto.getReason())
|
||||
.result(deleteSurveyDataRequestDto.getResult())
|
||||
.build();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.krt.sun.entity.capi;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "interviewer_info")
|
||||
public class InterviewerInfoEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "IDX")
|
||||
private int idx;
|
||||
|
||||
@Column(name = "CD")
|
||||
private String code;
|
||||
|
||||
@Column(name = "IV_ID")
|
||||
private String interviewerId;
|
||||
|
||||
@Column(name = "IV_PW")
|
||||
private String interviewerPwd;
|
||||
|
||||
@Column(name = "NM")
|
||||
private String interviewerName;
|
||||
|
||||
@Column(name = "INFO")
|
||||
private String interviewerInfo;
|
||||
|
||||
@Column(name = "REG_MBR", updatable = false)
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
|
||||
// public static InterviewerInfoEntity toEntity(SaveInterviewerRequestDto saveInterviewerRequestDto){
|
||||
// return InterviewerInfoEntity.builder()
|
||||
// .idx(saveInterviewerRequestDto.getIdx())
|
||||
// .code(saveInterviewerRequestDto.getCode())
|
||||
// .interviewerId(saveInterviewerRequestDto.getId())
|
||||
// .interviewerPwd(saveInterviewerRequestDto.getPwd())
|
||||
// .interviewerInfo(saveInterviewerRequestDto.getInfo())
|
||||
// .regMember(saveInterviewerRequestDto.getRegMember())
|
||||
// .regDate(saveInterviewerRequestDto.getRegDate())
|
||||
// .build();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.krt.sun.entity.hardcode;
|
||||
|
||||
import com.krt.sun.dto.hardcode.HardCodeDto;
|
||||
import com.krt.sun.entity_pk.hardcode.HardcodeEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(HardcodeEntityPK.class)
|
||||
@Table(name = "question_hardcode")
|
||||
public class HardCodeEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long id;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "Q_UK")
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Id
|
||||
@Column(name = "TY")
|
||||
private int hardCodeType;
|
||||
|
||||
@Column(name = "CONTENT")
|
||||
private String content;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false)
|
||||
private String regDate;
|
||||
|
||||
public HardCodeDto of(HardCodeEntity hardCodeEntity) {
|
||||
return HardCodeDto.builder()
|
||||
.id(hardCodeEntity.getId())
|
||||
.projectCode(hardCodeEntity.getProjectCode())
|
||||
.questionUniqueKey(hardCodeEntity.getQuestionUniqueKey())
|
||||
.hardCodeType(hardCodeEntity.getHardCodeType())
|
||||
.content(hardCodeEntity.getContent())
|
||||
.regMember(hardCodeEntity.getRegMember())
|
||||
.regDate(hardCodeEntity.getRegDate())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.krt.sun.entity.hardcode;
|
||||
|
||||
import com.krt.sun.dto.hardcode.HardCodeHistoryDto;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "question_hardcode_history")
|
||||
public class HardCodeHistoryEntity {
|
||||
|
||||
@Id
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long id;
|
||||
|
||||
@Column(name = "PRJ_CD", updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Column(name = "Q_UK")
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Column(name = "TY")
|
||||
private int hardCodeType;
|
||||
|
||||
@Column(name = "CONTENT")
|
||||
private String content;
|
||||
|
||||
@Column(name = "UP_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "UP_DT", insertable = false)
|
||||
private String regDate;
|
||||
|
||||
public static HardCodeHistoryDto of(HardCodeHistoryEntity hardCodeHistoryEntity) {
|
||||
return HardCodeHistoryDto.builder()
|
||||
.projectCode(hardCodeHistoryEntity.getProjectCode())
|
||||
.questionUniqueKey(hardCodeHistoryEntity.getQuestionUniqueKey())
|
||||
.hardCodeType(hardCodeHistoryEntity.getHardCodeType())
|
||||
.content(hardCodeHistoryEntity.getContent())
|
||||
.regMember(hardCodeHistoryEntity.getRegMember())
|
||||
.regDate(hardCodeHistoryEntity.getRegDate())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
40
src/main/java/com/krt/sun/entity/list/ListContentEntity.java
Normal file
40
src/main/java/com/krt/sun/entity/list/ListContentEntity.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.krt.sun.entity.list;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "list")
|
||||
public class ListContentEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private int idx;
|
||||
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Column(name = "LT_ID")
|
||||
private String listId;
|
||||
|
||||
@Column(name = "LT_INFO")
|
||||
private String listInfo;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
|
||||
public void listContentUpdate(String listInfo){
|
||||
this.listInfo = listInfo;
|
||||
}
|
||||
}
|
||||
41
src/main/java/com/krt/sun/entity/list/ListHeaderEntity.java
Normal file
41
src/main/java/com/krt/sun/entity/list/ListHeaderEntity.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.krt.sun.entity.list;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "list_header")
|
||||
public class ListHeaderEntity {
|
||||
|
||||
@Id
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private int idx;
|
||||
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Column(name = "ORDER_NO")
|
||||
private int orderNo;
|
||||
|
||||
@Column(name = "NM")
|
||||
private String name;
|
||||
|
||||
@Column(name = "TY")
|
||||
private int type;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
}
|
||||
48
src/main/java/com/krt/sun/entity/project/ProjectEntity.java
Normal file
48
src/main/java/com/krt/sun/entity/project/ProjectEntity.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.krt.sun.entity.project;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.springframework.data.domain.Persistable;
|
||||
|
||||
@Entity
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "project")
|
||||
public class ProjectEntity {
|
||||
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private int idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "CD", updatable = false)
|
||||
private String code;
|
||||
|
||||
@Column(name = "IN_TT")
|
||||
private String projectTitle;
|
||||
|
||||
@Column(name = "OUT_TT")
|
||||
private String surveyTitle;
|
||||
|
||||
@Column(name = "ST", updatable = false)
|
||||
private int state;
|
||||
|
||||
@Column(name = "OWN_TM_CD")
|
||||
private String ownTeam;
|
||||
|
||||
@Column(name = "COMP")
|
||||
private int company;
|
||||
|
||||
@Column(name = "REG_MBR", updatable = false)
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
|
||||
@Column(name = "IS_DEL", insertable = false)
|
||||
private int isDelete;
|
||||
|
||||
@Column(name = "DEL_DT", insertable = false)
|
||||
private String deleteDate;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.krt.sun.entity.project;
|
||||
|
||||
import com.krt.sun.entity_pk.project.ProjectFileEntityPK;
|
||||
import com.krt.sun.util.Common;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(ProjectFileEntityPK.class)
|
||||
@Table(name = "project_file")
|
||||
public class ProjectFileEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "NM")
|
||||
private String fileName;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT")
|
||||
private String regDate;
|
||||
|
||||
public static ProjectFileEntity of(String projectCode, String fileName, int memberCode){
|
||||
return ProjectFileEntity.builder()
|
||||
.projectCode(projectCode)
|
||||
.fileName(fileName)
|
||||
.regMember(memberCode)
|
||||
.regDate(Common.getNow(null))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.krt.sun.entity.project;
|
||||
|
||||
import com.krt.sun.entity_pk.project.ProjectParameterEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(ProjectParameterEntityPK.class)
|
||||
@Table(name = "project_parameter")
|
||||
public class ProjectParameterEntity {
|
||||
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "NM")
|
||||
private String parameterName;
|
||||
|
||||
@Column(name = "IS_DEF")
|
||||
private int isDefault;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false)
|
||||
private String regDate;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.krt.sun.entity.project;
|
||||
|
||||
import com.krt.sun.entity_pk.project.ProjectRedirectEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(ProjectRedirectEntityPK.class)
|
||||
@Table(name = "project_redirect")
|
||||
public class ProjectRedirectEntity {
|
||||
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD", updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "PN_CD")
|
||||
private String panelCode;
|
||||
|
||||
@Column(name = "PN_NM")
|
||||
private String panelName;
|
||||
|
||||
@Column(name = "CO")
|
||||
private String completeUrl;
|
||||
|
||||
@Column(name = "QT")
|
||||
private String quotaUrl;
|
||||
|
||||
@Column(name = "SC")
|
||||
private String screenUrl;
|
||||
|
||||
@Column(name = "REG_MBR", updatable = false)
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.krt.sun.entity.project;
|
||||
|
||||
import com.krt.sun.entity_pk.project.ProjectResponseEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(ProjectResponseEntityPK.class)
|
||||
@Table(name = "project_response")
|
||||
public class ProjectResponseEntity {
|
||||
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private int idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD", updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "RES_OP_CD", updatable = false)
|
||||
private int optionCode;
|
||||
|
||||
@Column(name = "RES_OP_VAL")
|
||||
private String optionValue;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.krt.sun.entity.project;
|
||||
|
||||
import com.krt.sun.entity_pk.project.ProjectStyleEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(ProjectStyleEntityPK.class)
|
||||
@Table(name = "project_style", schema = "newssak")
|
||||
public class ProjectStyleEntity {
|
||||
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD", updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "CD", updatable = false)
|
||||
private int styleCode;
|
||||
|
||||
@Column(name = "VAL")
|
||||
private String styleValue;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.krt.sun.entity.question;
|
||||
|
||||
import com.krt.sun.entity_pk.question.QuestionBlockEntityPk;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(QuestionBlockEntityPk.class)
|
||||
@Table(name = "question_block_collection")
|
||||
public class QuestionBlockCollectEntity {
|
||||
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
@GeneratedValue(strategy= GenerationType.IDENTITY)
|
||||
private int idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "BK_CD")
|
||||
private int blockCode;
|
||||
|
||||
@Column(name = "Q_UK")
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false)
|
||||
private Date regDate;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumns({
|
||||
@JoinColumn(name = "PRJ_CD", referencedColumnName = "PRJ_CD", insertable = false, updatable = false),
|
||||
@JoinColumn(name = "BK_CD", referencedColumnName = "CD", insertable = false, updatable = false)
|
||||
})
|
||||
private QuestionBlockEntity questionBlockEntity;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.krt.sun.entity.question;
|
||||
|
||||
|
||||
import com.krt.sun.entity_pk.question.QuestionBlockEntityPk;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(QuestionBlockEntityPk.class)
|
||||
@Table(name = "question_block")
|
||||
public class QuestionBlockEntity {
|
||||
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
@GeneratedValue(strategy= GenerationType.IDENTITY)
|
||||
private int idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "CD")
|
||||
private int blockCode;
|
||||
|
||||
@Column(name = "NM")
|
||||
private String blockName;
|
||||
|
||||
@Column(name = "TY")
|
||||
private int blockType;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false)
|
||||
private Date regDate;
|
||||
|
||||
@OneToMany(mappedBy = "questionBlockEntity")
|
||||
private List<QuestionBlockCollectEntity> blockCollectList = new ArrayList<>();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.krt.sun.entity.question;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.krt.sun.dto.question.response.QuestionInfoDto;
|
||||
import com.krt.sun.entity_pk.question.QuestionBlockEntityPk;
|
||||
import com.krt.sun.util.Common;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(QuestionBlockEntityPk.class)
|
||||
@Table(name = "question_block_option")
|
||||
public class QuestionBlockOptionEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD", updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "BK_CD", updatable = false)
|
||||
private int blockCode;
|
||||
|
||||
@Column(name = "OPT_VAL")
|
||||
private String optionValue;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false)
|
||||
private String regDate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.krt.sun.entity.question;
|
||||
|
||||
import com.krt.sun.entity_pk.question.QuestionEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(QuestionEntityPK.class)
|
||||
@Table(name = "question")
|
||||
public class QuestionEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD", insertable = false, updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "Q_UK", insertable = false, updatable = false)
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Column(name = "Q_ID", insertable = false, updatable = false)
|
||||
private String questionID;
|
||||
|
||||
@Column(name = "Q_ODR", insertable = false, updatable = false)
|
||||
private int questionOrder;
|
||||
|
||||
@Column(name = "NM", insertable = false, updatable = false)
|
||||
private String questionName;
|
||||
|
||||
@Column(name = "DIM", insertable = false, updatable = false)
|
||||
private int questionDimension;
|
||||
|
||||
@Column(name = "TY", insertable = false, updatable = false)
|
||||
private int questionType;
|
||||
|
||||
@Column(name = "EXP_TXT", insertable = false, updatable = false)
|
||||
private String questionExplain;
|
||||
|
||||
@Column(name = "TT", insertable = false, updatable = false)
|
||||
private String questionTitle;
|
||||
|
||||
@Column(name = "DES", insertable = false, updatable = false)
|
||||
private String questionDescription;
|
||||
|
||||
@Column(name = "REG_MBR", insertable = false, updatable = false)
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
|
||||
@Column(name = "IS_DEL", insertable = false)
|
||||
private int isDelete;
|
||||
|
||||
@Column(name = "DEL_DT", insertable = false)
|
||||
private String deleteDate;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.krt.sun.entity.question;
|
||||
|
||||
import com.krt.sun.entity_pk.question.QuestionEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(QuestionEntityPK.class)
|
||||
@Table(name = "question_hardcode")
|
||||
public class QuestionHardcodeEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD", insertable = false, updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "Q_UK", insertable = false, updatable = false)
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Column(name = "TY", insertable = false, updatable = false)
|
||||
private int hardcodeType;
|
||||
|
||||
@Column(name = "CONTENT", insertable = false, updatable = false)
|
||||
private String hardcodeContent;
|
||||
|
||||
@Column(name = "REG_MBR", insertable = false, updatable = false)
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.krt.sun.entity.question;
|
||||
|
||||
import com.krt.sun.entity_pk.question.QuestionLabelEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter @Setter
|
||||
@Builder
|
||||
@IdClass(QuestionLabelEntityPK.class)
|
||||
@Table(name = "question_label")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionLabelEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD", insertable = false, updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "Q_UK", insertable = false, updatable = false)
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Id
|
||||
@Column(name = "DIM", insertable = false, updatable = false)
|
||||
private int labelDimension;
|
||||
|
||||
@Column(name = "L_INFO", insertable = false, updatable = false)
|
||||
private String labelInfo;
|
||||
|
||||
@Column(name = "L_OPT", insertable = false, updatable = false)
|
||||
private String labelOption;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.krt.sun.entity.question;
|
||||
|
||||
import com.krt.sun.entity_pk.question.QuestionEntityPK;
|
||||
import com.krt.sun.util.Common;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(QuestionEntityPK.class)
|
||||
@Table(name="question_logic")
|
||||
public class QuestionLogicEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD", updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "Q_UK", updatable = false)
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Column(name = "B_LGC")
|
||||
private String beforeLogic;
|
||||
|
||||
@Column(name = "A_LGC")
|
||||
private String afterLogic;
|
||||
|
||||
@Column(name = "REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false)
|
||||
private String regDate;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.krt.sun.entity.question;
|
||||
|
||||
import com.krt.sun.entity_pk.question.QuestionEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(QuestionEntityPK.class)
|
||||
@Table(name = "question_option")
|
||||
public class QuestionOptionEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD", insertable = false, updatable = false)
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "Q_UK", insertable = false, updatable = false)
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Column(name = "OPT_VAL", insertable = false, updatable = false)
|
||||
private String optionValue;
|
||||
|
||||
@Column(name = "REG_MBR", insertable = false, updatable = false)
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
}
|
||||
49
src/main/java/com/krt/sun/entity/quota/QuotaCellEntity.java
Normal file
49
src/main/java/com/krt/sun/entity/quota/QuotaCellEntity.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package com.krt.sun.entity.quota;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name="quota_cell")
|
||||
public class QuotaCellEntity {
|
||||
@Id
|
||||
@Column(name="IDX", insertable = false, updatable = false)
|
||||
@GeneratedValue(strategy= GenerationType.IDENTITY)
|
||||
private long idx;
|
||||
|
||||
@Column(name="PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Column(name="QT_CD")
|
||||
private int quotaCode;
|
||||
|
||||
@Column(name="QT_CNT")
|
||||
private int quotaCount;
|
||||
|
||||
@Column(name="VW_CNT")
|
||||
private int viewCount;
|
||||
|
||||
@Column(name="QT_INFO")
|
||||
private String quotaInfo;
|
||||
|
||||
@Column(name="IS_USE")
|
||||
private int isUse;
|
||||
|
||||
// public static QuotaCellEntity toEntity(String projectCode, int quotaCode, QuotaCellDto quotaCellDto){
|
||||
// Gson gson = new Gson();
|
||||
//
|
||||
// return QuotaCellEntity.builder()
|
||||
// .projectCode(projectCode)
|
||||
// .quotaCode(quotaCode)
|
||||
// .quotaCount(quotaCellDto.getQuotaCount())
|
||||
// .viewCount(quotaCellDto.getViewCount())
|
||||
// .quotaInfo(gson.toJson(quotaCellDto.getQuotaInfo()))
|
||||
// .isUse(quotaCellDto.getIsUse())
|
||||
// .build();
|
||||
// }
|
||||
}
|
||||
57
src/main/java/com/krt/sun/entity/quota/QuotaEntity.java
Normal file
57
src/main/java/com/krt/sun/entity/quota/QuotaEntity.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.krt.sun.entity.quota;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name="quota")
|
||||
public class QuotaEntity {
|
||||
|
||||
@Id
|
||||
@Column(name="IDX", insertable = false, updatable = false)
|
||||
@GeneratedValue(strategy= GenerationType.IDENTITY)
|
||||
private long idx;
|
||||
|
||||
@Column(name="PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Column(name="CD")
|
||||
private int quotaCode;
|
||||
|
||||
@Column(name="IS_BST")
|
||||
private int isBooster;
|
||||
|
||||
@Column(name="ROW_QUK")
|
||||
private String rowQuestionUniqueKey;
|
||||
|
||||
@Column(name="COL_QUK")
|
||||
private String colQuestionUniqueKey;
|
||||
|
||||
@Column(name="TT")
|
||||
private String quotaTitle;
|
||||
|
||||
@Column(name="REG_MBR")
|
||||
private int regMember;
|
||||
|
||||
@Column(name = "REG_DT", insertable = false, updatable = false)
|
||||
private String regDate;
|
||||
|
||||
// public static QuotaEntity toEntity(QuotaUpsertDto quotaUpsertDto){
|
||||
// Gson gson = new Gson();
|
||||
//
|
||||
// return QuotaEntity.builder()
|
||||
// .projectCode(quotaUpsertDto.getProjectCode())
|
||||
// .quotaCode(quotaUpsertDto.getQuotaCode())
|
||||
// .isBooster(quotaUpsertDto.getIsBooster())
|
||||
// .rowQuestionUniqueKey(gson.toJson(quotaUpsertDto.getRowQuestionList()))
|
||||
// .colQuestionUniqueKey(gson.toJson(quotaUpsertDto.getColQuestionList()))
|
||||
// .quotaTitle(quotaUpsertDto.getQuotaTitle())
|
||||
// .regMember(quotaUpsertDto.getRegMember())
|
||||
// .build();
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.krt.sun.entity.survey;
|
||||
|
||||
import com.krt.sun.entity_pk.question.SurveyBlockLoopEntityPK;
|
||||
import com.krt.sun.entity_pk.survey.SurveyRespondentEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(SurveyBlockLoopEntityPK.class)
|
||||
@Table(name = "survey_loop")
|
||||
public class SurveyBlockLoopEntity {
|
||||
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private int idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "BK_CD")
|
||||
private int blockCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "ODR")
|
||||
private int order;
|
||||
|
||||
@Id
|
||||
@Column(name = "ANS_ID")
|
||||
private String answerId;
|
||||
|
||||
@Column(name = "LOOP_ID")
|
||||
private int loopId;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.krt.sun.entity.survey;
|
||||
|
||||
import com.krt.sun.dto.survey.request.DataSaveDto;
|
||||
import com.krt.sun.entity_pk.survey.SurveyDataEntityPK;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(SurveyDataEntityPK.class)
|
||||
@Table(name = "survey_data")
|
||||
public class SurveyDataEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "ANS_ID")
|
||||
private String answerId;
|
||||
|
||||
@Id
|
||||
@Column(name = "Q_UK")
|
||||
private int questionUniqueKey;
|
||||
|
||||
@Id
|
||||
@Column(name = "LOOP_ID")
|
||||
private int loopId;
|
||||
|
||||
@Column(name = "ANS_DATA")
|
||||
private String answerData;
|
||||
|
||||
@Column(name = "ANS_DT")
|
||||
private String answerDate;
|
||||
|
||||
public static SurveyDataEntity toEntity(String projectCode, String answerId, int questionUniqueKey, int loopId, String answerData, String answerDate){
|
||||
return SurveyDataEntity.builder()
|
||||
.projectCode(projectCode)
|
||||
.answerId(answerId)
|
||||
.questionUniqueKey(questionUniqueKey)
|
||||
.loopId(loopId)
|
||||
.answerData(answerData)
|
||||
.answerDate(answerDate)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.krt.sun.entity.survey;
|
||||
|
||||
import com.krt.sun.entity_pk.survey.SurveyRespondentEntityPK;
|
||||
import com.krt.sun.util.Common;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@IdClass(SurveyRespondentEntityPK.class)
|
||||
@Table(name = "survey_respondent")
|
||||
public class SurveyRespondentEntity {
|
||||
@Column(name = "IDX", insertable = false, updatable = false)
|
||||
private long idx;
|
||||
|
||||
@Id
|
||||
@Column(name = "PRJ_CD")
|
||||
private String projectCode;
|
||||
|
||||
@Id
|
||||
@Column(name = "ANS_ID")
|
||||
private String answerId;
|
||||
|
||||
@Column(name = "SV_TY_CD")
|
||||
private int surveyTypeCode;
|
||||
|
||||
@Column(name = "ANS_ST")
|
||||
private int answerState;
|
||||
|
||||
@Column(name = "ANS_S_DT", insertable = false, updatable = false)
|
||||
private String answerStartDate;
|
||||
|
||||
@Column(name = "ANS_E_Q_UK")
|
||||
private int answerEndQuestionUniqueKey;
|
||||
|
||||
@Column(name = "ANS_LOOP_ID")
|
||||
private int answerLoopId;
|
||||
|
||||
@Column(name = "ANS_E_DT", insertable = false)
|
||||
private String answerEndDate;
|
||||
|
||||
public static SurveyRespondentEntity of(String projectCode, String answerId, int surveyTypeCode, int answerState, int answerEndQuestionUniqueKey, int loopId){
|
||||
return SurveyRespondentEntity.builder()
|
||||
.projectCode(projectCode)
|
||||
.answerId(answerId)
|
||||
.surveyTypeCode(surveyTypeCode)
|
||||
.answerState(answerState)
|
||||
.answerEndQuestionUniqueKey(answerEndQuestionUniqueKey)
|
||||
.answerLoopId(loopId)
|
||||
.answerEndDate(Common.getNow(null))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.krt.sun.entity_pk.hardcode;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class HardcodeEntityPK implements Serializable {
|
||||
private String projectCode;
|
||||
private int questionUniqueKey;
|
||||
private int hardCodeType;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.krt.sun.entity_pk.project;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ProjectFileEntityPK implements Serializable {
|
||||
private String projectCode;
|
||||
private String fileName;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.krt.sun.entity_pk.project;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ProjectParameterEntityPK implements Serializable {
|
||||
private String projectCode;
|
||||
private String parameterName;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.krt.sun.entity_pk.project;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ProjectRedirectEntityPK implements Serializable {
|
||||
private String projectCode;
|
||||
private String panelCode;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.krt.sun.entity_pk.project;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ProjectResponseEntityPK implements Serializable {
|
||||
private String projectCode;
|
||||
private int optionCode;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.krt.sun.entity_pk.project;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ProjectStyleEntityPK implements Serializable {
|
||||
private String projectCode;
|
||||
private int styleCode;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.krt.sun.entity_pk.question;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class QuestionBlockCollectEntityPk implements Serializable {
|
||||
|
||||
private String projectCode;
|
||||
private int blockCode;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.krt.sun.entity_pk.question;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class QuestionBlockEntityPk implements Serializable {
|
||||
|
||||
private String projectCode;
|
||||
private int blockCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.krt.sun.entity_pk.question;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class QuestionEntityPK implements Serializable {
|
||||
private int questionUniqueKey;
|
||||
private String projectCode;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.krt.sun.entity_pk.question;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class QuestionLabelEntityPK implements Serializable {
|
||||
private int questionUniqueKey;
|
||||
private String projectCode;
|
||||
private int labelDimension;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.krt.sun.entity_pk.question;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class SurveyBlockLoopEntityPK implements Serializable {
|
||||
private String projectCode;
|
||||
private int blockCode;
|
||||
private int order;
|
||||
private String answerId;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.krt.sun.entity_pk.survey;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class SurveyDataEntityPK implements Serializable {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
private int questionUniqueKey;
|
||||
private int loopId;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.krt.sun.entity_pk.survey;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class SurveyRespondentEntityPK implements Serializable {
|
||||
private String projectCode;
|
||||
private String answerId;
|
||||
}
|
||||
30
src/main/java/com/krt/sun/enums/AnswerStateEnum.java
Normal file
30
src/main/java/com/krt/sun/enums/AnswerStateEnum.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.krt.sun.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
@ToString
|
||||
public enum AnswerStateEnum {
|
||||
ONGOING("ONGOING", 1),
|
||||
END("END", 10),
|
||||
SCREEN("SCREEN", 99),
|
||||
QUOTA("QUOTA", 98);
|
||||
|
||||
private final String stateString;
|
||||
private final int stateCode;
|
||||
|
||||
AnswerStateEnum(String stateString, int stateCode){
|
||||
this.stateString = stateString;
|
||||
this.stateCode = stateCode;
|
||||
}
|
||||
|
||||
public static AnswerStateEnum stateCodeOfStateString(String stateString){
|
||||
return Arrays.stream(values())
|
||||
.filter(x -> x.stateString.equals(stateString))
|
||||
.findAny()
|
||||
.orElse(ONGOING);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user