Merge branch 'dev' into susu
This commit is contained in:
@@ -14,4 +14,26 @@ public class CommonConstants {
|
||||
* 작업 면적의 직접입력 코드
|
||||
*/
|
||||
public static final String AREA_CODE_OTHER = "code.record.area.self";
|
||||
|
||||
/**
|
||||
* 관리자 아이디 생성 규칙
|
||||
* [정책] 아이디: 4~15자, 영문/숫자/한글/특수문자(_,-) 허용
|
||||
*/
|
||||
public static final String ADMIN_ID_REGEX = "^[a-zA-Z0-9가-힣_-]{4,15}$";
|
||||
|
||||
/**
|
||||
* 관리자 아이디 유효성 실패 메시지
|
||||
*/
|
||||
public static final String ADMIN_ID_MSG = "아이디는 4~15자, 영문/숫자/한글/특수문자(_,-)만 가능합니다.";
|
||||
|
||||
/**
|
||||
* 관리자 비밀번호 생성 규칙
|
||||
* [정책] 비밀번호: 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상
|
||||
*/
|
||||
public static final String ADMIN_PASSWORD_REGEX = "^[a-zA-Z0-9가-힣_-]{4,15}$";
|
||||
|
||||
/**
|
||||
* 관리자 비밀번호 유효성 실패 메시지
|
||||
*/
|
||||
public static final String ADMIN_PASSWORD_MSG = "비밀번호는 5자, 숫자 + 특수문자(!@#$%_-) 1개 이상입니다.";
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package app.module.core.usecase.file.createFile.ports.application;
|
||||
|
||||
import app.module.core.config.application.enums.FileUploadType;
|
||||
import app.module.core.usecase.file.createFile.ports.CreateFilePortIn;
|
||||
import app.module.core.usecase.file.createFile.ports.CreateFilePortOut;
|
||||
import app.module.core.usecase.file.createFile.ports.application.domain.CreateFile;
|
||||
import app.module.core.usecase.file.createFile.ports.application.domain.CreateFileCmd;
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class CreateFileService implements CreateFilePortIn {
|
||||
@@ -16,6 +19,24 @@ class CreateFileService implements CreateFilePortIn {
|
||||
|
||||
@Override
|
||||
public Optional<CreateFile> operate(CreateFileCmd command) {
|
||||
validateFileSize(command);
|
||||
return portOut.operate(command);
|
||||
}
|
||||
|
||||
private void validateFileSize(CreateFileCmd command) {
|
||||
// 공지사항 파일 업로드 형식 파일당 최대 5MB
|
||||
if(FileUploadType.NOTICE.equals(command.getType())) {
|
||||
long NOTICE_MAX_FILE_SIZE = 5 * 1024 * 1024;
|
||||
|
||||
if (command.getFileLength() != null && command.getFileLength() > NOTICE_MAX_FILE_SIZE) {
|
||||
log.info(String.format(
|
||||
"파일 크기는 5MB 이하만 업로드 가능합니다: %s (크기: %.2fMB)",
|
||||
command.getOriginName(),
|
||||
command.getFileLength() / (1024.0 * 1024.0)
|
||||
));
|
||||
|
||||
throw new IllegalArgumentException("파일 크기는 5MB 이하만 업로드 가능합니다");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,14 @@
|
||||
LEFT JOIN uicode u ON u.parent_id = 'code.region.main' AND u.id = a.region_main_code
|
||||
WHERE a.is_deleted = false
|
||||
|
||||
<if test="cmd.searchField != null and cmd.searchValue != null and cmd.searchValue != ''">
|
||||
<if test="cmd.searchValue != null and cmd.searchValue != ''">
|
||||
<choose>
|
||||
<when test="cmd.searchField == ''">
|
||||
AND (
|
||||
a.id ILIKE '%' || #{cmd.searchValue} || '%'
|
||||
OR a.name ILIKE '%' || #{cmd.searchValue} || '%'
|
||||
)
|
||||
</when>
|
||||
<when test="cmd.searchField == 'name'">AND a.name LIKE '%' || #{cmd.searchValue} || '%'</when>
|
||||
<when test="cmd.searchField == 'id'">AND a.id LIKE '%' || #{cmd.searchValue} || '%'</when>
|
||||
</choose>
|
||||
@@ -48,24 +54,7 @@
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="pageable.sort != null and !pageable.sort.isEmpty()">
|
||||
ORDER BY
|
||||
<foreach collection="pageable.sort" item="order" separator=",">
|
||||
<choose>
|
||||
<when test="order.property eq 'id'">a.id</when>
|
||||
<when test="order.property eq 'email'">a.email</when>
|
||||
<when test="order.property eq 'accountDisabled'">a.account_disabled</when>
|
||||
<when test="order.property eq 'accountLocked'">a.account_locked</when>
|
||||
<when test="order.property eq 'createdAt'">a.created_at</when>
|
||||
<when test="order.property eq 'updatedAt'">a.updated_at</when>
|
||||
<otherwise>a.created_at</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="order.direction.toString() eq 'DESC'">DESC</when>
|
||||
<otherwise>ASC</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY a.seq DESC
|
||||
|
||||
OFFSET #{pageable.offset} ROWS FETCH NEXT #{pageable.pageSize} ROWS ONLY
|
||||
</select>
|
||||
|
||||
@@ -16,13 +16,27 @@ delete from uri where id in (
|
||||
'uri.admin.settings.user.update',
|
||||
'uri.admin.settings.user.privilege'
|
||||
'uri.admin.settings.user.role',
|
||||
'uri.admin.settings.user.group',
|
||||
'uri.admin.settings.user',
|
||||
'uri.admin.settings.admins.group',
|
||||
'uri.admin.settings.adminPrivilege',
|
||||
'uri.admin.settings.adminRoles'
|
||||
);
|
||||
|
||||
-- front_user
|
||||
delete from uri_has_role where uri_id in (
|
||||
'uri.admin.addons.email.create',
|
||||
'uri.admin.addons.email',
|
||||
'uri.admin.addons'
|
||||
);
|
||||
|
||||
delete from uri where id in (
|
||||
'uri.admin.addons.email.create',
|
||||
'uri.admin.addons.email',
|
||||
'uri.admin.addons'
|
||||
);
|
||||
|
||||
|
||||
-- front_user 테이블 : household 로 사용되어 삭제
|
||||
DROP TABLE IF EXISTS front_user_has_upload_file;
|
||||
DROP TABLE IF EXISTS front_user_has_role;
|
||||
DROP TABLE IF EXISTS front_user_social;
|
||||
@@ -33,6 +47,7 @@ DROP SEQUENCE IF EXISTS front_user_has_upload_file_seq;
|
||||
DROP SEQUENCE IF EXISTS front_user_has_role_seq;
|
||||
DROP SEQUENCE IF EXISTS front_user_social_seq ;
|
||||
|
||||
-- 일계부 테이블 : daily_xxx 로 사용되어 삭제
|
||||
DROP TABLE IF EXISTS input_day_group;
|
||||
DROP TABLE IF EXISTS daily_input_status;
|
||||
DROP TABLE IF EXISTS income_expense_record;
|
||||
@@ -51,10 +66,35 @@ DROP SEQUENCE IF EXISTS work_input_seq;
|
||||
DROP SEQUENCE IF EXISTS forestry_self_consumption_seq;
|
||||
DROP SEQUENCE IF EXISTS agriculture_self_consumption_seq;
|
||||
|
||||
-- 샘플 게시판 테이블 : 미사용으로 삭제
|
||||
DROP TABLE IF EXISTS article_has_upload_file ;
|
||||
DROP TABLE IF EXISTS article_comment ;
|
||||
DROP TABLE IF EXISTS article ;
|
||||
|
||||
DROP SEQUENCE IF EXISTS article_comment_seq ;
|
||||
|
||||
delete from uri_has_role where uri_id in (
|
||||
'uri.admin.board.article.excel',
|
||||
'uri.admin.board.article.delete',
|
||||
'uri.admin.board.article.update.{{pathVar}}',
|
||||
'uri.admin.board.article.create',
|
||||
'uri.admin.board.article',
|
||||
'uri.admin.board'
|
||||
);
|
||||
|
||||
delete from uri where id in (
|
||||
'uri.admin.board.article.excel',
|
||||
'uri.admin.board.article.delete',
|
||||
'uri.admin.board.article.update.{{pathVar}}',
|
||||
'uri.admin.board.article.create',
|
||||
'uri.admin.board.article',
|
||||
'uri.admin.board'
|
||||
);
|
||||
|
||||
-- 이월금(매달 1일, 말일) 테이블 : daily_summary 로 사용되어 삭제
|
||||
DROP TABLE IF EXISTS monthly_carryover;
|
||||
|
||||
DROP SEQUENCE IF EXISTS monthly_carryover_seq;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ DROP TABLE IF EXISTS suggestion;
|
||||
DROP TABLE IF EXISTS upload_receipt_files;
|
||||
DROP TABLE IF EXISTS forest_product_yield;
|
||||
DROP TABLE IF EXISTS forest_product;
|
||||
DROP TABLE IF EXISTS monthly_carryover;
|
||||
|
||||
DROP TABLE IF EXISTS bank_auto_transfer;
|
||||
DROP TABLE IF EXISTS monthly_input_status;
|
||||
@@ -84,7 +83,6 @@ DROP SEQUENCE IF EXISTS research_area_seq;
|
||||
DROP SEQUENCE IF EXISTS upload_receipt_files_seq;
|
||||
DROP SEQUENCE IF EXISTS forest_product_yield_seq;
|
||||
DROP SEQUENCE IF EXISTS forest_product_seq;
|
||||
DROP SEQUENCE IF EXISTS monthly_carryover_seq;
|
||||
|
||||
|
||||
DROP SEQUENCE IF EXISTS bank_auto_transfer_seq;
|
||||
|
||||
@@ -1016,46 +1016,6 @@ COMMENT ON COLUMN bank_auto_transfer.transfer_category_code IS '이체 카테고
|
||||
COMMENT ON COLUMN bank_auto_transfer.unit IS '단위(직접입력)';
|
||||
COMMENT ON COLUMN bank_auto_transfer.category IS '카테고리';
|
||||
|
||||
-- 6. monthly_carryover
|
||||
-- ============================================
|
||||
-- TABLE : monthly_carryover
|
||||
-- DESC : 이월금(매달 1일, 말일) 테이블
|
||||
-- ============================================
|
||||
CREATE SEQUENCE monthly_carryover_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE monthly_carryover (
|
||||
id bigint DEFAULT nextval('monthly_carryover_seq') NOT NULL, -- 이월금 ID
|
||||
household_seq bigint NOT NULL, -- 임가정보 일련번호 (FK)
|
||||
month varchar(7) NOT NULL, -- 조사시행 월 (yyyy-mm)
|
||||
start_price integer, -- 월초이월금(현금)
|
||||
end_price integer, -- 월말현금
|
||||
created_at timestamp(6) NOT NULL, -- 생성일
|
||||
created_by varchar(255) NOT NULL, -- 생성자
|
||||
updated_at timestamp(6) NOT NULL, -- 수정일
|
||||
updated_by varchar(255) NOT NULL, -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false, -- 삭제여부
|
||||
|
||||
CONSTRAINT monthly_carryover_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_monthly_carryover__household FOREIGN KEY (household_seq) REFERENCES household(seq)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE monthly_carryover IS '이월금(매달 1일, 말일)';
|
||||
|
||||
COMMENT ON COLUMN monthly_carryover.id IS '이월금 ID';
|
||||
COMMENT ON COLUMN monthly_carryover.household_seq IS '임가정보 일련번호';
|
||||
COMMENT ON COLUMN monthly_carryover.month IS '조사시행 월 (yyyy-mm)';
|
||||
COMMENT ON COLUMN monthly_carryover.start_price IS '월초이월금(현금)';
|
||||
COMMENT ON COLUMN monthly_carryover.end_price IS '월말현금';
|
||||
COMMENT ON COLUMN monthly_carryover.created_at IS '생성일';
|
||||
COMMENT ON COLUMN monthly_carryover.created_by IS '생성자';
|
||||
COMMENT ON COLUMN monthly_carryover.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN monthly_carryover.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN monthly_carryover.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN monthly_carryover.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN monthly_carryover.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 12. upload_receipt_files
|
||||
-- ============================================
|
||||
|
||||
Reference in New Issue
Block a user