Merge branch 'susu' into dev

This commit is contained in:
주수현
2025-06-16 09:37:54 +09:00
24 changed files with 473 additions and 462 deletions

View File

@@ -44,10 +44,8 @@ public class AdminCreatePostController {
bindingVO.getSeq(), bindingVO.getSeq(),
bindingVO.getId(), bindingVO.getId(),
bindingVO.getPassword(), bindingVO.getPassword(),
bindingVO.getEmail(),
bindingVO.getRegionMainCode(), bindingVO.getRegionMainCode(),
bindingVO.getAccountDisabled(), bindingVO.getAccountDisabled(),
bindingVO.getAccountLocked(),
bindingVO.getRoleIds()); bindingVO.getRoleIds());
redirectAttributes.addFlashAttribute( redirectAttributes.addFlashAttribute(

View File

@@ -53,12 +53,9 @@ class AdminUpdateGetController {
output.getSeq(), output.getSeq(),
output.getId(), output.getId(),
null, null,
output.getEmail(),
output.getRegionMainCode(), output.getRegionMainCode(),
output.getPasswordUpdatedAt(), output.getPasswordUpdatedAt(),
output.getAccountDisabled(), output.getAccountDisabled(),
output.getLoginFailCnt(),
output.getAccountLocked(),
output.getRoles().stream().map(CoreRole::getId).collect(Collectors.toList())); output.getRoles().stream().map(CoreRole::getId).collect(Collectors.toList()));
model.addAttribute("bindingVO", bindingVO); model.addAttribute("bindingVO", bindingVO);

View File

@@ -44,10 +44,8 @@ class AdminUpdatePostController {
bindingVO.getSeq(), bindingVO.getSeq(),
bindingVO.getId(), bindingVO.getId(),
bindingVO.getUpdatePassword(), bindingVO.getUpdatePassword(),
bindingVO.getEmail(),
bindingVO.getRegionMainCode(), bindingVO.getRegionMainCode(),
bindingVO.getAccountDisabled(), bindingVO.getAccountDisabled(),
bindingVO.getAccountLocked(),
bindingVO.getRoleIds()); bindingVO.getRoleIds());
redirectAttributes.addFlashAttribute( redirectAttributes.addFlashAttribute(

View File

@@ -15,15 +15,15 @@ public class AdminCreateBindingVO {
private String id; private String id;
private String password; private String password;
@NotBlank(message = "{valid.common.required}") /* @NotBlank(message = "{valid.common.required}")
@Pattern( @Pattern(
regexp = regexp =
"^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$", "^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$",
message = "{valid.common.email.wrong}") message = "{valid.common.email.wrong}")
private String email; private String email;*/
private Boolean accountDisabled; private Boolean accountDisabled;
private Boolean accountLocked; /* private Boolean accountLocked;*/
private List<String> roleIds; private List<String> roleIds;
private String regionMainCode; private String regionMainCode;
} }

View File

@@ -26,17 +26,17 @@ public class AdminUpdateBindingVO implements AuditOutput {
private String id; private String id;
private String updatePassword; private String updatePassword;
@NotBlank(message = "{valid.common.required}") /* @NotBlank(message = "{valid.common.required}")
@Pattern( @Pattern(
regexp = regexp =
"^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$", "^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$",
message = "{valid.common.email.wrong}") message = "{valid.common.email.wrong}")
private String email; private String email;*/
private String regionMainCode; private String regionMainCode;
private LocalDateTime passwordUpdatedAt; private LocalDateTime passwordUpdatedAt;
private Boolean accountDisabled; private Boolean accountDisabled;
private Integer loginFailCnt; /* private Integer loginFailCnt;
private Boolean accountLocked; private Boolean accountLocked;*/
private List<String> roleIds; private List<String> roleIds;
} }

View File

@@ -45,4 +45,8 @@ public class GetHouseholdsStatusCmd {
// 로그인한 유저 실사 지역 // 로그인한 유저 실사 지역
private String userRegionMainCode; private String userRegionMainCode;
public GetHouseholdsStatusCmd(String searchRegionMainCode) {
this.regionMainCode = searchRegionMainCode;
}
} }

View File

@@ -0,0 +1,15 @@
package app.module.admin.usecase.researcher.persistence.model;
import lombok.Data;
@Data
public class HouseholdDto {
private Long seq;
private String id;
private String name;
private String phone;
private String regionMainCodeName;
private Integer householdCount;
private String accountDisabledFlag;
}

View File

@@ -1,8 +1,10 @@
package app.module.admin.usecase.researcher.service; package app.module.admin.usecase.researcher.service;
import app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain.GetHouseholdsStatus;
import app.module.admin.usecase.researcher.persistence.model.ResearchersDto; import app.module.admin.usecase.researcher.persistence.model.ResearchersDto;
import app.module.admin.usecase.researcher.persistence.model.ResearchersHouseholdVisitDto; import app.module.admin.usecase.researcher.persistence.model.ResearchersHouseholdVisitDto;
import app.module.admin.usecase.researcher.persistence.model.ResearchersMappingHouseholdDto; import app.module.admin.usecase.researcher.persistence.model.ResearchersMappingHouseholdDto;
import app.module.admin.usecase.researcher.web.model.MappingHouseholdListUIReqVO;
import app.module.admin.usecase.researcher.web.model.ResearchersDetailReqVO; import app.module.admin.usecase.researcher.web.model.ResearchersDetailReqVO;
import app.module.admin.usecase.researcher.web.model.ResearchersListReqVO; import app.module.admin.usecase.researcher.web.model.ResearchersListReqVO;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -16,4 +18,5 @@ public interface ResearcherService {
Page<ResearchersMappingHouseholdDto> mappingHouseholdList(ResearchersDetailReqVO reqVO); Page<ResearchersMappingHouseholdDto> mappingHouseholdList(ResearchersDetailReqVO reqVO);
Page<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO); Page<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO);
Integer visitHouseholdDelete(List<Integer> selectIds); Integer visitHouseholdDelete(List<Integer> selectIds);
Page<GetHouseholdsStatus> reginMainCodeHouseholdList(MappingHouseholdListUIReqVO reqVO);
} }

