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:
@@ -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);
|
||||
}
|
||||
@@ -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 GetRolesPortOut {
|
||||
|
||||
List<GetRoles> operate(GetRolesCmd command);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.module.core.usecase.user.getRoles.ports.application;
|
||||
|
||||
import app.module.core.usecase.user.getRoles.ports.GetRolesPortIn;
|
||||
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.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetRolesService implements GetRolesPortIn {
|
||||
|
||||
private final GetRolesPortOut portOut;
|
||||
|
||||
@Override
|
||||
public List<GetRoles> operate(GetRolesCmd command) {
|
||||
return portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.module.core.usecase.user.getRoles.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetRoles {
|
||||
private String id;
|
||||
private String description;
|
||||
private Integer orderNo;
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package app.module.core.usecase.user.getRoles.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetRolesCmd {
|
||||
|
||||
private AppType appType;
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package app.module.core.usecase.user.getUsers.adapters.persistence;
|
||||
|
||||
import app.module.core.usecase.user.getUsers.adapters.persistence.model.GetUsersDto;
|
||||
import app.module.core.usecase.user.getUsers.ports.GetUsersPortOut;
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsers;
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsersCmd;
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsersRole;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetUsersDao implements GetUsersPortOut {
|
||||
|
||||
private final GetUsersMapper mapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Page<GetUsers> operate(Pageable pageable, GetUsersCmd command) {
|
||||
// 사용자 목록 조회
|
||||
List<GetUsersDto> users = mapper.getUsers(command, pageable);
|
||||
|
||||
// 사용자의 역할 목록 얻기
|
||||
List<GetUsersRole> roles =
|
||||
mapper.findRolesWithPrivilegesByUserIds(users.stream().map(GetUsersDto::getId).toList());
|
||||
|
||||
return new PageImpl<>(
|
||||
users.stream()
|
||||
.map(user -> new GetUsers(
|
||||
user.getId(),
|
||||
user.getEmail(),
|
||||
user.getNickname(),
|
||||
user.getSignUpType(),
|
||||
user.getPasswordUpdatedAt(),
|
||||
user.getAccountDisabled(),
|
||||
user.getLoginFailCnt(),
|
||||
user.getAccountLocked(),
|
||||
user.getCreatedAt(),
|
||||
user.getCreatedBy(),
|
||||
user.getUpdatedAt(),
|
||||
user.getUpdatedBy(),
|
||||
roles.stream()
|
||||
.filter(r -> r.getUserId().equals(user.getId()))
|
||||
.collect(Collectors.toSet())
|
||||
)).toList(),
|
||||
pageable,
|
||||
users.isEmpty() ? 0 : users.get(0).getTotal());
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package app.module.core.usecase.user.getUsers.adapters.persistence;
|
||||
|
||||
import app.module.core.usecase.user.getUsers.adapters.persistence.model.GetUsersDto;
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsersCmd;
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsersRole;
|
||||
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 GetUsersMapper {
|
||||
List<GetUsersDto> getUsers(
|
||||
@Param("cmd") GetUsersCmd cmd,
|
||||
@Param("pageable") Pageable pageable);
|
||||
|
||||
List<GetUsersRole> findRolesWithPrivilegesByUserIds(@Param("ids") List<String> ids);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package app.module.core.usecase.user.getUsers.adapters.persistence.model;
|
||||
|
||||
import app.module.core.config.application.enums.SignUpType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class GetUsersDto {
|
||||
private String id;
|
||||
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 Long total;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.user.getUsers.ports;
|
||||
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsers;
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsersCmd;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public interface GetUsersPortIn {
|
||||
|
||||
Page<GetUsers> operate(Pageable pageable, GetUsersCmd command);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.module.core.usecase.user.getUsers.ports;
|
||||
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsers;
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsersCmd;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public interface GetUsersPortOut {
|
||||
|
||||
Page<GetUsers> operate(Pageable pageable, GetUsersCmd command);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.module.core.usecase.user.getUsers.ports.application;
|
||||
|
||||
import app.module.core.usecase.user.getUsers.ports.GetUsersPortIn;
|
||||
import app.module.core.usecase.user.getUsers.ports.GetUsersPortOut;
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsers;
|
||||
import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsersCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetUsersService implements GetUsersPortIn {
|
||||
|
||||
private final GetUsersPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Page<GetUsers> operate(Pageable pageable, GetUsersCmd command) {
|
||||
return portOut.operate(pageable, command);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package app.module.core.usecase.user.getUsers.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.time.LocalDateTime;
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetUsers {
|
||||
private String id;
|
||||
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<GetUsersRole> roles;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user