내정보 메인 : 화면 추가, 일부 개인정보 추가. 링크
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package app.module.front.usecase.info;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetInfoUIController {
|
||||
|
||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
||||
|
||||
@GetMapping(path = "/info")
|
||||
String operate(Model model) {
|
||||
|
||||
//TODO 일계부를 등록하지 않은 날짜 처리 필요
|
||||
boolean isUnregisteredDate = false;
|
||||
|
||||
//TODO 최근등록일 취득 해야함
|
||||
String latestRegisteredDate = "2025년 5월 16~17일";
|
||||
|
||||
model.addAttribute("userInfo",getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
||||
model.addAttribute("isUnregisteredDate",isUnregisteredDate);
|
||||
return "info/main";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.module.front.usecase.info.bank.getBanksUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetBanksUIController {
|
||||
|
||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
||||
|
||||
@GetMapping(path = "/info/bank")
|
||||
String operate(Model model) {
|
||||
|
||||
model.addAttribute("userInfo",
|
||||
getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
||||
|
||||
return "info/bank/banks";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetMontylysUIController {
|
||||
|
||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
||||
|
||||
@GetMapping(path = "/info/monthly")
|
||||
String operate(Model model) {
|
||||
|
||||
model.addAttribute("userInfo",
|
||||
getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
||||
|
||||
return "info/monthly/monthlys";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.module.front.usecase.info.notice.getNoticesUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetNoticesUIController {
|
||||
|
||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
||||
|
||||
@GetMapping(path = "/info/notice")
|
||||
String operate(Model model) {
|
||||
|
||||
model.addAttribute("userInfo",
|
||||
getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
||||
|
||||
return "info/notice/notices";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.module.front.usecase.info.user.getUserUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetUserUIController {
|
||||
|
||||
private final GetHouseholdPortIn getHouseholdPortIn;
|
||||
|
||||
@GetMapping(path = "/info/user")
|
||||
String operate(Model model) {
|
||||
|
||||
model.addAttribute("userInfo",
|
||||
getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
|
||||
|
||||
return "info/user/user";
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,24 @@
|
||||
uri=\uD648 \uD654\uBA74
|
||||
uri.front=\uC784\uAC00\uACBD\uC81C\uC870\uC0AC
|
||||
#uri.front.board.exampleBoard=\uC608\uC81C \uAC8C\uC2DC\uD310
|
||||
uri.front.board.articles=\uC608\uC81C \uAC8C\uC2DC\uD310
|
||||
uri.front.board.exampleBoard.{{pathVar}}=\uC608\uC81C \uAC8C\uC2DC\uD310 \uC0C1\uC138\uBCF4\uAE30
|
||||
|
||||
uri.front.login=\uB85C\uADF8\uC778
|
||||
uri.front.user.register=\uD68C\uC6D0\uAC00\uC785
|
||||
uri.front.user.info=\uC815\uBCF4\uC218\uC815
|
||||
uri.front.board.article.create=\uC608\uC81C \uAC8C\uC2DC\uD310 \uB4F1\uB85D
|
||||
uri.front.board.article.{{pathVar}}=\uC608\uC81C \uAC8C\uC2DC\uD310 \uC0C1\uC138\uBCF4\uAE30
|
||||
uri.front.board.article.update.{{pathVar}}=\uC608\uC81C \uAC8C\uC2DC\uD310 \uC218\uC815
|
||||
|
||||
# \uC785\uB825\uD604\uD669
|
||||
uri.front.status=\uC785\uB825\uD604\uD669
|
||||
|
||||
# \uD1B5\uACC4
|
||||
uri.front.statistics=\uD1B5\uACC4
|
||||
|
||||
|
||||
# \uB0B4\uC815\uBCF4
|
||||
uri.front.info=\uB0B4\uC815\uBCF4
|
||||
uri.front.info.path=/info
|
||||
uri.front.info.user=\uAC1C\uC778\uC815\uBCF4
|
||||
uri.front.info.notice=\uACF5\uC9C0\uC0AC\uD56D
|
||||
uri.front.info.monthly=\uC6D4\uBCC4 \uC784\uC0B0\uBB3C \uD604\uD669
|
||||
uri.front.info.bank=\uC740\uD589 \uC790\uB3D9\uC774\uCCB4 \uB0B4\uC5ED
|
||||
|
||||
|
||||
|
||||
# \uC77C\uACC4\uBD80
|
||||
uri.front.record.calendar=\uC784\uAC00\uACBD\uC81C\uC870\uC0AC \uC77C\uACC4\uBD80
|
||||
|
||||
@@ -13,7 +13,7 @@ kri.menu.daily = function() {
|
||||
location.href = '/record/calendar';
|
||||
}
|
||||
kri.menu.my = function() {
|
||||
location.href = '/user/info';
|
||||
location.href = '/info';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -77,32 +77,32 @@
|
||||
<a href="javascript:void(0);" onclick="kri.menu.main();" class="logo"><img th:src="@{/static/assets/images/common/logo_kri.svg}" alt="KRI 로고"> <span>[[${#messages.msg(currentURI.id)}]]</span></a>
|
||||
</h1>
|
||||
<!--/* TODO 전체메뉴 S */-->
|
||||
<p>
|
||||
<strong>Current Device</strong> : [[${currentDevice}]]
|
||||
</p>
|
||||
<ul th:if="${topNode != null}">
|
||||
<li>
|
||||
<a th:classappend="${topNode.uri eq currentURI.uri} ? 'active'"
|
||||
th:href="${topNode.uri}">[[${#messages.msg(topNode.id)}]]</a>
|
||||
</li>
|
||||
<li th:each="menu : ${topNode.children}" th:if="${menu.showOnNavi}">
|
||||
<!-- 자식 nodes 가 없는 경우 -->
|
||||
<a th:classappend="${currentURI.id == menu.id}? 'active'"
|
||||
th:href="${menu.uri}" th:if="${#lists.size(menu.children) == 0}"
|
||||
th:text="${#messages.msg(menu.id)}">메뉴명</a>
|
||||
<!-- 자식 nodes 가 있는 경우 -->
|
||||
<a th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, menu.id)}? 'active'"
|
||||
th:href="${menu.uri}"
|
||||
th:if="${#lists.size(menu.children) > 0}" th:text="${#messages.msg(menu.id)}">메뉴명</a>
|
||||
<ul th:if="${#lists.size(menu.children) > 0}">
|
||||
<li th:each="child : ${menu.children}" th:if="${child.showOnNavi}">
|
||||
<a class="dropdown-item"
|
||||
th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, child.id)}? 'active'"
|
||||
th:href="${child.uri}" th:text="${#messages.msg(child.id)}">메뉴명</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- <p>-->
|
||||
<!-- <strong>Current Device</strong> : [[${currentDevice}]]-->
|
||||
<!-- </p>-->
|
||||
<!-- <ul th:if="${topNode != null}">-->
|
||||
<!-- <li>-->
|
||||
<!-- <a th:classappend="${topNode.uri eq currentURI.uri} ? 'active'"-->
|
||||
<!-- th:href="${topNode.uri}">[[${#messages.msg(topNode.id)}]]</a>-->
|
||||
<!-- </li>-->
|
||||
<!-- <li th:each="menu : ${topNode.children}" th:if="${menu.showOnNavi}">-->
|
||||
<!-- <!– 자식 nodes 가 없는 경우 –>-->
|
||||
<!-- <a th:classappend="${currentURI.id == menu.id}? 'active'"-->
|
||||
<!-- th:href="${menu.uri}" th:if="${#lists.size(menu.children) == 0}"-->
|
||||
<!-- th:text="${#messages.msg(menu.id)}">메뉴명</a>-->
|
||||
<!-- <!– 자식 nodes 가 있는 경우 –>-->
|
||||
<!-- <a th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, menu.id)}? 'active'"-->
|
||||
<!-- th:href="${menu.uri}"-->
|
||||
<!-- th:if="${#lists.size(menu.children) > 0}" th:text="${#messages.msg(menu.id)}">메뉴명</a>-->
|
||||
<!-- <ul th:if="${#lists.size(menu.children) > 0}">-->
|
||||
<!-- <li th:each="child : ${menu.children}" th:if="${child.showOnNavi}">-->
|
||||
<!-- <a class="dropdown-item"-->
|
||||
<!-- th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, child.id)}? 'active'"-->
|
||||
<!-- th:href="${child.uri}" th:text="${#messages.msg(child.id)}">메뉴명</a>-->
|
||||
<!-- </li>-->
|
||||
<!-- </ul>-->
|
||||
<!-- </li>-->
|
||||
<!-- </ul>-->
|
||||
<!--/* TODO 전체메뉴 E */-->
|
||||
<div class="inner">
|
||||
<button type="button" class="btn-back"><span class="hide-txt">이전으로 이동</span></button>
|
||||
|
||||
130
front/src/main/resources/templates/info/bank/banks.html
Normal file
130
front/src/main/resources/templates/info/bank/banks.html
Normal file
@@ -0,0 +1,130 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<div layout:fragment="content">
|
||||
<main id="content" role="main">
|
||||
|
||||
<style>
|
||||
label {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
div {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.invalid-feedback {
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.is-invalid + .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input[readonly] {
|
||||
background-color: #e9ecef;
|
||||
color: #6c757d;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<form
|
||||
method="get"
|
||||
name="reqForm"
|
||||
th:action="@{/user/info}" th:object="${userInfo}">
|
||||
|
||||
<input type="hidden" name="id" th:value="*{seq}">
|
||||
|
||||
<div>
|
||||
<label for="householdNum">임가번호</label>
|
||||
<input id="householdNum" name="householdNum" placeholder="아이디" readonly="readonly" th:field="*{householdNum}"
|
||||
type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerName">경영주</label>
|
||||
<input id="ownerName" name="ownerName" placeholder="경영주 이름" th:field="*{ownerName}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerAge">만나이</label>
|
||||
<input id="ownerAge" name="ownerAge" placeholder="나이" th:field="*{ownerAge}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tel">가구연락처</label>
|
||||
<input id="tel" name="tel" placeholder="가구연락처" th:field="*{tel}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="phone">핸드폰번호</label>
|
||||
<input id="phone" name="phone" placeholder="핸드폰번호" th:field="*{phone}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<!-- <div>-->
|
||||
<!-- <label for="region">시.도</label>-->
|
||||
<!-- <input id="region" name="region" placeholder="시.도" th:field="*{region}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <label for="city">시.군.도</label>-->
|
||||
<!-- <input id="city" name="city" placeholder="시.군.도" th:field="*{city}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<div>
|
||||
<label for="addressDetail">전체 주소</label>
|
||||
<input id="addressDetail" name="addressDetail" placeholder="세부 주소" th:field="*{address}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
</form>
|
||||
<button onclick="updateUser();">수정하기</button>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
const updateUser = () => {
|
||||
const f = document.reqForm;
|
||||
const obj = $(f).serializeObject();
|
||||
|
||||
// 기존 에러 메세지 초기화
|
||||
$('.is-invalid').removeClass('is-invalid');
|
||||
|
||||
$.ajax({
|
||||
method: 'PATCH',
|
||||
url: '/api/front/household/update',
|
||||
data: obj,
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
if (confirm(`'${res.ownerName} 님의' 정보가 수정되었습니다.`)) {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
'422': (res) => {
|
||||
const fieldErrors = res.responseJSON.fieldErrors;
|
||||
$(fieldErrors).each(function (idx, error) {
|
||||
let target = $(f).find('[name=' + error.field + ']');
|
||||
target.addClass('is-invalid');
|
||||
|
||||
target.parent().find('.invalid-feedback').text(error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
</section>
|
||||
|
||||
</html>
|
||||
92
front/src/main/resources/templates/info/main.html
Normal file
92
front/src/main/resources/templates/info/main.html
Normal file
@@ -0,0 +1,92 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
|
||||
<div layout:fragment="content" th:classappend="'mypage-wrap bg-gray'">
|
||||
<main id="content" role="main">
|
||||
<!-- alert-box 클래스 리스트
|
||||
fail : 실패(빨강)
|
||||
warning : 경고(노랑)
|
||||
success : 성공(초록)
|
||||
info : 인포(파랑)
|
||||
-->
|
||||
<article class="alert-box warning" th:if="${isUnregisteredDate}"> <!-- TODO Controller 단에서 처리 필요. 임시 -->
|
||||
<p class="tit"><strong th:text="${userInfo?.ownerName}">홍길동</strong>님,</p>
|
||||
<span class="txt">
|
||||
일계부를 등록하지 않은 날짜가 있습니다. <br>
|
||||
정확한 조사를 위해 꾸준히 입력해 주세요.
|
||||
</span>
|
||||
</article>
|
||||
|
||||
<section class="info-top-area">
|
||||
<div class="inner">
|
||||
<dl class="info-card">
|
||||
<dt class="name" th:text="${userInfo?.ownerName}"></dt>
|
||||
<dd class="location" th:text="${userInfo?.address}"></dd><!-- TODO 임가 주소 위치 임시로 . 처리함. -->
|
||||
<dd class="date" th:if="${latestRegisteredDate != null or !#strings.isEmpty(latestRegisteredDate)}" th:text="${'최근등록: '+latestRegisteredDate}"></dd>
|
||||
</dl>
|
||||
|
||||
<a href="/info/notice/1" class="notice-box"><!-- TODO 공지사항 작성후 처리 필요 -->
|
||||
<p class="tit">공지사항</p>
|
||||
<p class="txt">2025 임가경제조사 실시 안내</p>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="info-bottom-area bg-white bg-lround">
|
||||
<ul class="btn-link-list">
|
||||
<li>
|
||||
<a href="/info/user/password">
|
||||
<i class="ico-privacy ico-normal" aria-hidden="true"></i>
|
||||
<dl>
|
||||
<dt>개인정보 변경</dt>
|
||||
<dd>이름, 주소, 연락처를 수정할 수 있어요</dd>
|
||||
</dl>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/info/monthly">
|
||||
<i class="ico-chart ico-normal" aria-hidden="true"></i>
|
||||
<dl>
|
||||
<dt>임산물 현황</dt>
|
||||
<dd>이번 달 생산한 임산물을 입력해 주세요</dd>
|
||||
</dl>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/info/bank">
|
||||
<i class="ico-bank ico-normal" aria-hidden="true"></i>
|
||||
<dl>
|
||||
<dt>은행 자동이체 내역</dt>
|
||||
<dd>자동으로 입금·출금된 금액을 <br>
|
||||
기록해 주세요</dd>
|
||||
</dl>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[#{uri.front.info.path}]]*/'rootUrl',
|
||||
},
|
||||
submitted: false,
|
||||
};
|
||||
|
||||
let formControl = {
|
||||
createValid() {
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</section>
|
||||
|
||||
|
||||
</html>
|
||||
130
front/src/main/resources/templates/info/monthly/monthlys.html
Normal file
130
front/src/main/resources/templates/info/monthly/monthlys.html
Normal file
@@ -0,0 +1,130 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<div layout:fragment="content">
|
||||
<main id="content" role="main">
|
||||
|
||||
<style>
|
||||
label {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
div {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.invalid-feedback {
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.is-invalid + .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input[readonly] {
|
||||
background-color: #e9ecef;
|
||||
color: #6c757d;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<form
|
||||
method="get"
|
||||
name="reqForm"
|
||||
th:action="@{/user/info}" th:object="${userInfo}">
|
||||
|
||||
<input type="hidden" name="id" th:value="*{seq}">
|
||||
|
||||
<div>
|
||||
<label for="householdNum">임가번호</label>
|
||||
<input id="householdNum" name="householdNum" placeholder="아이디" readonly="readonly" th:field="*{householdNum}"
|
||||
type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerName">경영주</label>
|
||||
<input id="ownerName" name="ownerName" placeholder="경영주 이름" th:field="*{ownerName}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerAge">만나이</label>
|
||||
<input id="ownerAge" name="ownerAge" placeholder="나이" th:field="*{ownerAge}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tel">가구연락처</label>
|
||||
<input id="tel" name="tel" placeholder="가구연락처" th:field="*{tel}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="phone">핸드폰번호</label>
|
||||
<input id="phone" name="phone" placeholder="핸드폰번호" th:field="*{phone}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<!-- <div>-->
|
||||
<!-- <label for="region">시.도</label>-->
|
||||
<!-- <input id="region" name="region" placeholder="시.도" th:field="*{region}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <label for="city">시.군.도</label>-->
|
||||
<!-- <input id="city" name="city" placeholder="시.군.도" th:field="*{city}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<div>
|
||||
<label for="addressDetail">전체 주소</label>
|
||||
<input id="addressDetail" name="addressDetail" placeholder="세부 주소" th:field="*{address}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
</form>
|
||||
<button onclick="updateUser();">수정하기</button>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
const updateUser = () => {
|
||||
const f = document.reqForm;
|
||||
const obj = $(f).serializeObject();
|
||||
|
||||
// 기존 에러 메세지 초기화
|
||||
$('.is-invalid').removeClass('is-invalid');
|
||||
|
||||
$.ajax({
|
||||
method: 'PATCH',
|
||||
url: '/api/front/household/update',
|
||||
data: obj,
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
if (confirm(`'${res.ownerName} 님의' 정보가 수정되었습니다.`)) {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
'422': (res) => {
|
||||
const fieldErrors = res.responseJSON.fieldErrors;
|
||||
$(fieldErrors).each(function (idx, error) {
|
||||
let target = $(f).find('[name=' + error.field + ']');
|
||||
target.addClass('is-invalid');
|
||||
|
||||
target.parent().find('.invalid-feedback').text(error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
</section>
|
||||
|
||||
</html>
|
||||
130
front/src/main/resources/templates/info/notice/notices.html
Normal file
130
front/src/main/resources/templates/info/notice/notices.html
Normal file
@@ -0,0 +1,130 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<div layout:fragment="content">
|
||||
<main id="content" role="main">
|
||||
|
||||
<style>
|
||||
label {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
div {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.invalid-feedback {
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.is-invalid + .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input[readonly] {
|
||||
background-color: #e9ecef;
|
||||
color: #6c757d;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<form
|
||||
method="get"
|
||||
name="reqForm"
|
||||
th:action="@{/user/info}" th:object="${userInfo}">
|
||||
|
||||
<input type="hidden" name="id" th:value="*{seq}">
|
||||
|
||||
<div>
|
||||
<label for="householdNum">임가번호</label>
|
||||
<input id="householdNum" name="householdNum" placeholder="아이디" readonly="readonly" th:field="*{householdNum}"
|
||||
type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerName">경영주</label>
|
||||
<input id="ownerName" name="ownerName" placeholder="경영주 이름" th:field="*{ownerName}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerAge">만나이</label>
|
||||
<input id="ownerAge" name="ownerAge" placeholder="나이" th:field="*{ownerAge}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tel">가구연락처</label>
|
||||
<input id="tel" name="tel" placeholder="가구연락처" th:field="*{tel}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="phone">핸드폰번호</label>
|
||||
<input id="phone" name="phone" placeholder="핸드폰번호" th:field="*{phone}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<!-- <div>-->
|
||||
<!-- <label for="region">시.도</label>-->
|
||||
<!-- <input id="region" name="region" placeholder="시.도" th:field="*{region}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <label for="city">시.군.도</label>-->
|
||||
<!-- <input id="city" name="city" placeholder="시.군.도" th:field="*{city}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<div>
|
||||
<label for="addressDetail">전체 주소</label>
|
||||
<input id="addressDetail" name="addressDetail" placeholder="세부 주소" th:field="*{address}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
</form>
|
||||
<button onclick="updateUser();">수정하기</button>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
const updateUser = () => {
|
||||
const f = document.reqForm;
|
||||
const obj = $(f).serializeObject();
|
||||
|
||||
// 기존 에러 메세지 초기화
|
||||
$('.is-invalid').removeClass('is-invalid');
|
||||
|
||||
$.ajax({
|
||||
method: 'PATCH',
|
||||
url: '/api/front/household/update',
|
||||
data: obj,
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
if (confirm(`'${res.ownerName} 님의' 정보가 수정되었습니다.`)) {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
'422': (res) => {
|
||||
const fieldErrors = res.responseJSON.fieldErrors;
|
||||
$(fieldErrors).each(function (idx, error) {
|
||||
let target = $(f).find('[name=' + error.field + ']');
|
||||
target.addClass('is-invalid');
|
||||
|
||||
target.parent().find('.invalid-feedback').text(error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
</section>
|
||||
|
||||
</html>
|
||||
130
front/src/main/resources/templates/info/user/user.html
Normal file
130
front/src/main/resources/templates/info/user/user.html
Normal file
@@ -0,0 +1,130 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<div layout:fragment="content">
|
||||
<main id="content" role="main">
|
||||
|
||||
<style>
|
||||
label {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
div {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.invalid-feedback {
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.is-invalid + .invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input[readonly] {
|
||||
background-color: #e9ecef;
|
||||
color: #6c757d;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<form
|
||||
method="get"
|
||||
name="reqForm"
|
||||
th:action="@{/user/info}" th:object="${userInfo}">
|
||||
|
||||
<input type="hidden" name="id" th:value="*{seq}">
|
||||
|
||||
<div>
|
||||
<label for="householdNum">임가번호</label>
|
||||
<input id="householdNum" name="householdNum" placeholder="아이디" readonly="readonly" th:field="*{householdNum}"
|
||||
type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerName">경영주</label>
|
||||
<input id="ownerName" name="ownerName" placeholder="경영주 이름" th:field="*{ownerName}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ownerAge">만나이</label>
|
||||
<input id="ownerAge" name="ownerAge" placeholder="나이" th:field="*{ownerAge}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tel">가구연락처</label>
|
||||
<input id="tel" name="tel" placeholder="가구연락처" th:field="*{tel}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="phone">핸드폰번호</label>
|
||||
<input id="phone" name="phone" placeholder="핸드폰번호" th:field="*{phone}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
<!-- <div>-->
|
||||
<!-- <label for="region">시.도</label>-->
|
||||
<!-- <input id="region" name="region" placeholder="시.도" th:field="*{region}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <label for="city">시.군.도</label>-->
|
||||
<!-- <input id="city" name="city" placeholder="시.군.도" th:field="*{city}" type="text">-->
|
||||
<!-- <div class="invalid-feedback field-id"></div>-->
|
||||
<!-- </div>-->
|
||||
<div>
|
||||
<label for="addressDetail">전체 주소</label>
|
||||
<input id="addressDetail" name="addressDetail" placeholder="세부 주소" th:field="*{address}" type="text">
|
||||
<div class="invalid-feedback field-id"></div>
|
||||
</div>
|
||||
</form>
|
||||
<button onclick="updateUser();">수정하기</button>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
const updateUser = () => {
|
||||
const f = document.reqForm;
|
||||
const obj = $(f).serializeObject();
|
||||
|
||||
// 기존 에러 메세지 초기화
|
||||
$('.is-invalid').removeClass('is-invalid');
|
||||
|
||||
$.ajax({
|
||||
method: 'PATCH',
|
||||
url: '/api/front/household/update',
|
||||
data: obj,
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
if (confirm(`'${res.ownerName} 님의' 정보가 수정되었습니다.`)) {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
'422': (res) => {
|
||||
const fieldErrors = res.responseJSON.fieldErrors;
|
||||
$(fieldErrors).each(function (idx, error) {
|
||||
let target = $(f).find('[name=' + error.field + ']');
|
||||
target.addClass('is-invalid');
|
||||
|
||||
target.parent().find('.invalid-feedback').text(error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
</section>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user