View File

@@ -1,10 +1,14 @@
package app.module.admin.usecase.researcher.service; package app.module.admin.usecase.researcher.service;
import app.module.admin.usecase.household.getHouseholdsStatus.adapters.persistence.GetHouseholdsStatusMapper;
import app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain.GetHouseholdsStatus;
import app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain.GetHouseholdsStatusCmd;
import app.module.admin.usecase.researcher.persistence.ResearcherMapper; import app.module.admin.usecase.researcher.persistence.ResearcherMapper;
import app.module.admin.usecase.researcher.persistence.model.ResearchersDto; import app.module.admin.usecase.researcher.persistence.model.ResearchersDto;
import app.module.admin.usecase.researcher.persistence.model.ResearchersHouseholdVisitDto; import app.module.admin.usecase.researcher.persistence.model.ResearchersHouseholdVisitDto;
import app.module.admin.usecase.researcher.persistence.model.ResearchersMappingHouseholdDto; import app.module.admin.usecase.researcher.persistence.model.ResearchersMappingHouseholdDto;
import app.module.admin.usecase.researcher.web.model.MappingHouseholdListUIReqVO;
import app.module.admin.usecase.researcher.web.model.ResearchersDetailReqVO; import app.module.admin.usecase.researcher.web.model.ResearchersDetailReqVO;
import app.module.admin.usecase.researcher.web.model.ResearchersListReqVO; import app.module.admin.usecase.researcher.web.model.ResearchersListReqVO;
import app.module.core.config.application.util.CommonUtil; import app.module.core.config.application.util.CommonUtil;
@@ -23,6 +27,7 @@ import java.util.List;
@RequiredArgsConstructor @RequiredArgsConstructor
public class ResearcherServiceImpl implements ResearcherService { public class ResearcherServiceImpl implements ResearcherService {
private final ResearcherMapper researcherMapper; private final ResearcherMapper researcherMapper;
private final GetHouseholdsStatusMapper householdsStatusMapper;
@Override @Override
public Page<ResearchersDto> list(ResearchersListReqVO reqVO) { public Page<ResearchersDto> list(ResearchersListReqVO reqVO) {
@@ -60,4 +65,15 @@ public class ResearcherServiceImpl implements ResearcherService {
String deletedBy = CommonUtil.getLoginUsername(); String deletedBy = CommonUtil.getLoginUsername();
return researcherMapper.visitHouseholdDelete(selectIds,deletedBy); return researcherMapper.visitHouseholdDelete(selectIds,deletedBy);
} }
@Override
public Page<GetHouseholdsStatus> reginMainCodeHouseholdList(MappingHouseholdListUIReqVO reqVO) {
Pageable pageable = PageRequest.of(reqVO.getPage() , reqVO.getSize());
List<GetHouseholdsStatus> householdsStatus = householdsStatusMapper.getHouseholdsStatus(pageable,
new GetHouseholdsStatusCmd(reqVO.getSearchRegionMainCode()));
return new PageImpl<>(householdsStatus, pageable,
householdsStatus.isEmpty() ? 0 : householdsStatus.get(0).getTotal());
}
} }

View File

@@ -2,9 +2,7 @@ package app.module.admin.usecase.researcher.web;
import app.module.admin.config.application.util.DateUiUtil; import app.module.admin.config.application.util.DateUiUtil;
import app.module.admin.usecase.researcher.service.ResearcherService; import app.module.admin.usecase.researcher.service.ResearcherService;
import app.module.admin.usecase.researcher.web.model.ResearchersDetailReqVO; import app.module.admin.usecase.researcher.web.model.*;
import app.module.admin.usecase.researcher.web.model.ResearchersDetailUIReqVO;
import app.module.admin.usecase.researcher.web.model.ResearchersListReqVO;
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn; import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -12,7 +10,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import app.module.admin.usecase.researcher.web.model.GetResearchersUIReqVO;
import java.util.List; import java.util.List;
@@ -48,6 +45,13 @@ class ResearcherController {
return ResponseEntity.status(HttpStatus.OK).body(researcherService.mappingHouseholdList(reqVO)); return ResponseEntity.status(HttpStatus.OK).body(researcherService.mappingHouseholdList(reqVO));
} }
@GetMapping(path = "/mappingHousehold/list")
String mappingHouseholdResearcherList(Model model, @ModelAttribute("reqVO") MappingHouseholdListUIReqVO reqVO) {
model.addAttribute("householdDto", researcherService.reginMainCodeHouseholdList(reqVO));
return "researcher/mappingHouserhold";
}
@GetMapping(path = "/visitHouseholdList") @GetMapping(path = "/visitHouseholdList")
ResponseEntity<?> visitHouseholdList( @ModelAttribute ResearchersDetailReqVO reqVO) { ResponseEntity<?> visitHouseholdList( @ModelAttribute ResearchersDetailReqVO reqVO) {
return ResponseEntity.status(HttpStatus.OK).body(researcherService.visitHouseholdList(reqVO)); return ResponseEntity.status(HttpStatus.OK).body(researcherService.visitHouseholdList(reqVO));

View File

@@ -0,0 +1,22 @@
package app.module.admin.usecase.researcher.web.model;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class MappingHouseholdListUIReqVO {
private Integer page;
private Integer size;
private String searchRegionMainCode;
public Integer getPage() {
// 요청 페이지 넘버 - 초기값 `0`
return page != null ? page : 0;
}
public Integer getSize() {
// 페이지 당 아이템 수 - 초기값 `10`
return size != null ? size : 10;
}
}

View File

@@ -2,17 +2,44 @@
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" <html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:th="http://www.thymeleaf.org"> xmlns:th="http://www.thymeleaf.org">
<section class="fw-bold" layout:fragment="content"> <section layout:fragment="content">
<form <form
method="post" method="post"
th:action="@{/settings/admins/create}" th:action="@{/settings/admins/create}"
th:object="${bindingVO}"> th:object="${bindingVO}">
<div class="row mb-3"> <table class="type-form">
<label class="col-sm-2 col-form-label" for="id">ID *</label> <tbody>
<div class="col-sm-4"> <tr>
<input class="form-control" id="id" <th><label for="roleIds">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="d-flex">
<div class="component-input">
<div class="component-select">
<select class="select-list" id="roleIds"
th:classappend="${#fields.hasErrors('roleIds')} ? 'is-invalid'"
th:field="*{roleIds}"
onchange="onRoleChange(this);">
<option value="">선택</option>
<option th:each="role : ${roles}" th:text="${role.description}"
th:value="${role.id}"></option>
</select>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
th:if="${#fields.hasErrors('roleIds')}">
에러 메세지
</div>
</div>
</div>
</td>
</tr>
<tr>
<th><label for="id">ID<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="id"
th:classappend="${#fields.hasErrors('id')} ? 'is-invalid'" th:classappend="${#fields.hasErrors('id')} ? 'is-invalid'"
th:field="*{id}"/> th:field="*{id}"/>
<div class="invalid-feedback fw-bold" th:errors="*{id}" <div class="invalid-feedback fw-bold" th:errors="*{id}"
@@ -21,58 +48,29 @@
</div> </div>
</div> </div>
</div> </div>
</td>
<div class="row mb-3"> <th><label for="password">Password<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<label class="col-sm-2 col-form-label" for="password">Password *</label> <td>
<div class="col-sm-4"> <div class="component-input">
<div class="input-field">
<input class="form-control" id="password" <input id="password" type="password"
th:classappend="${#fields.hasErrors('password')} ? 'is-invalid'" th:classappend="${#fields.hasErrors('password')} ? 'is-invalid'"
th:field="*{password}" th:field="*{password}"/>
type="password"/>
<div class="invalid-feedback fw-bold" th:errors="*{password}" <div class="invalid-feedback fw-bold" th:errors="*{password}"
th:if="${#fields.hasErrors('password')}"> th:if="${#fields.hasErrors('password')}">
에러 메세지 에러 메세지
</div> </div>
</div> </div>
</div> </div>
</td>
<div class="row mb-3"> </tr>
<label class="col-sm-2 col-form-label" for="email">Email *</label> <tr class="regionMainCodeArea"
<div class="col-sm-4"> th:classappend="${#lists.isEmpty(bindingVO.roleIds) or #lists.contains(bindingVO.roleIds, 'ROLE_ADMIN')} ? 'd-none'">
<input class="form-control" id="email" <th><label for="regionMainCode">실사<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
th:classappend="${#fields.hasErrors('email')} ? 'is-invalid'" <td>
th:field="*{email}" <div class="component-select">
type="email"/> <select class="select-list" id="regionMainCode" name="regionMainCode"
<div class="invalid-feedback fw-bold" th:errors="*{email}" th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'"
th:if="${#fields.hasErrors('email')}">
에러 메세지
</div>
</div>
</div>
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="roleIds">권한 *</label>
<div class="col-sm-4">
<select class="form-control" id="roleIds" multiple
th:classappend="${#fields.hasErrors('roleIds')} ? 'is-invalid'"
th:field="*{roleIds}"
onchange="onRoleChange(this);">
<option th:each="role : ${roles}" th:text="${role.id}"
th:value="${role.id}"></option>
</select>
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
th:if="${#fields.hasErrors('roleIds')}">
에러 메세지
</div>
</div>
</div>
<div class="row mb-3 regionMainCodeArea" style="display: none;">
<label class="col-sm-2 col-form-label" for="regionMainCode">실사 *</label>
<div class="col-sm-4">
<select class="form-select" id="regionMainCode" name="regionMainCode"
th:field="*{regionMainCode}"> th:field="*{regionMainCode}">
<option value="">선택</option> <option value="">선택</option>
<option th:each="code : ${regionMainCode}" <option th:each="code : ${regionMainCode}"
@@ -81,67 +79,74 @@
</option> </option>
</select> </select>
</div> </div>
</div> <div class="invalid-feedback fw-bold" th:errors="*{regionMainCode}"
th:if="${#fields.hasErrors('regionMainCode')}">
<!-- 활성화 -->
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="inlineRadio1">비활성화 여부 *</label>
<div class="col-sm-4 pt-1">
<div class="form-check form-check-inline">
<input class="form-check-input" id="inlineRadio1" name="accountDisabled"
type="radio" value="true">
<label class="form-check-label" for="inlineRadio1">비활성화</label>
</div>
<div class="form-check form-check-inline">
<input checked class="form-check-input" id="inlineRadio2"
name="accountDisabled" type="radio" value="false">
<label class="form-check-label" for="inlineRadio2">활성화</label>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
th:if="${#fields.hasErrors('roleIds')}">
에러 메세지 에러 메세지
</div> </div>
</td>
</tr>
<tr>
<th><label>사용 여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td class="radio-group">
<div class="component-input">
<label for="inlineRadio1" class="radio-inner">
<input id="inlineRadio1" th:field="*{accountDisabled}" type="radio" value="true">
<span class="radio-item">
<span class="radio-txt">미사용</span>
</span>
</label>
</div> </div>
<div class="component-input">
<label for="inlineRadio2" class="radio-inner">
<input id="inlineRadio2" th:field="*{accountDisabled}" type="radio" value="false" checked>
<span class="radio-item">
<span class="radio-txt">사용</span>
</span>
</label>
</div> </div>
<div class="invalid-feedback fw-bold" th:errors="*{accountDisabled}"
<!-- 계정잠김 --> th:if="${#fields.hasErrors('accountDisabled')}">
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="accountLocked1">계정잠김 여부*</label>
<div class="col-sm-4 pt-1">
<div class="form-check form-check-inline">
<input class="form-check-input" id="accountLocked1" name="accountLocked"
type="radio" value="true">
<label class="form-check-label" for="accountLocked1">Locked</label>
</div>
<div class="form-check form-check-inline">
<input checked class="form-check-input" id="accountLocked2"
name="accountLocked" type="radio" value="false">
<label class="form-check-label" for="accountLocked2">Unlocked</label>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
th:if="${#fields.hasErrors('roleIds')}">
에러 메세지 에러 메세지
</div> </div>
</div> </td>
</div> </tr>
</tbody>
</table>
<button class="btn btn-primary float-end" type="submit">저장</button> <div class="component-btns bottom-btn-group">
<button class="btn btn-light" onclick="gotoList();return false;" type="button">목록으로 이동 <div class="btns-row align-right">
<button type="button" class="btn btn-secondary" onclick="gotoList();return false;">
<span class="btn-txt">목록으로 이동</span>
</button> </button>
<button type="submit" class="btn btn-primary">
<span class="btn-txt">저장</span>
</button>
</div>
</div>
</form> </form>
<script> <th:block layout:fragment="script">
<script th:inline="javascript">
function gotoList() { function gotoList() {
document.prevAdminParamForm ? document.prevAdminParamForm.submit() if (document.prevAdminParamForm) {
: location.href = '/settings/admins'; const f = document.prevAdminParamForm;
f.submit();
} else {
location.href = '/settings/admins';
}
} }
</script>
<script> $(document).ready(() => {
const roleSelect = document.getElementById('roleIds');
onRoleChange(roleSelect);
});
const onRoleChange = (el) => { const onRoleChange = (el) => {
$('.regionMainCodeArea').toggle(el.value !== "ROLE_ADMIN"); const selectedValues = Array.from(el.selectedOptions).map(option => option.value);
} const isAdmin = !selectedValues.length || selectedValues.includes('ROLE_ADMIN');
$('.regionMainCodeArea').toggle(!isAdmin);
};
</script> </script>
</th:block>
</section> </section>

View File

@@ -13,77 +13,76 @@
<input name="sort" th:value="${listOutput.pageable.sort}" type="hidden"/> <input name="sort" th:value="${listOutput.pageable.sort}" type="hidden"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/> <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row p-2 mb-2 border-secondary border-top border-bottom border-1"> <section class="filter-wrap">
<div class="col-5"> <div class="form-area">
<label class="col-sm-2 col-form-label" for="searchField">검색필드</label> <div class="input-group">
<select class="form-select d-inline w-25" id="searchField" <div class="input-label">
th:field="*{searchField}"> <p class="label-txt"><label for="searchField">검색필드</label></p>
</div>
<div class="d-flex">
<div class="component-select">
<select class="select-list" id="searchField" th:field="*{searchField}">
<option selected value="">선택</option> <option selected value="">선택</option>
<option value="id">ID</option> <option value="id">ID</option>
<option value="email">Email</option> <option value="email">Email</option>
</select> </select>
<label>
<input class="form-control d-inline" placeholder="검색어를 입력하세요."
style="width: 250px;"
th:field="*{searchValue}" type="text">
</label>
</div> </div>
<div class="col"> <div class="component-input">
<label class="col-sm-2 col-form-label" for="searchRole">권한</label> <div class="input-field">
<select class="form-select d-inline w-50" id="searchRole" th:field="*{searchRole}"> <input type="text" placeholder="검색어를 입력하세요."
style="width: 250px;"
th:field="*{searchValue}" >
</div>
</div>
</div>
</div>
<div class="input-group">
<div class="input-label">
<p class="label-txt">권한</p>
</div>
<div class="component-select">
<select class="select-list" id="searchRole" th:field="*{searchRole}">
<option selected value="">전체</option> <option selected value="">전체</option>
<option th:each="role : ${roles}" th:text="${role.id}" <option th:each="role : ${roles}" th:text="${role.id}"
th:value="${role.id}"></option> th:value="${role.id}"></option>
</select> </select>
</div> </div>
<div class="col text-end"> </div>
<button class="btn btn-outline-secondary" onclick="goSearch();" <div class="component-btns">
<div class="btns-row">
<button class="btn" onclick="goSearch();"
type="button"> type="button">
<i class="bi bi-search"></i> 검색
</button> </button>
<button class="btn btn-outline-secondary" onclick="goInit();" <button class="btn" onclick="goInit();"
type="button">초기화 type="button">초기화
</button> </button>
</div> </div>
</div> </div>
</div>
</section>
<div class="row"> <div class="row">
<div class="col text-start"> <div class="col text-start">
<div class="fw-bolder text-muted">Total: <span <div class="fw-bolder text-muted">Total: <span
th:text="${listOutput.totalElements}"></span></div> th:text="${listOutput.totalElements}"></span></div>
</div> </div>
<div class="col text-end">
<i class="bi bi-list-ol"></i>
<label>
<select class="form-select form-select-sm" id="pageSize" name="pageSize"
onchange="goSearch()">
<option
th:each="item : ${pageRows}"
th:selected="${#strings.toString(listOutput.pageable.pageSize) eq item.codeValue}"
th:text="${item.codeText}"
th:value="${item.codeValue}"></option>
</select>
</label>
</div> </div>
</div> <section>
<table>
<table class="table">
<thead> <thead>
<tr> <tr>
<th scope="col">#</th> <th >#</th>
<th scope="col"> <th scope="col">
<label><input class="form-check-input" onchange="toggleCheckbox(this);" <label><input class="form-check-input" onchange="toggleCheckbox(this);"
type="checkbox"/></label> type="checkbox"/></label>
</th> </th>
<th scope="col"><a class="order-able" data-sort-field="id" href="#">ID</a></th> <th scope="col"><a class="order-able" data-sort-field="id" href="#">ID</a></th>
<th class="text-secondary" scope="col">권한</th> <th class="text-secondary" scope="col">권한</th>
<th scope="col"><a class="order-able" data-sort-field="email" href="#">Email</a>
</th> </th>
<th scope="col"><a class="order-able" data-sort-field="accountDisabled" <th scope="col"><a class="order-able" data-sort-field="accountDisabled"
href="#">활성화</a> href="#">활성화</a>
</th> </th>
<th scope="col"><a class="order-able" data-sort-field="accountLocked"
href="#">계정잠김</a></th>
<th scope="col"><a class="order-able" data-sort-field="createdAt" href="#">등록일</a> <th scope="col"><a class="order-able" data-sort-field="createdAt" href="#">등록일</a>
</th> </th>
<th scope="col"><a class="order-able" data-sort-field="updatedAt" href="#">수정일</a> <th scope="col"><a class="order-able" data-sort-field="updatedAt" href="#">수정일</a>
@@ -92,44 +91,36 @@
</thead> </thead>
<tbody> <tbody>
<tr th:each="item, status : ${listOutput.content}"> <tr th:each="item, status : ${listOutput.content}">
<th scope="row" <th th:text="${status.count + (listOutput.pageable.pageNumber * listOutput.pageable.pageSize)}">
th:text="${status.count + (listOutput.pageable.pageNumber * listOutput.pageable.pageSize)}">
게시물번호 게시물번호
</th> </th>
<td><label><input class="form-check-input" name="checkedIds" th:value="${item.id}" <td><label><input class="form-check-input" name="checkedIds" th:value="${item.id}"
type="checkbox"/></label> type="checkbox"/></label>
</td> </td>
<td><a th:href="|javascript:goUpdate('${item.id}')|" th:text="${item.id}">아이디</a> <td class="underline"><a th:href="|javascript:goUpdate('${item.id}')|" th:text="${item.id}">아이디</a>
</td> </td>
<td> <td>
<span th:each="role, status : ${item.roles}" <span th:each="role, status : ${item.roles}"
th:text="${role.getId()} + ${!status.last ? ', ': ''}"></span> th:text="${role.getDescription()} + ${!status.last ? ', ': ''}"></span>
</td> </td>
<td th:text="${item.email}">이메일</td>
<td th:text="${item.accountDisabled == null || !item.accountDisabled ? 'Y' : 'N' }"></td> <td th:text="${item.accountDisabled == null || !item.accountDisabled ? 'Y' : 'N' }"></td>
<td th:text="${item.accountLocked == null || !item.accountLocked ? 'N' : 'Y' }"></td>
<td th:text="${#temporals.format(item.createdAt, 'yyyy-MM-dd hh:mm')}">등록일</td> <td th:text="${#temporals.format(item.createdAt, 'yyyy-MM-dd hh:mm')}">등록일</td>
<td th:text="${#temporals.format(item.updatedAt, 'yyyy-MM-dd hh:mm')}">수정일</td> <td th:text="${#temporals.format(item.updatedAt, 'yyyy-MM-dd hh:mm')}">수정일</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</form>
<div th:replace="common/list-components :: pagination(${listOutput})"></div> <div th:replace="common/list-components :: pagination(${listOutput})"></div>
<div class="component-btns bottom-btn-group">
<div class="row"> <div class="btns-row align-right">
<div class="col text-start">
<button class="btn btn-success" onclick="goExcel();" type="button">엑셀 다운로드</button> <button class="btn btn-success" onclick="goExcel();" type="button">엑셀 다운로드</button>
</div> <button class="btn" onclick="location.href='/settings/admins/create';" type="button">등록</button>
<div class="col text-end mb-2"> <button class="btn" onclick="goRemove();" type="button">삭제</button>
<button class="btn btn-primary" onclick="location.href='/settings/admins/create';"
type="button">등록
</button>
<button class="btn btn-danger" onclick="goRemove();" type="button">삭제</button>
</div> </div>
</div> </div>
</section> </section>
</form>
</section>
<section layout:fragment="script"> <section layout:fragment="script">
<script th:inline="javascript"> <script th:inline="javascript">

View File

@@ -2,7 +2,7 @@
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" <html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:th="http://www.thymeleaf.org"> xmlns:th="http://www.thymeleaf.org">
<section class="fw-bold" layout:fragment="content"> <section layout:fragment="content">
<form <form
method="post" method="post"
@@ -11,64 +11,58 @@
<input type="hidden" name="seq" th:field="*{seq}"/> <input type="hidden" name="seq" th:field="*{seq}"/>
<div class="row mb-3"> <table class="type-form">
<label class="col-sm-2 col-form-label" for="id">ID *</label> <tbody>
<div class="col-sm-4"> <tr>
<input class="form-control" id="id" readonly="readonly" <th> <label for="roleIds">권한<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
th:field="*{id}"/> <td>
<div class="component-select">
<select class="select-list" id="roleIds"
th:classappend="${#fields.hasErrors('roleIds')} ? 'is-invalid'"
th:field="*{roleIds}"
onchange="onRoleChange(this);">
<option value="">선택</option>
<option th:each="role : ${roles}" th:text="${role.description}"
th:value="${role.id}"></option>
</select>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
th:if="${#fields.hasErrors('roleIds')}">
에러 메세지
</div>
</td>
</tr>
<tr>
<th><label for="id">ID<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td>
<div class="component-input">
<div class="input-field">
<input id="id" readonly="readonly" th:field="*{id}"/>
</div> </div>
</div> </div>
</td>
<div class="row mb-3"> <th><label for="password">비밀번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<label class="col-sm-2 col-form-label" for="password">Password *</label> <td>
<div class="col-sm-4"> <div class="component-input">
<input class="form-control" id="password" placeholder="암호를 변경하고 싶다면 입력하세요" <div class="input-field">
<input id="password" placeholder="암호를 변경하고 싶다면 입력하세요"
th:classappend="${#fields.hasErrors('updatePassword')} ? 'is-invalid'" th:classappend="${#fields.hasErrors('updatePassword')} ? 'is-invalid'"
th:field="*{updatePassword}" th:field="*{updatePassword}"
type="password"/> type="password"/>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{updatePassword}" <div class="invalid-feedback fw-bold" th:errors="*{updatePassword}"
th:if="${#fields.hasErrors('updatePassword')}"> th:if="${#fields.hasErrors('updatePassword')}">
에러 메세지 에러 메세지
</div> </div>
</div> </div>
</div> </td>
</tr>
<div class="row mb-3"> <tr class="regionMainCodeArea"
<label class="col-sm-2 col-form-label" for="email">Email *</label> th:classappend="${#lists.isEmpty(bindingVO.roleIds) or #lists.contains(bindingVO.roleIds, 'ROLE_ADMIN')} ? 'd-none'">
<div class="col-sm-4"> <th><label for="regionMainCode">실사<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<input class="form-control" id="email" <td>
th:classappend="${#fields.hasErrors('email')} ? 'is-invalid'" <div class="component-select">
th:field="*{email}" <select class="select-list" id="regionMainCode" name="regionMainCode"
type="email"/>
<div class="invalid-feedback fw-bold" th:errors="*{email}"
th:if="${#fields.hasErrors('email')}">
에러 메세지
</div>
</div>
</div>
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="roleIds">권한 *</label>
<div class="col-sm-4">
<select class="form-control" id="roleIds" multiple
th:classappend="${#fields.hasErrors('roleIds')} ? 'is-invalid'"
th:field="*{roleIds}"
onchange="onRoleChange(this);">
<option th:each="role : ${roles}" th:text="${role.id}"
th:value="${role.id}"></option>
</select>
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
th:if="${#fields.hasErrors('roleIds')}">
에러 메세지
</div>
</div>
</div>
<div class="row mb-3 regionMainCodeArea"
th:style="${#lists.contains(bindingVO.roleIds, 'ROLE_ADMIN')} ? 'display: none;' : 'display: flex;'">
<label class="col-sm-2 col-form-label" for="regionMainCode">실사 *</label>
<div class="col-sm-4">
<select class="form-select" id="regionMainCode" name="regionMainCode"
th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'" th:classappend="${#fields.hasErrors('regionMainCode')} ? 'is-invalid'"
th:field="*{regionMainCode}"> th:field="*{regionMainCode}">
<option value="">선택</option> <option value="">선택</option>
@@ -77,63 +71,52 @@
th:text="${code.codeText}"> th:text="${code.codeText}">
</option> </option>
</select> </select>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{regionMainCode}" <div class="invalid-feedback fw-bold" th:errors="*{regionMainCode}"
th:if="${#fields.hasErrors('regionMainCode')}"> th:if="${#fields.hasErrors('regionMainCode')}">
에러 메세지 에러 메세지
</div> </div>
</td>
</tr>
<tr>
<th> <label>사용 여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></label></th>
<td class="radio-group">
<div class="component-input">
<label for="inlineRadio1" class="radio-inner">
<input id="inlineRadio1" th:field="*{accountDisabled}" type="radio" value="true">
<span class="radio-item">
<span class="radio-txt">미사용</span>
</span>
</label>
</div> </div>
<div class="component-input">
<label for="inlineRadio2" class="radio-inner">
<input id="inlineRadio2" th:field="*{accountDisabled}" type="radio" value="false">
<span class="radio-item">
<span class="radio-txt">사용</span>
</span>
</label>
</div> </div>
<div class="invalid-feedback fw-bold" th:errors="*{accountDisabled}"
<!-- 활성화 --> th:if="${#fields.hasErrors('accountDisabled')}">
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="inlineRadio1">비활성화 여부 *</label>
<div class="col-sm-4 pt-1">
<div class="form-check form-check-inline">
<input class="form-check-input" id="inlineRadio1" th:field="*{accountDisabled}"
type="radio" value="true">
<label class="form-check-label" for="inlineRadio1">비활성화</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" id="inlineRadio2" th:field="*{accountDisabled}"
type="radio" value="false">
<label class="form-check-label" for="inlineRadio2">활성화</label>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
th:if="${#fields.hasErrors('roleIds')}">
에러 메세지 에러 메세지
</div> </div>
</div> </td>
</div> </tr>
</tbody>
</table>
<!-- <div th:replace="common/components :: auditArea"></div>-->
<!-- 계정잠김 --> <div class="component-btns bottom-btn-group">
<div class="row mb-3"> <div class="btns-row align-right">
<label class="col-sm-2 col-form-label" for="accountLocked1">계정잠김 여부*</label> <button type="button" class="btn btn-secondary" onclick="gotoList();return false;">
<div class="col-sm-4 pt-1"> <span class="btn-txt">목록</span>
<div class="form-check form-check-inline">
<input class="form-check-input" id="accountLocked1" th:field="*{accountLocked}"
type="radio" value="true">
<label class="form-check-label" for="accountLocked1">Locked</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" id="accountLocked2" th:field="*{accountLocked}"
type="radio" value="false">
<label class="form-check-label" for="accountLocked2">Unlocked</label>
</div>
<div class="invalid-feedback fw-bold" th:errors="*{roleIds}"
th:if="${#fields.hasErrors('roleIds')}">
에러 메세지
</div>
</div>
</div>
<div class="row w-50">
<!-- audit area -->
<div th:replace="common/components :: auditArea"></div>
</div>
<button class="btn btn-primary float-end" type="submit">저장</button>
<button class="btn btn-light" onclick="gotoList();return false;" type="button">목록으로 이동
</button> </button>
<button type="submit" class="btn btn-primary">
<span class="btn-txt">저장</span>
</button>
</div>
</div>
</form> </form>
<!-- 이전 목록페이지의 검색 및 정렬조건 폼 --> <!-- 이전 목록페이지의 검색 및 정렬조건 폼 -->
@@ -151,11 +134,11 @@
</form> </form>
</th:block> </th:block>
<th:block layout:fragment="script">
<script th:inline="javascript"> <script th:inline="javascript">
function gotoList() { function gotoList() {
if (document.prevAdminParamForm) { if (document.prevAdminParamForm) {
const f = document.prevAdminParamForm; const f = document.prevAdminParamForm;
f.sort.value = convertToPageableSortValue(f.sort.value);
f.submit(); f.submit();
} else { } else {
location.href = '/settings/admins'; location.href = '/settings/admins';
@@ -167,14 +150,20 @@
[[${#temporals.format(bindingVO.createdAt, "yyyy-MM-dd'T'HH:mm:ss")}]], [[${#temporals.format(bindingVO.createdAt, "yyyy-MM-dd'T'HH:mm:ss")}]],
[[${bindingVO.updatedBy}]], [[${bindingVO.updatedBy}]],
[[${#temporals.format(bindingVO.updatedAt, "yyyy-MM-dd'T'HH:mm:ss")}]]); [[${#temporals.format(bindingVO.updatedAt, "yyyy-MM-dd'T'HH:mm:ss")}]]);
});
</script>
<script> // 초기 로드 시 roleIds에 따라 regionMainCodeArea 표시/숨김
const onRoleChange = (el) => { const roleSelect = document.getElementById('roleIds');
$('.regionMainCodeArea').toggle(el.value !== "ROLE_ADMIN"); if (roleSelect) {
onRoleChange(roleSelect);
} }
});
const onRoleChange = (el) => {
const isAdmin = el.value === 'ROLE_ADMIN' || !el.value;
$('.regionMainCodeArea').toggle(!isAdmin);
};
</script> </script>
</th:block>
</section> </section>

View File

@@ -11,25 +11,20 @@
--> -->
<div th:fragment="pagination(items)"> <div th:fragment="pagination(items)">
<div class="row"> <div class="row">
<nav aria-label="Page navigation example"> <nav class="component-pagination" aria-label="페이지네이션">
<ul class="pagination justify-content-center"> <a class="pagination-item prev"
<li class="page-item" th:classappend="${!items.pageable.hasPrevious} ? 'disabled'"> th:classappend="${!items.pageable.hasPrevious} ? 'disabled'"
<a class="page-link" th:href="${items.pageable.hasPrevious} ? 'javascript:goPageable(' + ${items.pageable.pageNumber - 1} + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'"></a>
th:href="|javascript:goPageable(${items.pageable.pageNumber - 1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|">이전</a>
</li> <a class="pagination-item"
<li class="page-item"
th:classappend="${idx == items.pageable.pageNumber} ? 'disabled'" th:classappend="${idx == items.pageable.pageNumber} ? 'disabled'"
th:each="idx : ${#numbers.sequence(0, items.totalPages == 0 ? 0 : items.totalPages - 1)}"> th:each="idx : ${#numbers.sequence(0, items.totalPages == 0 ? 0 : items.totalPages - 1)}"
<a class="page-link" th:href="${idx != items.pageable.pageNumber} ? 'javascript:goPageable(' + ${idx} + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'"
th:href="|javascript:goPageable(${idx}, ${items.pageable.pageSize}, '${items.pageable.sort}')|"
th:text="${idx + 1}">페이지넘버</a> th:text="${idx + 1}">페이지넘버</a>
</li>
<li class="page-item" <a class="pagination-item next"
th:classappend="${items.pageable.pageNumber == items.totalPages - 1 or items.totalPages == 0} ? 'disabled'"> th:classappend="${items.pageable.pageNumber >= items.totalPages - 1 or items.totalPages == 0} ? 'disabled'"
<a class="page-link" th:href="${items.pageable.pageNumber < items.totalPages - 1 and items.totalPages > 0} ? 'javascript:goPageable(' + ${items.pageable.pageNumber + 1} + ', ' + ${items.pageable.pageSize} + ', \'' + ${items.pageable.sort ?: 'id,desc'} + '\')' : '#'"></a>
th:href="|javascript:goPageable(${items.pageable.pageNumber + 1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|">다음</a>
</li>
</ul>
</nav> </nav>
</div> </div>
</div> </div>

View File

@@ -4,7 +4,6 @@
<th layout:fragment="content"> <th layout:fragment="content">
<section> <section>
<!-- 테이블 영역 -->
<table class="type-form confirm" th:object="${researcherDto}" > <table class="type-form confirm" th:object="${researcherDto}" >
<tbody> <tbody>
<tr> <tr>
@@ -63,14 +62,17 @@
TOTAL. <span id="household-totalElements"></span> TOTAL. <span id="household-totalElements"></span>
</div> </div>
</div> </div>
<div id="researcher-tab1" style="display: none;">
<button type="button" class="btn" onclick="location.href='/researcher/researchers'">
<span class="btn-txt">임가매핑</span>
</button>
</div>
</div> </div>
<!-- hidden parameters --> <!-- hidden parameters -->
<input name="page" th:field="*{page}" type="hidden"/> <input name="page" th:field="*{page}" type="hidden"/>
<input name="adminSeq" th:field="${researcherDto.seq}" type="hidden"/> <input name="adminSeq" th:field="${researcherDto.seq}" type="hidden"/>
<div class="tab-body"> <div class="tab-body">
<div class="tab-content" data-tab-value="tab1"> <div class="tab-content" data-tab-value="tab1">
<div class="content-inner"> <div class="content-inner">
@@ -339,8 +341,6 @@
'/researcher/visitHousehold/remove', '/researcher/visitHousehold/remove',
JSON.stringify(selectIds), JSON.stringify(selectIds),
function (response) { function (response) {
console.log("여기있어요");
console.log(response);
if(response > 0){ if(response > 0){
alert('선택한 임가정보가 삭제되었습니다.'); alert('선택한 임가정보가 삭제되었습니다.');
getHouseholdVisitList(document.householdReqForm.page.value); getHouseholdVisitList(document.householdReqForm.page.value);

View File

@@ -47,10 +47,8 @@ class AdminAuthFailHandlerTest {
1L, 1L,
testUsername, testUsername,
"test.1@#$", "test.1@#$",
"xx4@test.com",
null, null,
false, false,
false,
Arrays.asList("ROLE_SUPER", "ROLE_STAFF")); Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
} }

View File

@@ -42,10 +42,8 @@ class AdminDetailsServiceTest {
1L, 1L,
username, username,
password, password,
"xx1@test.com",
null, null,
false, false,
false,
Arrays.asList("ROLE_SUPER", "ROLE_STAFF")); Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));

View File

@@ -38,10 +38,8 @@ class AdminCreateUpdateDaoTest {
1L, 1L,
"admin_for_createDao_test", "admin_for_createDao_test",
"test.1@#$", "test.1@#$",
"admin_for_createDao_test@test.com",
null, null,
false, false,
false,
Arrays.asList("ROLE_SUPER", "ROLE_STAFF")); Arrays.asList("ROLE_SUPER", "ROLE_STAFF"));
adminViewPortIn adminViewPortIn
@@ -56,10 +54,8 @@ class AdminCreateUpdateDaoTest {
2L, 2L,
"admin_for_createDao_test", "admin_for_createDao_test",
"test.1@#$", "test.1@#$",
"admin_for_createDao_test@test.com",
null, null,
false, false,
false,
List.of("ROLE_STAFF")); List.of("ROLE_STAFF"));
assertEquals( assertEquals(
1, 1,

View File

@@ -32,10 +32,8 @@ public class InitAdminData implements ApplicationRunner {
null, null,
"test-admin", "test-admin",
"admin1@#$", "admin1@#$",
"admin@framework.org",
null, null,
false, false,
false,
List.of("ROLE_ADMIN")); List.of("ROLE_ADMIN"));
// 지방실사 // 지방실사
@@ -43,10 +41,8 @@ public class InitAdminData implements ApplicationRunner {
null, null,
"test-local-inspection", "test-local-inspection",
"local1@#$", "local1@#$",
"local@framework.org",
"code.region.main.1", "code.region.main.1",
false, false,
false,
List.of("ROLE_LOCAL_INSPECTION")); List.of("ROLE_LOCAL_INSPECTION"));
// 조사원 // 조사원
@@ -54,10 +50,8 @@ public class InitAdminData implements ApplicationRunner {
null, null,
"test-researcher", "test-researcher",
"researcher1@#$", "researcher1@#$",
"researcher@framework.org",
"code.region.main.1", "code.region.main.1",
false, false,
false,
List.of("ROLE_RESEARCHER")); List.of("ROLE_RESEARCHER"));
} }
} }

View File

@@ -8,9 +8,7 @@ public interface SaveAdminPortIn {
Long seq, Long seq,
String id, String id,
String password, String password,
String email,
String regionMainCode, String regionMainCode,
Boolean accountDisabled, Boolean accountDisabled,
Boolean accountLocked,
List<String> roleIds); List<String> roleIds);
} }

