From 3418fee37721cdce976b02876b99ffbb793253dd Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Thu, 18 May 2023 05:54:09 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=94=ED=8B=B0=ED=8B=B0/=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=EA=B3=B5=ED=86=B5=20=ED=95=84=EB=93=9C/=EC=BB=AC?= =?UTF-8?q?=EB=9F=BC=20=EC=B6=94=EA=B0=80=20->=20REG=5FDT,=20RGTR,=20MDFCN?= =?UTF-8?q?=5FDT,=20MDFR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/base/file/FileInfo.java | 67 +------------------ .../cokr/xit/base/file/dao/FileMapper.java | 8 +-- .../java/cokr/xit/base/file/package-info.java | 2 +- .../xit/base/file/service/bean/FileBean.java | 8 +-- 4 files changed, 12 insertions(+), 73 deletions(-) diff --git a/src/main/java/cokr/xit/base/file/FileInfo.java b/src/main/java/cokr/xit/base/file/FileInfo.java index 257a1ea..f3b4279 100644 --- a/src/main/java/cokr/xit/base/file/FileInfo.java +++ b/src/main/java/cokr/xit/base/file/FileInfo.java @@ -11,7 +11,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Base64; import java.util.Collections; -import java.util.Date; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -19,12 +18,13 @@ import java.util.stream.Stream; import org.springframework.util.FileCopyUtils; import cokr.xit.foundation.AbstractComponent; +import cokr.xit.foundation.AbstractEntity; import cokr.xit.foundation.Assert; /**파일 정보 * @author mjkhan */ -public class FileInfo { +public class FileInfo extends AbstractEntity { /**파일의 관계 정보 * @author mjkhan */ @@ -284,13 +284,10 @@ public class FileInfo { path, url, mimeType, - extension, - createdBy, - inUse; + extension; private long size; private int downloadCount; private int sortOrder; - private Date createdAt; private InputStream input; /**주어진 경로에서 파일 이름을 추출한다. @@ -499,64 +496,6 @@ public class FileInfo { this.sortOrder = sortOrder; } - /**등록자 ID를 반환한다. - * @return 등록자 ID - */ - public String getCreatedBy() { - return createdBy; - } - - /**등록자 ID를 설정한다. - * @param createdBy 등록자 ID - */ - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - /**등록 일시를 반환한다. - * @return 등록 일시 - */ - public Date getCreatedAt() { - return createdAt; - } - - /**등록 일시를 설정한다. - * @param createdAt 등록 일시 - */ - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - - /**사용여부를 반환한다. - * @return 삭제여부 - * - */ - public String getInUse() { - return Assert.ifEmpty(inUse, "Y"); - } - - /**사용여부를 반환한다. - * @return 사용여부 - * - */ - public boolean inUse() { - return "Y".equals(getInUse()); - } - - /**사용여부를 설정한다. - * @param deleted 사용여부 - * - */ - public void setInUse(String deleted) { - this.inUse = deleted; - } - /**FileInfo 경로의 InputStream을 반환한다. * @return InputStream */ diff --git a/src/main/java/cokr/xit/base/file/dao/FileMapper.java b/src/main/java/cokr/xit/base/file/dao/FileMapper.java index 513e3b8..bfbaa58 100644 --- a/src/main/java/cokr/xit/base/file/dao/FileMapper.java +++ b/src/main/java/cokr/xit/base/file/dao/FileMapper.java @@ -19,7 +19,7 @@ import cokr.xit.foundation.data.DataObject; *

파일 저장 경로는 다음 SQL문으로 설정한다. *

{@code 
  *  SELECT INF_TYPE
- *     , CONCAT('D://workspace/xit/base/files/', DIR, TO_CHAR(CURRENT_DATE, 'YYYY/MM/DD/')) DIR
+ *     , CONCAT('C://workspace/xit/base/files/', DIR, DATE_FORMAT(CURRENT_DATE, '%Y/%m/%d/')) DIR
  *  FROM (
  *       SELECT '00' INF_TYPE, 'attachment/' DIR UNION
  *       SELECT '10' INF_TYPE, 'document/' DIR UNION
@@ -27,7 +27,7 @@ import cokr.xit.foundation.data.DataObject;
  *       ) FILE_DIRS
  * }
* 위 문장은 - *