- 설문조사 백엔드 : Springboot + JPA + MySQL -> with NAT
주소 | 타입 | 기능 |
---|---|---|
protocol:://addr:port/survey/createSurvey | POST | 설문생성 |
protocol:://addr:port/survey/getSurveyTitle | GET | 만들어진 설문 전체 조회 |
protocol:://addr:port/survey/getSurveyDetail?titleId= | GET | 타이틀 아이디에 해당하는 설문 상세조회 |
protocol:://addr:port/survey/getResult?userId=&titleId= | GET | 타이틀 아이디에 해당하는 결과 상세조회 |
protocol:://addr:port/survey/addResult | POST | 설문 답변 등록 |
설문생성 JSON 예시
{ "title": { "title":"선택이 필요합니다." } , "questions":[ { "question_id":1, "question_msg":"야식은 무엇을 먹을까요?", "answers" : [ { "answer_id":1, "answer_msg":"1.치킨" }, { "answer_id":2, "answer_msg":"2.족발" }, { "answer_id":3, "answer_msg":"3.굶기" } ] } , { "question_id":2, "question_msg":"오늘은 몇시에잘까요?", "answers" : [ { "answer_id":1, "answer_msg":"22시59분" }, { "answer_id":2, "answer_msg":"23시59분" }, { "answer_id":3, "answer_msg":"내일자요" } ] }, { "question_id":3, "question_msg":"어느 커피숍을 갈까요?", "answers" : [ { "answer_id":1, "answer_msg":"스타벅스" }, { "answer_id":2, "answer_msg":"이디야" }, { "answer_id":3, "answer_msg":"메가" } ] } ] }
설문 답변 등록 JSON 예시
{ "userId":202104061549, "titleId":1, "userAnsList":[ { "questionId":1, "answerId":2 }, { "questionId":2, "answerId":1 } ], "countList":null }
테이블명 | 간단설명 |
---|---|
survey_title | 설문의 아이디와 제목 |
survey_question | 문항의 아이디와 내용 |
survey_answer | 세부문항의 아이디와 내용 |
survey_user | 유저의 아이디와 답변 |
테이블명 | 컬럼명 | 타입 | 설명 | 기본키 or 복합키 |
---|---|---|---|---|
survey_title | id | bigint | 설문의 아이디 | ✔ |
title | varchar(1024) | 설문의 제목 | ||
survey_question | id | bigint | 설문의 아이디 | ✔ |
question_id | bigint | 문항의 아이디 | ✔ | |
question_msg | varchar(1024) | 문항의 내용 | ||
survey_answer | id | bigint | 설문의 아이디 | ✔ |
question_id | bigint | 문항의 아이디 | ✔ | |
answer_id | bigint | 세부문항의 아이디 | ✔ | |
answer_msg | varchar(1024) | 세부문항의 내용 | ||
survey_user | user_id | bigint | 유저의 아이디 | ✔ |
id | bigint | 설문의 아이디 | ✔ | |
question_id | bigint | 문항의 아이디 | ✔ | |
answer_id | bigint | 세부문항의 아이디 |