diff --git a/src/main/java/com/eactive/httpmockserver/api/controller/MockRouteMgmtController.java b/src/main/java/com/eactive/httpmockserver/api/controller/MockRouteMgmtController.java index 6c0c469..16f91f3 100644 --- a/src/main/java/com/eactive/httpmockserver/api/controller/MockRouteMgmtController.java +++ b/src/main/java/com/eactive/httpmockserver/api/controller/MockRouteMgmtController.java @@ -46,7 +46,9 @@ public class MockRouteMgmtController { @GetMapping("/create_view.do") public String createView(ModelMap model) { MockRouteDTO defaultRoute = new MockRouteDTO(); - defaultRoute.getResponses().add(new MockResponseDTO()); + MockResponseDTO defaultResponse = new MockResponseDTO(); + defaultResponse.setDefaultResponse(true); + defaultRoute.getResponses().add(defaultResponse); model.addAttribute("mockRoute", defaultRoute); return MOCK_ROUTE_EDIT; } @@ -55,7 +57,8 @@ public class MockRouteMgmtController { public String updateView(ModelMap model, @RequestParam("id") Long id) { MockRoute found = mockRouteService.findById(id); - model.addAttribute("mockRoute", found); + + model.addAttribute("mockRoute", mockRouteMapper.map(found)); return MOCK_ROUTE_EDIT; } diff --git a/src/main/java/com/eactive/httpmockserver/api/dto/MockResponseDTO.java b/src/main/java/com/eactive/httpmockserver/api/dto/MockResponseDTO.java index 093ebb8..c127796 100644 --- a/src/main/java/com/eactive/httpmockserver/api/dto/MockResponseDTO.java +++ b/src/main/java/com/eactive/httpmockserver/api/dto/MockResponseDTO.java @@ -3,12 +3,11 @@ package com.eactive.httpmockserver.api.dto; import javax.validation.constraints.Min; import java.util.ArrayList; import java.util.List; -import java.util.Map; public class MockResponseDTO { @Min(100) - private int statusCode = 100; + private int statusCode = 200; private List headers = new ArrayList<>(); @@ -16,6 +15,7 @@ public class MockResponseDTO { private long delay = 0; //millisecond + private boolean defaultResponse = false; private List conditions; public int getStatusCode() { @@ -57,4 +57,12 @@ public class MockResponseDTO { public void setConditions(List conditions) { this.conditions = conditions; } + + public boolean isDefaultResponse() { + return defaultResponse; + } + + public void setDefaultResponse(boolean defaultResponse) { + this.defaultResponse = defaultResponse; + } } diff --git a/src/main/java/com/eactive/httpmockserver/api/entity/MockResponse.java b/src/main/java/com/eactive/httpmockserver/api/entity/MockResponse.java index f0f2f6d..36dd2f7 100644 --- a/src/main/java/com/eactive/httpmockserver/api/entity/MockResponse.java +++ b/src/main/java/com/eactive/httpmockserver/api/entity/MockResponse.java @@ -27,6 +27,9 @@ public class MockResponse { private long delay = 0; //millisecond + @Column(name = "DEFAULT_RESPONSE", nullable = false, columnDefinition = "boolean default false") + private boolean defaultResponse = false; + @ManyToOne @JoinColumn(name = "ROUTE_ID", nullable = false) private MockRoute route; @@ -89,4 +92,12 @@ public class MockResponse { public void setConditions(List conditions) { this.conditions = conditions; } + + public boolean isDefaultResponse() { + return defaultResponse; + } + + public void setDefaultResponse(boolean defaultResponse) { + this.defaultResponse = defaultResponse; + } } diff --git a/src/main/resources/static/css/custom.css b/src/main/resources/static/css/custom.css index 4a55aa0..12d676b 100644 --- a/src/main/resources/static/css/custom.css +++ b/src/main/resources/static/css/custom.css @@ -59,42 +59,7 @@ ul li { border-color: #f5c08d; } -/*메인페이지 뉴스 패널*/ -.nav-tabs { - margin-top: 6px; - border-bottom: 0; -} -.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { - border: 0px; -} - -.nav-tabs > li > a { - height: 60px; - margin-right: 0; - font-size: 16px; - line-height: 2.5; - color: #888; - border-radius: 0; - border: 0px; - border-bottom: 2px solid #ddd; - box-shadow: inset 0px 2px 0px .0px rgba(0, 0, 0, .2); -} - -.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { - color: #222; - font-size: 17px; - font-weight: 600; - box-sizing: border-box; - border-bottom: 2px solid #222; - box-shadow: inset 0px 1.5px 0px .0px rgba(0, 0, 0, 1); - z-index: 999; - background: url(../img/bullet01.png) no-repeat 190px center; -} - -.nav-tabs .active { - border: 0px; -} /*사이트소개*/ .portal_main_head { position: relative; @@ -291,48 +256,11 @@ ul li { margin-right: 10px; } -div.calen-s { - display: inline-block; - position: relative; - margin-left: 10px; - vertical-align: middle; -} - -div.calen-s span { - margin-right: 3px; -} - -div.calen-s input[type="date"] { - display: block; - float: left; - width: 150px; - margin-right: 3px; -} .signup .idsave { margin: 10px 0 0 95px; } -/*관리자 페이지 왼쪽 메뉴*/ -.admin_menu { - display: block; - position: relative; - margin-left: 70px; - float: left; - top: 30px; - padding: 10px 20px 10px 20px; - width: 220px; /* box-shadow: 0px 0px 10px 2px rgba(0,0,0,0.08); */ - border-radius: 10px; - background-color: #fff; - clear: both; - z-index: 100; -} - -.admin_menu ul li div ul li:last-child a { - margin-bottom: 10px; -} - - .b-example-divider { flex-shrink: 0; width: 1.5rem; @@ -343,26 +271,6 @@ div.calen-s input[type="date"] { box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15); } -.btn-toggle { - display: inline-flex; - align-items: center; - width: 100%; - padding: 20px; /*margin: 10px 0 5px 0;*/ - height: 30px; - background-color: /*transparent*/ #fff8eb; - border-radius: 4px; - border: 0; - font-weight: 500; - font-size: 16px; - color: #222; -} - -.btn-toggle:hover, -.btn-toggle:focus { - color: rgba(0, 0, 0, .85); - background-color: #fff8eb; -} - /* 화면 스크롤 해도 nav_bar를 상단에 고정 */ .fixed_top { position: fixed; @@ -382,97 +290,14 @@ div.calen-s input[type="date"] { display: block; } -.btn-toggle[aria-expanded="true"] { - width: 100%; - color: #fff; - font-size: 16px; - font-weight: 500; - background-color: #fd9b00; -} - -.btn-toggle[aria-expanded="true"]::before { - transform: rotate(90deg); -} - -.btn-toggle-nav a { - display: inline-flex; - width: 100%; - padding: .1875rem .5rem; - margin-top: .125rem; - margin-left: 1.25rem; - text-decoration: none; - font-size: 15px; - font-weight: 400; - line-height: 1.5; - color: #222; -} - - .scrollarea { overflow-y: auto; } -.admin_content { - display: block; - position: relative; - margin: 0 auto; -} - .has-error .form-control { border-color: #dc312d; } -.explan.error { - color: #dc312d; -} - - -/*테스트 등록*/ -.testregister_wrap { - width: 100%; - padding: 0; - border-radius: 10px; - border: 1px solid #ddd; - margin: 20px 0 40px 0; -} - -.testregister_top { - padding: 40px 60px 40px 60px; -} - -.testregister_left, .testregister_right { - display: inline-block; - width: 49.8%; - padding: 40px 60px 60px 60px; - vertical-align: top; -} - -.testregister_left { - border-right: 1px solid #e6e6e6; -} - - -.testregister_wrap h3 { - display: block; - float: left; - margin-top: 10px; - font-weight: 600; - margin-bottom: 20px; -} - -.jg-regist { - display: block; - position: relative; - float: left; - width: 100%; -} - -.jg-regist table tr { - height: 40px; - font-size: 14px; - border-bottom: 1px solid #ddd; -} - .jsgrid-table { position: relative; margin-left: 15px; @@ -482,103 +307,6 @@ div.calen-s input[type="date"] { width: 150px; } -.testregister_wrap h3 span { - display: inline-block; - position: relative; - width: 26px; - height: 26px; - margin-right: 10px; - top: -2px; - background-color: #222; - border-radius: 50%; - text-align: center; - color: #fff; - font-weight: 400; - font-size: 16px; - line-height: 1.6; -} - -.testregister_wrap hr { - display: block; - width: 100%; - margin: 0; - border-color: #ddd; -} - -.testregister_result { - width: 100%; - border: 1px solid #ddd; - border-radius: 6px; - padding: 10px 0 10px 20px; - line-height: 1.7; - list-style: none; -} - -.testregister_select_tit { - float: left; - width: 100%; - border: 1px solid #ddd; - border-radius: 6px; - padding: 15px 0 15px 20px; - line-height: 1.7; - list-style: none; -} - -.testregister_select_tit li { - text-align: center; -} - -.testregister_select { - float: left; - width: 100%; - border: 1px solid #ddd; - border-radius: 6px; - padding: 10px 20px; - background-color: #fafafa; - line-height: 1.7; - list-style: none; -} - -.testregister_select li { - display: inline-block; - width: 100%; - height: 46px; - line-height: 2.8; - text-indent: 20px; -} - -.testregister_select li:first-child { - border-bottom: 1px solid #ddd; -} - -.testregister_select li:hover { - display: inline-block; - width: 100%; - background-color: #f1f1f1; -} - -.testregister_result a, .testregister_select a { - color: #222; -} - -.testregister_left .pagination { - margin-top: 15px; -} - -.testregister_left .pagination ul li a, -.testregister_left .pagination ul li.on a, -.testregister_left .pagination ul li:hover a { - border-radius: 4px; -} - -.testregister_detail { - padding: 40px 60px 40px 60px; -} - -.testregister_detail label { - font-size: 20px; -} - .board_content { padding: 10px; line-height: 1.5; @@ -1812,7 +1540,6 @@ figure div span { } - .dev { background-color : #f74140 !important; color : white !important; diff --git a/src/main/resources/templates/page/apiTester.html b/src/main/resources/templates/page/apiTester.html index 7a743dc..6304ccf 100644 --- a/src/main/resources/templates/page/apiTester.html +++ b/src/main/resources/templates/page/apiTester.html @@ -192,7 +192,6 @@ $('#path').on('input', function(){ model.path = $(this).val(); - //parse querystring from path and set to model.queryParams model.queryParams = []; let queryString = model.path.split('?')[1]; if(queryString){ diff --git a/src/main/resources/templates/page/routes/mockRouteEdit.html b/src/main/resources/templates/page/routes/mockRouteEdit.html index da497a0..0111361 100644 --- a/src/main/resources/templates/page/routes/mockRouteEdit.html +++ b/src/main/resources/templates/page/routes/mockRouteEdit.html @@ -10,16 +10,15 @@ th:object='${mockRoute}' method="post">
-

API 정보 등록

-

API 정보 수정

+
API 정보 등록
+
API 정보 수정
+ th:classappend="${#fields.hasErrors('name')}? 'is-invalid'" th:field="*{name}" required/>
@@ -53,134 +52,45 @@
-

응답

+
응답
-
-
-
-
- - -
-
-
-
-
-
-
-
- 조건 항목 -
-
-
- - - - - - - - - - - - - - - - - -
종류 - -
- - - - - -
-
-
-
-
-
-
응답 내용
-
-
- - -
-
- - -
-
- - -
-
-
- - - - - - - - - - - - - - - -
Header 이름 - -
- - - -
-
-
-
-
+
+
+
+ + + + +
    +
  • + + + +
  • +
+
    +
  • + + +
  • +
+ +
+
-