미사용 파일 삭제
This commit is contained in:
@@ -1,83 +0,0 @@
|
||||
package app.module.admin.usecase.admin.getAdmins.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.admin.getAdmins.adapters.web.model.AdminListFilterVO;
|
||||
import app.module.core.config.application.util.ExcelUtil;
|
||||
import app.module.core.usecase.admin.getAdmins.ports.GetAdminsPortIn;
|
||||
import app.module.core.usecase.admin.getAdmins.ports.application.domain.GetAdmins;
|
||||
import app.module.core.usecase.admin.getAdmins.ports.application.domain.GetAdminsCmd;
|
||||
import app.module.core.usecase.admin.getAdmins.ports.application.domain.GetAdminsRole;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class AdminExcelController {
|
||||
|
||||
private final GetAdminsPortIn getAdminsPortIn;
|
||||
private final ExcelUtil excelUtil;
|
||||
|
||||
@PostMapping(path = "/settings/admins/excel")
|
||||
void excelDownload(
|
||||
HttpServletResponse response,
|
||||
@PageableDefault(sort = "createdAt") Pageable pageable,
|
||||
@ModelAttribute("paramDto") AdminListFilterVO adminListFilterVO) {
|
||||
|
||||
Workbook wb = new XSSFWorkbook();
|
||||
Sheet sheet = wb.createSheet("예제 관리자 목록");
|
||||
|
||||
Page<GetAdmins> listOutput =
|
||||
getAdminsPortIn.connect(
|
||||
pageable,
|
||||
new GetAdminsCmd(
|
||||
adminListFilterVO.getSearchField(),
|
||||
adminListFilterVO.getSearchValue(),
|
||||
adminListFilterVO.getSearchRole(),
|
||||
adminListFilterVO.getSearchArea(),
|
||||
adminListFilterVO.getSearchDisabled()));
|
||||
|
||||
if (CollectionUtils.isNotEmpty(listOutput.getContent())) {
|
||||
// Header
|
||||
Row headerRow = sheet.createRow(sheet.getPhysicalNumberOfRows());
|
||||
excelUtil.createCells(headerRow, "번호", "이메일", "권한", "등록일", "최근 수정일");
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
|
||||
|
||||
listOutput
|
||||
.getContent()
|
||||
.forEach(
|
||||
item -> {
|
||||
Row row = sheet.createRow(sheet.getPhysicalNumberOfRows());
|
||||
excelUtil.createCells(
|
||||
row,
|
||||
item.getId(),
|
||||
item.getEmail(),
|
||||
item.getRoles().stream()
|
||||
.map(GetAdminsRole::getId)
|
||||
.collect(Collectors.joining(", ")),
|
||||
Optional.ofNullable(item.getCreatedAt())
|
||||
.map(localDateTime -> localDateTime.format(formatter))
|
||||
.orElse(""),
|
||||
Optional.ofNullable(item.getUpdatedAt())
|
||||
.map(localDateTime -> localDateTime.format(formatter))
|
||||
.orElse(""));
|
||||
});
|
||||
}
|
||||
|
||||
excelUtil.generateWithPassword(response, wb, "admin-list");
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package app.module.admin.usecase.admin.removeAdmins.adapters.web;
|
||||
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import app.module.core.usecase.admin.removeAdmin.ports.RemoveAdminPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class AdminRemoveController {
|
||||
|
||||
private final MessageUtil messageUtil;
|
||||
private final RemoveAdminPortIn removeAdminPortIn;
|
||||
|
||||
@PostMapping(path = "/settings/admins/delete")
|
||||
String operate(RedirectAttributes redirectAttributes, @RequestParam List<String> checkedIds) {
|
||||
|
||||
if (CollectionUtils.isNotEmpty(checkedIds)) {
|
||||
removeAdminPortIn.connect(checkedIds);
|
||||
redirectAttributes.addFlashAttribute(
|
||||
"operationMessage", messageUtil.getMessage("operation.settings.admin.removed"));
|
||||
}
|
||||
|
||||
return "redirect:/settings/admins";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
package app.module.admin.usecase.communication.notice.updateNotice.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.communication.notice.updateNotice.ports.UpdateNoticePortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -13,14 +10,9 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||
@RequiredArgsConstructor
|
||||
class UpdateNoticeUIController {
|
||||
|
||||
private final UpdateNoticePortIn updateNoticePortIn;
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
@GetMapping(path = "/communication/notices/{id}")
|
||||
String operate(@PathVariable @ModelAttribute("id") Long id) {
|
||||
|
||||
@GetMapping(path = "/communication/notices/{id}")
|
||||
String operate(Model model
|
||||
, @PathVariable @ModelAttribute("id") Long id) {
|
||||
|
||||
|
||||
return "communication/notice/{id}";
|
||||
}
|
||||
return "communication/notice/{id}";
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package app.module.admin.usecase.communication.sms.getSmsUI;
|
||||
|
||||
import app.module.admin.usecase.communication.sms.getSmsUI.model.GetSmsReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetSmsController {
|
||||
|
||||
@GetMapping(path = "/communication/sms")
|
||||
String operate(
|
||||
Model model,
|
||||
@ModelAttribute("reqVO") GetSmsReqVO reqVO) {
|
||||
|
||||
return "communication/sms";
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package app.module.admin.usecase.communication.sms.getSmsUI.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetSmsReqVO {
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package app.module.admin.usecase.operationlog.list.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.operationlog.list.adapters.web.model.OperationLogListFilterVO;
|
||||
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.in.OperationLogListPortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort.Direction;
|
||||
import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class OperationLogListController {
|
||||
|
||||
private final OperationLogListPortIn operationLogListPortIn;
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
|
||||
@GetMapping("/analysis/operationlog")
|
||||
String operate(
|
||||
Model model,
|
||||
@PageableDefault(sort = "createdAt", direction = Direction.DESC) Pageable pageable,
|
||||
@ModelAttribute("paramDto") OperationLogListFilterVO statusVO) {
|
||||
|
||||
Page<OperationLogElement> listOutput =
|
||||
operationLogListPortIn.connect(
|
||||
pageable,
|
||||
new OperationLogListFilterCommand(
|
||||
statusVO.getSearchField(),
|
||||
statusVO.getSearchValue(),
|
||||
statusVO.getSearchAppType(),
|
||||
statusVO.getSearchOperationType()));
|
||||
|
||||
model.addAttribute("listOutput", listOutput);
|
||||
model.addAttribute("pageRows", uiCodeListPortIn.connect("code.pageable.rows"));
|
||||
|
||||
return "operationLog/operationLogList";
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package app.module.admin.usecase.operationlog.list.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.operationlog.list.adapters.web.model.OperationLogListFilterVO;
|
||||
import app.module.core.config.application.util.ExcelUtil;
|
||||
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.in.OperationLogListPortIn;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort.Direction;
|
||||
import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Optional;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class OperationLogListExcelController {
|
||||
|
||||
private final ExcelUtil excelUtil;
|
||||
private final OperationLogListPortIn operationLogListPortIn;
|
||||
|
||||
@GetMapping("/analysis/operationlog/excel")
|
||||
public void operate(
|
||||
HttpServletResponse response,
|
||||
@PageableDefault(sort = "createdAt", direction = Direction.DESC) Pageable pageable,
|
||||
@ModelAttribute("paramDto") OperationLogListFilterVO statusVO) {
|
||||
Workbook wb = new XSSFWorkbook();
|
||||
Sheet sheet = wb.createSheet("수행로그 목록");
|
||||
|
||||
Page<OperationLogElement> listOutput =
|
||||
operationLogListPortIn.connect(
|
||||
pageable,
|
||||
new OperationLogListFilterCommand(
|
||||
statusVO.getSearchField(),
|
||||
statusVO.getSearchValue(),
|
||||
statusVO.getSearchAppType(),
|
||||
statusVO.getSearchOperationType()));
|
||||
|
||||
if (CollectionUtils.isNotEmpty(listOutput.getContent())) {
|
||||
// Header
|
||||
Row headerRow = sheet.createRow(sheet.getPhysicalNumberOfRows());
|
||||
excelUtil.createCells(
|
||||
headerRow, "로그 ID", "App Type", "Operation Type", "IP", "수행일", "수행자", "피수행자",
|
||||
"수행 내용");
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
|
||||
|
||||
listOutput
|
||||
.getContent()
|
||||
.forEach(
|
||||
item -> {
|
||||
Row row = sheet.createRow(sheet.getPhysicalNumberOfRows());
|
||||
|
||||
excelUtil.createCells(
|
||||
row,
|
||||
item.getId(),
|
||||
item.getAppType().name(),
|
||||
item.getOperationLogType().name(),
|
||||
item.getIp(),
|
||||
Optional.ofNullable(item.getCreatedAt())
|
||||
.map(localDateTime -> localDateTime.format(formatter))
|
||||
.orElse(""),
|
||||
item.getCreatedBy(),
|
||||
item.getTargetId(),
|
||||
item.getTaskDesc());
|
||||
});
|
||||
}
|
||||
|
||||
excelUtil.generateWithPassword(response, wb, "operation-logs");
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package app.module.admin.usecase.operationlog.list.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class OperationLogListFilterVO {
|
||||
|
||||
private String searchField;
|
||||
private String searchValue;
|
||||
private String searchAppType;
|
||||
private String searchOperationType;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package app.module.admin.usecase.uri.index.adapter.web;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.usecase.role.list.ports.RoleListPortIn;
|
||||
import app.module.core.usecase.role.list.ports.application.domain.RoleElement;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
class URIIndexController {
|
||||
|
||||
private final RoleListPortIn<RoleElement> roleListPortIn;
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
|
||||
@GetMapping(path = "/settings/uri/{appType}")
|
||||
String intro(Model model, @PathVariable AppType appType) {
|
||||
model.addAttribute("roles", roleListPortIn.connect(appType));
|
||||
model.addAttribute("appType", appType);
|
||||
model.addAttribute("pageRows", uiCodeListPortIn.connect("code.pageable.rows"));
|
||||
|
||||
return "uri/uriList";
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package app.module.admin.usecase.uri.remove.adapter.web;
|
||||
|
||||
import app.module.core.config.adapters.web.rest.response.RestResponse;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.exception.NonRemovableItemException;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import app.module.core.usecase.uri.remove.ports.URIRemovePortIn;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class URIRemoveController {
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
private final MessageUtil messageUtil;
|
||||
private final URIRemovePortIn uriRemovePortIn;
|
||||
|
||||
@PostMapping(path = "/api/uri/remove")
|
||||
ResponseEntity<?> remove(@Valid URIRemoveVO removeVO, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
}
|
||||
|
||||
try {
|
||||
uriRemovePortIn.connect(AppType.ADMIN, removeVO.getId());
|
||||
} catch (NonRemovableItemException e) {
|
||||
bindingResult.reject("", e.getMessage());
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
}
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(
|
||||
RestResponse.builder()
|
||||
.message(messageUtil.getMessage("operation.common.remove.done"))
|
||||
.build());
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package app.module.admin.usecase.uri.remove.adapter.web;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class URIRemoveVO {
|
||||
|
||||
@NotEmpty(message = "{valid.common.required}")
|
||||
private String id;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package app.module.admin.usecase.uri.save.adapter.web.web;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.enums.SaveType;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class URISaveBindingVO {
|
||||
|
||||
private String id;
|
||||
private AppType appType;
|
||||
|
||||
@NotEmpty(message = "{valid.uri.text}")
|
||||
private String text;
|
||||
|
||||
@NotEmpty(message = "{valid.uri.uri}")
|
||||
@Pattern(regexp = "^(/)|(/).+", message = "{valid.uri.must.startWith.slash}")
|
||||
@Pattern(regexp = "^(/)|.*[^/]$", message = "{valid.uri.mustNot.endWith.slash}")
|
||||
private String uri;
|
||||
|
||||
private String type;
|
||||
|
||||
@NotEmpty(message = "{valid.common.required}")
|
||||
private String parentId;
|
||||
|
||||
private Integer orderNo;
|
||||
private boolean showOnNavi;
|
||||
|
||||
private String ogTitle;
|
||||
private String ogDesc;
|
||||
private String ogKeywords;
|
||||
private String ogImage;
|
||||
|
||||
private MultipartFile ogImageFile;
|
||||
|
||||
private Set<String> roles;
|
||||
|
||||
private SaveType saveType;
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package app.module.admin.usecase.uri.save.adapter.web.web;
|
||||
|
||||
import app.module.core.config.adapters.web.rest.response.RestResponse;
|
||||
import app.module.core.config.application.enums.SaveType;
|
||||
import app.module.core.config.application.exception.AlreadyExistItemException;
|
||||
import app.module.core.config.application.exception.UnAcceptableFileException;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import app.module.core.usecase.uri.save.ports.URISavePortIn;
|
||||
import app.module.core.usecase.uri.save.ports.application.domain.URISaveCommand;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class URISaveController {
|
||||
|
||||
private final CoreUtil coreUtil;
|
||||
private final URISavePortIn uriSavePortIn;
|
||||
private final MessageUtil messageUtil;
|
||||
|
||||
@PostMapping(path = "/api/uri/save")
|
||||
public ResponseEntity<?> save(@Valid URISaveBindingVO saveVO, BindingResult bindingResult)
|
||||
throws IOException {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
}
|
||||
|
||||
String createdId;
|
||||
try {
|
||||
createdId =
|
||||
uriSavePortIn.connect(
|
||||
new URISaveCommand(
|
||||
saveVO.getId(),
|
||||
saveVO.getParentId(),
|
||||
saveVO.getAppType(),
|
||||
saveVO.getUri(),
|
||||
saveVO.isShowOnNavi(),
|
||||
saveVO.getText(),
|
||||
saveVO.getOrderNo(),
|
||||
saveVO.getOgTitle(),
|
||||
saveVO.getOgDesc(),
|
||||
saveVO.getOgKeywords(),
|
||||
saveVO.getOgImage(),
|
||||
saveVO.getRoles()),
|
||||
saveVO.getOgImageFile(),
|
||||
saveVO.getSaveType().equals(SaveType.CREATE));
|
||||
|
||||
} catch (UnAcceptableFileException e) {
|
||||
bindingResult.rejectValue("ogImageFile", "", e.getMessage());
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
|
||||
} catch (AlreadyExistItemException e) {
|
||||
bindingResult.rejectValue("uri", "", new String[]{"URI"}, e.getMessage());
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
}
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(
|
||||
RestResponse.builder()
|
||||
.item(createdId)
|
||||
.message(messageUtil.getMessage("operation.common.save.done"))
|
||||
.build());
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package app.module.admin.usecase.uri.sort.adapter.web;
|
||||
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.uri.sort.ports.URISortPortIn;
|
||||
import app.module.core.usecase.uri.sort.ports.application.domain.URISortCommand;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class URISortController {
|
||||
|
||||
private final URISortPortIn uriSortPortIn;
|
||||
private final CoreUtil coreUtil;
|
||||
|
||||
@PostMapping(path = "/api/uri/switchOrderNo")
|
||||
ResponseEntity<?> switchOrderNo(
|
||||
@Valid @RequestBody List<URISortVO> sortVOs, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return coreUtil.getErrorInfo(bindingResult);
|
||||
}
|
||||
|
||||
uriSortPortIn.connect(
|
||||
sortVOs.stream()
|
||||
.map(item -> new URISortCommand(item.getId(), item.getOrderNo()))
|
||||
.collect(Collectors.toList()));
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(null);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package app.module.admin.usecase.uri.sort.adapter.web;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class URISortVO {
|
||||
|
||||
@NotBlank(message = "{valid.common.required}")
|
||||
private String id;
|
||||
|
||||
private Integer orderNo;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package app.module.admin.usecase.uri.toptier.adapter.web;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.usecase.uri.toptier.ports.URITopTierPortIn;
|
||||
import app.module.core.usecase.uri.toptier.ports.application.domain.URITopTier;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class URITopTierController {
|
||||
|
||||
private final URITopTierPortIn topTierPortIn;
|
||||
|
||||
@GetMapping(path = "/api/uri/topTier/{appType}")
|
||||
ResponseEntity<?> recursiveItems(@PathVariable AppType appType) {
|
||||
URITopTier topTierOutput = topTierPortIn.connect(appType);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(recursiveMapping(topTierOutput));
|
||||
}
|
||||
|
||||
private URITreeVO recursiveMapping(URITopTier output) {
|
||||
return new URITreeVO(
|
||||
output.getId(),
|
||||
output.getText(),
|
||||
output.getUri(),
|
||||
output.getOrderNo(),
|
||||
CollectionUtils.emptyIfNull(output.getChildren()).stream()
|
||||
.map(this::recursiveMapping)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package app.module.admin.usecase.uri.toptier.adapter.web;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class URITreeVO {
|
||||
|
||||
private String id;
|
||||
private String text;
|
||||
private String uri;
|
||||
private Integer orderNo;
|
||||
private List<URITreeVO> nodes;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package app.module.admin.usecase.uri.view.adapter.web;
|
||||
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class URIBindingVO {
|
||||
|
||||
private String id;
|
||||
private AppType appType;
|
||||
private String text;
|
||||
private String uri;
|
||||
private String parentId;
|
||||
private Integer orderNo;
|
||||
private boolean showOnNavi;
|
||||
private String ogTitle;
|
||||
private String ogDesc;
|
||||
private String ogKeywords;
|
||||
private String ogImage;
|
||||
private Set<String> roles;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package app.module.admin.usecase.uri.view.adapter.web;
|
||||
|
||||
import app.module.core.config.adapters.web.rest.response.RestResponse;
|
||||
import app.module.core.config.application.enums.AppType;
|
||||
import app.module.core.config.application.util.MessageUtil;
|
||||
import app.module.core.usecase.uri.view.ports.URIViewPortIn;
|
||||
import app.module.core.usecase.uri.view.ports.application.domain.URIView;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class URIViewController {
|
||||
|
||||
private final MessageUtil messageUtil;
|
||||
private final URIViewPortIn uriViewPortIn;
|
||||
|
||||
@GetMapping(path = "/api/uri/{appType}/{id}")
|
||||
ResponseEntity<?> operate(@PathVariable AppType appType, @PathVariable String id) {
|
||||
URIView output =
|
||||
uriViewPortIn
|
||||
.connect(appType, id)
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new NoSuchElementException(
|
||||
messageUtil.getMessage("exception.noSuchElement", id, "URI")));
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(
|
||||
RestResponse.builder()
|
||||
.item(
|
||||
new URIBindingVO(
|
||||
output.getId(),
|
||||
output.getAppType(),
|
||||
output.getText(),
|
||||
output.getUri(),
|
||||
output.getParentId(),
|
||||
output.getOrderNo(),
|
||||
output.getShowOnNavi(),
|
||||
output.getOgTitle(),
|
||||
output.getOgDesc(),
|
||||
output.getOgKeywords(),
|
||||
output.getOgImage(),
|
||||
output.getRoles()))
|
||||
.build());
|
||||
}
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
|
||||
<form method="get" name="paramForm" onsubmit="goSearch();"
|
||||
th:action="@{/analysis/operationlog}" th:object="${paramDto}">
|
||||
<!-- hidden parameters -->
|
||||
<input name="page" th:value="${listOutput.pageable.pageNumber}" type="hidden"/>
|
||||
<input name="sort" th:value="${listOutput.pageable.sort}" type="hidden"/>
|
||||
|
||||
<div class="row bg-secondary p-2 mb-2" style="--bs-bg-opacity: .2;">
|
||||
<div class="col">
|
||||
<label class="col-form-label" for="searchAppType">App Type</label>
|
||||
<select class="form-select d-inline" id="searchAppType" style="width: 110px;"
|
||||
th:field="*{searchAppType}">
|
||||
<option selected value="">전체</option>
|
||||
<option
|
||||
th:each="appType : ${T(app.module.core.config.application.enums.AppType).values()}"
|
||||
th:value="${appType.name}">
|
||||
[[${appType.name}]]
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<label class="col-form-label" for="searchOperationType">Operation Type</label>
|
||||
<select class="form-select d-inline" id="searchOperationType" style="width: 110px;"
|
||||
th:field="*{searchOperationType}">
|
||||
<option selected value="">전체</option>
|
||||
<option
|
||||
th:each="operationType : ${T(app.module.core.config.application.enums.OperationLogType).values()}"
|
||||
th:value="${operationType.name}">[[${operationType.name}]] ([[${operationType.desc}]])
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
<label class="col-form-label" for="searchField">검색필드</label>
|
||||
<select class="form-select d-inline w-auto" id="searchField"
|
||||
th:field="*{searchField}">
|
||||
<option selected value="">선택</option>
|
||||
<option value="id">로그 ID</option>
|
||||
<option value="operatorId">수행자</option>
|
||||
<option value="targetId">피수행자</option>
|
||||
</select>
|
||||
<label>
|
||||
<input class="form-control d-inline" placeholder="검색어를 입력하세요."
|
||||
style="" th:field="*{searchValue}"
|
||||
type="text">
|
||||
</label>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-secondary" onclick="goSearch();"
|
||||
type="button">검색
|
||||
</button>
|
||||
<button class="btn btn-light" onclick="goInit();" type="button">초기화
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col text-start">
|
||||
<div class="fw-bolder text-muted">
|
||||
Total: <span th:text="${listOutput.totalElements}"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<i class="bi bi-list-ol"></i> <label> <select
|
||||
class="form-select form-select-sm" id="pageSize" name="pageSize"
|
||||
onchange="goSearch()">
|
||||
<option
|
||||
th:each="item : ${pageRows}"
|
||||
th:text="${item.codeText}" th:value="${item.codeValue}"></option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col"><a class="order-able" data-sort-field="id"
|
||||
href="#">로그 ID</a></th>
|
||||
<th scope="col"><a class="order-able" data-sort-field="appType"
|
||||
href="#">App Type</a></th>
|
||||
<th scope="col"><a class="order-able" data-sort-field="operationLogType"
|
||||
href="#">Operation Type</a></th>
|
||||
<th scope="col"><a class="order-able" data-sort-field="ip"
|
||||
href="#">IP</a></th>
|
||||
<th scope="col"><a class="order-able" data-sort-field="createdAt"
|
||||
href="#">수행일</a></th>
|
||||
<th scope="col"><a class="order-able" data-sort-field="createdBy"
|
||||
href="#">수행자</a></th>
|
||||
<th scope="col"><a class="order-able" data-sort-field="targetId"
|
||||
href="#">피수행자</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="sortable">
|
||||
|
||||
<div th:each="item, status : ${listOutput.content}" th:remove="tag">
|
||||
<tr>
|
||||
<td class="row">[[${status.count + (listOutput.pageable.pageNumber *
|
||||
listOutput.pageable.pageSize)}]]
|
||||
</td>
|
||||
<th class="bg-info">[[${item.id}]]</th>
|
||||
<td>[[${item.appType}]]</td>
|
||||
<td>[[${item.operationLogType}]]</td>
|
||||
<td>
|
||||
<span th:if="${not #strings.isEmpty(item.ip)}" th:remove="tag">[[${item.ip}]]</span>
|
||||
<span th:if="${#strings.isEmpty(item.ip)}" th:remove="tag"><i
|
||||
class="bi bi-slash-circle"></i></span>
|
||||
</td>
|
||||
<td>[[${#temporals.format(item.createdAt, 'yyyy-MM-dd HH:mm')}]]</td>
|
||||
<td>[[${item.createdBy}]]</td>
|
||||
<td>
|
||||
<span th:if="${not #strings.isEmpty(item.targetId)}" th:remove="tag">[[${item.targetId}]]</span>
|
||||
<span th:if="${#strings.isEmpty(item.targetId)}" th:remove="tag"><i
|
||||
class="bi bi-slash-circle"></i></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="8"><i class="bi bi-arrow-right"></i> [[${item.taskDesc}]]</td>
|
||||
</tr>
|
||||
</div>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
<div th:replace="common/list-components :: pagination(${listOutput})"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col text-start">
|
||||
<button class="btn btn-success" onclick="goExcel();" type="button">엑셀 다운로드</button>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
// 목록 정렬 표기 및 갱신 기능 적용
|
||||
uiUtil.applyListSortNotation([[${listOutput.pageable.pageSize}]],
|
||||
[[${listOutput.pageable.sort.toString()}]]);
|
||||
</script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
// 검색
|
||||
function goSearch() {
|
||||
const f = document.paramForm;
|
||||
f.action = '/analysis/operationlog';
|
||||
f.page.value = 0;
|
||||
f.sort.value = convertToPageableSortValue(f.sort.value);
|
||||
f.method = 'get';
|
||||
f.submit();
|
||||
}
|
||||
|
||||
// 초기화
|
||||
function goInit() {
|
||||
const f = document.paramForm;
|
||||
f.searchField.value = '';
|
||||
f.searchValue.value = '';
|
||||
f.searchAppType.value = '';
|
||||
f.searchOperationType.value = '';
|
||||
}
|
||||
|
||||
function goExcel() {
|
||||
const f = document.paramForm;
|
||||
f.sort.value = convertToPageableSortValue(f.sort.value);
|
||||
f.action = '/analysis/operationlog/excel';
|
||||
f.method = 'get';
|
||||
f.submit();
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -272,36 +272,6 @@ public class InitUriAdminData implements ApplicationRunner {
|
||||
// 커뮤니케이션 메뉴 끝
|
||||
|
||||
|
||||
// 분석 메뉴 시작
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_ANALYSIS,
|
||||
ADMIN_ANALYSIS_OPERATION_LOG,
|
||||
"Operation Log (수행로그)",
|
||||
"/analysis/operationlog",
|
||||
true,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_ANALYSIS,
|
||||
ADMIN_ANALYSIS_OPERATION_LOG_UPDATE,
|
||||
"수행로그 상세",
|
||||
"/analysis/operationlog/{{pathVar}}",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_ANALYSIS_OPERATION_LOG,
|
||||
ADMIN_ANALYSIS_OPERATION_LOG_EXCEL,
|
||||
"수행로그 Excel",
|
||||
"/analysis/operationlog/excel",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
// 분석 메뉴 끝
|
||||
|
||||
|
||||
// 관리자 시작
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
@@ -330,15 +300,6 @@ public class InitUriAdminData implements ApplicationRunner {
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN_DELETE,
|
||||
"관리자 삭제",
|
||||
"/settings/admins/delete",
|
||||
false,
|
||||
Set.of("ROLE_ADMIN"));
|
||||
|
||||
appendURI(
|
||||
AppType.ADMIN,
|
||||
ADMIN_SETTINGS_ADMIN,
|
||||
|
||||
Reference in New Issue
Block a user