View File

@@ -25,10 +25,8 @@ public class SaveAdminService implements SaveAdminPortIn {
Long seq, Long seq,
String id, String id,
String password, String password,
String email,
String regionMainCode, String regionMainCode,
Boolean accountDisabled, Boolean accountDisabled,
Boolean accountLocked,
List<String> roleIds) { List<String> roleIds) {
LocalDateTime passwordUpdatedAt; LocalDateTime passwordUpdatedAt;
@@ -58,11 +56,9 @@ public class SaveAdminService implements SaveAdminPortIn {
id, id,
password, password,
passwordUpdatedAt, passwordUpdatedAt,
email,
regionMainCode, regionMainCode,
accountDisabled, accountDisabled,
loginFailCnt, loginFailCnt,
accountLocked,
roleIds roleIds
)); ));
} }

View File

@@ -15,10 +15,10 @@ public class SaveAdminCmd extends AuditCommand {
private String id; private String id;
private String encodedPassword; private String encodedPassword;
private LocalDateTime passwordUpdatedAt; private LocalDateTime passwordUpdatedAt;
private String email; /* private String email;*/
private String regionMainCode; private String regionMainCode;
private Boolean accountDisabled; private Boolean accountDisabled;
private Integer loginFailCnt; private Integer loginFailCnt;
private Boolean accountLocked; /* private Boolean accountLocked;*/
private List<String> roleIds; private List<String> roleIds;
} }

