first commit
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user