이름 랜덤 생성 기능 추가

main
이범준 12 months ago
parent a0a4b09575
commit 3f8005ce2e

@ -28,7 +28,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
"externalsystem.piss",
"externalsystem.ino",
"externalsystem.jinwoo",
"externalsystem.nuri2"
"externalsystem.nuri2",
"externalsystem.testpool"
})
public class CommonConfig {
/**AntPathMatcher .

@ -0,0 +1,35 @@
package externalsystem.testpool;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class RandomUtil {
public static String randomHangulName() {
List<String> seong = Arrays.asList(
"김", "이", "박", "최", "정", "강", "조", "윤", "장", "임", "한", "오", "서", "신", "권", "황", "안",
"송", "류", "전", "홍", "고", "문", "양", "손", "배", "조", "백", "허", "유", "남", "심", "노", "정",
"하", "곽", "성", "차", "주", "우", "구", "신", "임", "나", "전", "민", "유", "진", "지", "엄", "채",
"원", "천", "방", "공", "강", "현", "함", "변", "염", "양", "변", "여", "추", "노", "도", "소", "신",
"석", "선", "설", "마", "길", "주", "연", "방", "위", "표", "명", "기", "반", "왕", "금", "옥", "육",
"인", "맹", "제", "모", "장", "남", "탁", "국", "여", "진", "어", "은", "편", "구", "용");
List<String> irum = Arrays.asList(
"가", "강", "건", "경", "고", "관", "광", "구", "규", "근", "기", "길", "나", "남", "노", "누", "다",
"단", "달", "담", "대", "덕", "도", "동", "두", "라", "래", "로", "루", "리", "마", "만", "명", "무",
"문", "미", "민", "바", "박", "백", "범", "별", "병", "보", "빛", "사", "산", "상", "새", "서", "석",
"선", "설", "섭", "성", "세", "소", "솔", "수", "숙", "순", "숭", "슬", "승", "시", "신", "아", "안",
"애", "엄", "여", "연", "영", "예", "오", "옥", "완", "요", "용", "우", "원", "월", "위", "유", "윤",
"율", "으", "은", "의", "이", "익", "인", "일", "잎", "자", "잔", "장", "재", "전", "정", "제", "조",
"종", "주", "준", "중", "지", "진", "찬", "창", "채", "천", "철", "초", "춘", "충", "치", "탐", "태",
"택", "판", "하", "한", "해", "혁", "현", "형", "혜", "호", "홍", "화", "환", "회", "효", "훈", "휘",
"희", "운", "모", "배", "부", "림", "봉", "혼", "황", "량", "린", "을", "비", "솜", "공", "면", "탁",
"온", "디", "항", "후", "려", "균", "묵", "송", "욱", "휴", "언", "령", "섬", "들", "견", "추", "걸",
"삼", "열", "웅", "분", "변", "양", "출", "타", "흥", "겸", "곤", "번", "식", "란", "더", "손", "술",
"훔", "반", "빈", "실", "직", "흠", "흔", "악", "람", "뜸", "권", "복", "심", "헌", "엽", "학", "개",
"롱", "평", "늘", "늬", "랑", "얀", "향", "울", "련");
Collections.shuffle(seong);
Collections.shuffle(irum);
return seong.get(0) + irum.get(0) + irum.get(1);
}
}

@ -10,4 +10,6 @@ public interface TestPoolMapper extends AbstractMapper {
DataObject selectRandomMber();
DataObject selectRandomAddr();
DataObject selectRandomCarBasic();
int insertNamePool(String name);
}

@ -0,0 +1,32 @@
package externalsystem.testpool.web;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.foundation.web.AbstractController;
import externalsystem.testpool.RandomUtil;
import externalsystem.testpool.dao.TestPoolMapper;
@Controller
@RequestMapping(name="테스트풀", value="/testpool")
public class TestPoolController extends AbstractController {
@Resource
private TestPoolMapper testPoolMapper;
@RequestMapping(name="이름 테스트풀 생성", value="/makeName.do")
public ModelAndView makeName() {
ModelAndView mav = new ModelAndView("jsonView");
String newName = RandomUtil.randomHangulName();
try {
testPoolMapper.insertNamePool(newName);
} catch(Exception e) {
}
return mav;
}
}

@ -3,7 +3,7 @@
<mapper namespace="externalsystem.testpool.dao.TestPoolMapper">
<select id="selectRandomMber" resultType="dataobject">
SELECT *
SELECT *
FROM TESTPOOL_TB_MBER
ORDER BY RAND() LIMIT 1
</select>
@ -20,5 +20,11 @@ FROM TESTPOOL_TB_CAR_BASIC
ORDER BY RAND() LIMIT 1
</select>
<insert id="insertNamePool" parameterType="string">
INSERT INTO TESTPOOL_TB_NAME
VALUES (#{name})
</insert>
</mapper>

@ -8,18 +8,25 @@
<div class="layout-container">
<div class="layout-page ps-5">
<div class="content-wrapper" style="justify-content:flex-start">
<div class="container-xxl container-p-y ms-1">
<h5>테스트풀</h5>
<button type="button" id="btnMakePersonNamePool" class="btn btn-primary">이름 테스트풀 생성</button>
</div>
<div class="container-xxl container-p-y ms-1">
<h5>국민신문고</h5>
<button type="button" id="btnForCivil" class="btn btn-primary disabled">신고자 모의 테스트</button>
<button type="button" id="btnForSinmungoAdmin" class="btn btn-primary">신문고 담당자 모의 테스트</button>
</div>
<div class="container-xxl container-p-y ms-1">
<h5>모바일 메시지 서비스 모듈 관련 파일 생성</h5>
<h5>모바일 메시지 서비스 관련</h5>
<button type="button" id="btnMessageAccountValidation" class="btn btn-primary">SMS 계정 신청 검증</button>
<button type="button" id="btnMakeConfForMessage" class="btn btn-primary">설정 파일 생성</button>
<button type="button" id="btnMakeScriptForMessage" class="btn btn-primary">스크립트 파일 생성</button>
<!-- <button type="button" id="btnSendMobileMessage" class="btn btn-primary">모바일 메시지 API submit(랜덤)</button> -->
</div>
</div>
</div>
</div>
</div>
@ -30,6 +37,21 @@
<script>
$("#btnMakePersonNamePool").on("click",function(){
$.ajax({
type : "GET",
ContentType : "text/html;charset=UTF-8",
url : "/testpool/makeName.do",
data: {},
success: (resp) => {
}
});
});
//$("#btnSendMobileMessage").on("click",function(){
//
//});
$("#btnForSinmungoAdmin").on("click", function(){
$.ajax({

Loading…
Cancel
Save