Merge branch 'dev' into first_open_fetch
# Conflicts: # README.md # admin/src/main/resources/mappers/researcher/ResearcherMapper.xml # core/src/main/java/app/module/core/usecase/file/updateFile/adapters/persistence/UpdateFileDao.java
This commit is contained in:
97
README.md
97
README.md
@@ -54,6 +54,7 @@ usecase/
|
||||
-Dspring.profiles.active=prod
|
||||
-Dserver.port=8081
|
||||
-Dfile.encoding=UTF-8
|
||||
-Dspring.sql.init.mode=never
|
||||
-Djava.net.preferIPv4Stack=true
|
||||
-Dlogging.level.org.springframework.security=DEBUG
|
||||
-Daes.secret-key=092HW829O0A0AVR0
|
||||
@@ -62,6 +63,7 @@ usecase/
|
||||
-Dpath.upload.tmpdir=/home/etribe/data/upload/tmp
|
||||
-Djasypt.encryptor.password=ko-research
|
||||
-Djasypt.encryptor.algorithm=PBEWITHHMACSHA512ANDAES_256
|
||||
|
||||
````
|
||||
|
||||
## 💻 로컬 구동 시 필수 설정
|
||||
@@ -89,6 +91,72 @@ usecase/
|
||||
* 운영 DB에 직접 접근하여 개발하지 않도록 주의가 필요합니다
|
||||
* `Jasypt`로 암호화된 DB 계정 정보가 있는 경우, 로컬 비밀번호 복호화를 위한 `encryptor.password`가 반드시 필요합니다.
|
||||
|
||||
--
|
||||
다음은 `-Dspring.sql.init.mode=always` 옵션 관련 내용을 **인수인계 문서** 형식으로 정리한 예시입니다. 운영 환경에서의 위험성까지 강조해서 작성했습니다.
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ 로컬 DB 초기화 및 `initData` 적용 방법
|
||||
|
||||
### ✅
|
||||
Spring Boot 프로젝트에서는 `initData` SQL 스크립트를 통해 로컬 DB에 초기 데이터를 삽입할 수 있습니다. 이를 위해 **VM 옵션 설정이 반드시 필요**합니다.
|
||||
|
||||
---
|
||||
|
||||
### 🛠️ 적용 방법
|
||||
|
||||
1. **VM 옵션 추가**
|
||||
|
||||
```
|
||||
-Dspring.sql.init.mode=always
|
||||
```
|
||||
|
||||
2. **서버 재기동**
|
||||
|
||||
* 위 옵션을 적용하고 서버를 재기동하면 다음과 같은 동작이 수행됩니다:
|
||||
|
||||
* **모든 테이블 DROP**
|
||||
* **스키마 재생성 (CREATE)**
|
||||
* **`01.init-data.sql` 등의 초기화 SQL 실행**
|
||||
|
||||
3. **초기화 완료 후 필수 작업‼️**
|
||||
|
||||
```
|
||||
VM 옵션을 반드시 아래와 같이 변경:
|
||||
-Dspring.sql.init.mode=never
|
||||
```
|
||||
|
||||
* 계속 `always` 상태로 두면, 서버 기동 시마다 데이터가 **모두 삭제됨** ⚠️⚠️⚠️
|
||||
|
||||
---
|
||||
|
||||
### ⚠️ 운영 환경 주의사항
|
||||
|
||||
> 💥 **운영 서버에는 절대 `-Dspring.sql.init.mode=always` 설정을 사용하지 마세요!!**
|
||||
> 이 설정은 모든 테이블과 데이터를 제거하고 다시 생성하므로,
|
||||
> 운영 DB에 적용 시 **치명적인 데이터 손실**이 발생할 수 있습니다.
|
||||
|
||||
---
|
||||
|
||||
### ℹ️ 옵션 설명
|
||||
|
||||
| 옵션값 | 설명 |
|
||||
| -------- | ----------------------------- |
|
||||
| `never` | SQL 초기화 스크립트 **실행하지 않음** (기본) |
|
||||
| `always` | SQL 초기화 스크립트 **항상 실행함** |
|
||||
|
||||
---
|
||||
|
||||
### 📁 초기화 스크립트 위치 예시
|
||||
|
||||
* `core/src/main/resources/sql/schema/02_create-table.sql` (DDL)
|
||||
* `core/src/main/resources/sql/schema/02_create-function.sql` (DDL)
|
||||
* `core/src/main/resources/sql/schema/02_create-view.sql` (DDL)
|
||||
* `core/src/main/resources/sql/data/01_init_data.sql` (DML)
|
||||
|
||||
---
|
||||
|
||||
|
||||
---
|
||||
## 🔐 Jasypt 암호화
|
||||
|
||||
@@ -152,6 +220,31 @@ mybatis:
|
||||
sqlSessionFactoryRef = "mmsSqlSessionFactory")
|
||||
```
|
||||
|
||||
|
||||
## 🔧 일계부 등록 가능 날짜
|
||||
|
||||
`DailyRecordConstants.java`는 **일계부 등록 및 수정 가능 시점에 대한 정책 상수**를 정의하고 있습니다.
|
||||
---
|
||||
|
||||
### ✅ 정책 정의
|
||||
|
||||
| 항목 | 정책 설명 | 상수명 | 값 |
|
||||
| ------- | ------------------------ | ---------------------- |------------------------|
|
||||
| 등록 가능 월 | 해당 월 기준, **이전 월만 등록 가능** | `REGISTER_LIMIT_MONTH` | `1` → *임시로 `4` 설정 중* |
|
||||
| 등록 가능 일 | 해당 월 **15일까지만 등록 가능** | `REGISTER_LIMIT_DAY` | `15` → *임시로 `31` 설정 중* |
|
||||
| 수정 가능 월 | 해당 월 기준, **이전 월만 수정 가능** | `MODIFY_LIMIT_MONTH` | `1` → *임시로 `4` 설정 중* |
|
||||
| 수정 가능 일 | 해당 월 **15일까지만 수정 가능** | `MODIFY_LIMIT_DAY` | `15` → *임시로 `31` 설정 중* |
|
||||
|
||||
---
|
||||
|
||||
### ⚠️ 현재 임시 설정 사항
|
||||
|
||||
현재 시스템에서는 **등록 가능 월(`REGISTER_LIMIT_MONTH`)** 및 **수정 가능 월(`MODIFY_LIMIT_MONTH`)** 값을 **임시로 `4달` **등록 가능 일(`REGISTER_LIMIT_DAY`)** 및 **수정 가능 일(`MODIFY_LIMIT_DAY`)** 값을 **임시로 `31일`로 설정**해 두었으며,
|
||||
**정책상 원래는 `15일`로 제한**되어야 합니다.
|
||||
|
||||
> 📌 향후 운영 정책에 따라 **`이전월`** **`15일`로 복원 예정**으로 해당값으로 수정한 war파일 제공
|
||||
|
||||
---
|
||||
## 📤 파일 업로드
|
||||
|
||||
```bash
|
||||
@@ -284,6 +377,10 @@ $ mvn clean package -P war
|
||||
|---------| ------ |
|
||||
| `22221` | `1111` |
|
||||
| `22222` | `1111` |
|
||||
| `22223` | `1111` |
|
||||
| `22224` | `1111` |
|
||||
| `22225` | `1111` |
|
||||
| `22226` | `1111` |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -81,8 +81,6 @@ public class AdminURIInterceptor implements HandlerInterceptor {
|
||||
return;
|
||||
}
|
||||
|
||||
// 활성 프로파일 가져오기 TODO 2차 오픈시 삭제 예정
|
||||
modelAndView.addObject("activeProfile", activeProfiles);
|
||||
|
||||
String roleId = AdminUtil.getLoginUserRole();
|
||||
if (!CommonUtil.isAjaxRequest(request)) {
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
package app.module.admin.config.application.aop;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.enums.OperationLogType;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand;
|
||||
import app.module.core.usecase.operationlog.save.application.port.in.OperationLogSavePortIn;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
@@ -18,21 +13,12 @@ import org.springframework.stereotype.Component;
|
||||
@RequiredArgsConstructor
|
||||
public class LoginFailAspect {
|
||||
|
||||
private final OperationLogSavePortIn operationLogSavePortIn;
|
||||
private final MessageUtil messageUtil;
|
||||
|
||||
@After("@annotation(app.module.admin.config.application.aop.LoginFailOperateLog)")
|
||||
public void operate(JoinPoint joinPoint) throws Throwable {
|
||||
Object[] args = joinPoint.getArgs();
|
||||
HttpServletRequest request = (HttpServletRequest) args[0];
|
||||
String targetId = request.getParameter("username");
|
||||
|
||||
operationLogSavePortIn.connect(
|
||||
new OperationLogSaveCommand(
|
||||
AppType.ADMIN,
|
||||
OperationLogType.LOGIN_FAIL,
|
||||
targetId,
|
||||
CommonUtil.getClientIP(request),
|
||||
messageUtil.getMessage("operate.login.fail", targetId)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.enums.OperationLogType;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand;
|
||||
import app.module.core.usecase.operationlog.save.application.port.in.OperationLogSavePortIn;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -20,8 +18,6 @@ import org.springframework.stereotype.Component;
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class LoginSuccessAspect {
|
||||
|
||||
private final OperationLogSavePortIn operationLogSavePortIn;
|
||||
private final MessageUtil messageUtil;
|
||||
|
||||
@After("@annotation(app.module.admin.config.application.aop.LoginSuccessOperateLog)")
|
||||
@@ -31,12 +27,5 @@ public class LoginSuccessAspect {
|
||||
HttpServletRequest request = (HttpServletRequest) args[0];
|
||||
Authentication authentication = (Authentication) args[2];
|
||||
|
||||
operationLogSavePortIn.connect(
|
||||
new OperationLogSaveCommand(
|
||||
AppType.ADMIN,
|
||||
OperationLogType.LOGIN_SUCCESS,
|
||||
null,
|
||||
CommonUtil.getClientIP(request),
|
||||
messageUtil.getMessage("operate.login.success", authentication.getName())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ import app.module.core.config.application.enums.OperationLogType;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.admin.view.ports.AdminViewPortIn;
|
||||
import app.module.core.usecase.admin.view.ports.application.domain.AdminView;
|
||||
import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand;
|
||||
import app.module.core.usecase.operationlog.save.application.port.in.OperationLogSavePortIn;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
@@ -27,7 +25,6 @@ import java.util.Optional;
|
||||
public class RoleUpdateAspect {
|
||||
|
||||
private final AdminViewPortIn adminViewPortIn;
|
||||
private final OperationLogSavePortIn operationLogSavePortIn;
|
||||
|
||||
@Around(
|
||||
"execution(* app.module.core.usecase.admin.saveAdmin.ports.application.SaveAdminService.connect(..))")
|
||||
@@ -54,34 +51,7 @@ public class RoleUpdateAspect {
|
||||
// .map(adminUserWithRole -> adminUserWithRole.getRole().getId())
|
||||
// .collect(Collectors.toList());
|
||||
|
||||
boolean createLog = false;
|
||||
|
||||
if (beforeAdmin.isPresent()) {
|
||||
List<String> beforeRoles =
|
||||
beforeAdmin.stream().map(r -> r.getRole().getId()).toList();
|
||||
if (beforeRoles.size() != currentRoles.size()
|
||||
|| currentRoles.stream().anyMatch(item -> !beforeRoles.contains(item))) {
|
||||
createLog = true;
|
||||
}
|
||||
} else if (!currentRoles.isEmpty()) {
|
||||
createLog = true;
|
||||
}
|
||||
|
||||
if (createLog) {
|
||||
String operatorId = Optional.ofNullable(CommonUtil.getLoginUsername())
|
||||
.orElse("init data");
|
||||
HttpServletRequest request = CommonUtil.getRequest();
|
||||
|
||||
operationLogSavePortIn.connect(
|
||||
new OperationLogSaveCommand(
|
||||
AppType.ADMIN,
|
||||
OperationLogType.ROLE_UPDATE,
|
||||
adminId,
|
||||
request != null ? CommonUtil.getClientIP(request) : null,
|
||||
String.format(
|
||||
"`%s` grants [%s] permissions to `%s`",
|
||||
operatorId, StringUtils.join(currentRoles, ", "), adminId)));
|
||||
}
|
||||
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import app.module.core.config.application.util.MessageUtil;
|
||||
import app.module.core.usecase.admin.status.ports.AdminUpdateAccountLockPortIn;
|
||||
import app.module.core.usecase.admin.status.ports.AdminUpdateLoginFailPortIn;
|
||||
import app.module.core.usecase.admin.view.ports.AdminViewPortIn;
|
||||
import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand;
|
||||
import app.module.core.usecase.operationlog.save.application.port.in.OperationLogSavePortIn;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -31,7 +29,6 @@ public class AdminAuthFailEvent {
|
||||
private final AdminViewPortIn adminViewPortIn;
|
||||
private final AdminUpdateLoginFailPortIn updateLoginFailPortIn;
|
||||
private final AdminUpdateAccountLockPortIn updateAccountLockPortIn;
|
||||
private final OperationLogSavePortIn operationLogSavePortIn;
|
||||
private final MessageUtil messageUtil;
|
||||
@Value("${app.admin.auth.fail.permit}")
|
||||
private int failPermit;
|
||||
@@ -61,15 +58,6 @@ public class AdminAuthFailEvent {
|
||||
request.getSession(),
|
||||
messageUtil.getMessage("security.auth.fail.exceed", failPermit));
|
||||
|
||||
// 계정 잠금 로그 기록
|
||||
operationLogSavePortIn.connect(
|
||||
new OperationLogSaveCommand(
|
||||
AppType.ADMIN,
|
||||
OperationLogType.ACCOUNT_LOCKED,
|
||||
adminUserViewInfo.getId(),
|
||||
CommonUtil.getClientIP(request),
|
||||
messageUtil.getMessage(
|
||||
"operate.account.locked", adminUserViewInfo.getId())));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.admin.usecase.communication.notice.getNotice.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.FileUploadType;
|
||||
import app.module.core.usecase.file.model.UploadFile;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -9,7 +10,7 @@ import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* DTO for {@link app.module.core.config.adapters.persistence.entity.UploadFile}
|
||||
* DTO for {@link UploadFile}
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -48,16 +48,6 @@ public class CreateHouseholdValidator implements Validator {
|
||||
return;
|
||||
}
|
||||
|
||||
// 4. 가구 연락처
|
||||
// TODO : 필수입력값 맞는지 체크
|
||||
// if (!StringUtils.hasText(vo.getTel1()) || !StringUtils.hasText(vo.getTel2()) || !StringUtils.hasText(vo.getTel3())) {
|
||||
// errors.reject("tel", "가구 연락처를 모두 입력해주세요.");
|
||||
// return;
|
||||
// }
|
||||
// if (vo.getTel2().length() > 4 || vo.getTel3().length() > 4) {
|
||||
// errors.reject("tel", "가구 연락처는 각 4자리까지 입력 가능합니다.");
|
||||
// return;
|
||||
// }
|
||||
if (StringUtils.hasText(vo.getTel2()) || StringUtils.hasText(vo.getTel3())) {
|
||||
if ((vo.getTel2() != null && vo.getTel2().length() > 4) ||
|
||||
(vo.getTel3() != null && vo.getTel3().length() > 4)) {
|
||||
|
||||
@@ -385,7 +385,7 @@
|
||||
/* 맵핑 여부 */
|
||||
<choose>
|
||||
<when test="cmd.isMapping">
|
||||
AND hvr.researcher_name is not null
|
||||
AND hvr.researcher_name is not null
|
||||
</when>
|
||||
<when test="!cmd.isMapping">
|
||||
AND hvr.researcher_name is null
|
||||
|
||||
@@ -136,7 +136,6 @@ var ajaxUtil = {
|
||||
|
||||
if (options.handle422Type === 'field' || !options.handle422Type) {
|
||||
$(rstData.responseJSON).each((idx, oj) => {
|
||||
// TODO : form id? or body
|
||||
let target = $('body').find('[name=' + oj.field + ']');
|
||||
target.addClass('is-invalid');
|
||||
|
||||
|
||||
@@ -81,7 +81,6 @@
|
||||
const tbody = $('.tab-content.forest-product tbody');
|
||||
tbody.empty();
|
||||
|
||||
// TODO(ks) : monthlyStatus 없을 경우 처리 추가... 일단 .. 이렇게 처리 하지만.. 또 다른 방안이 있을지...
|
||||
if (!response.monthlyStatus || !response.monthlyStatus.forestStatus) {
|
||||
noDataMonthly(tbody, null, 15);
|
||||
return;
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Admin extends AuditEntity {
|
||||
private Long seq;
|
||||
|
||||
private String id;
|
||||
|
||||
private String password;
|
||||
|
||||
private String email;
|
||||
|
||||
private LocalDateTime passwordUpdatedAt;
|
||||
|
||||
private Boolean accountDisabled;
|
||||
|
||||
private Integer loginFailCnt;
|
||||
|
||||
private Boolean accountLocked;
|
||||
|
||||
public Admin(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AdminHasRole extends AuditEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String adminId;
|
||||
|
||||
private String roleId;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import app.module.core.config.application.enums.SignUpType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FrontUser extends AuditEntity {
|
||||
|
||||
private String id;
|
||||
|
||||
private String password;
|
||||
|
||||
private String email;
|
||||
|
||||
private String nickname;
|
||||
|
||||
private SignUpType signUpType;
|
||||
|
||||
private LocalDateTime passwordUpdatedAt;
|
||||
|
||||
private Boolean accountDisabled;
|
||||
|
||||
private Integer loginFailCnt;
|
||||
|
||||
private Boolean accountLocked;
|
||||
|
||||
// private String roleId;
|
||||
|
||||
private String uploadFileId;
|
||||
|
||||
public FrontUser(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public FrontUser(String id, String email, String nickname, Boolean accountDisabled,
|
||||
Integer loginFailCnt, Boolean accountLocked) {
|
||||
this.id = id;
|
||||
this.email = email;
|
||||
this.nickname = nickname;
|
||||
this.accountDisabled = accountDisabled;
|
||||
this.loginFailCnt = loginFailCnt;
|
||||
this.accountLocked = accountLocked;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class FrontUserHasRole extends AuditEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String frontUSerId;
|
||||
|
||||
private String roleId;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FrontUserHasUploadFile extends AuditEntity {
|
||||
|
||||
private String frontUserId;
|
||||
|
||||
private Long uploadFilesId;
|
||||
|
||||
public FrontUserHasUploadFile(String frontUserId) {
|
||||
this.frontUserId = frontUserId;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Household extends AuditEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String householdNum;
|
||||
|
||||
private String ownerName;
|
||||
|
||||
private Integer ownerAge;
|
||||
|
||||
private String tel;
|
||||
|
||||
private String phone;
|
||||
|
||||
private String password;
|
||||
|
||||
private String region;
|
||||
|
||||
private String city;
|
||||
|
||||
private String addressDetail;
|
||||
|
||||
private Integer industryLargeCode;
|
||||
|
||||
private Integer industryMiddleCode;
|
||||
|
||||
private Integer industrySmallCode;
|
||||
|
||||
private Integer scaleCode;
|
||||
|
||||
private Integer employmentType;
|
||||
|
||||
private Boolean isPanel;
|
||||
|
||||
private String memo;
|
||||
|
||||
private String dropReason;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class NoticeHasUploadFile extends AuditEntity {
|
||||
|
||||
private Long noticeId;
|
||||
|
||||
private Long uploadFilesId;
|
||||
|
||||
public NoticeHasUploadFile(Long noticeId) {
|
||||
this.noticeId = noticeId;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.enums.OperationLogType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OperationLog extends AuditEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private AppType appType;
|
||||
|
||||
private OperationLogType operationLogType;
|
||||
|
||||
private String targetId;
|
||||
|
||||
private String ip;
|
||||
|
||||
private String taskDesc;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Spring Security - Remember me 기능을 위한 엔티티
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class PersistentLogins extends AuditEntity {
|
||||
|
||||
private String series;
|
||||
|
||||
private String username;
|
||||
|
||||
private String token;
|
||||
|
||||
private Date lastUsed;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UriHasRole extends AuditEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String uriId;
|
||||
|
||||
private String roleId;
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import app.module.core.usecase.admin.saveAdmin.ports.SaveAdminPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Order(5)
|
||||
public class InitAdminData implements ApplicationRunner {
|
||||
|
||||
private final SaveAdminPortIn saveAdminPortIn;
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* // 관리자
|
||||
saveAdminPortIn.connect(
|
||||
null,
|
||||
"test-admin",
|
||||
"admin1@#$",
|
||||
null,
|
||||
false,
|
||||
List.of("ROLE_ADMIN"));
|
||||
|
||||
// 지방실사
|
||||
saveAdminPortIn.connect(
|
||||
null,
|
||||
"test-local-inspection",
|
||||
"local1@#$",
|
||||
"code.region.main.1",
|
||||
false,
|
||||
List.of("ROLE_LOCAL_INSPECTION"));
|
||||
|
||||
// 조사원
|
||||
saveAdminPortIn.connect(
|
||||
null,
|
||||
"test-researcher",
|
||||
"researcher1@#$",
|
||||
"code.region.main.1",
|
||||
false,
|
||||
List.of("ROLE_RESEARCHER"));*/
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Order(5)
|
||||
public class InitFrontUserData implements ApplicationRunner {
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
// createHouseholdPortIn.operate(new CreateHouseholdInCmd(
|
||||
// "11111",
|
||||
// "테스트임가",
|
||||
// 58,
|
||||
// null,
|
||||
// "010-1111-1111",
|
||||
// "code.region.main.1", // 서울
|
||||
// "code.region.sub.31", // 경기도
|
||||
// "code.region.detail.9", // 경기
|
||||
// "경기도 성남시 분당구 산성대로 437번길",
|
||||
// null,
|
||||
// null,
|
||||
// null,
|
||||
// null,
|
||||
// null,
|
||||
// true,
|
||||
// null,
|
||||
// null
|
||||
// ));
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.usecase.privilege.save.ports.PrivilegeSavePortIn;
|
||||
import app.module.core.usecase.privilege.save.ports.application.domain.PrivilegeSaveCommand;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(2)
|
||||
public class InitPrivilegeData implements ApplicationRunner {
|
||||
|
||||
private final PrivilegeSavePortIn privilegeSavePortIn;
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
privilegeSavePortIn.connect(new PrivilegeSaveCommand( AppType.ADMIN, "ADMIN_API", "ADMIN API 이용 권한", 0));
|
||||
privilegeSavePortIn.connect(new PrivilegeSaveCommand(AppType.ADMIN,"ADMIN_ACCESS", "ADMIN 사이트 접근 권한", 1));
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.usecase.role.save.ports.RoleSavePortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(3)
|
||||
public class InitRoleData implements ApplicationRunner {
|
||||
|
||||
private final RoleSavePortIn roleSavePortIn;
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
int orderNo = 0;
|
||||
|
||||
roleSavePortIn.connect(
|
||||
AppType.ADMIN,
|
||||
"ROLE_ADMIN",
|
||||
"관리자",
|
||||
orderNo++,
|
||||
List.of("ADMIN_API", "ADMIN_ACCESS"));
|
||||
|
||||
roleSavePortIn.connect(
|
||||
AppType.ADMIN,
|
||||
"ROLE_LOCAL_INSPECTION",
|
||||
"지방실사",
|
||||
orderNo++,
|
||||
List.of("ADMIN_API", "ADMIN_ACCESS"));
|
||||
|
||||
roleSavePortIn.connect(
|
||||
AppType.ADMIN,
|
||||
"ROLE_RESEARCHER",
|
||||
"조사원",
|
||||
orderNo++,
|
||||
List.of("ADMIN_API", "ADMIN_ACCESS"));
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import app.module.core.usecase.uicode.save.ports.UICodeSavePortIn;
|
||||
import app.module.core.usecase.uicode.save.ports.application.domain.UICodeSaveCommand;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Order(4)
|
||||
public class InitUICodeData implements ApplicationRunner {
|
||||
|
||||
private final UICodeSavePortIn uiCodeSavePortIn;
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String UICODE = "code";
|
||||
final String UICODE_PAGEABLE = "code.pageable";
|
||||
final String UICODE_PAGEABLE_ROWS = "code.pageable.rows";
|
||||
|
||||
// root 노드 - code
|
||||
uiCodeSavePortIn.connect(
|
||||
new UICodeSaveCommand(UICODE, null, null, "UI Code", "", null,null, true), false);
|
||||
|
||||
// code - board
|
||||
uiCodeSavePortIn.connect(
|
||||
new UICodeSaveCommand(UICODE_PAGEABLE, UICODE, 0, "Pageable", "", null,null, true), false);
|
||||
|
||||
// code - board - rows
|
||||
uiCodeSavePortIn.connect(
|
||||
new UICodeSaveCommand(UICODE_PAGEABLE_ROWS, UICODE_PAGEABLE, 0, "ROW 갯수", "", null,null,
|
||||
true),
|
||||
false);
|
||||
|
||||
uiCodeSavePortIn.connect(
|
||||
new UICodeSaveCommand(
|
||||
UICODE_PAGEABLE_ROWS + ".10", UICODE_PAGEABLE_ROWS, 0, "10", "10", null, null,true),
|
||||
false);
|
||||
|
||||
uiCodeSavePortIn.connect(
|
||||
new UICodeSaveCommand(
|
||||
UICODE_PAGEABLE_ROWS + ".20", UICODE_PAGEABLE_ROWS, 1, "20", "20", null,null, true),
|
||||
false);
|
||||
|
||||
uiCodeSavePortIn.connect(
|
||||
new UICodeSaveCommand(
|
||||
UICODE_PAGEABLE_ROWS + ".50", UICODE_PAGEABLE_ROWS, 2, "50", "50", null, null,true),
|
||||
false);
|
||||
|
||||
uiCodeSavePortIn.connect(
|
||||
new UICodeSaveCommand(
|
||||
UICODE_PAGEABLE_ROWS + ".100", UICODE_PAGEABLE_ROWS, 3, "100", "100", null,null, true),
|
||||
false);
|
||||
}
|
||||
}
|
||||
@@ -1,366 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.usecase.uri.save.ports.URISavePortIn;
|
||||
import app.module.core.usecase.uri.save.ports.application.domain.URISaveCommand;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Order(4)
|
||||
public class InitUriAdminData implements ApplicationRunner {
|
||||
|
||||
private final URISavePortIn uriSavePortIn;
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void run(ApplicationArguments args) throws IOException {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String ADMIN = "uri.admin";
|
||||
|
||||
final String ADMIN_SETTINGS = "uri.admin.settings";
|
||||
|
||||
final String ADMIN_SETTINGS_ADMIN_GROUP = "uri.admin.settings.admins.group";
|
||||
final String ADMIN_SETTINGS_ADMIN = "uri.admin.settings.admins";
|
||||
final String ADMIN_SETTINGS_ADMIN_CREATE = "uri.admin.settings.admins.create";
|
||||
final String ADMIN_SETTINGS_ADMIN_UPDATE = "uri.admin.settings.admins.update.{{pathVar}}";
|
||||
final String ADMIN_SETTINGS_ADMIN_DELETE = "uri.admin.settings.admins.delete";
|
||||
final String ADMIN_SETTINGS_ADMIN_EXCEL = "uri.admin.settings.admins.excel";
|
||||
final String ADMIN_SETTINGS_ADMIN_ROLE = "uri.admin.settings.adminRoles";
|
||||
final String ADMIN_SETTINGS_ADMIN_PRIVILEGE = "uri.admin.settings.adminPrivilege";
|
||||
|
||||
final String ADMIN_SETTINGS_URI_ADMIN = "uri.admin.settings.uri.admin";
|
||||
final String ADMIN_SETTINGS_URI_FRONT = "uri.admin.settings.uri.front";
|
||||
final String ADMIN_SETTINGS_CODE = "uri.admin.settings.uicode";
|
||||
|
||||
final String ADMIN_ANALYSIS = "uri.admin.analysis";
|
||||
final String ADMIN_ANALYSIS_OPERATION_LOG = "uri.admin.analysis.operationLog";
|
||||
final String ADMIN_ANALYSIS_OPERATION_LOG_UPDATE =
|
||||
"uri.admin.analysis.operationLog.{{pathVar}}";
|
||||
final String ADMIN_ANALYSIS_OPERATION_LOG_EXCEL = "uri.admin.analysis.operationLog.excel";
|
||||
|
||||
// 임가현황 메뉴
|
||||
final String ADMIN_HOUSEHOLD = "uri.admin.household"; // 1depth
|
||||
final String ADMIN_HOUSEHOLD_STATUS = "uri.admin.household.households"; // 2depth 임가 리스트
|
||||
final String ADMIN_HOUSEHOLD_STATUS_CREATE = "uri.admin.household.households.create"; // 임가 등록
|
||||
final String ADMIN_HOUSEHOLD_STATUS_VIEW = "uri.admin.household.households.view.{{pathVar}}"; // 임가 상세
|
||||
|
||||
// 조사원현황 메뉴
|
||||
final String ADMIN_RESEARCHER = "uri.admin.researcher"; // 1depth
|
||||
final String ADMIN_RESEARCHER_STATUS = "uri.admin.researcher.researchers"; // 2depth 조사원 리스트
|
||||
final String ADMIN_RESEARCHER_STATUS_CREATE = "uri.admin.researcher.researchers.create"; // 조사원 등록
|
||||
final String ADMIN_RESEARCHER_STATUS_VIEW = "uri.admin.researcher.researchers.view.{{pathVar}}"; // 조사원 상세
|
||||
|
||||
// 대시보드
|
||||
final String ADMIN_DASHBOARD = "uri.admin.dashboard"; // 1depth
|
||||
final String ADMIN_DASHBOARD_OVERVIEW = "uri.admin.dashboard.overview"; // 2depth
|
||||
|
||||
// 커뮤니케이션 메뉴
|
||||
final String ADMIN_COMMUNICATION = "uri.admin.communication"; // 1depth
|
||||
final String ADMIN_COMMUNICATION_NOTICE = "uri.admin.communication.notices"; // 2depth 공지사항
|
||||
final String ADMIN_COMMUNICATION_NOTICE_CREATE = "uri.admin.communication.notices.create"; // 공지사항 등록
|
||||
final String ADMIN_COMMUNICATION_NOTICE_UPDATE = "uri.admin.communication.notices.update.{{pathVar}}"; // 공지사항 수정,상세
|
||||
final String ADMIN_COMMUNICATION_SUGGESTION = "uri.admin.communication.suggestions"; // 2depth 건의사항
|
||||
final String ADMIN_COMMUNICATION_SUGGESTION_VIEW = "uri.admin.communication.suggestions.view.{{pathVar}}"; // 건의사항 상세
|
||||
final String ADMIN_COMMUNICATION_SMS = "uri.admin.communication.sms"; // 2depth 문자발송
|
||||
|
||||
// 최상위 URI 정보
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
null,
|
||||
ADMIN,
|
||||
"메인",
|
||||
"/",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION", "ROLE_RESEARCHER"));
|
||||
|
||||
// `1` depth URI 정의 - 시작
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN,
|
||||
ADMIN_HOUSEHOLD,
|
||||
"임가 현황",
|
||||
"/household",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION", "ROLE_RESEARCHER"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN,
|
||||
ADMIN_RESEARCHER,
|
||||
"조사원 현황",
|
||||
"/researcher",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN,
|
||||
ADMIN_DASHBOARD,
|
||||
"대시보드",
|
||||
"/dashboard",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION", "ROLE_RESEARCHER"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN,
|
||||
ADMIN_COMMUNICATION,
|
||||
"커뮤니케이션",
|
||||
"/communication",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN,
|
||||
ADMIN_ANALYSIS,
|
||||
"분석",
|
||||
"/analysis",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN,
|
||||
ADMIN_SETTINGS,
|
||||
"Settings",
|
||||
"/true",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
// `1` depth URI 정의 - 끝
|
||||
|
||||
|
||||
// 임가 현황 메뉴 시작
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_HOUSEHOLD,
|
||||
ADMIN_HOUSEHOLD_STATUS,
|
||||
"임가 현황",
|
||||
"/households",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION", "ROLE_RESEARCHER"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_HOUSEHOLD,
|
||||
ADMIN_HOUSEHOLD_STATUS_CREATE,
|
||||
"임가 등록",
|
||||
"/households/create",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION", "ROLE_RESEARCHER"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_HOUSEHOLD,
|
||||
ADMIN_HOUSEHOLD_STATUS_VIEW,
|
||||
"임가 상세",
|
||||
"/households/{{pathVar}}",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION", "ROLE_RESEARCHER"));
|
||||
|
||||
// 조사원 현황 메뉴 시작
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_RESEARCHER,
|
||||
ADMIN_RESEARCHER_STATUS,
|
||||
"조사원 현황",
|
||||
"/researcher/researchers",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_RESEARCHER,
|
||||
ADMIN_RESEARCHER_STATUS_CREATE,
|
||||
"조사원 등록",
|
||||
"/researcher/researchers/create",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_RESEARCHER,
|
||||
ADMIN_RESEARCHER_STATUS_VIEW,
|
||||
"조사원 상세",
|
||||
"/researcher/researchers/view/{{pathVar}}",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION"));
|
||||
|
||||
// 대시보드
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_DASHBOARD,
|
||||
ADMIN_DASHBOARD_OVERVIEW,
|
||||
"대시보드",
|
||||
"/dashboard",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN", "ROLE_LOCAL_INSPECTION", "ROLE_RESEARCHER"));
|
||||
|
||||
// 커뮤니케이션 메뉴 시작
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_COMMUNICATION,
|
||||
ADMIN_COMMUNICATION_NOTICE,
|
||||
"공지사항",
|
||||
"/communication/notices",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_COMMUNICATION,
|
||||
ADMIN_COMMUNICATION_NOTICE_CREATE,
|
||||
"공지사항 등록",
|
||||
"/communication/notices/create",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_COMMUNICATION,
|
||||
ADMIN_COMMUNICATION_NOTICE_UPDATE,
|
||||
"공지사항 수정",
|
||||
"/communication/notices/{{pathVar}}",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_COMMUNICATION,
|
||||
ADMIN_COMMUNICATION_SUGGESTION,
|
||||
"건의사항",
|
||||
"/communication/suggestions",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_COMMUNICATION,
|
||||
ADMIN_COMMUNICATION_SUGGESTION_VIEW,
|
||||
"건의사항 상세",
|
||||
"/communication/suggestions/{{pathVar}}",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_COMMUNICATION,
|
||||
ADMIN_COMMUNICATION_SMS,
|
||||
"문자발송",
|
||||
"/communication/sms",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
// 커뮤니케이션 메뉴 끝
|
||||
|
||||
|
||||
// 관리자 시작
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN_GROUP,
|
||||
ADMIN_SETTINGS_ADMIN,
|
||||
"관리자 목록",
|
||||
"/settings/admins",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN_CREATE,
|
||||
"관리자 등록",
|
||||
"/settings/admins/create",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN_UPDATE,
|
||||
"관리자 수정",
|
||||
"/settings/admins/update/{{pathVar}}",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN_EXCEL,
|
||||
"관리자 엑셀 다운로드",
|
||||
"/settings/admins/excel",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_SETTINGS,
|
||||
ADMIN_SETTINGS_URI_ADMIN,
|
||||
"URI 관리 (관리자)",
|
||||
"/settings/uri/ADMIN",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_SETTINGS,
|
||||
ADMIN_SETTINGS_URI_FRONT,
|
||||
"URI 관리 (FRONT)",
|
||||
"/settings/uri/FRONT",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_SETTINGS,
|
||||
ADMIN_SETTINGS_CODE,
|
||||
"UI 코드 (공통코드)",
|
||||
"/settings/uicode",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
}
|
||||
|
||||
private void appendURI(
|
||||
AppType appType,
|
||||
String parentId,
|
||||
String menuId,
|
||||
String menuTitle,
|
||||
String uri,
|
||||
boolean showOnNavi,
|
||||
Set<String> roles)
|
||||
throws IOException {
|
||||
uriSavePortIn.connect(
|
||||
new URISaveCommand(
|
||||
menuId,
|
||||
parentId,
|
||||
appType,
|
||||
uri,
|
||||
showOnNavi,
|
||||
menuTitle,
|
||||
null,
|
||||
menuTitle,
|
||||
menuTitle,
|
||||
null,
|
||||
null,
|
||||
roles),
|
||||
null,
|
||||
false);
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.usecase.uri.save.ports.URISavePortIn;
|
||||
import app.module.core.usecase.uri.save.ports.application.domain.URISaveCommand;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Order(4)
|
||||
public class InitUriFrontData implements ApplicationRunner {
|
||||
|
||||
private final URISavePortIn uriSavePortIn;
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void run(ApplicationArguments args) throws IOException {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String FRONT_ROOT_ID = "uri.front";
|
||||
|
||||
uriSavePortIn.connect(
|
||||
new URISaveCommand(
|
||||
FRONT_ROOT_ID,
|
||||
null,
|
||||
AppType.FRONT,
|
||||
"/",
|
||||
true,
|
||||
"프론트",
|
||||
null,
|
||||
"프론트 홈",
|
||||
"프론트 메인",
|
||||
"front",
|
||||
null,
|
||||
null),
|
||||
null,
|
||||
false);
|
||||
|
||||
// 로그인
|
||||
uriSavePortIn.connect(
|
||||
new URISaveCommand(
|
||||
FRONT_ROOT_ID + ".login",
|
||||
FRONT_ROOT_ID,
|
||||
AppType.FRONT,
|
||||
"/login",
|
||||
false,
|
||||
"로그인",
|
||||
null,
|
||||
"로그인",
|
||||
"로그인 페이지",
|
||||
"front",
|
||||
null,
|
||||
null),
|
||||
null,
|
||||
false);
|
||||
|
||||
// 회원가입
|
||||
uriSavePortIn.connect(
|
||||
new URISaveCommand(
|
||||
FRONT_ROOT_ID + ".user.register",
|
||||
FRONT_ROOT_ID,
|
||||
AppType.FRONT,
|
||||
"/user/register",
|
||||
false,
|
||||
"회원가입",
|
||||
null,
|
||||
"회원가입",
|
||||
"회원가입 페이지",
|
||||
"회원가입",
|
||||
null,
|
||||
null),
|
||||
null,
|
||||
false);
|
||||
|
||||
// 정보수정
|
||||
uriSavePortIn.connect(
|
||||
new URISaveCommand(
|
||||
FRONT_ROOT_ID + ".user.info",
|
||||
FRONT_ROOT_ID,
|
||||
AppType.FRONT,
|
||||
"/user/info",
|
||||
false,
|
||||
"정보수정",
|
||||
null,
|
||||
"정보수정",
|
||||
"정보수정 페이지",
|
||||
"정보수정",
|
||||
null,
|
||||
Set.of("ROLE_GENERAL")),
|
||||
null,
|
||||
false);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import app.module.core.usecase.userPrivilege.saveUserPrivilege.ports.SaveUserPrivilegePortIn;
|
||||
import app.module.core.usecase.userPrivilege.saveUserPrivilege.ports.application.domain.SaveUserPrivilegeCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(2)
|
||||
public class InitUserPrivilegeData implements ApplicationRunner {
|
||||
|
||||
private final SaveUserPrivilegePortIn saveUserPrivilegePortIn;
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
saveUserPrivilegePortIn.operate(new SaveUserPrivilegeCmd("FRONT_API", "Front API 사용권한", 0));
|
||||
saveUserPrivilegePortIn.operate(
|
||||
new SaveUserPrivilegeCmd("FRONT_ACCESS", "Front 사이트 접근 권한", 1));
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import app.module.core.usecase.userRole.saveUserRole.ports.SaveUserRolePortIn;
|
||||
import app.module.core.usecase.userRole.saveUserRole.ports.application.domain.SaveUserRoleCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(3)
|
||||
public class InitUserRoleData implements ApplicationRunner {
|
||||
|
||||
private final SaveUserRolePortIn saveUserRolePortIn;
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
saveUserRolePortIn.operate(
|
||||
new SaveUserRoleCmd("ROLE_GENERAL", "일반 사용자", 0, List.of("FRONT_API", "FRONT_ACCESS")));
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData;
|
||||
|
||||
import app.module.core.config.adapters.persistence.initData.helper.RemoveAllMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(1)
|
||||
public class RemoveInitData implements ApplicationRunner {
|
||||
|
||||
private final RemoveAllMapper mapper;
|
||||
|
||||
@Value("${app.initData.core}")
|
||||
private boolean isCoreDataRequired;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
if (!isCoreDataRequired) {
|
||||
return;
|
||||
}
|
||||
|
||||
mapper.deleteAllAdminHasRole();
|
||||
mapper.deleteAllAdmin();
|
||||
|
||||
// mapper.deleteAllHouseholdHasRole();
|
||||
// mapper.deleteAllHousehold();
|
||||
|
||||
mapper.deleteAllRoleHasPrivilege();
|
||||
mapper.deleteAllPrivilege();
|
||||
|
||||
mapper.deleteAllUriHasRole();
|
||||
mapper.deleteAllUri();
|
||||
|
||||
mapper.deleteAllFrontUserHasRole();
|
||||
mapper.deleteAllFrontUser();
|
||||
|
||||
// mapper.deleteAllRole();
|
||||
|
||||
mapper.deleteAllUicode();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData.helper;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface RemoveAllAdminURIMapper {
|
||||
void deleteAllByAppType(AppType appType);
|
||||
void deleteAllByAdminUriIds(List<String> uriIds);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData.helper;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface RemoveAllFrontURIMapper {
|
||||
void deleteAllByAppType(AppType appType);
|
||||
void deleteAllByFrontUriIds(List<String> uriIds);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.initData.helper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface RemoveAllMapper {
|
||||
void deleteAllAdminHasRole();
|
||||
void deleteAllAdmin();
|
||||
|
||||
void deleteAllRoleHasPrivilege();
|
||||
void deleteAllPrivilege();
|
||||
|
||||
void deleteAllUriHasRole();
|
||||
void deleteAllUri();
|
||||
|
||||
void deleteAllFrontUserHasRole();
|
||||
void deleteAllFrontUser();
|
||||
|
||||
void deleteAllHouseholdHasRole();
|
||||
void deleteAllHousehold();
|
||||
|
||||
void deleteAllRole();
|
||||
|
||||
void deleteAllUicode();
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.repository;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface AdminRepo {
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.repository;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface OperationLogRepo {
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.repository;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.Role;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface RoleRepo {
|
||||
|
||||
List<Role> findAllByAppType(AppType appType, Sort sort);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.repository;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UICodeRepo {
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.repository;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface URIRepo {
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package app.module.core.config.adapters.persistence.repository;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UploadFileRepo {
|
||||
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public final class DailyRecordConstants {
|
||||
* 일계부 등록 가능 일
|
||||
* [정책] 해당월 15일까지는 이전달 데이터 등록 가능
|
||||
* 날짜 기준 정책
|
||||
* TODO 15로 변경
|
||||
* 임시로 31일로 설정해둠 15일로 변경해야됨.
|
||||
*/
|
||||
public static final int REGISTER_LIMIT_DAY = 31;
|
||||
|
||||
@@ -61,7 +61,7 @@ public final class DailyRecordConstants {
|
||||
* 일계부 수정 가능 일
|
||||
* [정책] 해당월 15일까지는 이전달 데이터 수정 가능
|
||||
* 날짜 기준 정책
|
||||
* TODO : 15로 변경
|
||||
* 임시로 31일로 설정해둠 15일로 변경해야됨.
|
||||
*/
|
||||
public static final int MODIFY_LIMIT_DAY = 31;
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ public class CreateCellService implements CreateCellPortIn {
|
||||
cell.setCellValue(Double.parseDouble(String.valueOf(cellValue)));
|
||||
} catch (NumberFormatException e) {
|
||||
cell.setCellValue(String.valueOf(cellValue)); // 숫자로 변환 불가 시 문자열로 처리
|
||||
// TODO: 로깅 또는 예외 처리
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -83,10 +82,6 @@ public class CreateCellService implements CreateCellPortIn {
|
||||
// 셀 스타일 적용 (null 체크)
|
||||
if (cellConfig.getCellStyle() != null) {
|
||||
cell.setCellStyle(cellConfig.getCellStyle());
|
||||
//} else {
|
||||
// TODO: cellConfig.getCellStyle()이 null인 경우, 워크북에서 새로운 스타일을 생성하거나 기본 스타일을 적용하는 로직 고려
|
||||
// XSSFWorkbook workbook = (XSSFWorkbook) sheet.getWorkbook();
|
||||
// cell.setCellStyle(workbook.createCellStyle());
|
||||
}
|
||||
|
||||
// MERGE 병합
|
||||
@@ -108,7 +103,7 @@ public class CreateCellService implements CreateCellPortIn {
|
||||
private void setMergedRegionBorderStyle(
|
||||
XSSFCellStyle style, CellRangeAddress cellRangeAddress, Sheet sheet) {
|
||||
if (style == null) {
|
||||
// TODO: 스타일이 제공되지 않으면 경고 로깅 또는 기본 스타일 적용 고려
|
||||
// 스타일이 제공되지 않으면 경고 로깅 또는 기본 스타일 적용 고려
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.file.createFile.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.UploadFile;
|
||||
import app.module.core.usecase.file.model.UploadFile;
|
||||
import app.module.core.config.application.enums.FileStorageType;
|
||||
import app.module.core.usecase.file.createFile.ports.CreateFilePortOut;
|
||||
import app.module.core.usecase.file.createFile.ports.application.domain.CreateFile;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.file.createFile.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.UploadFile;
|
||||
import app.module.core.usecase.file.model.UploadFile;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
package app.module.core.usecase.file.model;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import app.module.core.config.application.enums.FileUploadType;
|
||||
@@ -54,22 +54,6 @@ class GetAttachmentController {
|
||||
.body("파일을 찾을 수 없습니다: " + e.getMessage());
|
||||
}
|
||||
|
||||
// TODO - private 업로드 기능을 일단 mute
|
||||
|
||||
// boolean isPrivate = !getFile.getType().isPubic();
|
||||
//
|
||||
// if (isPrivate) {
|
||||
// Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
// auth.getAuthorities().stream()
|
||||
// .filter(
|
||||
// grantedAuthority ->
|
||||
// grantedAuthority.getAuthority().equals("ROLE_SUPER")
|
||||
// || grantedAuthority.getAuthority().equals("PRIVATE_DOWNLOAD"))
|
||||
// .findFirst()
|
||||
// .orElseThrow(
|
||||
// () -> new AccessDeniedException("[AccessDenied] Private 파일 리소스 접근 권한이 없습니다."));
|
||||
// }
|
||||
|
||||
// HTTP 헤더 설정
|
||||
String encodedFileName = URLEncoder.encode(getFile.getOriginName(), StandardCharsets.UTF_8)
|
||||
.replace("+", "%20");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.loggedinuser.save.adapter.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.LoggedInUser;
|
||||
import app.module.core.usecase.loggedinuser.save.adapter.persistence.model.LoggedInUser;
|
||||
import app.module.core.usecase.loggedinuser.save.ports.LoggedInUserSavePortOut;
|
||||
import app.module.core.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.loggedinuser.save.adapter.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.LoggedInUser;
|
||||
import app.module.core.usecase.loggedinuser.save.adapter.persistence.model.LoggedInUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
package app.module.core.usecase.loggedinuser.save.adapter.persistence.model;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 동시접속 사용자 체크를 위한 기록용 엔티티
|
||||
* 사용자 로그
|
||||
*/
|
||||
@Builder
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LoggedInUser extends AuditEntity {
|
||||
public class LoggedInUser {
|
||||
|
||||
private AppType appType;
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.list.adapter.persistence;
|
||||
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogElement;
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogListFilterCommand;
|
||||
import app.module.core.usecase.operationlog.list.application.port.out.OperationLogListPortOut;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class OperationLogListDao implements OperationLogListPortOut {
|
||||
|
||||
private final OperationLogMapper operationLogMapper;
|
||||
|
||||
@Override
|
||||
public Page<OperationLogElement> connect(
|
||||
Pageable pageable, OperationLogListFilterCommand operationLogListFilterCommand) {
|
||||
|
||||
// 로그 목록 조회
|
||||
List<OperationLogElement> contents = ListUtils.emptyIfNull(
|
||||
operationLogMapper.getLogs(pageable, operationLogListFilterCommand));
|
||||
|
||||
return new PageImpl<>(
|
||||
contents,
|
||||
pageable,
|
||||
contents.isEmpty() ? 0 : contents.get(0).getTotal()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.list.adapter.persistence;
|
||||
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogElement;
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogListFilterCommand;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface OperationLogMapper {
|
||||
List<OperationLogElement> getLogs(
|
||||
@Param("pageable") Pageable pageable,
|
||||
@Param("cmd") OperationLogListFilterCommand cmd
|
||||
);
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.list.application.domain;
|
||||
|
||||
import app.module.core.config.application.component.AuditOutput;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.enums.OperationLogType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class OperationLogElement implements AuditOutput {
|
||||
private String createdBy;
|
||||
private LocalDateTime createdAt;
|
||||
// 고유키
|
||||
private Long id;
|
||||
// App 타입
|
||||
private AppType appType;
|
||||
// 수행 작업 타입
|
||||
private OperationLogType operationLogType;
|
||||
// 타겟 계정
|
||||
private String targetId;
|
||||
// 접속 아이피
|
||||
private String ip;
|
||||
// 수행 내용 설명
|
||||
private String taskDesc;
|
||||
// 총개수
|
||||
Long total;
|
||||
|
||||
@Override
|
||||
public String getUpdatedBy() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.list.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OperationLogListFilterCommand {
|
||||
|
||||
private String searchField;
|
||||
private String searchValue;
|
||||
private String searchAppType;
|
||||
private String searchOperationType;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.list.application.port.in;
|
||||
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogElement;
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogListFilterCommand;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public interface OperationLogListPortIn {
|
||||
|
||||
Page<OperationLogElement> connect(Pageable pageable, OperationLogListFilterCommand condition);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.list.application.port.in;
|
||||
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogElement;
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogListFilterCommand;
|
||||
import app.module.core.usecase.operationlog.list.application.port.out.OperationLogListPortOut;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OperationLogListService implements OperationLogListPortIn {
|
||||
|
||||
private final OperationLogListPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Page<OperationLogElement> connect(
|
||||
Pageable pageable, OperationLogListFilterCommand condition) {
|
||||
return portOut.connect(pageable, condition);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.list.application.port.out;
|
||||
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogElement;
|
||||
import app.module.core.usecase.operationlog.list.application.domain.OperationLogListFilterCommand;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public interface OperationLogListPortOut {
|
||||
|
||||
Page<OperationLogElement> connect(Pageable pageable, OperationLogListFilterCommand condition);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.save.adapter.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.OperationLog;
|
||||
import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand;
|
||||
import app.module.core.usecase.operationlog.save.application.port.out.OperationLogSavePortOut;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class OperationLogSaveDao implements OperationLogSavePortOut {
|
||||
|
||||
private final OperationLogSaveMapper mapper;
|
||||
|
||||
@Override
|
||||
public void connect(OperationLogSaveCommand saveCommand) {
|
||||
mapper.insertOperationLog(new OperationLog(
|
||||
null,
|
||||
saveCommand.getAppType(),
|
||||
saveCommand.getOperationLogType(),
|
||||
saveCommand.getTargetId(),
|
||||
saveCommand.getIp(),
|
||||
saveCommand.getTaskDesc()
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.save.adapter.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.OperationLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface OperationLogSaveMapper {
|
||||
void insertOperationLog(OperationLog log);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.save.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.enums.OperationLogType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class OperationLogSaveCommand {
|
||||
|
||||
// App 타입
|
||||
private AppType appType;
|
||||
// 수행 작업 타입
|
||||
private OperationLogType operationLogType;
|
||||
// 타겟 계정
|
||||
private String targetId;
|
||||
|
||||
// 접속 아이피
|
||||
private String ip;
|
||||
// 수행 내용 설명
|
||||
private String taskDesc;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.save.application.port.in;
|
||||
|
||||
import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand;
|
||||
|
||||
public interface OperationLogSavePortIn {
|
||||
|
||||
void connect(OperationLogSaveCommand saveCommand);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.save.application.port.in;
|
||||
|
||||
import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand;
|
||||
import app.module.core.usecase.operationlog.save.application.port.out.OperationLogSavePortOut;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class OperationLogSaveService implements OperationLogSavePortIn {
|
||||
|
||||
private final OperationLogSavePortOut operationLogSavePortout;
|
||||
|
||||
@Override
|
||||
public void connect(OperationLogSaveCommand saveCommand) {
|
||||
operationLogSavePortout.connect(saveCommand);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package app.module.core.usecase.operationlog.save.application.port.out;
|
||||
|
||||
import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand;
|
||||
|
||||
public interface OperationLogSavePortOut {
|
||||
|
||||
void connect(OperationLogSaveCommand saveCommand);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.role.save.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.Role;
|
||||
import app.module.core.usecase.uri.model.Role;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.util.AuditUtil;
|
||||
import app.module.core.usecase.role.save.adapters.persistence.model.RoleHasPrivilegeDeleteParam;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.role.save.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.Role;
|
||||
import app.module.core.usecase.uri.model.Role;
|
||||
import app.module.core.usecase.role.save.adapters.persistence.model.RoleHasPrivilegeDeleteParam;
|
||||
import app.module.core.usecase.role.save.adapters.persistence.model.RoleHasPrivilegeSaveParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
package app.module.core.usecase.uicode.model;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -10,7 +10,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@RequiredArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UICode extends AuditEntity {
|
||||
public class UICode {
|
||||
|
||||
private String id;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.uicode.save.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.UICode;
|
||||
import app.module.core.usecase.uicode.model.UICode;
|
||||
import app.module.core.usecase.uicode.save.ports.UICodeSavePortOut;
|
||||
import app.module.core.usecase.uicode.save.ports.application.domain.UICodeSaveCommand;
|
||||
import app.module.core.usecase.uicode.view.adapters.persistence.UICodeViewMapper;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.uicode.save.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.UICode;
|
||||
import app.module.core.usecase.uicode.model.UICode;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.uicode.toptier.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.UICode;
|
||||
import app.module.core.usecase.uicode.model.UICode;
|
||||
import app.module.core.usecase.uicode.toptier.ports.UICodeTopTierPortOut;
|
||||
import app.module.core.usecase.uicode.toptier.ports.application.domain.UICodeTopTier;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.uicode.toptier.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.UICode;
|
||||
import app.module.core.usecase.uicode.model.UICode;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.uri.currentmatch.ports.application;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.Role;
|
||||
import app.module.core.usecase.uri.model.Role;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.uri.currentmatch.ports.URICurrentMatchingPortIn;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package app.module.core.usecase.uri.getUris.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.Role;
|
||||
import app.module.core.config.adapters.persistence.entity.RoleHasPrivilege;
|
||||
import app.module.core.usecase.uri.model.Role;
|
||||
import app.module.core.usecase.uri.model.RoleHasPrivilege;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.usecase.uri.getUris.adapters.persistence.model.GetRolesDto;
|
||||
import app.module.core.usecase.uri.getUris.adapters.persistence.model.GetUrisDto;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.uri.getUris.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.Role;
|
||||
import app.module.core.usecase.uri.model.Role;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
package app.module.core.usecase.uri.model;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
package app.module.core.usecase.uri.model;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.module.core.config.adapters.persistence.entity;
|
||||
package app.module.core.usecase.uri.model;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditEntity;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.uri.save.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.URI;
|
||||
import app.module.core.usecase.uri.model.URI;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.uri.save.adapters.persistence.model.UriHasRoleDeleteParam;
|
||||
import app.module.core.usecase.uri.save.adapters.persistence.model.UriHasRoleSaveParam;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.uri.save.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.URI;
|
||||
import app.module.core.usecase.uri.model.URI;
|
||||
import app.module.core.usecase.uri.save.adapters.persistence.model.UriHasRoleDeleteParam;
|
||||
import app.module.core.usecase.uri.save.adapters.persistence.model.UriHasRoleSaveParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package app.module.core.usecase.uri.view.ports.application;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.Role;
|
||||
import app.module.core.usecase.uri.model.Role;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.usecase.uri.getUris.ports.GetUrisPortIn;
|
||||
import app.module.core.usecase.uri.view.ports.URIViewPortIn;
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
package app.module.core.usecase.user.createUser.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.FrontUser;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.user.createUser.adapters.persistence.model.SaveFrontUserHasRoleParam;
|
||||
import app.module.core.usecase.user.createUser.ports.CreateUserPortOut;
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUser;
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUserCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class CreateUserDao implements CreateUserPortOut {
|
||||
|
||||
private final CreateUserMapper mapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Optional<CreateUser> operate(CreateUserCmd cmd) {
|
||||
|
||||
String userId = CommonUtil.getLoginUsername();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
mapper.insertFrontUser(
|
||||
new FrontUser(
|
||||
cmd.getId(),
|
||||
cmd.getPassword(),
|
||||
cmd.getEmail(),
|
||||
cmd.getNickname(),
|
||||
cmd.getSignUpType(),
|
||||
LocalDateTime.now(),
|
||||
cmd.isAccountDisabled(),
|
||||
cmd.getLoginFailCnt(),
|
||||
cmd.getAccountLocked(),
|
||||
null
|
||||
));
|
||||
|
||||
if(CollectionUtils.isNotEmpty(cmd.getRoles())) {
|
||||
mapper.insertFrontUserHasRoles(new SaveFrontUserHasRoleParam(
|
||||
cmd.getId(), cmd.getRoles(), now, userId, now, userId, false
|
||||
));
|
||||
}
|
||||
|
||||
return Optional.of(new CreateUser(
|
||||
cmd.getId(),
|
||||
cmd.getPassword(),
|
||||
cmd.getEmail(),
|
||||
cmd.isAccountDisabled(),
|
||||
cmd.getLoginFailCnt(),
|
||||
cmd.getAccountLocked(),
|
||||
cmd.getRoles()
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.user.createUser.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.persistence.entity.FrontUser;
|
||||
import app.module.core.usecase.user.createUser.adapters.persistence.model.SaveFrontUserHasRoleParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CreateUserMapper {
|
||||
void insertFrontUser(FrontUser user);
|
||||
void insertFrontUserHasRoles(SaveFrontUserHasRoleParam param);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package app.module.core.usecase.user.createUser.adapters.persistence.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class SaveFrontUserHasRoleParam {
|
||||
private String userId;
|
||||
private Set<String> roleIds;
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
private boolean deleted;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.user.createUser.ports;
|
||||
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUser;
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUserCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface CreateUserPortIn {
|
||||
|
||||
Optional<CreateUser> operate(CreateUserCmd command);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.user.createUser.ports;
|
||||
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUser;
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUserCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface CreateUserPortOut {
|
||||
|
||||
Optional<CreateUser> operate(CreateUserCmd command);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package app.module.core.usecase.user.createUser.ports.application;
|
||||
|
||||
import app.module.core.usecase.user.createUser.ports.CreateUserPortIn;
|
||||
import app.module.core.usecase.user.createUser.ports.CreateUserPortOut;
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUser;
|
||||
import app.module.core.usecase.user.createUser.ports.application.domain.CreateUserCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class CreateUserService implements CreateUserPortIn {
|
||||
|
||||
private final CreateUserPortOut portOut;
|
||||
private final BCryptPasswordEncoder passwordEncoder;
|
||||
|
||||
@Override
|
||||
public Optional<CreateUser> operate(CreateUserCmd command) {
|
||||
command.setPassword(passwordEncoder.encode(command.getPassword()));
|
||||
return portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.module.core.usecase.user.createUser.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateUser {
|
||||
private String id;
|
||||
private String password;
|
||||
private String email;
|
||||
private boolean accountDisabled;
|
||||
private Integer loginFailCnt;
|
||||
private Boolean accountLocked;
|
||||
private Set<String> roles;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package app.module.core.usecase.user.createUser.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.SignUpType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateUserCmd {
|
||||
private String id;
|
||||
private String password;
|
||||
private String email;
|
||||
private String nickname;
|
||||
private SignUpType signUpType;
|
||||
private boolean accountDisabled;
|
||||
private Integer loginFailCnt;
|
||||
private Boolean accountLocked;
|
||||
private Set<String> roles;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.web.security.domain.CoreRole;
|
||||
import app.module.core.config.application.enums.FileUploadType;
|
||||
import app.module.core.usecase.user.findUser.adapters.persistence.model.FindUserDto;
|
||||
import app.module.core.usecase.user.findUser.ports.FindUserPortOut;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindProfileImages;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUser;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUserCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class FindUserDao implements FindUserPortOut {
|
||||
|
||||
private final FindUserMapper mapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Optional<FindUser> operate(FindUserCmd command) {
|
||||
String id = command.getId();
|
||||
|
||||
FindUserDto dto = mapper.findUserById(id);
|
||||
List<CoreRole> roles = mapper.findRolesWithPrivilegesByUserId(id);
|
||||
FindProfileImages image = mapper.findProfileImageByUserId(id, FileUploadType.PRIVATE.name());
|
||||
|
||||
return Optional.of(new FindUser(
|
||||
dto.getId(),
|
||||
dto.getPassword(),
|
||||
dto.getEmail(),
|
||||
dto.getNickname(),
|
||||
dto.getSignUpType(),
|
||||
dto.getPasswordUpdatedAt(),
|
||||
dto.getAccountDisabled(),
|
||||
dto.getLoginFailCnt(),
|
||||
dto.getAccountLocked(),
|
||||
dto.getCreatedAt(),
|
||||
dto.getCreatedBy(),
|
||||
dto.getUpdatedAt(),
|
||||
dto.getUpdatedBy(),
|
||||
Set.copyOf(roles),
|
||||
image
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.adapters.persistence;
|
||||
|
||||
import app.module.core.config.adapters.web.security.domain.CoreRole;
|
||||
import app.module.core.usecase.user.findUser.adapters.persistence.model.FindUserDto;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindProfileImages;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface FindUserMapper {
|
||||
FindUserDto findUserById(String id);
|
||||
List<CoreRole> findRolesWithPrivilegesByUserId(String userId);
|
||||
FindProfileImages findProfileImageByUserId(
|
||||
@Param("userId") String userId,
|
||||
@Param("fileUploadType") String fileUploadType);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.adapters.persistence.model;
|
||||
|
||||
import app.module.core.config.application.enums.SignUpType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class FindUserDto {
|
||||
private String id;
|
||||
private String password;
|
||||
private String email;
|
||||
private String nickname;
|
||||
private SignUpType signUpType;
|
||||
private LocalDateTime passwordUpdatedAt;
|
||||
private Boolean accountDisabled;
|
||||
private Integer loginFailCnt;
|
||||
private Boolean accountLocked;
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.ports;
|
||||
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUser;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUserCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface FindUserPortIn {
|
||||
|
||||
Optional<FindUser> operate(FindUserCmd command);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.ports;
|
||||
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUser;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUserCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface FindUserPortOut {
|
||||
|
||||
Optional<FindUser> operate(FindUserCmd command);
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.ports.application;
|
||||
|
||||
import app.module.core.config.application.enums.FileStorageType;
|
||||
import app.module.core.usecase.file.url.application.port.in.FileUrlPortIn;
|
||||
import app.module.core.usecase.user.findUser.ports.FindUserPortIn;
|
||||
import app.module.core.usecase.user.findUser.ports.FindUserPortOut;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindProfileImages;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUser;
|
||||
import app.module.core.usecase.user.findUser.ports.application.domain.FindUserCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class FindUserService implements FindUserPortIn {
|
||||
|
||||
private final FindUserPortOut portOut;
|
||||
private final FileUrlPortIn fileUrlPortIn;
|
||||
|
||||
@Value("${path.upload.storage}")
|
||||
private String uploadStorageType;
|
||||
|
||||
@Override
|
||||
public Optional<FindUser> operate(FindUserCmd command) {
|
||||
return portOut
|
||||
.operate(command)
|
||||
.flatMap(
|
||||
findUser -> {
|
||||
FindProfileImages profileImg = findUser.getUploadFile();
|
||||
|
||||
if (profileImg != null) {
|
||||
// 참조 URL 전달
|
||||
profileImg.setReferURL(
|
||||
fileUrlPortIn.getInline(
|
||||
FileStorageType.valueOf(uploadStorageType),
|
||||
profileImg.getPath(),
|
||||
profileImg.getName()));
|
||||
|
||||
// attachment URL 전달
|
||||
profileImg.setAttachmentURL(
|
||||
fileUrlPortIn.getAttachment(
|
||||
FileStorageType.valueOf(uploadStorageType), profileImg.getId()));
|
||||
}
|
||||
|
||||
return Optional.of(findUser);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.FileUploadType;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class FindProfileImages {
|
||||
private Long id;
|
||||
private FileUploadType type;
|
||||
private String path;
|
||||
private String name;
|
||||
private String originName;
|
||||
private Long fileLength;
|
||||
private String referURL;
|
||||
private String attachmentURL;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.web.security.domain.CoreRole;
|
||||
import app.module.core.config.application.enums.SignUpType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class FindUser {
|
||||
private String id;
|
||||
private String password;
|
||||
private String email;
|
||||
private String nickname;
|
||||
private SignUpType signUpType;
|
||||
private LocalDateTime passwordUpdatedAt;
|
||||
private Boolean accountDisabled;
|
||||
private Integer loginFailCnt;
|
||||
private Boolean accountLocked;
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
private Set<CoreRole> roles;
|
||||
private FindProfileImages uploadFile;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class FindUserCmd {
|
||||
|
||||
private String id;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class FindUserPrivilege {
|
||||
|
||||
private String id;
|
||||
private String description;
|
||||
private Integer orderNo;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package app.module.core.usecase.user.findUser.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class FindUserRole {
|
||||
|
||||
private String id;
|
||||
private String description;
|
||||
private Integer orderNo;
|
||||
private Set<FindUserPrivilege> privileges;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package app.module.core.usecase.user.getRoles.adapters.persistence;
|
||||
|
||||
import app.module.core.usecase.user.getRoles.ports.GetRolesPortOut;
|
||||
import app.module.core.usecase.user.getRoles.ports.application.domain.GetRoles;
|
||||
import app.module.core.usecase.user.getRoles.ports.application.domain.GetRolesCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetRolesDao implements GetRolesPortOut {
|
||||
|
||||
private final GetRolesMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<GetRoles> operate(GetRolesCmd command) {
|
||||
return mapper.findByAppType(command);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package app.module.core.usecase.user.getRoles.adapters.persistence;
|
||||
|
||||
import app.module.core.usecase.user.getRoles.ports.application.domain.GetRoles;
|
||||
import app.module.core.usecase.user.getRoles.ports.application.domain.GetRolesCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface GetRolesMapper {
|
||||
List<GetRoles> findByAppType(GetRolesCmd cmd);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.user.getRoles.ports;
|
||||
|
||||
import app.module.core.usecase.user.getRoles.ports.application.domain.GetRoles;
|
||||
import app.module.core.usecase.user.getRoles.ports.application.domain.GetRolesCmd;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface GetRolesPortIn {
|
||||
|
||||
List<GetRoles> operate(GetRolesCmd command);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user