View File

@@ -12,22 +12,18 @@
INSERT INTO admin (seq, INSERT INTO admin (seq,
id, id,
password, password,
email,
region_main_code, region_main_code,
password_updated_at, password_updated_at,
account_disabled, account_disabled,
login_fail_cnt, login_fail_cnt,
account_locked,
<include refid="common.fields.CreateUpdateBaseColumns"/>) <include refid="common.fields.CreateUpdateBaseColumns"/>)
VALUES (#{seq}, VALUES (#{seq},
#{id}, #{id},
#{encodedPassword}, #{encodedPassword},
#{email},
#{regionMainCode}, #{regionMainCode},
#{passwordUpdatedAt}, #{passwordUpdatedAt},
#{accountDisabled}, #{accountDisabled},
#{loginFailCnt}, #{loginFailCnt},
#{accountLocked},
<include refid="common.fields.CreateUpdateBaseValues"/>) <include refid="common.fields.CreateUpdateBaseValues"/>)
</insert> </insert>
@@ -36,12 +32,10 @@
UPDATE admin UPDATE admin
SET SET
password = #{encodedPassword}, password = #{encodedPassword},
email = #{email},
region_main_code = #{regionMainCode}, region_main_code = #{regionMainCode},
password_updated_at = #{passwordUpdatedAt}, password_updated_at = #{passwordUpdatedAt},
account_disabled = #{accountDisabled}, account_disabled = #{accountDisabled},
login_fail_cnt = #{loginFailCnt}, login_fail_cnt = #{loginFailCnt},
account_locked = #{accountLocked},
<include refid="common.fields.UpdateBaseSet"/> <include refid="common.fields.UpdateBaseSet"/>
WHERE seq = #{seq} WHERE seq = #{seq}
</update> </update>