init
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
|||||||
|
################################################################################
|
||||||
|
#gitignore
|
||||||
|
################################################################################
|
||||||
|
/.gradle/
|
||||||
|
/.idea/
|
||||||
|
/build/
|
||||||
|
/gradle/
|
||||||
|
/logs/
|
||||||
|
/out/
|
||||||
|
/target/
|
||||||
|
/src/main/generated/
|
||||||
|
/src/test/generated_tests/
|
||||||
|
/.settings/
|
||||||
|
/.factorypath
|
||||||
|
/.project
|
||||||
|
/.classpath
|
||||||
|
|
||||||
|
/documents/erd/.metadata/
|
||||||
|
/documents/kbjin-0819.txt
|
||||||
|
/src/main/webapp/wenMedia/extend/js/env.js.txt
|
||||||
|
/src/main.7z
|
||||||
|
|
||||||
|
/files/
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beansProjectDescription>
|
||||||
|
<version>1</version>
|
||||||
|
<pluginVersion><![CDATA[3.9.15.202012132325-RELEASE]]></pluginVersion>
|
||||||
|
<configSuffixes>
|
||||||
|
<configSuffix><![CDATA[xml]]></configSuffix>
|
||||||
|
</configSuffixes>
|
||||||
|
<enableImports><![CDATA[false]]></enableImports>
|
||||||
|
<configs>
|
||||||
|
<config>java:com.ns.mobile.website.LanEduWebsiteApplication</config>
|
||||||
|
</configs>
|
||||||
|
<autoconfigs>
|
||||||
|
</autoconfigs>
|
||||||
|
<configSets>
|
||||||
|
</configSets>
|
||||||
|
</beansProjectDescription>
|
||||||
@@ -0,0 +1,328 @@
|
|||||||
|
CREATE TABLE phonessayo.file_upload (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
`original_file_name` varchar(255) NOT NULL,
|
||||||
|
`file_extension` varchar(255) NOT NULL,
|
||||||
|
`save_file_name` varchar(255) NOT NULL,
|
||||||
|
`local_path` varchar(255) NOT NULL,
|
||||||
|
`reg_uid` bigint(20) DEFAULT NULL,
|
||||||
|
`reg_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`udt_uid` bigint(20) DEFAULT NULL,
|
||||||
|
`udt_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`del_uid` bigint(20) DEFAULT NULL,
|
||||||
|
`del_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_yn` bit(1) DEFAULT b'0',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
CREATE TABLE phonessayo.phone (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
`title` varchar(255) NOT NULL,
|
||||||
|
`title_en` varchar(255) NOT NULL,
|
||||||
|
`sub_title` varchar(255) DEFAULT NULL,
|
||||||
|
`producer` varchar(255) DEFAULT NULL,
|
||||||
|
`phone_type` varchar(10) DEFAULT NULL,
|
||||||
|
`title_img` varchar(255) DEFAULT NULL,
|
||||||
|
`md_pick` bit(1) DEFAULT b'1',
|
||||||
|
`hot` bit(1) DEFAULT b'1',
|
||||||
|
`kt` bit(1) DEFAULT b'1',
|
||||||
|
`skt` bit(1) DEFAULT b'1',
|
||||||
|
`lgu` bit(1) DEFAULT b'1',
|
||||||
|
`reg_uid` bigint(20) DEFAULT 0,
|
||||||
|
`udt_uid` bigint(20) DEFAULT 0,
|
||||||
|
`del_uid` bigint(20) DEFAULT 0,
|
||||||
|
`reg_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`udt_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_yn` bit(1) DEFAULT b'0',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE phonessayo.phone_color (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
`phone_id` bigint(20) NOT NULL,
|
||||||
|
`sort` int(11) NOT NULL,
|
||||||
|
`color` varchar(255) NOT NULL,
|
||||||
|
`color_kr` varchar(255) NOT NULL,
|
||||||
|
`color_en` varchar(255) NOT NULL,
|
||||||
|
`front_img` varchar(255) DEFAULT '',
|
||||||
|
`side_img` varchar(255) DEFAULT '',
|
||||||
|
`back_img` varchar(255) DEFAULT '',
|
||||||
|
`reg_uid` bigint(20) DEFAULT 0,
|
||||||
|
`udt_uid` bigint(20) DEFAULT 0,
|
||||||
|
`del_uid` bigint(20) DEFAULT 0,
|
||||||
|
`reg_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`udt_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_yn` bit(1) DEFAULT b'0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `phone_id` (`phone_id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE phonessayo.phone_detail (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
`phone_id` bigint(20) NOT NULL,
|
||||||
|
`detail_pc_img` varchar(255) DEFAULT NULL,
|
||||||
|
`detail_mobile_img` varchar(255) DEFAULT NULL,
|
||||||
|
`reg_uid` bigint(20) DEFAULT 0,
|
||||||
|
`udt_uid` bigint(20) DEFAULT 0,
|
||||||
|
`del_uid` bigint(20) DEFAULT 0,
|
||||||
|
`reg_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`udt_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_yn` bit(1) DEFAULT b'0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `phone_id` (`phone_id`),
|
||||||
|
CONSTRAINT `phone_detail_ibfk_1` FOREIGN KEY (`phone_id`) REFERENCES `phone` (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE phonessayo.phone_price (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
`phone_id` bigint(20) NOT NULL,
|
||||||
|
`storage` bigint(20) NOT NULL,
|
||||||
|
`release_price` bigint(20) NOT NULL,
|
||||||
|
`yogum` bigint(20) NOT NULL,
|
||||||
|
`dc_yogum` bigint(20) NOT NULL,
|
||||||
|
`dc_danmal` bigint(20) NOT NULL,
|
||||||
|
`reg_uid` bigint(20) DEFAULT 0,
|
||||||
|
`udt_uid` bigint(20) DEFAULT 0,
|
||||||
|
`del_uid` bigint(20) DEFAULT 0,
|
||||||
|
`reg_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`udt_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_yn` bit(1) DEFAULT b'0',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `phone_id` (`phone_id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
CREATE TABLE phonessayo.sell_user (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
`opening_date` datetime(6) DEFAULT NULL,
|
||||||
|
`account` varchar(100) DEFAULT NULL,
|
||||||
|
`news_agency` varchar(100) DEFAULT NULL,
|
||||||
|
`name` varchar(100) DEFAULT NULL,
|
||||||
|
`social_security_number` varchar(100) DEFAULT NULL,
|
||||||
|
`phone_number` varchar(100) DEFAULT NULL,
|
||||||
|
`customer_type` varchar(100) DEFAULT NULL,
|
||||||
|
`legal_representative_name` varchar(100) DEFAULT NULL,
|
||||||
|
`legal_representative_phone_number` varchar(100) DEFAULT NULL,
|
||||||
|
`installment_month` int(6) DEFAULT NULL,
|
||||||
|
`pet_name` varchar(100) DEFAULT NULL,
|
||||||
|
`serial_number` varchar(100) DEFAULT NULL,
|
||||||
|
`subscription` varchar(100) DEFAULT NULL,
|
||||||
|
`file_id` bigint(20) DEFAULT NULL,
|
||||||
|
`reg_uid` bigint(20) DEFAULT NULL,
|
||||||
|
`reg_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`udt_uid` bigint(20) DEFAULT NULL,
|
||||||
|
`udt_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`del_uid` bigint(20) DEFAULT NULL,
|
||||||
|
`del_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_yn` bit(1) DEFAULT b'0',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
CREATE TABLE phonessayo.user (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
`phone` varchar(255) NOT NULL,
|
||||||
|
`name` varchar(255) NOT NULL,
|
||||||
|
`password` varchar(255) NOT NULL,
|
||||||
|
`email` varchar(255) NOT NULL,
|
||||||
|
`pwd_update_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`phone2` varchar(255) DEFAULT NULL,
|
||||||
|
`last_login_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`login_fail_count` int(11) DEFAULT 0,
|
||||||
|
`reg_uid` bigint(20) DEFAULT NULL,
|
||||||
|
`reg_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`udt_uid` bigint(20) DEFAULT NULL,
|
||||||
|
`udt_dt` datetime(6) DEFAULT sysdate(),
|
||||||
|
`del_uid` bigint(20) DEFAULT NULL,
|
||||||
|
`del_dt` datetime(6) DEFAULT NULL,
|
||||||
|
`del_yn` bit(1) DEFAULT b'0',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
INSERT INTO phonessayo.phone (title,title_en,sub_title,producer,phone_type,title_img,md_pick,hot,kt,skt,lgu,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
('갤럭시 S22 사전예약','s22','회원님께 드리는 혜택','samsung','p','http://luckyphone.kr/all-pdData/thumb/s22_thumb.png',1,1,1,1,1,0,0,0,'2022-05-29 18:26:31.0',NULL,NULL,0),
|
||||||
|
('갤럭시 Z플립3','zfold3','회원님께 드리는 혜택','samsung','p','http://luckyphone.kr/all-pdData/thumb/zflip3_thumb.png',1,1,1,1,1,0,0,0,'2022-05-29 18:26:31.0',NULL,NULL,0),
|
||||||
|
('갤럭시 Z폴드3','zflip3','회원님께 드리는 혜택','samsung','p','http://luckyphone.kr/all-pdData/thumb/zfold3_thumb.png',1,1,1,1,1,0,0,0,'2022-05-29 18:35:02.0',NULL,NULL,0),
|
||||||
|
('아이폰13 PRO Max','iphone13pro_max','회원님께 드리는 혜택','apple','p','http://luckyphone.kr/all-pdData/thumb/iphone13_max_thumb.png',1,1,1,1,1,0,0,0,'2022-05-29 18:35:02.0',NULL,NULL,0),
|
||||||
|
('아이폰13 PRO','iphone13_pro','회원님께 드리는 혜택','apple','p','http://luckyphone.kr/all-pdData/thumb/iphone13_thumb.png',1,1,1,1,1,0,0,0,'2022-05-29 18:35:02.0',NULL,NULL,0),
|
||||||
|
('아이폰13','iphone_mini','회원님께 드리는 혜택','apple','p','http://luckyphone.kr/all-pdData/thumb/iphone_mini_pink.png',1,1,1,1,1,0,0,0,'2022-05-29 18:35:02.0',NULL,NULL,0),
|
||||||
|
('아이폰13 mini','iphone_mini','회원님께 드리는 혜택','apple','p','http://luckyphone.kr/all-pdData/thumb/iphone_mini_pink.png',1,1,1,1,1,0,0,0,'2022-05-29 18:35:02.0',NULL,NULL,0),
|
||||||
|
('갤럭시 노트20 5G','samsung-note205g','성능만큼 강력한 아름다움','samsung','p','http://luckyphone.kr/all-pdData/thumb/samsung-note205g-gwp-grey-1.png',1,1,1,1,1,0,0,0,'2022-05-29 18:35:02.0',NULL,NULL,0),
|
||||||
|
('갤럭시 Z 플립','galaxy_z_flip','스마트폰의 새로운 가능성','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_z_flip_main.png',1,1,1,1,1,0,0,0,'2022-05-29 18:43:27.0',NULL,NULL,0),
|
||||||
|
('갤럭시 S20 5G','galaxy_s20','스마트폰의 카메라의 새로운 기','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_s20_main.png',0,1,1,1,1,0,0,0,'2022-05-29 18:43:27.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone (title,title_en,sub_title,producer,phone_type,title_img,md_pick,hot,kt,skt,lgu,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
('갤럭시 S20+ 5G','galaxy_s20_plus','스마트폰의 새로운 가능성','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_s20_plus_main.png',1,0,1,1,1,0,0,0,'2022-05-29 18:46:28.0',NULL,NULL,0),
|
||||||
|
('갤럭시 S20 울트라 5G','galaxy_s20_ultra','사진의 미래를 바꿀 스마트폰','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_s20_ultra_main.png',0,1,1,1,1,0,0,0,'2022-05-29 18:46:28.0',NULL,NULL,0),
|
||||||
|
('갤럭시 S10','galaxy_s10','새로운 시대의 스마트폰','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_s10_main.png',1,1,1,1,1,0,0,0,'2022-05-29 18:46:28.0',NULL,NULL,0),
|
||||||
|
('갤럭시 S10+','galaxy_s10_plus','새로운 시대의 스마트폰','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_s10_main.png',1,0,1,1,1,0,0,0,'2022-05-29 18:46:28.0',NULL,NULL,0),
|
||||||
|
('갤럭시 S10e','galaxy_s10e','새로운 시대의 스마트폰','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_s10e_main.png',0,1,1,1,1,0,0,0,'2022-05-29 18:46:28.0',NULL,NULL,0),
|
||||||
|
('갤럭시 S10 5G','galaxy_s10','스마트폰의 새로운 가능성','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_s10_5g_main.png',1,1,1,1,1,0,0,0,'2022-05-29 18:46:28.0',NULL,NULL,0),
|
||||||
|
('갤럭시 노트10 5G','galaxy_s10_5g','5G로 만나는 새로운 세계','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_s10_5g_main.png',1,1,1,1,1,0,0,0,'2022-05-29 18:46:28.0',NULL,NULL,0),
|
||||||
|
('갤럭시 노트10+ 5G','galaxy_note10','새로운 혁신','samsung','p','http://luckyphone.kr/all-pdData/thumb/1.galaxy_note10_main.png',0,1,1,1,1,0,0,0,'2022-05-29 18:46:28.0',NULL,NULL,0),
|
||||||
|
('아이폰11','iPhone11','Just the right amount of everything','apple','p','http://luckyphone.kr/all-pdData/thumb/1.iPhone_11_main.png',1,0,1,1,1,0,0,0,'2022-05-29 18:55:10.0',NULL,NULL,0),
|
||||||
|
('아이폰11 Pro','iPhone11pro','Just the right amount of everything','apple','p','http://luckyphone.kr/all-pdData/thumb/1.iPhone_11_pro_main.png',1,1,1,1,1,0,0,0,'2022-05-29 18:55:10.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone (title,title_en,sub_title,producer,phone_type,title_img,md_pick,hot,kt,skt,lgu,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
('갤럭시 A50','galaxy_A50','트렌드와 기능을 모두 갖춘','samsung','s','http://luckyphone.kr/all-pdData/thumb/1.galaxy_A50_main.png',1,1,1,1,1,0,0,0,'2022-05-29 19:18:21.0',NULL,NULL,0),
|
||||||
|
('갤럭시 A40','galaxy_A40','놀라운 가성비의 갤럭시','samsung','s','http://luckyphone.kr/all-pdData/thumb/1.galaxy_A40_main.png',1,0,0,1,0,0,0,0,'2022-05-29 19:20:46.0',NULL,NULL,0),
|
||||||
|
('갤럭시 A90 5G','galaxy_A90_5G','최초의 5G','samsung','s','http://luckyphone.kr/all-pdData/thumb/1.galaxy_A90_5G_main.png',0,0,1,1,1,0,0,0,'2022-05-29 19:20:46.0',NULL,NULL,0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO phonessayo.phone_color (phone_id,sort,color,color_kr,color_en,front_img,side_img,back_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(11,1,'#54a0ff','클라우드 블루','cloudblue','http://luckyphone.kr/all-pdData/slider/galaxy_s20_cloudblue_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_cloudblue_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_cloudblue_detail3.jpg',0,0,0,'2022-05-30 01:03:30.0',NULL,NULL,0),
|
||||||
|
(11,2,'#576574','코스믹 그레이','gray','http://luckyphone.kr/all-pdData/slider/galaxy_s20_gray_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_gray_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_gray_detail3.jpg',0,0,0,'2022-05-30 01:11:44.0',NULL,NULL,0),
|
||||||
|
(11,3,'#c8d6e5','클라우드 화이트','white','http://luckyphone.kr/all-pdData/slider/galaxy_s20_white_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_white_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_white_detail3.jpg',0,0,0,'2022-05-30 01:11:44.0',NULL,NULL,0),
|
||||||
|
(1,1,'#000000','블랙','black','http://luckyphone.kr/all-pdData/slider/s22_01.jpg','http://luckyphone.kr/all-pdData/slider/s22_02.jpg','http://luckyphone.kr/all-pdData/slider/s22_03.jpg',0,0,0,'2022-05-30 03:27:28.0',NULL,NULL,0),
|
||||||
|
(2,1,'#211e16','팬텀블랙','black','http://luckyphone.kr/all-pdData/slider/zflip3_black01.jpg','http://luckyphone.kr/all-pdData/slider/zflip3_black02.jpg','http://luckyphone.kr/all-pdData/slider/zflip3_black03.jpg',0,0,0,'2022-05-30 03:29:35.0',NULL,NULL,0),
|
||||||
|
(2,2,'#e3deca','크림','cream','http://luckyphone.kr/all-pdData/slider/zflip3_cream01.jpg','http://luckyphone.kr/all-pdData/slider/zflip3_cream02.jpg','http://luckyphone.kr/all-pdData/slider/zflip3_cream03.jpg',0,0,0,'2022-05-30 03:29:35.0',NULL,NULL,0),
|
||||||
|
(2,3,'#303d3c','그린','green','http://luckyphone.kr/all-pdData/slider/zflip3_green01.jpg','http://luckyphone.kr/all-pdData/slider/zflip3_green02.jpg','http://luckyphone.kr/all-pdData/slider/zflip3_green03.jpg',0,0,0,'2022-05-30 03:29:35.0',NULL,NULL,0),
|
||||||
|
(2,4,'#bfb1d2','라벤더','laven','http://luckyphone.kr/all-pdData/slider/zflip3_laven01.jpg','http://luckyphone.kr/all-pdData/slider/zflip3_laven02.jpg','http://luckyphone.kr/all-pdData/slider/zflip3_laven03.jpg',0,0,0,'2022-05-30 03:29:35.0',NULL,NULL,0),
|
||||||
|
(3,1,'#211e16','팬텀블랙','black','http://luckyphone.kr/all-pdData/slider/zfold3_black01.jpg','http://luckyphone.kr/all-pdData/slider/zfold3_black02.jpg','http://luckyphone.kr/all-pdData/slider/zfold3_black03.jpg',0,0,0,'2022-05-30 03:33:18.0',NULL,NULL,0),
|
||||||
|
(3,2,'#223631','팬텀그린','green','http://luckyphone.kr/all-pdData/slider/zfold3_green01.jpg','http://luckyphone.kr/all-pdData/slider/zfold3_green02.jpg','http://luckyphone.kr/all-pdData/slider/zfold3_green03.jpg',0,0,0,'2022-05-30 03:33:18.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_color (phone_id,sort,color,color_kr,color_en,front_img,side_img,back_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(3,3,'#cac5c2','팬텀실버','silver','http://luckyphone.kr/all-pdData/slider/zfold3_silver01.jpg','http://luckyphone.kr/all-pdData/slider/zfold3_silver02.jpg','http://luckyphone.kr/all-pdData/slider/zfold3_silver03.jpg',0,0,0,'2022-05-30 03:33:18.0',NULL,NULL,0),
|
||||||
|
(4,1,'#F1F2ED','실버','silver','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_silver1.jpg','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_silver2.jpg','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_silver3.jpg',0,0,0,'2022-05-30 03:37:14.0',NULL,NULL,0),
|
||||||
|
(4,2,'#FAE7CF','골드','gold','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_gold1.jpg','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_gold2.jpg','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_gold3.jpg',0,0,0,'2022-05-30 03:37:14.0',NULL,NULL,0),
|
||||||
|
(4,3,'#54524F','그레이','gray','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_gray1.jpg','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_gray2.jpg','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_gray3.jpg',0,0,0,'2022-05-30 03:37:14.0',NULL,NULL,0),
|
||||||
|
(4,4,'#A7C1D9','블루','blue','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_blue1.jpg','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_blue2.jpg','http://luckyphone.kr/all-pdData/slider/iphone13pro_max_blue3.jpg',0,0,0,'2022-05-30 03:37:14.0',NULL,NULL,0),
|
||||||
|
(5,1,'#A7C1D9','시에라 블루','blue','http://luckyphone.kr/all-pdData/slider/iphone13_pro_blue1.jpg','http://luckyphone.kr/all-pdData/slider/iphone13_pro_blue2.jpg','http://luckyphone.kr/all-pdData/slider/iphone13_pro_blue3.jpg',0,0,0,'2022-05-30 03:54:14.0',NULL,NULL,0),
|
||||||
|
(5,2,'#F1F2ED','실버','silver','http://luckyphone.kr/all-pdData/slider/iphone13_pro_silver1.jpg','http://luckyphone.kr/all-pdData/slider/iphone13_pro_silver2.jpg','http://luckyphone.kr/all-pdData/slider/iphone13_pro_silver3.jpg',0,0,0,'2022-05-30 03:54:15.0',NULL,NULL,0),
|
||||||
|
(5,3,'#FAE7CF','골드','gold','http://luckyphone.kr/all-pdData/slider/iphone13_pro_gold1.jpg','http://luckyphone.kr/all-pdData/slider/iphone13_pro_gold2.jpg','http://luckyphone.kr/all-pdData/slider/iphone13_pro_gold3.jpg',0,0,0,'2022-05-30 03:54:15.0',NULL,NULL,0),
|
||||||
|
(5,4,'#54524F','그래파이트','gray','http://luckyphone.kr/all-pdData/slider/iphone13_pro_gray1.jpg','http://luckyphone.kr/all-pdData/slider/iphone13_pro_gray2.jpg','http://luckyphone.kr/all-pdData/slider/iphone13_pro_gray3.jpg',0,0,0,'2022-05-30 03:54:15.0',NULL,NULL,0),
|
||||||
|
(6,1,'#FBE2DD','핑크','pink','http://luckyphone.kr/all-pdData/slider/iphone_mini_pink.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_pink2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_pink3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_color (phone_id,sort,color,color_kr,color_en,front_img,side_img,back_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(6,2,'#C72332','레드','red','http://luckyphone.kr/all-pdData/slider/iphone_mini_red.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_red2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_red3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0),
|
||||||
|
(6,3,'#447792','블루','blue','http://luckyphone.kr/all-pdData/slider/iphone_mini_blue.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_blue2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_blue3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0),
|
||||||
|
(6,4,'#42474D','미드라이트','midnight','http://luckyphone.kr/all-pdData/slider/iphone_mini_midnight.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_midnight2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_midnight3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0),
|
||||||
|
(6,5,'#fcefe5','스타라이트','starlight','http://luckyphone.kr/all-pdData/slider/iphone_mini_starlight.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_starlight2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_starlight3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0),
|
||||||
|
(7,1,'#FBE2DD','핑크','pink','http://luckyphone.kr/all-pdData/slider/iphone_mini_pink.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_pink2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_pink3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0),
|
||||||
|
(7,2,'#C72332','레드','red','http://luckyphone.kr/all-pdData/slider/iphone_mini_red.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_red2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_red3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0),
|
||||||
|
(7,3,'#447792','블루','blue','http://luckyphone.kr/all-pdData/slider/iphone_mini_blue.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_blue2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_blue3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0),
|
||||||
|
(7,4,'#42474D','미드라이트','midnight','http://luckyphone.kr/all-pdData/slider/iphone_mini_midnight.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_midnight2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_midnight3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0),
|
||||||
|
(7,5,'#fcefe5','스타라이트','starlight','http://luckyphone.kr/all-pdData/slider/iphone_mini_starlight.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_starlight2.jpg','http://luckyphone.kr/all-pdData/slider/iphone_mini_starlight3.jpg',0,0,0,'2022-05-30 03:58:16.0',NULL,NULL,0),
|
||||||
|
(8,1,'#545454','미스틱 그레이','gray','http://luckyphone.kr/all-pdData/slider/samsung-note205g-gwp-grey-1.jpg','http://luckyphone.kr/all-pdData/slider/samsung-note205g-grey-5.jpg','http://luckyphone.kr/all-pdData/slider/samsung-note205g-grey-2.jpg',0,0,0,'2022-05-30 04:03:10.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_color (phone_id,sort,color,color_kr,color_en,front_img,side_img,back_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(8,2,'#af7e75','미스틱 브론즈','bronze','http://luckyphone.kr/all-pdData/slider/samsung-note205g-gwp-grey-1.jpg','http://luckyphone.kr/all-pdData/slider/bronze3.jpg','http://luckyphone.kr/all-pdData/slider/bronze2.jpg',0,0,0,'2022-05-30 04:03:10.0',NULL,NULL,0),
|
||||||
|
(8,3,'#2a51d4','블루','blue','http://luckyphone.kr/all-pdData/slider/gallaxy_note20_blue1.jpg','http://luckyphone.kr/all-pdData/slider/gallaxy_note20_blue2.jpg','http://luckyphone.kr/all-pdData/slider/gallaxy_note20_blue3.jpg',0,0,0,'2022-05-30 04:03:10.0',NULL,NULL,0),
|
||||||
|
(8,4,'#e9bbc8','핑크','pink','http://luckyphone.kr/all-pdData/slider/gallaxy_note20_pink1.jpg','http://luckyphone.kr/all-pdData/slider/gallaxy_note20_pink2.jpg','http://luckyphone.kr/all-pdData/slider/gallaxy_note20_pink3.jpg',0,0,0,'2022-05-30 04:03:10.0',NULL,NULL,0),
|
||||||
|
(8,5,'#df1614','레드','red','http://luckyphone.kr/all-pdData/slider/gallaxy_note20_red1.jpg','http://luckyphone.kr/all-pdData/slider/gallaxy_note20_red2.jpg','http://luckyphone.kr/all-pdData/slider/gallaxy_note20_red3.jpg',0,0,0,'2022-05-30 04:03:10.0',NULL,NULL,0),
|
||||||
|
(10,1,'#010206','미러블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_z_flip_black_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_z_flip_black_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_z_flip_black_detail3.jpg',0,0,0,'2022-05-30 04:05:57.0',NULL,NULL,0),
|
||||||
|
(10,2,'#f368e0','미러퍼플','pupple','http://luckyphone.kr/all-pdData/slider/galaxy_z_flip_pupple_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_z_flip_pupple_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_z_flip_pupple_detail3.jpg',0,0,0,'2022-05-30 04:05:57.0',NULL,NULL,0),
|
||||||
|
(12,1,'#5352ed','아우라 블루','aurablue','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_aurablue_detail1_skt.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_aurablue_detail2_skt.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_aurablue_detail3_skt.jpg',0,0,0,'2022-05-30 04:05:57.0',NULL,NULL,0),
|
||||||
|
(12,2,'#e84118','아우라 레드','aurared','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_aurared_detail1_kt.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_aurared_detail2_kt.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_aurared_detail3_kt.jpg',0,0,0,'2022-05-30 04:05:57.0',NULL,NULL,0),
|
||||||
|
(12,3,'#00a8ff','클라우드 블루','cloudblue','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_cloudblue_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_cloudblue_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_cloudblue_detail3.jpg',0,0,0,'2022-05-30 04:05:57.0',NULL,NULL,0),
|
||||||
|
(12,4,'#718093','그레이','gray','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_gray_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_gray_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_gray_detail3.jpg',0,0,0,'2022-05-30 04:05:57.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_color (phone_id,sort,color,color_kr,color_en,front_img,side_img,back_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(12,5,'#dcdde1','화이트','white','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_white_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_white_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_plus_white_detail3.jpg',0,0,0,'2022-05-30 04:05:57.0',NULL,NULL,0),
|
||||||
|
(13,1,'#353b48','울트라 블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_s20_ultra_black_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_ultra_black_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s20_ultra_black_detail3.jpg',0,0,0,'2022-05-30 04:09:12.0',NULL,NULL,0),
|
||||||
|
(14,1,'#2f3640','프리즘 블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_s10_prism_black_detail1_QbIbYN6.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_prism_black_detail2_0jfwjZ0.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_prism_black_detail3_XrLWAnu.jpg',0,0,0,'2022-05-30 04:11:11.0',NULL,NULL,0),
|
||||||
|
(14,2,'#2ecc71','프리즘 그린','green','http://luckyphone.kr/all-pdData/slider/galaxy_s10_prism_green_detail1_MgHISpk.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_prism_green_detail2_jaA9jk7.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_prism_green_detail3_FdK5oVv.jpg',0,0,0,'2022-05-30 04:11:11.0',NULL,NULL,0),
|
||||||
|
(14,3,'#bdc3c7','프리즘 화이트','white','http://luckyphone.kr/all-pdData/slider/galaxy_s10_prism_white_detail1_avEYjJs.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_prism_white_detail2_ein66W6.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_prism_white_detail3_u12HqX1.jpg',0,0,0,'2022-05-30 04:11:11.0',NULL,NULL,0),
|
||||||
|
(15,1,'#2c3e50','세라믹 블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_s10plus_ceramic_black_detail1_PFgpvk0.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10plus_ceramic_black_detail2_a99p2Nk.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10plus_ceramic_black_detail3_1s41xb8.jpg',0,0,0,'2022-05-30 04:12:36.0',NULL,NULL,0),
|
||||||
|
(15,2,'#bdc3c7','세라믹 화이트','white','http://luckyphone.kr/all-pdData/slider/galaxy_s10plus_ceramic_white_detail1_s3UrXdL.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10plus_ceramic_white_detail2_kPM0sLX.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10plus_ceramic_white_detail3_KpRUi1K.jpg',0,0,0,'2022-05-30 04:12:36.0',NULL,NULL,0),
|
||||||
|
(16,1,'#2c3e50','프리즘 블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_s10e_prism_black_detail1_oePsLs3.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10e_prism_black_detail2_KZw3lnL.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10e_prism_black_detail3_e5RHgCr.jpg',0,0,0,'2022-05-30 04:14:19.0',NULL,NULL,0),
|
||||||
|
(16,2,'#b2bec3','프리즘 화이트','white','http://luckyphone.kr/all-pdData/slider/galaxy_s10e_prism_white_detail1_RfB01kN.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10e_prism_white_detail2_PhLmAPa.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10e_prism_white_detail3_PrxJhFr.jpg',0,0,0,'2022-05-30 04:14:19.0',NULL,NULL,0),
|
||||||
|
(16,3,'#fdcb6e','프리즘 엘로우','yellow','http://luckyphone.kr/all-pdData/slider/galaxy_s10e_yellow_detail1_06F9UcX.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10e_yellow_detail2_HpsSgT6.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10e_yellow_detail3_kGBncUc.jpg',0,0,0,'2022-05-30 04:14:19.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_color (phone_id,sort,color,color_kr,color_en,front_img,side_img,back_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(17,1,'#222f3e','블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_black_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_black_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_black_detail3.jpg',0,0,0,'2022-05-30 04:16:07.0',NULL,NULL,0),
|
||||||
|
(17,2,'#feca57','골드','gold','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_gold_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_gold_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_gold_detail3.jpg',0,0,0,'2022-05-30 04:16:07.0',NULL,NULL,0),
|
||||||
|
(17,3,'#c8d6e5','실버','sliver','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_silver_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_silver_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_silver_detail3.jpg',0,0,0,'2022-05-30 04:16:07.0',NULL,NULL,0),
|
||||||
|
(18,1,'#222f3e','블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_black_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_black_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_black_detail3.jpg',0,0,0,'2022-05-30 04:16:07.0',NULL,NULL,0),
|
||||||
|
(18,2,'#feca57','골드','gold','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_gold_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_gold_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_gold_detail3.jpg',0,0,0,'2022-05-30 04:16:07.0',NULL,NULL,0),
|
||||||
|
(18,3,'#c8d6e5','실버','sliver','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_silver_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_silver_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_s10_5g_silver_detail3.jpg',0,0,0,'2022-05-30 04:16:07.0',NULL,NULL,0),
|
||||||
|
(19,1,'#1e3799','블루','blue','http://luckyphone.kr/all-pdData/slider/galaxy_note10_blue_detail1_for_SKT.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_note10_blue_detail2_for_SKT.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_note10_blue_detail3_for_SKT.jpg',0,0,0,'2022-05-30 04:18:36.0',NULL,NULL,0),
|
||||||
|
(19,2,'#CAD3C8','글로우','glow','http://luckyphone.kr/all-pdData/slider/galaxy_note10_glow_detail2_1yaQnCj.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_note10_glow_detail3_R8yyMmD.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_note10_white_detail1_hWwfCbf.jpg',0,0,0,'2022-05-30 04:18:36.0',NULL,NULL,0),
|
||||||
|
(19,3,'#dcdde1','화이트','white','http://luckyphone.kr/all-pdData/slider/galaxy_note10_white_detail1_hWwfCbf.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_note10_white_detail2_D0L9eIr.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_note10_white_detail3_dB5K9sb.jpg',0,0,0,'2022-05-30 04:18:36.0',NULL,NULL,0),
|
||||||
|
(20,1,'#2f3640','블랙','black','http://luckyphone.kr/all-pdData/slider/iPhone11_black_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_black_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_black_detail3.jpg',0,0,0,'2022-05-30 04:21:49.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_color (phone_id,sort,color,color_kr,color_en,front_img,side_img,back_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(20,2,'#78e08f','그린','green','http://luckyphone.kr/all-pdData/slider/iPhone11_green_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_green_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_green_detail3.jpg',0,0,0,'2022-05-30 04:21:49.0',NULL,NULL,0),
|
||||||
|
(20,3,'#5f27cd','퍼플','pupple','http://luckyphone.kr/all-pdData/slider/iPhone11_purple_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_purple_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_purple_detail3.jpg',0,0,0,'2022-05-30 04:21:49.0',NULL,NULL,0),
|
||||||
|
(20,4,'#e84118','레드','red','http://luckyphone.kr/all-pdData/slider/iPhone11_red_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_red_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_red_detail3.jpg',0,0,0,'2022-05-30 04:21:49.0',NULL,NULL,0),
|
||||||
|
(20,5,'#dcdde1','화이트','white','http://luckyphone.kr/all-pdData/slider/iPhone11_white_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_white_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_white_detail3.jpg',0,0,0,'2022-05-30 04:21:49.0',NULL,NULL,0),
|
||||||
|
(20,6,'#fbc531','엘로우','yellow','http://luckyphone.kr/all-pdData/slider/iPhone11_yellow_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_yellow_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11_yellow_detail3.jpg',0,0,0,'2022-05-30 04:21:49.0',NULL,NULL,0),
|
||||||
|
(21,1,'#fbc531','골드','gold','http://luckyphone.kr/all-pdData/slider/iPhone11pro_gold_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11pro_gold_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11pro_gold_detail3.jpg',0,0,0,'2022-05-30 04:24:00.0',NULL,NULL,0),
|
||||||
|
(21,2,'#dcdde1','그레이','gray','http://luckyphone.kr/all-pdData/slider/iPhone11pro_gray_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11pro_gray_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11pro_gray_detail3.jpg',0,0,0,'2022-05-30 04:24:00.0',NULL,NULL,0),
|
||||||
|
(21,3,'#60a3bc','그린','green','http://luckyphone.kr/all-pdData/slider/iPhone11pro_green_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11pro_green_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11pro_green_detail3.jpg',0,0,0,'2022-05-30 04:24:00.0',NULL,NULL,0),
|
||||||
|
(21,4,'#c8d6e5','실버','sliver','http://luckyphone.kr/all-pdData/slider/iPhone11pro_silver_detail1.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11pro_silver_detail2.jpg','http://luckyphone.kr/all-pdData/slider/iPhone11pro_silver_detail3.jpg',0,0,0,'2022-05-30 04:24:00.0',NULL,NULL,0),
|
||||||
|
(22,1,'#222','블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_A50_black_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A50_black_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A50_black_detail3.jpg',0,0,0,'2022-05-30 04:25:49.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_color (phone_id,sort,color,color_kr,color_en,front_img,side_img,back_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(22,2,'#ff6b6b','코랄','coral','http://luckyphone.kr/all-pdData/slider/galaxy_A50_coral_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A50_coral_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A50_coral_detail3.jpg',0,0,0,'2022-05-30 04:25:49.0',NULL,NULL,0),
|
||||||
|
(22,3,'#c8d6e5','화이트','white','http://luckyphone.kr/all-pdData/slider/galaxy_A50_white_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A50_white_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A50_white_detail3.jpg',0,0,0,'2022-05-30 04:25:49.0',NULL,NULL,0),
|
||||||
|
(23,1,'#222f3e','블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_A40_black_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A40_black_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A40_black_detail3.jpg',0,0,0,'2022-05-30 04:28:43.0',NULL,NULL,0),
|
||||||
|
(23,2,'#54a0ff','블루','blue','http://luckyphone.kr/all-pdData/slider/galaxy_A40_blue_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A40_blue_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A40_blue_detail3.jpg',0,0,0,'2022-05-30 04:28:43.0',NULL,NULL,0),
|
||||||
|
(23,3,'#c8d6e5','화이트','white','http://luckyphone.kr/all-pdData/slider/galaxy_A40_white_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A40_white_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A40_white_detail3.jpg',0,0,0,'2022-05-30 04:28:43.0',NULL,NULL,0),
|
||||||
|
(24,1,'#222f3e','블랙','black','http://luckyphone.kr/all-pdData/slider/galaxy_A90_5G_black_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A90_5G_black_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A90_5G_black_detail3.jpg',0,0,0,'2022-05-30 04:28:43.0',NULL,NULL,0),
|
||||||
|
(24,2,'#c8d6e5','화이트','white','http://luckyphone.kr/all-pdData/slider/galaxy_A90_5G_white_detail1.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A90_5G_white_detail2.jpg','http://luckyphone.kr/all-pdData/slider/galaxy_A90_5G_white_detail3.jpg',0,0,0,'2022-05-30 04:28:43.0',NULL,NULL,0);
|
||||||
|
|
||||||
|
INSERT INTO phonessayo.phone_detail (phone_id,detail_pc_img,detail_mobile_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(1,'','',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(2,'','',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(3,'','',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(4,'','',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(5,'','',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(6,'','',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(7,'','',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(8,'','',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(10,'http://luckyphone.kr/all-pdData/a_pcDetail/spec_galaxy_a_flip.jpg','http://luckyphone.kr/all-pdData/b_mDetail/spec_mobil_galaxy_a_flip.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(11,'http://luckyphone.kr/all-pdData/a_pcDetail/s20_pd-detail1.jpg','http://luckyphone.kr/all-pdData/b_mDetail/s20_pd-detail2.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_detail (phone_id,detail_pc_img,detail_mobile_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(12,'http://luckyphone.kr/all-pdData/a_pcDetail/spec_pc_galaxy_S20_plus.jpg','http://luckyphone.kr/all-pdData/b_mDetail/spec_mobile_galaxy_S20_plus.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(13,'http://luckyphone.kr/all-pdData/a_pcDetail/1.galaxy_pc_s20_ultra.jpg','http://luckyphone.kr/all-pdData/b_mDetail/1.galaxy_mobile_s20_ultra.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(14,'http://luckyphone.kr/all-pdData/a_pcDetail/galaxy_s10_prism_pc.jpg','http://luckyphone.kr/all-pdData/b_mDetail/galaxy_s10_prism_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(15,'http://luckyphone.kr/all-pdData/a_pcDetail/1.galaxy_s10_pc.jpg','http://luckyphone.kr/all-pdData/b_mDetail/1.galaxy_s10_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(16,'http://luckyphone.kr/all-pdData/b_mDetail/1.galaxy_s10e_pc.jpg','http://luckyphone.kr/all-pdData/a_pcDetail/1.galaxy_s10e_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(17,'http://luckyphone.kr/all-pdData/a_pcDetail/1.galaxy_s10_5g_pc.jpg','http://luckyphone.kr/all-pdData/b_mDetail/1.galaxy_s10_5g_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(18,'http://luckyphone.kr/all-pdData/a_pcDetail/1.galaxy_s10_5g_pc.jpg','http://luckyphone.kr/all-pdData/b_mDetail/1.galaxy_s10_5g_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(19,'http://luckyphone.kr/all-pdData/a_pcDetail/1.galaxy_note10_5g_pc.jpg','http://luckyphone.kr/all-pdData/b_mDetail/1.galaxy_note10_5g_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(20,'http://luckyphone.kr/all-pdData/a_pcDetail/iPhone_11_pc_detail.jpg','http://luckyphone.kr/all-pdData/a_pcDetail/iPhone_11_pc_detail.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(21,'http://luckyphone.kr/all-pdData/a_pcDetail/iphone_11_Pro_pc.jpg','http://luckyphone.kr/all-pdData/b_mDetail/iphone_11_Pro_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_detail (phone_id,detail_pc_img,detail_mobile_img,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(22,'http://luckyphone.kr/all-pdData/a_pcDetail/galaxy_A50_pc.jpg','http://luckyphone.kr/all-pdData/b_mDetail/galaxy_A50_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(23,'http://luckyphone.kr/all-pdData/a_pcDetail/galaxy_A40_pc.jpg','http://luckyphone.kr/all-pdData/b_mDetail/galaxy_A40_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0),
|
||||||
|
(24,'http://luckyphone.kr/all-pdData/a_pcDetail/galaxy_A90_5G_pc.jpg','http://luckyphone.kr/all-pdData/b_mDetail/galaxy_A90_5G_mobile.jpg',0,0,0,'2022-05-29 22:47:28.0',NULL,NULL,0);
|
||||||
|
|
||||||
|
INSERT INTO phonessayo.phone_price (phone_id,storage,release_price,yogum,dc_yogum,dc_danmal,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(1,128,1199000,89000,480000,360000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(1,256,1300000,89000,480000,360000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(2,256,1254000,89000,534600,480000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(3,256,1998700,89000,480000,360000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(4,256,1474000,89000,360000,360000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(5,256,1342000,89000,360000,360000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(6,256,1078000,89000,360000,360000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(7,256,946000,89000,360000,360000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(8,256,1100000,89000,360000,360000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(10,128,999900,89000,600000,210000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_price (phone_id,storage,release_price,yogum,dc_yogum,dc_danmal,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(10,256,1496000,89000,600000,210000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(11,128,1248500,89000,780000,480000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(12,256,1353000,89000,780000,215000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(13,256,1595000,89000,780000,480000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(14,256,899800,89000,600000,452000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(14,512,998800,89000,600000,452000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(15,512,1196800,89000,600000,552000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(16,128,899800,89000,600000,452000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(17,256,998800,89000,780000,450000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(17,512,1031800,89000,780000,450000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_price (phone_id,storage,release_price,yogum,dc_yogum,dc_danmal,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(18,256,1248500,89000,780000,215000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(19,256,1397000,89000,780000,215000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(19,512,1496000,89000,780000,215000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(20,64,990000,89000,600000,121000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(20,128,1056000,89000,600000,121000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(20,256,1188000,89000,600000,121000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(21,64,1375000,89000,600000,121000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(21,256,1375000,89000,600000,121000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(21,512,1375000,89000,600000,121000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(22,64,429000,89000,600000,153000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0);
|
||||||
|
INSERT INTO phonessayo.phone_price (phone_id,storage,release_price,yogum,dc_yogum,dc_danmal,reg_uid,udt_uid,del_uid,reg_dt,udt_dt,del_dt,del_yn) VALUES
|
||||||
|
(23,64,399300,89000,120000,153000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0),
|
||||||
|
(24,128,699600,89000,780000,500000,0,0,0,'2022-05-30 04:57:51.0',NULL,NULL,0);
|
||||||
|
|
||||||
|
INSERT INTO phonessayo.`user` (phone,name,password,email,pwd_update_dt,phone2,last_login_dt,login_fail_count,reg_uid,reg_dt,udt_uid,udt_dt,del_uid,del_dt,del_yn) VALUES
|
||||||
|
('01084068282','한강욱','1','zxcxz2002@naver.com',NULL,NULL,NULL,0,NULL,'2022-05-27 13:15:00.0',NULL,'2022-05-27 13:15:00.0',NULL,NULL,0);
|
||||||
@@ -0,0 +1,430 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.4.3</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
<groupId>com.ns.mobile</groupId>
|
||||||
|
<artifactId>nsmobile-website</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<packaging>war</packaging>
|
||||||
|
<name>nsmovile-website</name>
|
||||||
|
<description>nsmobile project for Spring Boot</description>
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
<webapp.lib>${basedir}/src/main/webapp/WEB-INF/lib</webapp.lib>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jdbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-rest</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-integration</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.ulisesbocchio</groupId>
|
||||||
|
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||||
|
<version>3.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.integration/spring-integration-http -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.integration</groupId>
|
||||||
|
<artifactId>spring-integration-http</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.integration/spring-integration-jdbc -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.integration</groupId>
|
||||||
|
<artifactId>spring-integration-jdbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.integration/spring-integration-jpa -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.integration</groupId>
|
||||||
|
<artifactId>spring-integration-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.integration/spring-integration-mail -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.integration</groupId>
|
||||||
|
<artifactId>spring-integration-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.integration/spring-integration-security -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.integration</groupId>
|
||||||
|
<artifactId>spring-integration-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.thymeleaf.extras</groupId>
|
||||||
|
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mariadb.jdbc</groupId>
|
||||||
|
<artifactId>mariadb-java-client</artifactId>
|
||||||
|
<version>2.7.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bgee.log4jdbc-log4j2</groupId>
|
||||||
|
<artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
|
||||||
|
<version>1.16</version>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/ch.simas.qlrm/qlrm -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.simas.qlrm</groupId>
|
||||||
|
<artifactId>qlrm</artifactId>
|
||||||
|
<version>1.7.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jsoup</groupId>
|
||||||
|
<artifactId>jsoup</artifactId>
|
||||||
|
<version>1.13.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
<version>2.4.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.auth0/java-jwt -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.auth0</groupId>
|
||||||
|
<artifactId>java-jwt</artifactId>
|
||||||
|
<version>3.15.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-configuration-processor -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<version>2.4.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.github.mervick/aes-everywhere-java -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.mervick</groupId>
|
||||||
|
<artifactId>aes-everywhere-java</artifactId>
|
||||||
|
<version>1.2.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
<version>4.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
|
<version>2.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Pull in as a traditional dependency -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.konghq</groupId>
|
||||||
|
<artifactId>unirest-java</artifactId>
|
||||||
|
<version>3.11.09</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- jstl dependecy -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>jstl</artifactId>
|
||||||
|
<version>1.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>taglibs</groupId>
|
||||||
|
<artifactId>standard</artifactId>
|
||||||
|
<version>1.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-taglibs -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-taglibs</artifactId>
|
||||||
|
<version>5.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-taglibs -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-taglibs</artifactId>
|
||||||
|
<version>5.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 인증모듈 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.icert.comm</groupId>
|
||||||
|
<artifactId>secu</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/ICERTSecu_JDK18.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- DB Logback -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bgee.log4jdbc-log4j2</groupId>
|
||||||
|
<artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
|
||||||
|
<version>1.16</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin.external.google</groupId>
|
||||||
|
<artifactId>android-json</artifactId>
|
||||||
|
<version>0.0.20131108.vaadin1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/junit/junit -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.13.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.junit.vintage</groupId>
|
||||||
|
<artifactId>junit-vintage-engine</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- JSTL -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>jstl</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<groupId>nl.captcha</groupId>
|
||||||
|
<artifactId>captcha</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/simple-captcha-1.2.1.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- KT 캡챠 라이브러리 START -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.captcha</groupId>
|
||||||
|
<artifactId>botdetect</artifactId>
|
||||||
|
<version>4.0.beta3.2</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/botdetect-4.0.beta3.2.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.captcha</groupId>
|
||||||
|
<artifactId>botdetect-jsf12</artifactId>
|
||||||
|
<version>4.0.beta3.2</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/botdetect-jsf12-4.0.beta3.2.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.captcha</groupId>
|
||||||
|
<artifactId>botdetect-jsf20</artifactId>
|
||||||
|
<version>4.0.beta3.2</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/botdetect-jsf20-4.0.beta3.2.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.captcha</groupId>
|
||||||
|
<artifactId>botdetect-jsp20</artifactId>
|
||||||
|
<version>4.0.beta3.2</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/botdetect-jsp20-4.0.beta3.2.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.captcha</groupId>
|
||||||
|
<artifactId>botdetect-servlet</artifactId>
|
||||||
|
<version>4.0.beta3.2</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/botdetect-servlet-4.0.beta3.2.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
<!-- KT 캡챠 라이브러리 END -->
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
<version>1.3</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/commons-codec-1.3.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-lang</groupId>
|
||||||
|
<artifactId>commons-lang</artifactId>
|
||||||
|
<version>2.4</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/commons-lang-2.4.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>kr.co.smartro</groupId>
|
||||||
|
<artifactId>xpg_pay</artifactId>
|
||||||
|
<version>0.0.0.02</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/xpg_pay-0.0.0.02.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-httpclient</groupId>
|
||||||
|
<artifactId>commons-httpclient</artifactId>
|
||||||
|
<version>3.1</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${webapp.lib}/commons-httpclient-3.1.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.20</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-ooxml</artifactId>
|
||||||
|
<version>5.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.navercorp.lucy</groupId>
|
||||||
|
<artifactId>lucy-xss-servlet</artifactId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>nsmobile</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.ns.mobile.website;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||||
|
import org.springframework.retry.annotation.EnableRetry;
|
||||||
|
|
||||||
|
|
||||||
|
//@EnableScheduling
|
||||||
|
@EnableRetry
|
||||||
|
@EnableAspectJAutoProxy
|
||||||
|
@SpringBootApplication
|
||||||
|
public class LanEduWebsiteApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(LanEduWebsiteApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.ns.mobile.website.biz.component;
|
||||||
|
|
||||||
|
import javax.net.ssl.*;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.security.KeyStore;
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.security.cert.CertificateException;
|
||||||
|
|
||||||
|
public class SSLContextHelper {
|
||||||
|
|
||||||
|
private static final String KEY_STORE_TYPE="JKS";
|
||||||
|
private static final String CLASS_NAME=SSLContextHelper.class.getName();
|
||||||
|
private static final String TRANSPORT_SECURITY_PROTOCOL="TLS";
|
||||||
|
|
||||||
|
public static void enable(){
|
||||||
|
String keystoreType = "JKS";
|
||||||
|
InputStream keystoreLocation = null;
|
||||||
|
char [] keystorePassword = null;
|
||||||
|
char [] keyPassword = null;
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
KeyStore keystore = KeyStore.getInstance(keystoreType);
|
||||||
|
keystore.load(keystoreLocation, keystorePassword);
|
||||||
|
KeyManagerFactory kmfactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
|
||||||
|
kmfactory.init(keystore, keyPassword);
|
||||||
|
InputStream truststoreLocation = null;
|
||||||
|
char [] truststorePassword = null;
|
||||||
|
String truststoreType = KEY_STORE_TYPE;
|
||||||
|
|
||||||
|
KeyStore truststore = KeyStore.getInstance(truststoreType);
|
||||||
|
truststore.load(truststoreLocation, truststorePassword);
|
||||||
|
TrustManagerFactory tmfactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
||||||
|
|
||||||
|
KeyManager [] keymanagers = kmfactory.getKeyManagers();
|
||||||
|
TrustManager [] trustmanagers = tmfactory.getTrustManagers();
|
||||||
|
|
||||||
|
SSLContext sslContext = SSLContext.getInstance(TRANSPORT_SECURITY_PROTOCOL);
|
||||||
|
sslContext.init(keymanagers, trustmanagers, new SecureRandom());
|
||||||
|
SSLContext.setDefault(sslContext);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void disable() {
|
||||||
|
try {
|
||||||
|
SSLContext sslc = SSLContext.getInstance("TLS");
|
||||||
|
TrustManager[] trustManagerArray = { (TrustManager) new NullX509TrustManager() };
|
||||||
|
sslc.init(null, trustManagerArray, null);
|
||||||
|
HttpsURLConnection.setDefaultSSLSocketFactory(sslc.getSocketFactory());
|
||||||
|
HttpsURLConnection.setDefaultHostnameVerifier(new NullHostnameVerifier());
|
||||||
|
} catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class NullX509TrustManager implements X509TrustManager {
|
||||||
|
@Override
|
||||||
|
public void checkClientTrusted(java.security.cert.X509Certificate[] arg0, String arg1)
|
||||||
|
throws CertificateException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void checkServerTrusted(java.security.cert.X509Certificate[] arg0, String arg1)
|
||||||
|
throws CertificateException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class NullHostnameVerifier implements HostnameVerifier {
|
||||||
|
public boolean verify(String hostname, SSLSession session) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,278 @@
|
|||||||
|
package com.ns.mobile.website.biz.component;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.component.model.TimeConvertObj;
|
||||||
|
|
||||||
|
public class TimeConvertComponent {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
/* DateFormat format1 = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss");
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
cal.setTime(new Date());
|
||||||
|
Date time1 = cal.getTime();
|
||||||
|
cal.add(Calendar.DATE, 7);
|
||||||
|
Date time2 = cal.getTime();
|
||||||
|
|
||||||
|
TimeConvertObj time = TimeConvertComponent.setTimeForm(time1, time2);
|
||||||
|
|
||||||
|
//System.out.println(getTimestampToDayWeek(time.getUnixStartTime()));
|
||||||
|
|
||||||
|
long a = subTime(time.getUnixEndTime(), time.getUnixStartTime());
|
||||||
|
|
||||||
|
System.out.println(a);*/
|
||||||
|
|
||||||
|
int val = 10;
|
||||||
|
|
||||||
|
int tot = 13;
|
||||||
|
|
||||||
|
double rate = (double)((double)val/(double)tot) * 100;
|
||||||
|
|
||||||
|
DecimalFormat form = new DecimalFormat("0.##");
|
||||||
|
|
||||||
|
System.out.println(Math.round(rate));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long subTime(long endTimestamp, long startTimeStamp) {
|
||||||
|
|
||||||
|
long diffSec = (endTimestamp * 1000L - startTimeStamp * 1000L) / 1000;
|
||||||
|
long diffDays = diffSec / (60); //분
|
||||||
|
|
||||||
|
|
||||||
|
return diffDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long getRestTime(long timestamp) {
|
||||||
|
|
||||||
|
SimpleDateFormat f = new SimpleDateFormat("HH:mm:ss");
|
||||||
|
Date now = new Date();
|
||||||
|
Date start = new java.util.Date(timestamp*1000L);
|
||||||
|
long diff = start.getTime() - now.getTime();
|
||||||
|
long minute = diff / 60000;
|
||||||
|
|
||||||
|
return minute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, Long> reSettingDate(long startDate, long endDate, int repeatType) {
|
||||||
|
if(repeatType == 0) return null;
|
||||||
|
|
||||||
|
Map<String, Long> rtnDateMap = null;
|
||||||
|
Calendar now = Calendar.getInstance();
|
||||||
|
Calendar end = Calendar.getInstance();
|
||||||
|
end.setTime(new java.util.Date(endDate * 1000L));
|
||||||
|
|
||||||
|
if(end.getTimeInMillis() < now.getTimeInMillis()) {
|
||||||
|
Calendar start = Calendar.getInstance();
|
||||||
|
start.setTime(new java.util.Date(startDate * 1000L));
|
||||||
|
|
||||||
|
int diff = 1;
|
||||||
|
if(repeatType == 1) diff = 7;
|
||||||
|
|
||||||
|
start.add(Calendar.DATE, diff);
|
||||||
|
end.add(Calendar.DATE, diff);
|
||||||
|
|
||||||
|
long resultStartDate = start.getTimeInMillis() / 1000L;
|
||||||
|
long resultEndDate = end.getTimeInMillis() / 1000L;
|
||||||
|
|
||||||
|
rtnDateMap = new HashMap<>();
|
||||||
|
rtnDateMap.put("start", resultStartDate);
|
||||||
|
rtnDateMap.put("end", resultEndDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rtnDateMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimestampToDate(long timestamp){
|
||||||
|
Date date = new java.util.Date(timestamp*1000L);
|
||||||
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("MM월dd일");
|
||||||
|
sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT+9"));
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimestampToFullDate(long timestamp){
|
||||||
|
Date date = new java.util.Date(timestamp*1000L);
|
||||||
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT+9"));
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimestampToDateKor(long timestamp){
|
||||||
|
Date date = new java.util.Date(timestamp*1000L);
|
||||||
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("HH시mm분ss초");
|
||||||
|
sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT+9"));
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimestampToDayWeek(long timestamp){
|
||||||
|
Date date = new java.util.Date(timestamp*1000L);
|
||||||
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("E");
|
||||||
|
sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT+9"));
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimestampToTime12(long timestamp){
|
||||||
|
Date date = new java.util.Date(timestamp*1000L);
|
||||||
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("aa hh:mm");
|
||||||
|
sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT+9"));
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimestampToTime12Kor(long timestamp){
|
||||||
|
Date date = new java.util.Date(timestamp*1000L);
|
||||||
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("a hh:mm", Locale.KOREA);
|
||||||
|
sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT+9"));
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimestampToTime24(long timestamp){
|
||||||
|
Date date = new java.util.Date(timestamp*1000L);
|
||||||
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("HH:mm");
|
||||||
|
sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT+9"));
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimestampToMonthDay(long timestamp){
|
||||||
|
Date date = new java.util.Date(timestamp*1000L);
|
||||||
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("MM월dd일");
|
||||||
|
sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT+9"));
|
||||||
|
String formattedDate = sdf.format(date);
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean checkStr(String str, int type) {
|
||||||
|
//type 1 영어 2 숫자
|
||||||
|
boolean returnVal = false;
|
||||||
|
|
||||||
|
return returnVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TimeConvertObj setTimeForm(Date startTime, Date endTime) {
|
||||||
|
|
||||||
|
TimeConvertObj timeForm = null;
|
||||||
|
|
||||||
|
SimpleDateFormat sqlFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
Calendar start = Calendar.getInstance();
|
||||||
|
Calendar end = Calendar.getInstance();
|
||||||
|
|
||||||
|
start.setTime(startTime);
|
||||||
|
|
||||||
|
//start.add(Calendar.HOUR);
|
||||||
|
|
||||||
|
end.setTime(endTime);
|
||||||
|
|
||||||
|
//end.add(Calendar.HOUR, -9);
|
||||||
|
|
||||||
|
long startUnixForm = start.getTimeInMillis() / 1000L;
|
||||||
|
String startSqlForm = sqlFormat.format(start.getTime());
|
||||||
|
|
||||||
|
long endUnixForm = end.getTimeInMillis() / 1000L;
|
||||||
|
String endSqlForm = sqlFormat.format(end.getTime());
|
||||||
|
|
||||||
|
|
||||||
|
timeForm = TimeConvertObj.builder()
|
||||||
|
.sqlStartTime(startSqlForm)
|
||||||
|
.sqlEndTime(endSqlForm)
|
||||||
|
.unixStartTime(startUnixForm)
|
||||||
|
.unixEndTime(endUnixForm)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return timeForm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TimeConvertObj setTimeForm(Date endTime) {
|
||||||
|
|
||||||
|
TimeConvertObj timeForm = null;
|
||||||
|
|
||||||
|
SimpleDateFormat sqlFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
Calendar end = Calendar.getInstance();
|
||||||
|
|
||||||
|
//start.add(Calendar.HOUR);
|
||||||
|
|
||||||
|
end.setTime(endTime);
|
||||||
|
|
||||||
|
//end.add(Calendar.HOUR, -9);
|
||||||
|
|
||||||
|
long endUnixForm = end.getTimeInMillis() / 1000L;
|
||||||
|
String endSqlForm = sqlFormat.format(end.getTime());
|
||||||
|
|
||||||
|
timeForm = TimeConvertObj.builder()
|
||||||
|
.sqlEndTime(endSqlForm)
|
||||||
|
.unixEndTime(endUnixForm)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return timeForm;
|
||||||
|
}
|
||||||
|
public static TimeConvertObj getTimeForm(Date startTime, Date endTime) {
|
||||||
|
return getTimeForm(startTime, endTime, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TimeConvertObj getTimeForm(Date startTime, Date endTime, Date repeatTime) {
|
||||||
|
|
||||||
|
TimeConvertObj timeForm = null;
|
||||||
|
|
||||||
|
SimpleDateFormat sqlFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
Calendar start = Calendar.getInstance();
|
||||||
|
Calendar end = Calendar.getInstance();
|
||||||
|
Calendar repeatEndDate = Calendar.getInstance();
|
||||||
|
|
||||||
|
start.setTime(startTime);
|
||||||
|
|
||||||
|
//start.add(Calendar.HOUR, 9);
|
||||||
|
|
||||||
|
end.setTime(endTime);
|
||||||
|
|
||||||
|
//end.add(Calendar.HOUR, 9);
|
||||||
|
if(repeatTime == null) {
|
||||||
|
repeatEndDate.add(Calendar.MONTH, 6);
|
||||||
|
}else {
|
||||||
|
repeatEndDate.setTime(repeatTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
long startUnixForm = start.getTimeInMillis() / 1000L;
|
||||||
|
String startSqlForm = sqlFormat.format(start.getTime());
|
||||||
|
|
||||||
|
long endUnixForm = end.getTimeInMillis() / 1000L;
|
||||||
|
String endSqlForm = sqlFormat.format(end.getTime());
|
||||||
|
|
||||||
|
long repeatEndDateUnixForm = repeatEndDate.getTimeInMillis() / 1000L;
|
||||||
|
String repeatEndDateForm = sqlFormat.format(repeatEndDate.getTime());
|
||||||
|
|
||||||
|
timeForm = TimeConvertObj.builder()
|
||||||
|
.sqlStartTime(startSqlForm)
|
||||||
|
.sqlEndTime(endSqlForm)
|
||||||
|
.unixStartTime(startUnixForm)
|
||||||
|
.unixEndTime(endUnixForm)
|
||||||
|
.sqlRepeatEndDate(repeatEndDateForm)
|
||||||
|
.unixRepeatEndDate(repeatEndDateUnixForm)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return timeForm;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.ns.mobile.website.biz.component.model;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface ReqCommon {
|
||||||
|
|
||||||
|
Map<String, Object> getParameter();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.ns.mobile.website.biz.component.model;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ToString
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
public class ReqOrgRegister implements ReqCommon {
|
||||||
|
|
||||||
|
String bizId; //biz_id string 필수 조직 정보 ID
|
||||||
|
String ip; //Ip string 옵션 조직 생성 이후, 별도 정보 업데이트 가능, 복수로 설정 가능
|
||||||
|
String name; // name string 필수 조직 이름
|
||||||
|
String upperBizId; // upper_biz_id string 필수 하위 조직 생성 시, upper_biz_id (상휘 조직) 정보가 반드시 포함 됨. 상위 조직 정보가 없는 경우, 생성되지 않음
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getParameter() {
|
||||||
|
|
||||||
|
Map<String, Object> parameter = new HashMap<>();
|
||||||
|
parameter.put("biz_id", bizId);
|
||||||
|
parameter.put("name", name);
|
||||||
|
if (upperBizId != null) {
|
||||||
|
parameter.put("upper_biz_id" , upperBizId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parameter;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.ns.mobile.website.biz.component.model;
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Builder
|
||||||
|
@XmlRootElement(name = "root")
|
||||||
|
public class TimeConvertObj {
|
||||||
|
|
||||||
|
private String sqlStartTime;
|
||||||
|
private String sqlEndTime;
|
||||||
|
private long unixStartTime;
|
||||||
|
private long unixEndTime;
|
||||||
|
|
||||||
|
private String sqlRepeatEndDate;
|
||||||
|
private long unixRepeatEndDate;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.ns.mobile.website.biz.dto;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.BaseEntity;
|
||||||
|
import com.ns.mobile.website.common.util.DateUtils;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public abstract class BaseDto {
|
||||||
|
|
||||||
|
protected String sqlSelectType;
|
||||||
|
protected String sqlUpdateType;
|
||||||
|
|
||||||
|
@CreatedDate
|
||||||
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
|
@LastModifiedDate
|
||||||
|
private LocalDateTime udtDt;
|
||||||
|
|
||||||
|
private LocalDateTime delDt;
|
||||||
|
|
||||||
|
private long regUid;
|
||||||
|
private String regName;
|
||||||
|
private long udtUid;
|
||||||
|
private String udtName;
|
||||||
|
private long delUid;
|
||||||
|
private String delName;
|
||||||
|
private boolean delYn;
|
||||||
|
|
||||||
|
public void base(BaseEntity base) {
|
||||||
|
this.regDt = base.getRegDt();
|
||||||
|
this.regUid = base.getRegUid();
|
||||||
|
this.udtDt = base.getUdtDt();
|
||||||
|
this.udtUid = base.getUdtUid();
|
||||||
|
this.delDt = base.getDelDt();
|
||||||
|
this.delUid = base.getUdtUid();
|
||||||
|
this.delYn = base.isDelYn();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegDtText() {
|
||||||
|
return DateUtils.toDateString(regDt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegDtTimeText() {
|
||||||
|
return DateUtils.toDateString(regDt, DateUtils.FORMAT_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUdtDtText() {
|
||||||
|
return DateUtils.toDateString(udtDt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUdtDtTimeText() {
|
||||||
|
return DateUtils.toDateString(udtDt, DateUtils.FORMAT_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDelDtKorText() {
|
||||||
|
if(delDt!= null) {
|
||||||
|
return DateUtils.toDateString(delDt, DateUtils.FORMAT_YYYYMMDD_KOR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return DateUtils.toDateString(LocalDateTime.now(), DateUtils.FORMAT_YYYYMMDD_KOR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDelDtNextWeekText() {
|
||||||
|
if(delDt!= null) {
|
||||||
|
return DateUtils.toDateString(delDt.plusDays(7), DateUtils.FORMAT_YYYYMMDD_KOR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return DateUtils.toDateString(LocalDateTime.now(), DateUtils.FORMAT_YYYYMMDD_KOR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.ns.mobile.website.biz.dto;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.FileUpload;
|
||||||
|
import com.ns.mobile.website.biz.entity.Phone;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FileUploadDto extends BaseDto{
|
||||||
|
|
||||||
|
long id;
|
||||||
|
String saveFileName;
|
||||||
|
String originalFileName;
|
||||||
|
String fileExtension;
|
||||||
|
String localPath;
|
||||||
|
|
||||||
|
public static FileUploadDto of(FileUpload fileUpload) {
|
||||||
|
|
||||||
|
FileUploadDto fileUploadDto = FileUploadDto.builder()
|
||||||
|
.id(fileUpload.getId())
|
||||||
|
.saveFileName(fileUpload.getSaveFileName())
|
||||||
|
.originalFileName(fileUpload.getOriginalFileName())
|
||||||
|
.fileExtension(fileUpload.getFileExtension())
|
||||||
|
.localPath(fileUpload.getLocalPath())
|
||||||
|
.build();
|
||||||
|
fileUploadDto.base(fileUpload);
|
||||||
|
|
||||||
|
return fileUploadDto;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.ns.mobile.website.biz.dto;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.PhoneColor;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PhoneColorDto extends BaseDto{
|
||||||
|
long id;
|
||||||
|
long phoneId;
|
||||||
|
int sort;
|
||||||
|
String color;
|
||||||
|
String colorKr;
|
||||||
|
String colorEn;
|
||||||
|
String frontImg;
|
||||||
|
String sideImg;
|
||||||
|
String backImg;
|
||||||
|
|
||||||
|
public static PhoneColorDto of(PhoneColor phoneColor) {
|
||||||
|
|
||||||
|
PhoneColorDto phoneColorDto = PhoneColorDto.builder()
|
||||||
|
.id(phoneColor.getId())
|
||||||
|
.phoneId(phoneColor.getPhoneId())
|
||||||
|
.color(phoneColor.getColor())
|
||||||
|
.colorKr(phoneColor.getColorKr())
|
||||||
|
.colorEn(phoneColor.getColorEn())
|
||||||
|
.frontImg(phoneColor.getFrontImg())
|
||||||
|
.sideImg(phoneColor.getSideImg())
|
||||||
|
.backImg(phoneColor.getBackImg())
|
||||||
|
.build();
|
||||||
|
phoneColorDto.base(phoneColor);
|
||||||
|
|
||||||
|
return phoneColorDto;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.ns.mobile.website.biz.dto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.PhoneDetail;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PhoneDetailDto extends BaseDto{
|
||||||
|
long id;
|
||||||
|
PhoneDto phoneDto;
|
||||||
|
List<PhoneColorDto> phoneColorDtoList;
|
||||||
|
List<PhonePriceDto> phonePriceDtoList;
|
||||||
|
long phoneId;
|
||||||
|
String detailPcImg;
|
||||||
|
String detailMobileImg;
|
||||||
|
|
||||||
|
|
||||||
|
public static PhoneDetailDto of(PhoneDetail phoneDetail) {
|
||||||
|
|
||||||
|
PhoneDetailDto phoneDetailDto = PhoneDetailDto.builder()
|
||||||
|
.id(phoneDetail.getId())
|
||||||
|
.phoneId(phoneDetail.getPhoneId())
|
||||||
|
.detailPcImg(phoneDetail.getDetailPcImg())
|
||||||
|
.detailMobileImg(phoneDetail.getDetailMobileImg())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
phoneDetailDto.base(phoneDetail);
|
||||||
|
|
||||||
|
return phoneDetailDto;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.ns.mobile.website.biz.dto;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.Phone;
|
||||||
|
import com.ns.mobile.website.common.util.NumberUtils;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PhoneDto extends BaseDto{
|
||||||
|
long id;
|
||||||
|
String title;
|
||||||
|
String titleEn;
|
||||||
|
String subTitle;
|
||||||
|
String producer;
|
||||||
|
String phoneType;
|
||||||
|
String titleImg;
|
||||||
|
boolean mdPick;
|
||||||
|
boolean hot;
|
||||||
|
boolean kt;
|
||||||
|
boolean skt;
|
||||||
|
boolean lgu;
|
||||||
|
PhonePriceDto phonePriceDto;
|
||||||
|
|
||||||
|
public static PhoneDto of(Phone phone) {
|
||||||
|
|
||||||
|
PhoneDto phoneDto = PhoneDto.builder()
|
||||||
|
.id(phone.getId())
|
||||||
|
.title(phone.getTitle())
|
||||||
|
.titleEn(phone.getTitleEn())
|
||||||
|
.subTitle(phone.getSubTitle())
|
||||||
|
.producer(phone.getProducer())
|
||||||
|
.phoneType(phone.getPhoneType())
|
||||||
|
.titleImg(phone.getTitleImg())
|
||||||
|
.mdPick(phone.isMdPick())
|
||||||
|
.hot(phone.isHot())
|
||||||
|
.kt(phone.isKt())
|
||||||
|
.skt(phone.isSkt())
|
||||||
|
.lgu(phone.isLgu())
|
||||||
|
.build();
|
||||||
|
phoneDto.base(phone);
|
||||||
|
|
||||||
|
return phoneDto;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.ns.mobile.website.biz.dto;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.PhonePrice;
|
||||||
|
import com.ns.mobile.website.common.util.NumberUtils;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PhonePriceDto extends BaseDto{
|
||||||
|
long id;
|
||||||
|
long phoneId;
|
||||||
|
int storage;
|
||||||
|
long releasePrice;
|
||||||
|
long yogum;
|
||||||
|
long dcYogum;
|
||||||
|
long dcDanmal;
|
||||||
|
|
||||||
|
public String getReleasePriceTerminalAndCommunicationToComma() {
|
||||||
|
return NumberUtils.toComma((releasePrice/24)+(66750));
|
||||||
|
}
|
||||||
|
public String getReleasePriceTerminalToComma() {
|
||||||
|
return NumberUtils.toComma(releasePrice/24);
|
||||||
|
}
|
||||||
|
public String getReleasePriceToComma() {
|
||||||
|
return NumberUtils.toComma(releasePrice);
|
||||||
|
}
|
||||||
|
public String getStorageString() {
|
||||||
|
return Integer.toString(storage) + "GB";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PhonePriceDto of(PhonePrice phonePrice) {
|
||||||
|
|
||||||
|
PhonePriceDto phonePriceDto = PhonePriceDto.builder()
|
||||||
|
.id(phonePrice.getId())
|
||||||
|
.phoneId(phonePrice.getPhoneId())
|
||||||
|
.storage(phonePrice.getStorage())
|
||||||
|
.releasePrice(phonePrice.getReleasePrice())
|
||||||
|
.yogum(phonePrice.getYogum())
|
||||||
|
.dcYogum(phonePrice.getDcYogum())
|
||||||
|
.dcDanmal(phonePrice.getDcDanmal())
|
||||||
|
.build();
|
||||||
|
phonePriceDto.base(phonePrice);
|
||||||
|
|
||||||
|
return phonePriceDto;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.ns.mobile.website.biz.dto;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.Phone;
|
||||||
|
import com.ns.mobile.website.biz.entity.SellUser;
|
||||||
|
import com.ns.mobile.website.common.util.DateUtils;
|
||||||
|
import com.ns.mobile.website.common.util.NumberUtils;
|
||||||
|
import com.ns.mobile.website.common.util.PhoneUtils;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class SellUserDto extends BaseDto{
|
||||||
|
|
||||||
|
long id;
|
||||||
|
LocalDateTime openingDate;
|
||||||
|
String account;
|
||||||
|
String newsAgency;
|
||||||
|
String name;
|
||||||
|
String socialSecurityNumber;
|
||||||
|
String phoneNumber;
|
||||||
|
String customerType;
|
||||||
|
String legalRepresentativeName;
|
||||||
|
String legalRepresentativePhoneNumber;
|
||||||
|
int installmentMonth;
|
||||||
|
String petName;
|
||||||
|
String serialNumber;
|
||||||
|
String subscription;
|
||||||
|
long fileId;
|
||||||
|
|
||||||
|
public static SellUserDto of(SellUser sellUser) {
|
||||||
|
|
||||||
|
SellUserDto sellUserDto = SellUserDto.builder()
|
||||||
|
.id(sellUser.getId())
|
||||||
|
.openingDate(sellUser.getOpeningDate())
|
||||||
|
.account(sellUser.getAccount())
|
||||||
|
.newsAgency(sellUser.getNewsAgency())
|
||||||
|
.name(sellUser.getName())
|
||||||
|
.socialSecurityNumber(sellUser.getSocialSecurityNumber())
|
||||||
|
.phoneNumber(sellUser.getPhoneNumber())
|
||||||
|
.customerType(sellUser.getCustomerType())
|
||||||
|
.legalRepresentativeName(sellUser.getLegalRepresentativeName())
|
||||||
|
.legalRepresentativePhoneNumber(sellUser.getLegalRepresentativePhoneNumber())
|
||||||
|
.installmentMonth(sellUser.getInstallmentMonth())
|
||||||
|
.petName(sellUser.getPetName())
|
||||||
|
.serialNumber(sellUser.getSerialNumber())
|
||||||
|
.subscription(sellUser.getSubscription())
|
||||||
|
.fileId(sellUser.getFileId())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
sellUserDto.base(sellUser);
|
||||||
|
|
||||||
|
return sellUserDto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpeningDateKor() {
|
||||||
|
return DateUtils.toDateString(openingDate, DateUtils.FORMAT_YYYYMMDD_KOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhoneNumberText() {
|
||||||
|
return PhoneUtils.toString(phoneNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLegalRepresentativePhoneNumberText() {
|
||||||
|
return PhoneUtils.toString(legalRepresentativePhoneNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.ns.mobile.website.biz.entity;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.hibernate.annotations.CreationTimestamp;
|
||||||
|
import org.hibernate.annotations.UpdateTimestamp;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@MappedSuperclass
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public abstract class BaseEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
@CreationTimestamp
|
||||||
|
@Column
|
||||||
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
|
@UpdateTimestamp
|
||||||
|
@Column
|
||||||
|
private LocalDateTime udtDt;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
private LocalDateTime delDt;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
private long regUid;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
private long udtUid;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
private long delUid;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
private boolean delYn;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ns.mobile.website.biz.entity;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class FileUpload extends BaseEntity {
|
||||||
|
|
||||||
|
long id;
|
||||||
|
String saveFileName;
|
||||||
|
String originalFileName;
|
||||||
|
String fileExtension;
|
||||||
|
String localPath;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.ns.mobile.website.biz.entity;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Phone extends BaseEntity{
|
||||||
|
long id;
|
||||||
|
String title;
|
||||||
|
String titleEn;
|
||||||
|
String subTitle;
|
||||||
|
String producer;
|
||||||
|
String phoneType;
|
||||||
|
String titleImg;
|
||||||
|
boolean mdPick;
|
||||||
|
boolean hot;
|
||||||
|
boolean kt;
|
||||||
|
boolean skt;
|
||||||
|
boolean lgu;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.ns.mobile.website.biz.entity;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PhoneColor extends BaseEntity{
|
||||||
|
long id;
|
||||||
|
long phoneId;
|
||||||
|
int sort;
|
||||||
|
String color;
|
||||||
|
String colorKr;
|
||||||
|
String colorEn;
|
||||||
|
String frontImg;
|
||||||
|
String sideImg;
|
||||||
|
String backImg;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.ns.mobile.website.biz.entity;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PhoneDetail extends BaseEntity{
|
||||||
|
long id;
|
||||||
|
long phoneId;
|
||||||
|
String detailPcImg;
|
||||||
|
String detailMobileImg;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ns.mobile.website.biz.entity;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PhonePrice extends BaseEntity{
|
||||||
|
long id;
|
||||||
|
long phoneId;
|
||||||
|
int storage;
|
||||||
|
long releasePrice;
|
||||||
|
long yogum;
|
||||||
|
long dcYogum;
|
||||||
|
long dcDanmal;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.ns.mobile.website.biz.entity;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SellUser extends BaseEntity{
|
||||||
|
long id;
|
||||||
|
LocalDateTime openingDate;
|
||||||
|
String account;
|
||||||
|
String newsAgency;
|
||||||
|
String name;
|
||||||
|
String socialSecurityNumber;
|
||||||
|
String phoneNumber;
|
||||||
|
String customerType;
|
||||||
|
String legalRepresentativeName;
|
||||||
|
String legalRepresentativePhoneNumber;
|
||||||
|
int installmentMonth;
|
||||||
|
String petName;
|
||||||
|
String serialNumber;
|
||||||
|
String subscription;
|
||||||
|
long fileId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
public class BizApiException extends CommonException {
|
||||||
|
|
||||||
|
public BizApiException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
public class BizException extends CommonException {
|
||||||
|
|
||||||
|
public BizException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
public class CommonException extends RuntimeException {
|
||||||
|
|
||||||
|
public static final String MSG_NOT_FOUND_PAGE = "페이지 정보가 존재하지 않습니다.";
|
||||||
|
public static final String MSG_NOT_LOGIN = "로그인 후 이용해 주세요.";
|
||||||
|
public static final String MSG_NOT_CONTENTS = "요청하신 내용이 존재하지 않습니다.";
|
||||||
|
public static final String MSG_MISS_INPUT_PARAMETER = "입력정보가 정확하지 않습니다.";
|
||||||
|
|
||||||
|
public static final String MSG_DB_COMMON_ERROR = "데이터 처리중 문제가 발생하였습니다.";
|
||||||
|
|
||||||
|
public static final String MSG_BBS_INVALID_BOARD_TYPE = "게시판 정보가 정확하지 않습니다.";
|
||||||
|
|
||||||
|
public static final String MSG_NOT_SELECTED_CAFE = "조직이 선택되지 않았습니다. 조직 선택 후 이용해 주세요.";
|
||||||
|
|
||||||
|
public static final String MSG_TEMPORARY_ERROR = "일시적인 오류가 발생했습니다. 잠시 후 다시 이용해 주세요.";
|
||||||
|
|
||||||
|
public static final String MSG_NOT_AUTH_ERROR = "이용 권한이 없습니다.";
|
||||||
|
|
||||||
|
public static final String MSG_DUBPLICATE_LOGIN = "동일한 사용자 계정으로 중복 로그인되어 자동 로그아웃 처리 되었습니다.";
|
||||||
|
|
||||||
|
public static final String MSG_KT_UNAUTHORIZED_ERROR = "토큰생성 중 일시적인 오류가 발생했습니다. 잠시 후 다시 이용해 주세요.";
|
||||||
|
|
||||||
|
public CommonException() {
|
||||||
|
super(MSG_NOT_LOGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommonException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
public class DuplicateLoginException extends CommonException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1609054675554685549L;
|
||||||
|
|
||||||
|
public DuplicateLoginException() {
|
||||||
|
super(MSG_NOT_LOGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DuplicateLoginException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
import org.springframework.security.core.AuthenticationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 로그인 실패 관련 예외
|
||||||
|
*/
|
||||||
|
public class LoginFailException extends AuthenticationException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4359790706288929704L;
|
||||||
|
|
||||||
|
private LoginFailMessage loginFailMessage;
|
||||||
|
|
||||||
|
public LoginFailException(LoginFailMessage loginFailMessage) {
|
||||||
|
super(loginFailMessage.getMessage());
|
||||||
|
this.loginFailMessage = loginFailMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginFailMessage getLoginFailMessage() {
|
||||||
|
return loginFailMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginFailMessage(LoginFailMessage loginFailMessage) {
|
||||||
|
this.loginFailMessage = loginFailMessage;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 로그인 실패 관련 메세지
|
||||||
|
*/
|
||||||
|
public enum LoginFailMessage {
|
||||||
|
|
||||||
|
USER_NOT_FOUND("아이디 또는 비밀번호가 정확하지 않습니다."),
|
||||||
|
USER_USING_STOP("이용이 중지된 회원입니다.");
|
||||||
|
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
LoginFailMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
|
||||||
|
public class NoExistsBizException extends CommonException {
|
||||||
|
|
||||||
|
public NoExistsBizException() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoExistsBizException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
public class NotAuthException extends BizException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 6890799958690708246L;
|
||||||
|
|
||||||
|
public NotAuthException() {
|
||||||
|
super(MSG_NOT_AUTH_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NotAuthException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
public class NotLoginException extends CommonException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1609054675554685549L;
|
||||||
|
|
||||||
|
public NotLoginException() {
|
||||||
|
super(MSG_NOT_LOGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NotLoginException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ns.mobile.website.biz.exception;
|
||||||
|
|
||||||
|
public class NotSelectedCafeException extends CommonException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1609054675554685549L;
|
||||||
|
|
||||||
|
public NotSelectedCafeException() {
|
||||||
|
super(MSG_NOT_LOGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NotSelectedCafeException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.ns.mobile.website.biz.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
public class ResponseData {
|
||||||
|
|
||||||
|
private ResponseDataHeader header;
|
||||||
|
private Object body;
|
||||||
|
|
||||||
|
public static ResponseData fail(String message) {
|
||||||
|
return fail(message, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseData fail(String message, Object body) {
|
||||||
|
return ResponseData.builder()
|
||||||
|
.header(ResponseDataHeader.builder().result(false).message(message).build())
|
||||||
|
.body(body)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseData fail(String errCode, String message, Object body) {
|
||||||
|
return ResponseData.builder()
|
||||||
|
.header(ResponseDataHeader.builder().result(false).errCode(errCode).message(message).build())
|
||||||
|
.body(body)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseData success() {
|
||||||
|
return success(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseData success(Object body) {
|
||||||
|
return ResponseData.builder()
|
||||||
|
.header(ResponseDataHeader.builder().result(true).message("").build())
|
||||||
|
.body(body)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseData success(String errCode, String message, Object body) {
|
||||||
|
return ResponseData.builder()
|
||||||
|
.header(ResponseDataHeader.builder().result(true).errCode(errCode).message(message).build())
|
||||||
|
.body(body)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.ns.mobile.website.biz.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ResponseDataHeader {
|
||||||
|
|
||||||
|
private boolean result;
|
||||||
|
private String errCode;
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.ns.mobile.website.biz.model;
|
||||||
|
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import com.ns.mobile.website.biz.dto.BaseDto;
|
||||||
|
|
||||||
|
public class ResponseResult {
|
||||||
|
|
||||||
|
public static ResponseEntity<?> result(ServiceResult<? extends BaseDto> result) {
|
||||||
|
|
||||||
|
if (result.isResult()) {
|
||||||
|
return success(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
//return ResponseEntity.badRequest().body(ResponseData.fail(result.getMessage()));
|
||||||
|
return ResponseEntity.ok().body(ResponseData.fail(result.getMessage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseEntity<?> success() {
|
||||||
|
return success(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseEntity<?> success(Object body) {
|
||||||
|
return ResponseEntity.ok().body(ResponseData.success(body));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseEntity<?> success(String errCode, String message, Object data){
|
||||||
|
return ResponseEntity.ok().body(ResponseData.success(errCode, message, data));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseEntity<?> fail(String message){
|
||||||
|
return ResponseEntity.ok().body(ResponseData.fail(message));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseEntity<?> fail(String errCode, String message){
|
||||||
|
return ResponseEntity.ok().body(ResponseData.fail(errCode, message, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResponseEntity<?> fail(String errCode, String message, Object data){
|
||||||
|
return ResponseEntity.ok().body(ResponseData.fail(errCode, message, data));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ns.mobile.website.biz.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SearchData {
|
||||||
|
String type;
|
||||||
|
String text;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.ns.mobile.website.biz.model;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.dto.BaseDto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
public class ServiceResult<T extends BaseDto> {
|
||||||
|
|
||||||
|
private boolean result;
|
||||||
|
private String message;
|
||||||
|
private T detail;
|
||||||
|
private List<T> list;
|
||||||
|
|
||||||
|
public ServiceResult() {
|
||||||
|
this.result = true;
|
||||||
|
this.message = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceResult(boolean result, String message) {
|
||||||
|
this.result = result;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceResult(T detail) {
|
||||||
|
this.result = true;
|
||||||
|
this.message = "";
|
||||||
|
this.detail = detail;
|
||||||
|
this.list = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceResult(List<T> list) {
|
||||||
|
this.result = true;
|
||||||
|
this.message = "";
|
||||||
|
this.detail = null;
|
||||||
|
this.list = list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFail() {
|
||||||
|
return !result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <S extends BaseDto> ServiceResult<S> success() {
|
||||||
|
return new ServiceResult<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <S extends BaseDto> ServiceResult<S> success(S obj) {
|
||||||
|
return new ServiceResult<>(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <S extends BaseDto> ServiceResult<S> success(List<S> objList) {
|
||||||
|
return new ServiceResult<>(objList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <S extends BaseDto> ServiceResult<S> fail(String message) {
|
||||||
|
return new ServiceResult<>(false, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.ns.mobile.website.biz.model;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.FileUpload;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UploadFileModel {
|
||||||
|
|
||||||
|
long id;
|
||||||
|
long length;
|
||||||
|
String originalFileName;
|
||||||
|
String fileExtension;
|
||||||
|
String saveFileName;
|
||||||
|
String uploadUrl;
|
||||||
|
String localPath;
|
||||||
|
String uuid;
|
||||||
|
|
||||||
|
boolean result;
|
||||||
|
String message;
|
||||||
|
|
||||||
|
public static UploadFileModel fail(String message) {
|
||||||
|
return UploadFileModel.builder().result(false).message(message).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FileUpload of(UploadFileModel uploadFileModel) {
|
||||||
|
|
||||||
|
return FileUpload.builder()
|
||||||
|
.originalFileName(uploadFileModel.getOriginalFileName())
|
||||||
|
.fileExtension(uploadFileModel.getFileExtension())
|
||||||
|
.saveFileName(uploadFileModel.getSaveFileName())
|
||||||
|
.localPath(uploadFileModel.getLocalPath())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ns.mobile.website.biz.properties;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties("file-url")
|
||||||
|
@ToString
|
||||||
|
@Data
|
||||||
|
public class FileUrlProperties {
|
||||||
|
private String baseUploadLocation;
|
||||||
|
private String uploadPath;
|
||||||
|
private String cmsUploadLocation;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ns.mobile.website.biz.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.dto.FileUploadDto;
|
||||||
|
import com.ns.mobile.website.biz.entity.FileUpload;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface FileUploadRepository extends JpaRepository<FileUpload, Long> {
|
||||||
|
Optional<List<FileUploadDto>> findByDelYn(boolean delYn);
|
||||||
|
List<FileUploadDto> findByDelYnOrderByIdDesc(boolean delYn);
|
||||||
|
@Transactional
|
||||||
|
@Modifying
|
||||||
|
@Query(value = "UPDATE file_upload SET del_yn = 1 WHERE id = :id", nativeQuery = true)
|
||||||
|
int updateDelYn(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ns.mobile.website.biz.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.PhoneColor;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface PhoneColorRepository extends JpaRepository<PhoneColor, Long> {
|
||||||
|
Optional<List<PhoneColor>> findByPhoneIdAndDelYnOrderBySort(long phoneId, boolean delYn);
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ns.mobile.website.biz.repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.PhoneDetail;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface PhoneDetailRepository extends JpaRepository<PhoneDetail, Long> {
|
||||||
|
Optional<PhoneDetail> findByPhoneIdAndDelYn(long phoneId, boolean delYn);
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ns.mobile.website.biz.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.PhonePrice;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface PhonePriceRepository extends JpaRepository<PhonePrice, Long> {
|
||||||
|
Optional<List<PhonePrice>> findByPhoneIdAndDelYn(long phoneId, boolean delYn);
|
||||||
|
Optional<PhonePrice> findTop1ByPhoneIdAndDelYnOrderByReleasePrice(long phoneId, boolean delYn);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ns.mobile.website.biz.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.Phone;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface PhoneRepository extends JpaRepository<Phone, Long> {
|
||||||
|
Optional<Phone> findByIdAndDelYn(long id, boolean delYn);
|
||||||
|
Optional<List<Phone>> findByDelYn(boolean delYn);
|
||||||
|
Optional<List<Phone>> findByProducerAndDelYn(String producer, boolean delYn);
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.ns.mobile.website.biz.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.SellUser;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SellUserRepository extends JpaRepository<SellUser, Long> {
|
||||||
|
Optional<List<SellUser>> findByDelYn(boolean delYn);
|
||||||
|
Optional<List<SellUser>> findByAccountContainsAndDelYn(String account, boolean delYn);
|
||||||
|
Optional<List<SellUser>> findByNewsAgencyContainsAndDelYn(String newsAgency, boolean delYn);
|
||||||
|
Optional<List<SellUser>> findByNameContainsAndDelYn(String name, boolean delYn);
|
||||||
|
Optional<List<SellUser>> findByPhoneNumberContainsAndDelYn(String phoneNumber, boolean delYn);
|
||||||
|
Optional<List<SellUser>> findByCustomerTypeContainsAndDelYn(String customerType, boolean delYn);
|
||||||
|
Optional<List<SellUser>> findByPetNameContainsAndDelYn(String petName, boolean delYn);
|
||||||
|
Optional<List<SellUser>> findBySerialNumberContainsAndDelYn(String serialNumber, boolean delYn);
|
||||||
|
|
||||||
|
@Query(value = "select * from sell_user "
|
||||||
|
+ "where (account like concat('%',:account,'%') "
|
||||||
|
+ "or news_agency like concat('%',:newsAgency,'%') "
|
||||||
|
+ "or name like concat('%',:name,'%') "
|
||||||
|
+ "or phone_number like concat('%',:phoneNumber,'%') "
|
||||||
|
+ "or customer_type like concat('%',:customerType,'%') "
|
||||||
|
+ "or pet_name like concat('%',:petName,'%') "
|
||||||
|
+ "or serial_number like concat('%',:serialNumber,'%')) "
|
||||||
|
+ "and del_yn = :delYn", nativeQuery = true)
|
||||||
|
Optional<List<SellUser>> findByAccountContainsOrNewsAgencyContainsOrNameContainsOrPhoneNumberContainsOrCustomerTypeContainsOrPetNameContainsOrSerialNumberContainsAndDelYn(String account, String newsAgency, String name, String phoneNumber, String customerType, String petName, String serialNumber, boolean delYn);
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Modifying
|
||||||
|
@Query(value = "UPDATE sell_user SET del_yn = 1 WHERE file_id = :id", nativeQuery = true)
|
||||||
|
int updateDelYn(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.ns.mobile.website.biz.service;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.FileUpload;
|
||||||
|
import com.ns.mobile.website.biz.model.UploadFileModel;
|
||||||
|
import com.ns.mobile.website.biz.properties.FileUrlProperties;
|
||||||
|
import com.ns.mobile.website.common.util.DateUtils;
|
||||||
|
import com.ns.mobile.website.common.util.FileUtils;
|
||||||
|
import com.ns.mobile.website.common.util.StringUtils;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class FileService {
|
||||||
|
|
||||||
|
private final FileUrlProperties fileUrlProperties;
|
||||||
|
|
||||||
|
public UploadFileModel upload(MultipartFile file) {
|
||||||
|
|
||||||
|
if (file == null) {
|
||||||
|
return UploadFileModel.fail("파일 정보가 존재하지 않습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
UploadFileModel uploadFileModel = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
uploadFileModel = this._upload(file);
|
||||||
|
if (uploadFileModel == null || uploadFileModel.getSaveFileName().isEmpty()) {
|
||||||
|
return UploadFileModel.fail("파일 정보가 존재하지 않습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
return UploadFileModel.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
String uuid = StringUtils.getUuid();
|
||||||
|
uploadFileModel.setUuid(uuid);
|
||||||
|
|
||||||
|
FileUpload hireUploadFile = UploadFileModel.of(uploadFileModel);
|
||||||
|
|
||||||
|
uploadFileModel.setResult(true);
|
||||||
|
uploadFileModel.setId(hireUploadFile.getId());
|
||||||
|
|
||||||
|
return uploadFileModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSaveLocalPath(String baseUploadLocation, String saveFilename) {
|
||||||
|
String currentYear = DateUtils.getCurrentYear();
|
||||||
|
String currentMonth = DateUtils.getCurrentMonth();
|
||||||
|
|
||||||
|
return String.format("%s/%s/%s/%s", baseUploadLocation, currentYear, currentMonth, saveFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getUploadPath(String uploadPath, String saveFilename) {
|
||||||
|
String currentYear = DateUtils.getCurrentYear();
|
||||||
|
String currentMonth = DateUtils.getCurrentMonth();
|
||||||
|
|
||||||
|
return String.format("%s/%s/%s/%s", uploadPath, currentYear, currentMonth, saveFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
private UploadFileModel _upload(MultipartFile multipartFile) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
FileUtils.createUploadPath(fileUrlProperties.getBaseUploadLocation());
|
||||||
|
|
||||||
|
long length = multipartFile.getSize();
|
||||||
|
String originalFilename = multipartFile.getOriginalFilename();
|
||||||
|
String fileExtension = FileUtils.getFileExtension(originalFilename).toLowerCase();
|
||||||
|
String saveFilename = String.format("%s.%s", StringUtils.getUuid(), fileExtension);
|
||||||
|
String localPath = getSaveLocalPath(fileUrlProperties.getBaseUploadLocation(), saveFilename);
|
||||||
|
String uploadUrl = getUploadPath(fileUrlProperties.getUploadPath(), saveFilename);
|
||||||
|
|
||||||
|
File file = new File(localPath);
|
||||||
|
FileCopyUtils.copy(multipartFile.getInputStream(), new FileOutputStream(file));
|
||||||
|
|
||||||
|
file.setExecutable(true, false);
|
||||||
|
file.setReadable(true, false);
|
||||||
|
file.setWritable(true, false);
|
||||||
|
|
||||||
|
return UploadFileModel.builder()
|
||||||
|
.length(length)
|
||||||
|
.originalFileName(originalFilename)
|
||||||
|
.fileExtension(fileExtension)
|
||||||
|
.saveFileName(saveFilename)
|
||||||
|
.uploadUrl(uploadUrl)
|
||||||
|
.localPath(localPath)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("error", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ns.mobile.website.biz.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.dto.PhoneDetailDto;
|
||||||
|
import com.ns.mobile.website.biz.dto.PhoneDto;
|
||||||
|
import com.ns.mobile.website.biz.entity.Phone;
|
||||||
|
|
||||||
|
public interface PhoneService {
|
||||||
|
List<PhoneDto> selectList(Phone parameter);
|
||||||
|
|
||||||
|
PhoneDetailDto select(Phone parameter);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ns.mobile.website.biz.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.dto.FileUploadDto;
|
||||||
|
import com.ns.mobile.website.biz.dto.SellUserDto;
|
||||||
|
import com.ns.mobile.website.biz.entity.FileUpload;
|
||||||
|
import com.ns.mobile.website.biz.entity.SellUser;
|
||||||
|
import com.ns.mobile.website.biz.model.SearchData;
|
||||||
|
|
||||||
|
public interface SellService {
|
||||||
|
List<SellUserDto> selectList(SearchData parameter);
|
||||||
|
List<FileUploadDto> selectAddList(SearchData parameter);
|
||||||
|
boolean saveList(FileUpload fileUpload, List<SellUser> list);
|
||||||
|
boolean delFileUpload(FileUpload fileUpload);
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
package com.ns.mobile.website.biz.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.dto.PhoneColorDto;
|
||||||
|
import com.ns.mobile.website.biz.dto.PhoneDetailDto;
|
||||||
|
import com.ns.mobile.website.biz.dto.PhoneDto;
|
||||||
|
import com.ns.mobile.website.biz.dto.PhonePriceDto;
|
||||||
|
import com.ns.mobile.website.biz.entity.Phone;
|
||||||
|
import com.ns.mobile.website.biz.entity.PhoneColor;
|
||||||
|
import com.ns.mobile.website.biz.entity.PhoneDetail;
|
||||||
|
import com.ns.mobile.website.biz.entity.PhonePrice;
|
||||||
|
import com.ns.mobile.website.biz.exception.BizException;
|
||||||
|
import com.ns.mobile.website.biz.repository.PhoneColorRepository;
|
||||||
|
import com.ns.mobile.website.biz.repository.PhoneDetailRepository;
|
||||||
|
import com.ns.mobile.website.biz.repository.PhonePriceRepository;
|
||||||
|
import com.ns.mobile.website.biz.repository.PhoneRepository;
|
||||||
|
import com.ns.mobile.website.biz.service.PhoneService;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import util.SU;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class PhoneServiceImpl implements PhoneService{
|
||||||
|
|
||||||
|
private final PhoneRepository phoneRepository;
|
||||||
|
private final PhoneDetailRepository phoneDetailRepository;
|
||||||
|
private final PhoneColorRepository phoneColorRepository;
|
||||||
|
private final PhonePriceRepository phonePriceRepository;
|
||||||
|
@Override
|
||||||
|
public List<PhoneDto> selectList(Phone parameter) {
|
||||||
|
List<Phone> phoneList = null;
|
||||||
|
if(SU.emt(parameter.getProducer())) {
|
||||||
|
phoneList = phoneRepository.findByDelYn(false).orElseThrow(()-> new BizException(""));
|
||||||
|
}else {
|
||||||
|
phoneList = phoneRepository.findByProducerAndDelYn(parameter.getProducer(),false).orElseThrow(()-> new BizException(""));
|
||||||
|
}
|
||||||
|
List<PhoneDto> resultList = new ArrayList<PhoneDto>();
|
||||||
|
for(Phone e : phoneList) {
|
||||||
|
PhoneDto temp = PhoneDto.of(e);
|
||||||
|
temp.setPhonePriceDto(PhonePriceDto.of(phonePriceRepository.findTop1ByPhoneIdAndDelYnOrderByReleasePrice(e.getId(), false).orElseThrow(()-> new BizException(""))));
|
||||||
|
resultList.add(temp);
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PhoneDetailDto select(Phone parameter) {
|
||||||
|
Phone phone = phoneRepository.findByIdAndDelYn(parameter.getId(), false).orElseThrow(()-> new BizException(""));
|
||||||
|
PhoneDto phoneDto = PhoneDto.of(phone);
|
||||||
|
|
||||||
|
List<PhonePrice> phonePriceList = phonePriceRepository.findByPhoneIdAndDelYn(phone.getId(), false).orElseThrow(()-> new BizException(""));
|
||||||
|
List<PhonePriceDto> phonPriceDtoList = new ArrayList<PhonePriceDto>();
|
||||||
|
for(PhonePrice e : phonePriceList) {
|
||||||
|
phonPriceDtoList.add(PhonePriceDto.of(e));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PhoneColor> phoneColorList = phoneColorRepository.findByPhoneIdAndDelYnOrderBySort(phone.getId(), false).orElseThrow(()-> new BizException(""));
|
||||||
|
List<PhoneColorDto> phonColorDtoList = new ArrayList<PhoneColorDto>();
|
||||||
|
for(PhoneColor e : phoneColorList) {
|
||||||
|
phonColorDtoList.add(PhoneColorDto.of(e));
|
||||||
|
}
|
||||||
|
|
||||||
|
PhoneDetail phoneDetail = phoneDetailRepository.findByPhoneIdAndDelYn(phone.getId(), false).orElseThrow(()-> new BizException(""));
|
||||||
|
PhoneDetailDto result = PhoneDetailDto.of(phoneDetail);
|
||||||
|
|
||||||
|
result.setPhoneDto(phoneDto);
|
||||||
|
result.setPhonePriceDtoList(phonPriceDtoList);
|
||||||
|
result.setPhoneColorDtoList(phonColorDtoList);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package com.ns.mobile.website.biz.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.dto.FileUploadDto;
|
||||||
|
import com.ns.mobile.website.biz.dto.SellUserDto;
|
||||||
|
import com.ns.mobile.website.biz.entity.FileUpload;
|
||||||
|
import com.ns.mobile.website.biz.entity.SellUser;
|
||||||
|
import com.ns.mobile.website.biz.exception.BizApiException;
|
||||||
|
import com.ns.mobile.website.biz.model.SearchData;
|
||||||
|
import com.ns.mobile.website.biz.repository.FileUploadRepository;
|
||||||
|
import com.ns.mobile.website.biz.repository.SellUserRepository;
|
||||||
|
import com.ns.mobile.website.biz.service.SellService;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import util.SU;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class SellServiceImpl implements SellService{
|
||||||
|
|
||||||
|
private final SellUserRepository sellUserRepository;
|
||||||
|
private final FileUploadRepository fileUploadRepository;
|
||||||
|
@Override
|
||||||
|
public List<SellUserDto> selectList(SearchData parameter) {
|
||||||
|
List<SellUser> sellUserList;
|
||||||
|
if(SU.eq("account",parameter.getType())) {
|
||||||
|
sellUserList = sellUserRepository.findByAccountContainsAndDelYn(parameter.getText(), false).orElseThrow(() -> new BizApiException("없는 거래처명입니다."));
|
||||||
|
}else if(SU.eq("newsAgency",parameter.getType())){
|
||||||
|
sellUserList = sellUserRepository.findByNewsAgencyContainsAndDelYn(parameter.getText(), false).orElseThrow(() -> new BizApiException("없는 통신사명입니다"));
|
||||||
|
}else if(SU.eq("name",parameter.getType())){
|
||||||
|
sellUserList = sellUserRepository.findByNameContainsAndDelYn(parameter.getText(), false).orElseThrow(() -> new BizApiException("없는 명의자 입니다"));
|
||||||
|
}else if(SU.eq("phoneNumber",parameter.getType())){
|
||||||
|
sellUserList = sellUserRepository.findByPhoneNumberContainsAndDelYn(parameter.getText(), false).orElseThrow(() -> new BizApiException("없는 개통번호입니다"));
|
||||||
|
}else if(SU.eq("customerType",parameter.getType())){
|
||||||
|
sellUserList = sellUserRepository.findByCustomerTypeContainsAndDelYn(parameter.getText(), false).orElseThrow(() -> new BizApiException("없는 고객종류입니다"));
|
||||||
|
}else if(SU.eq("petName",parameter.getType())){
|
||||||
|
sellUserList = sellUserRepository.findByPetNameContainsAndDelYn(parameter.getText(), false).orElseThrow(() -> new BizApiException("없는 펫네임입니다"));
|
||||||
|
}else if(SU.eq("serialNumber",parameter.getType())){
|
||||||
|
sellUserList = sellUserRepository.findBySerialNumberContainsAndDelYn(parameter.getText(), false).orElseThrow(() -> new BizApiException("없는 시리얼번호입니다"));
|
||||||
|
}else {
|
||||||
|
sellUserList = sellUserRepository.findByAccountContainsOrNewsAgencyContainsOrNameContainsOrPhoneNumberContainsOrCustomerTypeContainsOrPetNameContainsOrSerialNumberContainsAndDelYn(parameter.getText(),parameter.getText(),parameter.getText(),parameter.getText(),parameter.getText(),parameter.getText(),parameter.getText(), false).orElseThrow(() -> new BizApiException("없는 시리얼번호입니다"));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SellUserDto> resultList = new ArrayList<SellUserDto>();
|
||||||
|
for(SellUser e : sellUserList) {
|
||||||
|
SellUserDto temp = SellUserDto.of(e);
|
||||||
|
resultList.add(temp);
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FileUploadDto> selectAddList(SearchData parameter) {
|
||||||
|
List<FileUploadDto> resultList = fileUploadRepository.findByDelYnOrderByIdDesc(false);
|
||||||
|
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public boolean saveList(FileUpload fileUpload, List<SellUser> list) {
|
||||||
|
try {
|
||||||
|
fileUpload = fileUploadRepository.saveAndFlush(fileUpload);
|
||||||
|
for(SellUser e : list) {
|
||||||
|
e.setFileId(fileUpload.getId());
|
||||||
|
}
|
||||||
|
sellUserRepository.saveAll(list);
|
||||||
|
}catch(Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delFileUpload(FileUpload fileUpload) {
|
||||||
|
try {
|
||||||
|
fileUploadRepository.updateDelYn(fileUpload.getId());
|
||||||
|
sellUserRepository.updateDelYn(fileUpload.getId());
|
||||||
|
}catch(Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.ns.mobile.website.common;
|
||||||
|
|
||||||
|
public class AuthError {
|
||||||
|
public static final String INVALID_USERNAME_OR_PASSWORD = "INVALID_USERNAME_OR_PASSWORD";
|
||||||
|
public static final String INVALID_SECRET_KEY = "INVALID_SECRET_KEY";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ns.mobile.website.common;
|
||||||
|
|
||||||
|
public class Res {
|
||||||
|
|
||||||
|
public static final String URL_LOGIN_FAIL = "/home/user/login?error=true";
|
||||||
|
|
||||||
|
public static final String URL_LOGIN_PAGE = "/home/user/login";
|
||||||
|
public static final String URL_HOME = "/home";
|
||||||
|
|
||||||
|
public static final String URL_CAFE_LIST = "/home/user/orgs";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 비밀번호 실패 카운트 LIMIT
|
||||||
|
*/
|
||||||
|
public static final int PASSWORD_RETRY_LIMIT_COUNT = 5;
|
||||||
|
|
||||||
|
public static final String TIME_STAMP = "timestamp";
|
||||||
|
|
||||||
|
public static final String SITE_TYPE_B2B = "b";
|
||||||
|
public static final String SITE_TYPE_B2C = "c";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.ns.mobile.website.common.aop;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.Around;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
@Aspect
|
||||||
|
@Component
|
||||||
|
public class ServiceCallLogger {
|
||||||
|
|
||||||
|
@Around("execution(* com.ns.mobile.website.biz.service..*.*Service*.*(..))")
|
||||||
|
public Object log(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
|
||||||
|
|
||||||
|
ProceedingJoinPoint joinPoint = proceedingJoinPoint;
|
||||||
|
|
||||||
|
System.out.println("");
|
||||||
|
System.out.println("[=========================================]");
|
||||||
|
System.out.println("[START-SERVICE]");
|
||||||
|
System.out.println(joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName() + "()");
|
||||||
|
if (joinPoint.getArgs() != null) {
|
||||||
|
for(Object obj : joinPoint.getArgs()) {
|
||||||
|
System.out.println(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Object result = joinPoint.proceed();
|
||||||
|
|
||||||
|
System.out.println(joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName() + "()");
|
||||||
|
System.out.println("[END__-SERVICE]");
|
||||||
|
System.out.println("[=========================================]");
|
||||||
|
System.out.println("");
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package com.ns.mobile.website.common.aop;
|
||||||
|
|
||||||
|
public class TestClass {
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.web.auth.PublicAccess;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
public class AnnotationUtils {
|
||||||
|
|
||||||
|
public static boolean existGuestAccess(Method method) {
|
||||||
|
|
||||||
|
if (method != null) {
|
||||||
|
Annotation[] annotations = method.getAnnotations();
|
||||||
|
|
||||||
|
if (annotations != null) {
|
||||||
|
for (Annotation annotation : annotations) {
|
||||||
|
if (annotation instanceof PublicAccess) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,335 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.Period;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class DateUtils {
|
||||||
|
|
||||||
|
public static final String FORMAT_DEFAULT = "yyyy.MM.dd HH:mm";
|
||||||
|
public static final String FORMAT_YYYYMMDDHHMMSSMMM = "yyyy.MM.dd HH:mm:ss.SSS";
|
||||||
|
public static final String FORMAT_YYYYMMDDHHMMSS = "yyyy.MM.dd HH:mm:ss";
|
||||||
|
public static final String FORMAT_YYYYMMDD = "yyyy-MM-dd";
|
||||||
|
public static final String FORMAT_YYYYMMDD_KOR = "yyyy년 MM월 dd일";
|
||||||
|
public static final String FORMAT_YYYYMMDD_DOT = "yyyy.MM.dd";
|
||||||
|
public static final String FORMAT_YYYYMMDD_TRIM = "yyyyMMdd";
|
||||||
|
public static final String FORMAT_HHMMSS_TRIM = "HHmmss";
|
||||||
|
public static final String FORMAT_MD = "M/d";
|
||||||
|
public static final String FORMAT_DD = "dd";
|
||||||
|
public static final String FORMAT_HH = "HH";
|
||||||
|
public static final String FORMAT_YYMMDDHHMMSS = "yyMMddHHmmss";
|
||||||
|
private static final String[] WEEK_KOR_NAME = {"일", "월", "화", "수", "목", "금", "토"};
|
||||||
|
|
||||||
|
public static String toDateString(Date value) {
|
||||||
|
return toDateString(value, FORMAT_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toDateString(Date value, String formatText) {
|
||||||
|
return toDateString(value, formatText, Locale.KOREA);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toDateString(Date value, String formatText, Locale locale) {
|
||||||
|
if (value != null) {
|
||||||
|
return (new SimpleDateFormat(formatText, locale)).format(value);
|
||||||
|
}
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toDateString(LocalDateTime value) {
|
||||||
|
return toDateString(value, FORMAT_YYYYMMDD_DOT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toDateStringDefault(LocalDateTime value) {
|
||||||
|
return toDateString(value, FORMAT_YYYYMMDD);
|
||||||
|
}
|
||||||
|
public static String toDateStringDateTrim(LocalDateTime value) {
|
||||||
|
return toDateString(value, FORMAT_HHMMSS_TRIM);
|
||||||
|
}
|
||||||
|
public static String toDateStringTimeTrim(LocalDateTime value) {
|
||||||
|
return toDateString(value, FORMAT_HHMMSS_TRIM);
|
||||||
|
}
|
||||||
|
public static String toDateString(LocalDateTime value, String format) {
|
||||||
|
if (value != null) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||||
|
return value.format(formatter);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
public static String toDateString(LocalDate value, String format) {
|
||||||
|
if (value != null) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||||
|
return value.format(formatter);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String getCurrentDate() {
|
||||||
|
return getCurrentDate(FORMAT_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCurrentDate(String format) {
|
||||||
|
return toDateString(Calendar.getInstance().getTime(), format);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCurrentMillisecond() {
|
||||||
|
return getCurrentDate(FORMAT_YYYYMMDDHHMMSSMMM);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date toDate(String dateString) {
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(dateString)) {
|
||||||
|
if (dateString.length() == 10 && dateString.contains("-")) {
|
||||||
|
try {
|
||||||
|
Date date = (new SimpleDateFormat(FORMAT_YYYYMMDD)).parse(dateString);
|
||||||
|
return date;
|
||||||
|
} catch (ParseException e) {
|
||||||
|
}
|
||||||
|
} else if (dateString.length() == 8) {
|
||||||
|
try {
|
||||||
|
Date date = (new SimpleDateFormat(FORMAT_YYYYMMDD_TRIM)).parse(dateString);
|
||||||
|
return date;
|
||||||
|
} catch (ParseException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LocalDate localDate(String dateString) {
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(dateString)) {
|
||||||
|
if (dateString.length() == 10 && dateString.contains("-")) {
|
||||||
|
try {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(FORMAT_YYYYMMDD);
|
||||||
|
return LocalDate.parse(dateString, formatter);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
} else if (dateString.length() == 8) {
|
||||||
|
try {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(FORMAT_YYYYMMDD_TRIM);
|
||||||
|
return LocalDate.parse(dateString, formatter);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LocalDateTime localDateTime(String dateString) {
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(dateString)) {
|
||||||
|
try {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(FORMAT_YYMMDDHHMMSS);
|
||||||
|
return LocalDateTime.parse(dateString, formatter);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date now() {
|
||||||
|
return Calendar.getInstance().getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long nowTime() {
|
||||||
|
return Calendar.getInstance().getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 자정바로전 시간인데, 이름이.. 음...
|
||||||
|
*
|
||||||
|
* @param date
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Date getDateMidnight(Date date) {
|
||||||
|
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
cal.setTime(date);
|
||||||
|
|
||||||
|
Calendar cal2 = Calendar.getInstance();
|
||||||
|
cal2.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE), 23, 59, 59);
|
||||||
|
cal2.set(Calendar.MILLISECOND, 999);
|
||||||
|
|
||||||
|
return cal2.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date GET_START_DATE() {
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
cal.set(1, 1, 0, 0, 0, 0);
|
||||||
|
return cal.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date GET_END_DATE() {
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
cal.set(9999, 11, 31, 23, 59, 59);
|
||||||
|
return cal.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 날짜 리턴 by 날짜문자열 + 시간 + 분
|
||||||
|
*
|
||||||
|
* @param date
|
||||||
|
* @param hour
|
||||||
|
* @param minute
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Date dateByDateAndHourAndMinute(String date, int hour, int minute) {
|
||||||
|
|
||||||
|
int numbers[] = NumberUtils.dateNumberByString(date);
|
||||||
|
|
||||||
|
int year = numbers[0];
|
||||||
|
int month = numbers[1];
|
||||||
|
int day = numbers[2];
|
||||||
|
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
cal.set(year, month - 1, day, hour, minute, 0);
|
||||||
|
return cal.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int[] getDate() {
|
||||||
|
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
|
||||||
|
int year = calendar.get(Calendar.YEAR);
|
||||||
|
int month = calendar.get(Calendar.MONTH) + 1;
|
||||||
|
int day = calendar.get(Calendar.DATE);
|
||||||
|
|
||||||
|
int result[] = {year, month, day};
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 날짜값이 startDt가 endDt보다 크거나같은지 여부
|
||||||
|
*/
|
||||||
|
public static boolean dayEqualOrGreaterThan(Date startDt, Date endDt) {
|
||||||
|
long times = endDt.getTime() - startDt.getTime();
|
||||||
|
long days = times / (24 * 60 * 60 * 1000);
|
||||||
|
return days <= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 날짜값이 startDt가 endDt보다 작거나같은지 여부
|
||||||
|
*/
|
||||||
|
public static boolean dayEqualOrLessThan(Date startDt, Date endDt) {
|
||||||
|
long times = endDt.getTime() - startDt.getTime();
|
||||||
|
long days = times / (24 * 60 * 60 * 1000);
|
||||||
|
return days >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 날짜값이 startDt가 endDt보다 작은지 여부
|
||||||
|
*/
|
||||||
|
public static boolean dayLessThan(Date startDt, Date endDt) {
|
||||||
|
long times = endDt.getTime() - startDt.getTime();
|
||||||
|
long days = times / (24 * 60 * 60 * 1000);
|
||||||
|
return days > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 날짜값이 startDt가 endDt와 같은지 여부
|
||||||
|
*/
|
||||||
|
public static boolean dayEqual(Date startDt, Date endDt) {
|
||||||
|
long times = endDt.getTime() - startDt.getTime();
|
||||||
|
long days = times / (24 * 60 * 60 * 1000);
|
||||||
|
return days == 0;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 날짜값의 차이 값 반환
|
||||||
|
*/
|
||||||
|
public static long dayBetween(LocalDateTime startDt, LocalDateTime endDt) {
|
||||||
|
return ChronoUnit.DAYS.between(startDt.toLocalDate(), endDt.toLocalDate());
|
||||||
|
}
|
||||||
|
public static long minutesBetween(LocalDateTime startDt, LocalDateTime endDt) {
|
||||||
|
return ChronoUnit.MINUTES.between(startDt, endDt);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 현재날짜에 year를 더하고 day를 더함.
|
||||||
|
*/
|
||||||
|
public static Date addYearAndDay(Date date, int year, int day) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
if (year != 0) {
|
||||||
|
calendar.add(Calendar.YEAR, year);
|
||||||
|
}
|
||||||
|
calendar.add(Calendar.DATE, day);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date getYesterday() {
|
||||||
|
return addDay(now(), -1);
|
||||||
|
}
|
||||||
|
public static Date getNextThreeDay() {
|
||||||
|
return addDay(now(), 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 현재날짜에 day를 더함.
|
||||||
|
*/
|
||||||
|
public static Date addDay(Date date, int day) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.DATE, day);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCurrentYear() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
return String.format("%d", calendar.get(Calendar.YEAR));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCurrentMonth() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
return String.format("%02d", calendar.get(Calendar.MONTH) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checkDt 값이 startDt와 endDt사이에 있는지 확인
|
||||||
|
*/
|
||||||
|
public static boolean checkInDate(Date startDt, Date endDt, Date checkDt) {
|
||||||
|
return startDt.after(checkDt) && endDt.before(checkDt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean checkInDate(Date startDt, Date endDt) {
|
||||||
|
return checkInDate(startDt, endDt, DateUtils.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getDayGap(Date dt1, Date dt2) {
|
||||||
|
long diff = dt2.getTime() - dt1.getTime();
|
||||||
|
return (int) diff / (24 * 60 * 60 * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 요일 리턴
|
||||||
|
*/
|
||||||
|
public static String getWeekName(Date dt) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(dt);
|
||||||
|
return WEEK_KOR_NAME[calendar.get(Calendar.DAY_OF_WEEK) - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
static DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||||
|
|
||||||
|
public static String getTimeStamp() {
|
||||||
|
return LocalDateTime.now().format(dateTimeFormatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
import com.github.mervick.aes_everywhere.Aes256;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by PARK on 2018-09-01.
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class EncryptUtils {
|
||||||
|
|
||||||
|
|
||||||
|
private static final String Empty = "";
|
||||||
|
|
||||||
|
public static String encrypt(String input, String PASS_PHRASE) {
|
||||||
|
|
||||||
|
String encrypted = Empty;
|
||||||
|
try {
|
||||||
|
encrypted = Aes256.encrypt(input, PASS_PHRASE);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(encrypted);
|
||||||
|
|
||||||
|
String base64Encoding = Base64.getEncoder().withoutPadding().encodeToString(encrypted.getBytes(StandardCharsets.UTF_8));
|
||||||
|
|
||||||
|
System.out.println(base64Encoding);
|
||||||
|
|
||||||
|
return base64Encoding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String decrypt(String encrypted, String PASS_PHRASE) {
|
||||||
|
|
||||||
|
log.info("encrypted:{}", encrypted);
|
||||||
|
|
||||||
|
String decrypted = Empty;
|
||||||
|
try {
|
||||||
|
byte[] bytesBase64Decoding = Base64.getDecoder().decode(encrypted);
|
||||||
|
String base64Decoding = new String(bytesBase64Decoding);
|
||||||
|
|
||||||
|
log.info("base64Decoding:{}", base64Decoding);
|
||||||
|
|
||||||
|
decrypted = Aes256.decrypt(base64Decoding, PASS_PHRASE);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
System.out.println(e.getMessage());
|
||||||
|
log.info(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("decrypted:{}", decrypted);
|
||||||
|
|
||||||
|
return decrypted;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
GlassInput glassInput = new GlassInput("A001", "900000", "000002", "007", "5");
|
||||||
|
|
||||||
|
System.out.println(glassInput.toString());
|
||||||
|
|
||||||
|
String encryptedName = EncryptUtils.encrypt(glassInput.toString());
|
||||||
|
String decryptedName = EncryptUtils.decrypt(encryptedName);
|
||||||
|
|
||||||
|
System.out.println(encryptedName);
|
||||||
|
System.out.println(decryptedName);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void __main(String[] args) throws Exception {
|
||||||
|
|
||||||
|
String text = "TEXT";
|
||||||
|
String pass = "innosysit-iorder";
|
||||||
|
|
||||||
|
byte[] text_bytes = text.getBytes("UTF-8");
|
||||||
|
byte[] pass_bytes = pass.getBytes("UTF-8");
|
||||||
|
|
||||||
|
// strings encryption
|
||||||
|
String encrypted = Aes256.encrypt(text, pass);
|
||||||
|
System.out.println(encrypted);
|
||||||
|
|
||||||
|
String base64Encoding = Base64.getEncoder().withoutPadding().encodeToString(encrypted.getBytes(StandardCharsets.UTF_8));
|
||||||
|
System.out.println(base64Encoding);
|
||||||
|
|
||||||
|
// bytes encryption
|
||||||
|
byte[] encrypted_bytes = Aes256.encrypt(text_bytes, pass_bytes);
|
||||||
|
System.out.println(encrypted_bytes);
|
||||||
|
|
||||||
|
// strings decryption
|
||||||
|
String decrypted = Aes256.decrypt(encrypted, pass);
|
||||||
|
System.out.println(decrypted);
|
||||||
|
|
||||||
|
byte[] base64DecodingByte = Base64.getDecoder().decode(base64Encoding);
|
||||||
|
String base64Decoding = new String(base64DecodingByte);
|
||||||
|
|
||||||
|
System.out.println(base64Decoding);
|
||||||
|
|
||||||
|
System.out.println(Aes256.decrypt(base64Decoding, pass));
|
||||||
|
|
||||||
|
|
||||||
|
// bytes decryption
|
||||||
|
byte[] decrypted_bytes = Aes256.decrypt(encrypted_bytes, pass_bytes);
|
||||||
|
System.out.println(decrypted_bytes);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,225 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
|
import org.apache.poi.ss.usermodel.CellType;
|
||||||
|
import org.apache.poi.ss.usermodel.DateUtil;
|
||||||
|
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.ss.usermodel.WorkbookFactory;
|
||||||
|
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFWorkbookType;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.entity.SellUser;
|
||||||
|
import com.ns.mobile.website.biz.repository.FileUploadRepository;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class ExcelUtil {
|
||||||
|
|
||||||
|
// HttpServletResponse 경우
|
||||||
|
public void createExcelToResponse(Map<String, List<List<String>>> dataMap, HttpServletResponse response) {
|
||||||
|
Workbook workbook = new SXSSFWorkbook(); // 성능 개선 버전
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (String key : dataMap.keySet()) {
|
||||||
|
log.debug("Sheet Name : {}", key);
|
||||||
|
Sheet sheet = workbook.createSheet(key);
|
||||||
|
|
||||||
|
createExcel(sheet, dataMap.get(key));
|
||||||
|
}
|
||||||
|
// 컨텐츠 타입
|
||||||
|
response.setContentType("application/vnd.ms-excel");
|
||||||
|
|
||||||
|
workbook.write(response.getOutputStream());
|
||||||
|
workbook.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error(e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 생성
|
||||||
|
private void createExcel(Sheet sheet, List<List<String>> dataList) {
|
||||||
|
|
||||||
|
// 데이터를 한개씩 조회해서 한개의 행으로 만든다.
|
||||||
|
for(int rowIndex=0; rowIndex<dataList.size(); rowIndex++) {
|
||||||
|
List<String> data = dataList.get(rowIndex);
|
||||||
|
|
||||||
|
// row 생성
|
||||||
|
Row row = sheet.createRow(rowIndex);
|
||||||
|
for(int cellIndex=0; cellIndex<data.size(); cellIndex++) {
|
||||||
|
// cell 생성
|
||||||
|
Cell cell = row.createCell(cellIndex);
|
||||||
|
|
||||||
|
// cell에 데이터 삽입
|
||||||
|
cell.setCellValue(data.get(cellIndex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String,String> excelToAccountList(String filePath) {
|
||||||
|
Map<String,String> account = new HashMap<String,String>();
|
||||||
|
File file = new File(filePath);
|
||||||
|
try {
|
||||||
|
Workbook workbook = WorkbookFactory.create(file);
|
||||||
|
Sheet sheet = workbook.getSheetAt(4);
|
||||||
|
|
||||||
|
Iterator<Row> rowItr = sheet.iterator();
|
||||||
|
while(rowItr.hasNext()) {
|
||||||
|
Row row = rowItr.next();
|
||||||
|
if(row.getRowNum() < 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Iterator<Cell> cellItr = row.cellIterator();
|
||||||
|
String key = "";
|
||||||
|
String value = "";
|
||||||
|
while(cellItr.hasNext()) {
|
||||||
|
Cell cell = cellItr.next();
|
||||||
|
int index = cell.getColumnIndex();
|
||||||
|
switch(index) {
|
||||||
|
case 2:
|
||||||
|
key = cell.getStringCellValue();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
value = cell.getStringCellValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
account.put(key, value);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
String message = "[엑셀파일 로드 - Account] 처리 중 DB오류가 발생하였습니다.";
|
||||||
|
log.error(message + " >> ", e);
|
||||||
|
}
|
||||||
|
return account;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<SellUser> excelToSellList(String filePath, Map<String,String> account) {
|
||||||
|
|
||||||
|
//String localFilename = "/Users/parkkyutae/Downloads/회원목록_20201102140936.xlsx";
|
||||||
|
File file = new File(filePath);
|
||||||
|
boolean stop = false;
|
||||||
|
List<SellUser> sellUserList = new ArrayList<SellUser>();
|
||||||
|
try {
|
||||||
|
Workbook workbook = WorkbookFactory.create(file);
|
||||||
|
Sheet sheet = workbook.getSheetAt(2);
|
||||||
|
|
||||||
|
Iterator<Row> rowItr = sheet.iterator();
|
||||||
|
|
||||||
|
while(rowItr.hasNext()) {
|
||||||
|
SellUser sellUser = new SellUser();
|
||||||
|
Row row = rowItr.next();
|
||||||
|
if(row.getRowNum() < 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Iterator<Cell> cellItr = row.cellIterator();
|
||||||
|
while(cellItr.hasNext()) {
|
||||||
|
Cell cell = cellItr.next();
|
||||||
|
int index = cell.getColumnIndex();
|
||||||
|
switch(index) {
|
||||||
|
case 5:
|
||||||
|
if(cell.getDateCellValue() == null) {
|
||||||
|
stop = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sellUser.setOpeningDate((LocalDateTime)cell.getDateCellValue().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
sellUser.setAccount((String) getCellValue(cell));
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
sellUser.setNewsAgency(account.get(sellUser.getAccount()));
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
sellUser.setName((String) getCellValue(cell));
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
if(cell.getCellType() == CellType.NUMERIC)
|
||||||
|
sellUser.setSocialSecurityNumber(String.format("%06d",(int)cell.getNumericCellValue()));
|
||||||
|
else
|
||||||
|
sellUser.setSocialSecurityNumber((String) cell.getStringCellValue());
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
if(cell.getCellType() == CellType.NUMERIC)
|
||||||
|
sellUser.setPhoneNumber(String.format("%011d",(int)cell.getNumericCellValue()));
|
||||||
|
else
|
||||||
|
sellUser.setPhoneNumber(((String) cell.getStringCellValue()).replace("-", ""));
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
if(cell.getCellType() == CellType.NUMERIC)
|
||||||
|
sellUser.setCustomerType(String.format("%d",(int)cell.getNumericCellValue()));
|
||||||
|
else
|
||||||
|
sellUser.setCustomerType((String) cell.getStringCellValue());
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
sellUser.setLegalRepresentativeName((String) cell.getStringCellValue());
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
if(cell.getCellType() == CellType.NUMERIC)
|
||||||
|
sellUser.setLegalRepresentativePhoneNumber(String.format("%011d",(int)cell.getNumericCellValue()));
|
||||||
|
else
|
||||||
|
sellUser.setLegalRepresentativePhoneNumber(((String) cell.getStringCellValue()).replace("-", ""));
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
sellUser.setInstallmentMonth(((Double)cell.getNumericCellValue()).intValue());
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
sellUser.setPetName((String) cell.getStringCellValue());
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
if(cell.getCellType() == CellType.NUMERIC)
|
||||||
|
sellUser.setSerialNumber(String.format("%d",(int)cell.getNumericCellValue()));
|
||||||
|
else
|
||||||
|
sellUser.setSerialNumber((String) cell.getStringCellValue());
|
||||||
|
break;
|
||||||
|
case 17:
|
||||||
|
sellUser.setSubscription((String) cell.getStringCellValue());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(stop)
|
||||||
|
break;
|
||||||
|
sellUserList.add(sellUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
String message = "[엑셀파일 로드 - Data ] 처리 중 DB오류가 발생하였습니다.";
|
||||||
|
log.error(message + " >> ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sellUserList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Object getCellValue(Cell cell) {
|
||||||
|
switch(cell.getCellType()) {
|
||||||
|
case STRING:
|
||||||
|
return cell.getStringCellValue();
|
||||||
|
case BOOLEAN:
|
||||||
|
return cell.getBooleanCellValue();
|
||||||
|
case NUMERIC:
|
||||||
|
return cell.getNumericCellValue();
|
||||||
|
case FORMULA:
|
||||||
|
return cell.getCellFormula();
|
||||||
|
case BLANK:
|
||||||
|
return "";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,377 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.web.auth.CertSessionUtils;
|
||||||
|
import com.ns.mobile.website.web.auth.PublicAccess;
|
||||||
|
import com.ns.mobile.website.web.controller.BaseController;
|
||||||
|
import com.ns.mobile.website.web.controller.extra.ResultCert;
|
||||||
|
import com.ns.mobile.website.web.properties.LaneduProperties;
|
||||||
|
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.RequestMapping;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class ExtraCertUtils {
|
||||||
|
|
||||||
|
private static String getNow() {
|
||||||
|
|
||||||
|
return LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getSeqNumber() {
|
||||||
|
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
int seq = (new Random()).nextInt(10000) + 1;
|
||||||
|
|
||||||
|
return String.format("%s%05d"
|
||||||
|
, now.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))
|
||||||
|
, seq);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTrCertData(String actionType, LaneduProperties laneduProperties) {
|
||||||
|
|
||||||
|
//tr_cert 데이터 변수 선언 ---------------------------------------------------------------
|
||||||
|
String tr_cert = "";
|
||||||
|
String cpId = "KBZM1052"; // 회원사ID
|
||||||
|
|
||||||
|
String urlCode = "002001"; // URL코드
|
||||||
|
|
||||||
|
urlCode = "004001"; // - localhost - 회원가입
|
||||||
|
urlCode = "005001"; // - localhost:8080 - 회원가입
|
||||||
|
|
||||||
|
urlCode = laneduProperties.getPhoneUrlCode();
|
||||||
|
|
||||||
|
System.out.println("#######################");
|
||||||
|
System.out.println("#######################");
|
||||||
|
System.out.println("#######################");
|
||||||
|
System.out.println(urlCode);
|
||||||
|
|
||||||
|
|
||||||
|
String certNum = getSeqNumber(); // 요청번호 ( 본인인증 요청시 중복되지 않게 생성해야함. (예-시퀀스번호) )
|
||||||
|
String date = getNow(); // 요청일시
|
||||||
|
String certMet = "M"; // 본인인증방법
|
||||||
|
String name = ""; // 성명
|
||||||
|
String phoneNo = ""; // 휴대폰번호
|
||||||
|
String phoneCorp = ""; // 이동통신사
|
||||||
|
String birthDay = ""; // 생년월일
|
||||||
|
String gender = ""; // 성별
|
||||||
|
String nation = ""; // 내외국인 구분
|
||||||
|
String plusInfo = ""; // 추가DATA정보
|
||||||
|
String extendVar = "0000000000000000"; // 확장변수
|
||||||
|
//End-tr_cert 데이터 변수 선언 ---------------------------------------------------------------
|
||||||
|
|
||||||
|
plusInfo = actionType;
|
||||||
|
|
||||||
|
|
||||||
|
String tr_add = "N"; // IFrame사용여부
|
||||||
|
|
||||||
|
|
||||||
|
//01. 한국모바일인증(주) 암호화 모듈 선언
|
||||||
|
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||||
|
|
||||||
|
//02. 1차 암호화 (tr_cert 데이터변수 조합 후 암호화)
|
||||||
|
String enc_tr_cert = "";
|
||||||
|
tr_cert = cpId +"/"+ urlCode +"/"+ certNum +"/"+ date +"/"+ certMet +"/"+ birthDay +"/"+ gender +"/"+ name +"/"+ phoneNo +"/"+ phoneCorp +"/"+ nation +"/"+ plusInfo +"/"+ extendVar;
|
||||||
|
enc_tr_cert = seed.getEnc(tr_cert, "");
|
||||||
|
|
||||||
|
//03. 1차 암호화 데이터에 대한 위변조 검증값 생성 (HMAC)
|
||||||
|
String hmacMsg = "";
|
||||||
|
hmacMsg = seed.getMsg(enc_tr_cert);
|
||||||
|
|
||||||
|
//04. 2차 암호화 (1차 암호화 데이터, HMAC 데이터, extendVar 조합 후 암호화)
|
||||||
|
tr_cert = seed.getEnc(enc_tr_cert + "/" + hmacMsg + "/" + extendVar, "");
|
||||||
|
|
||||||
|
|
||||||
|
return tr_cert;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Boolean paramChk(String patn, String param) {
|
||||||
|
Pattern pattern = Pattern.compile(patn);
|
||||||
|
Matcher matcher = pattern.matcher(param);
|
||||||
|
return matcher.matches();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ResultCert getTrCertData(String rec_cert, String k_certNum, String clientIp) {
|
||||||
|
|
||||||
|
// 파라미터 유효성 검증
|
||||||
|
if( rec_cert.length() == 0 || k_certNum.length() == 0 ){
|
||||||
|
return ResultCert.fail("[오류] 결과값 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 변수선언 --------------------------------------------------------------------------------------------------------
|
||||||
|
//String rec_cert = ""; // 결과수신DATA
|
||||||
|
|
||||||
|
//String k_certNum = ""; // 파라미터로 수신한 요청번호
|
||||||
|
String certNum = ""; // 요청번호
|
||||||
|
String date = ""; // 요청일시
|
||||||
|
String CI = ""; // 연계정보(CI)
|
||||||
|
String DI = ""; // 중복가입확인정보(DI)
|
||||||
|
String phoneNo = ""; // 휴대폰번호
|
||||||
|
String phoneCorp = ""; // 이동통신사
|
||||||
|
String birthDay = ""; // 생년월일
|
||||||
|
String gender = ""; // 성별
|
||||||
|
String nation = ""; // 내국인
|
||||||
|
String name = ""; // 성명
|
||||||
|
String M_name = ""; // 미성년자 성명
|
||||||
|
String M_birthDay = ""; // 미성년자 생년월일
|
||||||
|
String M_Gender = ""; // 미성년자 성별
|
||||||
|
String M_nation = ""; // 미성년자 내외국인
|
||||||
|
String result = ""; // 결과값
|
||||||
|
|
||||||
|
String certMet = ""; // 인증방법
|
||||||
|
String ip = ""; // ip주소
|
||||||
|
String plusInfo = "";
|
||||||
|
|
||||||
|
String encPara = "";
|
||||||
|
String encMsg1 = "";
|
||||||
|
String encMsg2 = "";
|
||||||
|
String msgChk = "";
|
||||||
|
//-----------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//01. 암호화 모듈 (jar) Loading
|
||||||
|
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||||
|
|
||||||
|
//02. 1차 복호화
|
||||||
|
//수신된 certNum를 이용하여 복호화
|
||||||
|
rec_cert = seed.getDec(rec_cert, k_certNum);
|
||||||
|
|
||||||
|
//03. 1차 파싱
|
||||||
|
int inf1 = rec_cert.indexOf("/",0);
|
||||||
|
int inf2 = rec_cert.indexOf("/",inf1+1);
|
||||||
|
|
||||||
|
encPara = rec_cert.substring(0,inf1); //암호화된 통합 파라미터
|
||||||
|
encMsg1 = rec_cert.substring(inf1+1,inf2); //암호화된 통합 파라미터의 Hash값
|
||||||
|
|
||||||
|
//04. 위변조 검증
|
||||||
|
encMsg2 = seed.getMsg(encPara);
|
||||||
|
|
||||||
|
if(encMsg2.equals(encMsg1)){
|
||||||
|
msgChk="Y";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(msgChk.equals("N")){
|
||||||
|
//alert("비정상적인 접근입니다.!!<%=msgChk%>");
|
||||||
|
return ResultCert.fail("비정상적인 접근입니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//05. 2차 복호화
|
||||||
|
rec_cert = seed.getDec(encPara, k_certNum);
|
||||||
|
|
||||||
|
System.out.println("##########################################");
|
||||||
|
System.out.println(rec_cert);
|
||||||
|
|
||||||
|
//06. 2차 파싱
|
||||||
|
int info1 = rec_cert.indexOf("/",0);
|
||||||
|
int info2 = rec_cert.indexOf("/",info1+1);
|
||||||
|
int info3 = rec_cert.indexOf("/",info2+1);
|
||||||
|
int info4 = rec_cert.indexOf("/",info3+1);
|
||||||
|
int info5 = rec_cert.indexOf("/",info4+1);
|
||||||
|
int info6 = rec_cert.indexOf("/",info5+1);
|
||||||
|
int info7 = rec_cert.indexOf("/",info6+1);
|
||||||
|
int info8 = rec_cert.indexOf("/",info7+1);
|
||||||
|
int info9 = rec_cert.indexOf("/",info8+1);
|
||||||
|
int info10 = rec_cert.indexOf("/",info9+1);
|
||||||
|
int info11 = rec_cert.indexOf("/",info10+1);
|
||||||
|
int info12 = rec_cert.indexOf("/",info11+1);
|
||||||
|
int info13 = rec_cert.indexOf("/",info12+1);
|
||||||
|
int info14 = rec_cert.indexOf("/",info13+1);
|
||||||
|
int info15 = rec_cert.indexOf("/",info14+1);
|
||||||
|
int info16 = rec_cert.indexOf("/",info15+1);
|
||||||
|
int info17 = rec_cert.indexOf("/",info16+1);
|
||||||
|
int info18 = rec_cert.indexOf("/",info17+1);
|
||||||
|
|
||||||
|
certNum = rec_cert.substring(0,info1);
|
||||||
|
date = rec_cert.substring(info1+1,info2);
|
||||||
|
CI = rec_cert.substring(info2+1,info3);
|
||||||
|
phoneNo = rec_cert.substring(info3+1,info4);
|
||||||
|
phoneCorp = rec_cert.substring(info4+1,info5);
|
||||||
|
birthDay = rec_cert.substring(info5+1,info6);
|
||||||
|
gender = rec_cert.substring(info6+1,info7);
|
||||||
|
nation = rec_cert.substring(info7+1,info8);
|
||||||
|
name = rec_cert.substring(info8+1,info9);
|
||||||
|
result = rec_cert.substring(info9+1,info10);
|
||||||
|
certMet = rec_cert.substring(info10+1,info11);
|
||||||
|
ip = rec_cert.substring(info11+1,info12);
|
||||||
|
M_name = rec_cert.substring(info12+1,info13);
|
||||||
|
M_birthDay = rec_cert.substring(info13+1,info14);
|
||||||
|
M_Gender = rec_cert.substring(info14+1,info15);
|
||||||
|
M_nation = rec_cert.substring(info15+1,info16);
|
||||||
|
plusInfo = rec_cert.substring(info16+1,info17);
|
||||||
|
DI = rec_cert.substring(info17+1,info18);
|
||||||
|
|
||||||
|
//07. CI, DI 복호화
|
||||||
|
CI = seed.getDec(CI, k_certNum);
|
||||||
|
DI = seed.getDec(DI, k_certNum);
|
||||||
|
|
||||||
|
|
||||||
|
// 파라미터 유효성 검증 --------------------------------------------
|
||||||
|
boolean b = true;
|
||||||
|
String regex = "";
|
||||||
|
|
||||||
|
if( certNum.length() == 0 || certNum.length() > 40){
|
||||||
|
return ResultCert.fail("[오류] 요청번호 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if( date.length() != 14 || !paramChk(regex, date) ){
|
||||||
|
return ResultCert.fail("[오류] 요청일시 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[A-Z]*";
|
||||||
|
if( certMet.length() != 1 || !paramChk(regex, certMet) ){
|
||||||
|
return ResultCert.fail("[오류] 본인인증방법 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if( (phoneNo.length() != 10 && phoneNo.length() != 11) || !paramChk(regex, phoneNo) ){
|
||||||
|
return ResultCert.fail("[오류] 휴대폰번호 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[A-Z]*";
|
||||||
|
if( phoneCorp.length() != 3 || !paramChk(regex, phoneCorp) ){
|
||||||
|
return ResultCert.fail("[오류] 이동통신사 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if( birthDay.length() != 8 || !paramChk(regex, birthDay) ){
|
||||||
|
return ResultCert.fail("[오류] 생년월일 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if( gender.length() != 1 || !paramChk(regex, gender) ){
|
||||||
|
return ResultCert.fail("[오류] 성별 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if( nation.length() != 1 || !paramChk(regex, nation) ){
|
||||||
|
return ResultCert.fail("[오류] 내/외국인 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[\\sA-Za-z가-�R.,-]*";
|
||||||
|
if( name.length() > 60 || !paramChk(regex, name) ){
|
||||||
|
return ResultCert.fail("[오류] 성명 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[A-Z]*";
|
||||||
|
if( result.length() != 1 || !paramChk(regex, result) ){
|
||||||
|
return ResultCert.fail("[오류] 결과값 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[\\sA-Za-z가-?.,-]*";
|
||||||
|
if( M_name.length() != 0 ){
|
||||||
|
if( M_name.length() > 60 || !paramChk(regex, M_name) ){
|
||||||
|
return ResultCert.fail("[오류] 미성년자 성명 비정상");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if( M_birthDay.length() != 0 ){
|
||||||
|
if( M_birthDay.length() != 8 || !paramChk(regex, M_birthDay) ){
|
||||||
|
return ResultCert.fail("[오류] 미성년자 생년월일 비정상");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if( M_Gender.length() != 0 ){
|
||||||
|
if( M_Gender.length() != 1 || !paramChk(regex, M_Gender) ){
|
||||||
|
return ResultCert.fail("[오류] 미성년자 성별 비정상");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if( M_nation.length() != 0 ){
|
||||||
|
if( M_nation.length() != 1 || !paramChk(regex, M_nation) ){
|
||||||
|
return ResultCert.fail("[오류] 미성년자 내/외국인 비정상");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// End 파라미터 유효성 검증 --------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
// Start - 수신내역 유효성 검증(사설망의 사설 IP로 인해 미사용, 공용망의 경우 확인 후 사용) *********************/
|
||||||
|
// 1. date 값 검증
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.KOREAN); // 현재 서버 시각 구하기
|
||||||
|
String strCurrentTime = formatter.format(new Date());
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
Date toDate = formatter.parse(strCurrentTime);
|
||||||
|
Date fromDate = formatter.parse(date);
|
||||||
|
long timediff = toDate.getTime()-fromDate.getTime();
|
||||||
|
|
||||||
|
if ( timediff < -30*60*1000 || 30*60*100 < timediff ){
|
||||||
|
//return ResultCert.fail("[오류] 비정상적인 접근입니다. (요청시간경과)");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ParseException e) {
|
||||||
|
//e.printStackTrace();
|
||||||
|
return ResultCert.fail("[오류] 비정상적인 접근입니다. (요청시간경과)-2");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. ip 값 검증
|
||||||
|
String client_ip = clientIp;//request.getHeader("HTTP_X_FORWARDED_FOR"); // 사용자IP 구하기
|
||||||
|
/*
|
||||||
|
if ( client_ip != null ){
|
||||||
|
if( client_ip.indexOf(",") != -1 )
|
||||||
|
client_ip = client_ip.substring(0,client_ip.indexOf(","));
|
||||||
|
}
|
||||||
|
if ( client_ip==null || client_ip.length()==0 ){
|
||||||
|
client_ip = request.getRemoteAddr();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
// 전화하니까 IP체크 하지 않아도 된다네 ㅡㅡ;;
|
||||||
|
if( !client_ip.equals(ip) ){
|
||||||
|
return ResultCert.fail("[오류] 비정상적인 접근입니다. (IP불일치)");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
ResultCert rValue = ResultCert.success();
|
||||||
|
rValue.setCertNum(certNum);
|
||||||
|
rValue.setDate(date);
|
||||||
|
rValue.setCI(CI);
|
||||||
|
rValue.setPhoneNo(phoneNo);
|
||||||
|
rValue.setPhoneCorp(phoneCorp);
|
||||||
|
rValue.setBirthDay(birthDay);
|
||||||
|
rValue.setGender(gender);
|
||||||
|
rValue.setNation(nation);
|
||||||
|
rValue.setName(name);
|
||||||
|
rValue.setResult(result);
|
||||||
|
rValue.setCertMet(certMet);
|
||||||
|
rValue.setIp(ip);
|
||||||
|
rValue.setM_name(M_name);
|
||||||
|
rValue.setM_birthDay(M_birthDay);
|
||||||
|
rValue.setM_Gender(M_Gender);
|
||||||
|
rValue.setM_nation(M_nation);
|
||||||
|
rValue.setPlusInfo(plusInfo);
|
||||||
|
rValue.setDI(DI);
|
||||||
|
|
||||||
|
rValue.setSuccess(true);
|
||||||
|
|
||||||
|
return rValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public final class FileUtils {
|
||||||
|
|
||||||
|
/*
|
||||||
|
public static String getMimeType(File file) {
|
||||||
|
String mimeType = null;
|
||||||
|
try {
|
||||||
|
Tika tika = new Tika();
|
||||||
|
mimeType = tika.detect(file);
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return mimeType;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public static String getFileExtension(String fullName) {
|
||||||
|
if (fullName != null) {
|
||||||
|
String fileName = (new File(fullName)).getName();
|
||||||
|
int dotIndex = fileName.lastIndexOf(46);
|
||||||
|
return dotIndex == -1 ? "" : fileName.substring(dotIndex + 1);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getUploadPath(String baseUploadPath) {
|
||||||
|
|
||||||
|
baseUploadPath = String.format("%s%s/", baseUploadPath, DateUtils.getCurrentDate(DateUtils.FORMAT_YYYYMMDD_TRIM));
|
||||||
|
|
||||||
|
File uploadDir = new File(baseUploadPath);
|
||||||
|
if (!uploadDir.isDirectory()) {
|
||||||
|
uploadDir.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
return baseUploadPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void createUploadPath(String baseUploadPath) {
|
||||||
|
|
||||||
|
String currentYear = DateUtils.getCurrentYear();
|
||||||
|
String currentMonth = DateUtils.getCurrentMonth();
|
||||||
|
|
||||||
|
String[] dirs = {
|
||||||
|
String.format("%s/%s/", baseUploadPath, currentYear),
|
||||||
|
String.format("%s/%s/%s/", baseUploadPath, currentYear, currentMonth)
|
||||||
|
};
|
||||||
|
|
||||||
|
for (String dir : dirs) {
|
||||||
|
File file = new File(dir);
|
||||||
|
if (!file.isDirectory()) {
|
||||||
|
file.mkdirs();
|
||||||
|
try {
|
||||||
|
Runtime.getRuntime().exec("chmod 755 " + dir);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.info(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.method.HandlerMethod;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by PARK on 2018-09-01.
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class InterceptorUtils {
|
||||||
|
|
||||||
|
public static final String REQ_ATTR_TIMESTAMP = "timestamp";
|
||||||
|
public static final String REQ_ATTR_IS_MOBILE_BROWSER = "isMobileBrowser";
|
||||||
|
public static final String REQ_ATTR_USER_AGENT = "userAgent";
|
||||||
|
|
||||||
|
public static void headerLog(HttpServletRequest request) {
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
sb.append(StringUtils.CRLF).append(StringUtils.LINE_BAR)
|
||||||
|
.append(StringUtils.CRLF).append("#### [HTTP INFO__] ##############")
|
||||||
|
.append(StringUtils.CRLF).append(String.format(StringUtils.FORMAT_LOG, "requestURI", request.getRequestURI()))
|
||||||
|
.append(StringUtils.CRLF).append(String.format(StringUtils.FORMAT_LOG, "queryString", request.getQueryString()))
|
||||||
|
.append(StringUtils.CRLF).append(String.format(StringUtils.FORMAT_LOG, "method", request.getMethod()))
|
||||||
|
.append(StringUtils.CRLF).append("#### [HTTP HEADER] ##############");
|
||||||
|
|
||||||
|
Enumeration<String> headerNames = request.getHeaderNames();
|
||||||
|
if (headerNames != null) {
|
||||||
|
while (headerNames.hasMoreElements()) {
|
||||||
|
String name = (String) headerNames.nextElement();
|
||||||
|
String value = request.getHeader(name);
|
||||||
|
sb.append(StringUtils.CRLF).append(String.format(StringUtils.FORMAT_LOG, name, value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sb.append(StringUtils.CRLF).append(StringUtils.LINE_BAR);
|
||||||
|
|
||||||
|
log.info(sb.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void writeValiables(HttpServletRequest r) {
|
||||||
|
r.setAttribute(REQ_ATTR_TIMESTAMP, DateUtils.getTimeStamp());
|
||||||
|
//r.setAttribute(Res.SERVER_URL, SiteUtils.getServerUrl(r));
|
||||||
|
r.setAttribute(InterceptorUtils.REQ_ATTR_IS_MOBILE_BROWSER, RequestUtils.isMobileBrowser(r));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Method getExecuteMethod(Object handler) {
|
||||||
|
|
||||||
|
Method executeMethod = null;
|
||||||
|
|
||||||
|
if (handler instanceof HandlerMethod) {
|
||||||
|
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
||||||
|
executeMethod = handlerMethod.getMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (executeMethod == null) {
|
||||||
|
log.info("getExecuteMethod() ERROR => NULL");
|
||||||
|
}
|
||||||
|
|
||||||
|
return executeMethod;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import util.SU;
|
||||||
|
|
||||||
|
public class MaskingUtils {
|
||||||
|
|
||||||
|
public static boolean isDeveloper() {
|
||||||
|
String userName= System.getProperty("user.name");
|
||||||
|
return "kyutaepark".equals(userName) || "YOO".equals(userName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String name(String str) {
|
||||||
|
String originStr = str;
|
||||||
|
String regex = "(^[가-힣]+)$";
|
||||||
|
|
||||||
|
if(SU.isEmpty(originStr)) {
|
||||||
|
return originStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
Matcher matcher = Pattern.compile(regex).matcher(originStr);
|
||||||
|
|
||||||
|
if (matcher.find()) {
|
||||||
|
int length = originStr.length();
|
||||||
|
|
||||||
|
return originStr.substring(0, length - 1) + "*";
|
||||||
|
}
|
||||||
|
return originStr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String email(String str) {
|
||||||
|
String originStr = str;
|
||||||
|
String regex = "^([a-zA-Z0-9._-]+)+@([a-zA-Z0-9._-]+)+\\.([a-zA-Z0-9._-]+)$";
|
||||||
|
|
||||||
|
if(SU.isEmpty(originStr)) {
|
||||||
|
return originStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
Matcher matcher = Pattern.compile(regex).matcher(originStr);
|
||||||
|
|
||||||
|
if (matcher.find()) {
|
||||||
|
String target = matcher.group(1);
|
||||||
|
int length = target.length();
|
||||||
|
if (length > 3) {
|
||||||
|
char[] c = new char[3];
|
||||||
|
Arrays.fill(c, '*');
|
||||||
|
return originStr.replace(target, target.substring(0, length - 3) + String.valueOf(c));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return originStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String addrDetail(String str) {
|
||||||
|
String originStr = str;
|
||||||
|
|
||||||
|
if(SU.isEmpty(originStr)) {
|
||||||
|
return originStr;
|
||||||
|
}
|
||||||
|
int length = originStr.length();
|
||||||
|
|
||||||
|
char[] c = new char[length];
|
||||||
|
Arrays.fill(c, '*');
|
||||||
|
|
||||||
|
// return originStr.replace(originStr, originStr.substring(0, length) + String.valueOf(c));
|
||||||
|
return originStr.replace(originStr, String.valueOf(c));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
|
public class NumberUtils {
|
||||||
|
|
||||||
|
public static boolean isNumber(String str) {
|
||||||
|
if (StringUtils.isEmpty(str)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
char[] chars = str.toCharArray();
|
||||||
|
int sz = chars.length;
|
||||||
|
boolean hasExp = false;
|
||||||
|
boolean hasDecPoint = false;
|
||||||
|
boolean allowSigns = false;
|
||||||
|
boolean foundDigit = false;
|
||||||
|
int start = chars[0] == 45 ? 1 : 0;
|
||||||
|
int i;
|
||||||
|
if (sz > start + 1 && chars[start] == 48) {
|
||||||
|
if (chars[start + 1] == 120 || chars[start + 1] == 88) {
|
||||||
|
i = start + 2;
|
||||||
|
if (i == sz) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (i < chars.length) {
|
||||||
|
if ((chars[i] < 48 || chars[i] > 57) && (chars[i] < 97 || chars[i] > 102) && (chars[i] < 65 || chars[i] > 70)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Character.isDigit(chars[start + 1])) {
|
||||||
|
for (i = start + 1; i < chars.length; ++i) {
|
||||||
|
if (chars[i] < 48 || chars[i] > 55) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--sz;
|
||||||
|
|
||||||
|
for (i = start; i < sz || i < sz + 1 && allowSigns && !foundDigit; ++i) {
|
||||||
|
if (chars[i] >= 48 && chars[i] <= 57) {
|
||||||
|
foundDigit = true;
|
||||||
|
allowSigns = false;
|
||||||
|
} else if (chars[i] == 46) {
|
||||||
|
if (hasDecPoint || hasExp) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
hasDecPoint = true;
|
||||||
|
} else if (chars[i] != 101 && chars[i] != 69) {
|
||||||
|
if (chars[i] != 43 && chars[i] != 45) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!allowSigns) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
allowSigns = false;
|
||||||
|
foundDigit = false;
|
||||||
|
} else {
|
||||||
|
if (hasExp) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundDigit) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
hasExp = true;
|
||||||
|
allowSigns = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return i < chars.length ? (chars[i] >= 48 && chars[i] <= 57 ? true : (chars[i] != 101 && chars[i] != 69 ? (chars[i] == 46 ? (!hasDecPoint && !hasExp ? foundDigit : false) : (!allowSigns && (chars[i] == 100 || chars[i] == 68 || chars[i] == 102 || chars[i] == 70) ? foundDigit : (chars[i] != 108 && chars[i] != 76 ? false : foundDigit && !hasExp && !hasDecPoint))) : false)) : !allowSigns && foundDigit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static double toDoubleNumber(String value) {
|
||||||
|
try {
|
||||||
|
return Double.parseDouble(value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int toNumber(String value) {
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long toLong(String value) {
|
||||||
|
try {
|
||||||
|
return Long.parseLong(value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int[] dateNumberByString(String value) {
|
||||||
|
|
||||||
|
int number[] = {0, 0, 0};
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(value)) {
|
||||||
|
String arr[] = value.split("-");
|
||||||
|
number[0] = (arr.length > 0) ? toNumber(arr[0]) : 0;
|
||||||
|
number[1] = (arr.length > 1) ? toNumber(arr[1]) : 0;
|
||||||
|
number[2] = (arr.length > 2) ? toNumber(arr[2]) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toComma(long value) {
|
||||||
|
return (new DecimalFormat("###,###,###,##0")).format(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,597 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Component
|
||||||
|
public class PagerUtils {
|
||||||
|
|
||||||
|
final static String IMG_FIRST = "/images/cms/btn_pprev.gif";
|
||||||
|
final static String ALT_FIRST = "처음";
|
||||||
|
final static String IMG_PREVIOUS = "/images/cms/btn_prev.gif";
|
||||||
|
final static String ALT_PREVIOUS = "이전";
|
||||||
|
final static String IMG_NEXT = "/images/cms/btn_next.gif";
|
||||||
|
final static String ALT_NEXT = "다음";
|
||||||
|
final static String IMG_LAST = "/images/cms/btn_nnext.gif";
|
||||||
|
final static String ALT_LAST = "마지막";
|
||||||
|
|
||||||
|
public static final int DEFAULT_PAGE_SIZE = 20;
|
||||||
|
final public static int DEFAULT_PAGE_BLOCK = 10;
|
||||||
|
|
||||||
|
private boolean isPrevPage; //이전페이지 존재여부
|
||||||
|
private boolean isNextPage; //다음페이지 존재여부
|
||||||
|
private int nowPage; //현재페이지
|
||||||
|
private int rowTotal; //총 게시물수
|
||||||
|
private int blockList; //한페이지에 표시될 리스트수
|
||||||
|
private int blockPage; //한 블럭에 표시될 페이지수
|
||||||
|
private int blockSize;
|
||||||
|
private int totalPage; //전체페이지수
|
||||||
|
private int startPage; //시작페이지
|
||||||
|
private int endPage; //마지막 페이지
|
||||||
|
private int startRow; //데이타베이스의 쿼리에서 사용할 시작값
|
||||||
|
private int endRow; //데이타베이스의 쿼리에서 사용할 종료값
|
||||||
|
private int startNum; //리스트 표기시 처음 시작 숫자
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 페이지를 계산하는 생성자
|
||||||
|
* nowPage : 현재페이지
|
||||||
|
* rowTotal : 총게시물수
|
||||||
|
* blockList : 한페이지에 디스플레이될 게시물수
|
||||||
|
* blockPage: 한 블럭에 표시될 페이지수
|
||||||
|
*/
|
||||||
|
/*public PagerUtils(int nowPage, int rowTotal, int blockList) {
|
||||||
|
initialize(nowPage, rowTotal, blockList, PagerUtils.DEFAULT_PAGE_BLOCK);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public PagerUtils() {
|
||||||
|
initialize(0, 0, 0, PagerUtils.DEFAULT_PAGE_BLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagerUtils(int nowPage, int rowTotal, int blockList, int blockPage) {
|
||||||
|
initialize(nowPage, rowTotal, blockList, blockPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagerUtils(int pageIndex, int pageSize, int totalCount) {
|
||||||
|
initialize(pageIndex, totalCount, pageSize, PagerUtils.DEFAULT_PAGE_BLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public PagerUtils(int page, int totalCount) {
|
||||||
|
initialize(page, totalCount, PagerUtils.DEFAULT_PAGE_SIZE, PagerUtils.DEFAULT_PAGE_BLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
public PagerUtils(SearchParameter searchParameter, int rowTotal) {
|
||||||
|
initialize(searchParameter.getPage(), rowTotal, searchParameter.getSize(), PagerUtils.DEFAULT_PAGE_BLOCK);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 페이징 정보 설정
|
||||||
|
*/
|
||||||
|
public void reset(int pageIndex, int pageSize, int totalCount) {
|
||||||
|
initialize(pageIndex, totalCount, pageSize, PagerUtils.DEFAULT_PAGE_BLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initialize(int nowPage, int rowTotal, int blockList, int blockPage) {
|
||||||
|
|
||||||
|
//super();
|
||||||
|
|
||||||
|
this.nowPage = nowPage;
|
||||||
|
this.rowTotal = rowTotal;
|
||||||
|
this.blockList = blockList;
|
||||||
|
this.blockPage = blockPage;
|
||||||
|
|
||||||
|
// 각종 플래그를 초기화
|
||||||
|
isPrevPage = false;
|
||||||
|
isNextPage = false;
|
||||||
|
|
||||||
|
// 입력된 전체 열의 수를 통해 전체 페이지 수를 계산한다
|
||||||
|
this.totalPage = (int) Math.ceil((double) rowTotal / (double) blockList);
|
||||||
|
|
||||||
|
// 현재 페이지가 전체 페이지수보다 클경우 전체 페이지수로 강제로 조정한다
|
||||||
|
if (nowPage > this.totalPage) nowPage = this.totalPage;
|
||||||
|
|
||||||
|
//상기와 같을경우 totalPage가 0이고 nowPage가 1일경우 에러발생
|
||||||
|
if (nowPage < 1) nowPage = 1;
|
||||||
|
|
||||||
|
// DB입력을 위한 시작과 종료값을 구한다
|
||||||
|
this.startRow = (nowPage - 1) * blockList;
|
||||||
|
this.endRow = this.startRow + blockList - 1;
|
||||||
|
|
||||||
|
// 시작페이지와 종료페이지의 값을 구한다
|
||||||
|
this.startPage = ((nowPage - 1) / blockPage) * blockPage + 1;
|
||||||
|
this.endPage = this.startPage + blockPage - 1;
|
||||||
|
|
||||||
|
//리스트의 최상의 숫자를 구한다.
|
||||||
|
this.startNum = rowTotal - (blockList * (nowPage - 1));//리스트될 경우 최상위 숫자
|
||||||
|
|
||||||
|
|
||||||
|
// 마지막 페이지값이 전체 페이지값보다 클 경우 강제 조정
|
||||||
|
if (this.endPage > this.totalPage) {
|
||||||
|
this.endPage = totalPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 시작 페이지가 1보다 클 경우 이전 페이징이 가능한것으로 간주한다
|
||||||
|
if (this.startPage > 1) {
|
||||||
|
this.isPrevPage = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 종료페이지가 전체페이지보다 작을경우 다음 페이징이 가능한것으로 간주한다
|
||||||
|
if (this.endPage < this.totalPage) {
|
||||||
|
this.isNextPage = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 기타 값을 저장한다
|
||||||
|
this.nowPage = nowPage;
|
||||||
|
this.rowTotal = rowTotal;
|
||||||
|
this.blockList = blockList;
|
||||||
|
this.blockPage = blockPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Debug() {
|
||||||
|
System.out.println("input : nowPage :" + this.nowPage + " / rowTotal : " + this.rowTotal + " / blockList : " + this.blockList + " / blockPage : " + this.blockPage + " / totalPage : " + this.totalPage);
|
||||||
|
System.out.println("Total Page : " + this.totalPage + " / Start Page : " + this.startPage + " / End Page : " + this.endPage);
|
||||||
|
System.out.println("Total Row : " + this.rowTotal + " / Start Row : " + this.startRow + " / End Row : " + this.endRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HashMap<String, String> getParams() {
|
||||||
|
|
||||||
|
HashMap<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("isPrevPage", new Boolean(isPrevPage).toString());
|
||||||
|
params.put("isNextPage", new Boolean(isNextPage).toString());
|
||||||
|
|
||||||
|
params.put("nowPage", Integer.toString(nowPage));
|
||||||
|
params.put("rowTotal", Integer.toString(rowTotal));
|
||||||
|
params.put("blockList", Integer.toString(blockList));
|
||||||
|
params.put("blockPage", Integer.toString(blockPage));
|
||||||
|
params.put("blockSize", Integer.toString(blockSize));
|
||||||
|
params.put("totalPage", Integer.toString(totalPage));
|
||||||
|
params.put("startPage", Integer.toString(startPage));
|
||||||
|
params.put("endPage", Integer.toString(endPage));
|
||||||
|
params.put("startRow", Integer.toString(startRow));
|
||||||
|
params.put("endRow", Integer.toString(endRow));
|
||||||
|
params.put("startNum", Integer.toString(startNum));
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String printPage() {
|
||||||
|
return printPage("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String printPage(String parameter) {
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
sb.append("<ul>");
|
||||||
|
|
||||||
|
sb.append(String.format("<li><a href='?pageIndex=%d%s'><img src='%s' alt='%s'/></a></li>", 1, parameter, IMG_FIRST, ALT_FIRST));
|
||||||
|
|
||||||
|
if (isPrevPage) {
|
||||||
|
sb.append(String.format("<li><a href='?pageIndex=%d%s'><img src='%s' alt='%s'/></a></li>", nowPage - 1, parameter, IMG_PREVIOUS, ALT_PREVIOUS));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<li><a href='#'><img src='%s' alt='%s'/></a></li>", IMG_PREVIOUS, ALT_PREVIOUS));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = startPage; i <= endPage; i++) {
|
||||||
|
if (i > startPage) {
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nowPage == i) {
|
||||||
|
sb.append(String.format("<li class='on'><a href='#'>%d</a></li>", i));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<li><a href='?pageIndex=%d%s'>%d</a></li>", i, parameter, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNextPage) {
|
||||||
|
sb.append(String.format("<li><a href='?pageIndex=%d%s'><img src='%s' alt='%s'/></a></li>", endPage + 1, parameter, IMG_NEXT, ALT_NEXT));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<li><a href='#'><img src='%s' alt='%s'/></a></li>", IMG_NEXT, ALT_NEXT));
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append(String.format("<li><a href='?pageIndex=%d%s'><img src='%s' alt='%s'/></a></li>", totalPage, parameter, IMG_LAST, ALT_LAST));
|
||||||
|
|
||||||
|
sb.append("</ul>");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String printPage2(String parameter) {
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
sb.append("<div class=\"paging\">");
|
||||||
|
|
||||||
|
sb.append(String.format("<a href='?pageIndex=%d%s'><img src='%s' alt='%s'/></a>", 1, parameter, IMG_FIRST, ALT_FIRST));
|
||||||
|
|
||||||
|
if (isPrevPage) {
|
||||||
|
sb.append(String.format("<a class=\"pim\" href='?pageIndex=%d%s'><img src='%s' alt='%s'/></a>", nowPage - 1, parameter, IMG_PREVIOUS, ALT_PREVIOUS));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a class=\"pim\" href='#'><img src='%s' alt='%s'/></a>", IMG_PREVIOUS, ALT_PREVIOUS));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = startPage; i <= endPage; i++) {
|
||||||
|
if (i > startPage) {
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nowPage == i) {
|
||||||
|
sb.append(String.format("<a href='#' class='this'>%d</a>", i));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href='?pageIndex=%d%s'>%d</a>", i, parameter, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNextPage) {
|
||||||
|
sb.append(String.format("<a class=\"pim2\" href='?pageIndex=%d%s'><img src='%s' alt='%s'/></a>", endPage + 1, parameter, IMG_NEXT, ALT_NEXT));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a class=\"pim2\" href='#'><img src='%s' alt='%s'/></a>", IMG_NEXT, ALT_NEXT));
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append(String.format("<a href='?pageIndex=%d%s'><img src='%s' alt='%s'/></a>", totalPage, parameter, IMG_LAST, ALT_LAST));
|
||||||
|
|
||||||
|
sb.append("</div>");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
<div class="paging">
|
||||||
|
<a href="#" title="Prev" class="pv prev"></a>
|
||||||
|
<a href="#" class="on">1</a>
|
||||||
|
<a href="#">2</a>
|
||||||
|
<a href="#">3</a>
|
||||||
|
<a href="#">4</a>
|
||||||
|
<a href="#">5</a>
|
||||||
|
<a href="#" title="Next" class="pv next"></a>
|
||||||
|
</div>
|
||||||
|
*/
|
||||||
|
|
||||||
|
public String printPage3(String parameter) {
|
||||||
|
|
||||||
|
if (rowTotal < 1) {
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
sb.append("<div class=\"paging\">");
|
||||||
|
|
||||||
|
sb.append(String.format("<a class='pv first' title='First' href='?page=%d%s'></a>", 1, parameter));
|
||||||
|
|
||||||
|
if (isPrevPage) {
|
||||||
|
sb.append(String.format("<a class='pv prev' title='Previous' href='?page=%d%s'></a>", nowPage - 1, parameter));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a class='pv prev' title='Previous' href='#'></a>"));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = startPage; i <= endPage; i++) {
|
||||||
|
if (i > startPage) {
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nowPage == i) {
|
||||||
|
sb.append(String.format("<a href='#' class='on'>%d</a>", i));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href='?page=%d%s'>%d</a>", i, parameter, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNextPage) {
|
||||||
|
sb.append(String.format("<a class=\"pv next\" title='Next' href='?page=%d%s'></a>", endPage + 1, parameter));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a class=\"pv next\" title='Next' href='#'></a>"));
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append(String.format("<a class='pv last' title='Last' href='?page=%d%s'></a>", totalPage, parameter));
|
||||||
|
|
||||||
|
sb.append("</div>");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
<div class="co-table-nav">
|
||||||
|
<ul>
|
||||||
|
<li class="first"></li>
|
||||||
|
<li class="prev"></li>
|
||||||
|
<li class="on">1</li>
|
||||||
|
<li>2</li>
|
||||||
|
<li>3</li>
|
||||||
|
<li>4</li>
|
||||||
|
<li>5</li>
|
||||||
|
<li>6</li>
|
||||||
|
<li>7</li>
|
||||||
|
<li>8</li>
|
||||||
|
<li>9</li>
|
||||||
|
<li>10</li>
|
||||||
|
<li class="next"></li>
|
||||||
|
<li class="last"></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
public String printPage4(String parameter) {
|
||||||
|
|
||||||
|
if (rowTotal < 1) {
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
sb.append("<div class=\"co-table-nav mb100\">");
|
||||||
|
sb.append("\r\n");
|
||||||
|
sb.append("<ul>");
|
||||||
|
|
||||||
|
sb.append(String.format("<li class='first'><a href='?pageIndex=%d%s'></a></li>", 1, parameter));
|
||||||
|
sb.append("\r\n");
|
||||||
|
|
||||||
|
if (isPrevPage) {
|
||||||
|
sb.append(String.format("<li class='prev'><a href='?pageIndex=%d%s'></a></li>", nowPage - 1, parameter));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<li class='prev'><a href='#'></a></li>"));
|
||||||
|
}
|
||||||
|
sb.append("\r\n");
|
||||||
|
|
||||||
|
for (int i = startPage; i <= endPage; i++) {
|
||||||
|
if (i > startPage) {
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nowPage == i) {
|
||||||
|
sb.append(String.format("<li class='on'>%d</li>", i));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<li><a href='?pageIndex=%d%s'>%d</a></li>", i, parameter, i));
|
||||||
|
}
|
||||||
|
sb.append("\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNextPage) {
|
||||||
|
sb.append(String.format("<li class='next'><a href='?pageIndex=%d%s'></a></li>", endPage + 1, parameter));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<li class='next'><a href='#'></a></li>"));
|
||||||
|
}
|
||||||
|
sb.append("\r\n");
|
||||||
|
|
||||||
|
sb.append(String.format("<li class='last'><a href='?pageIndex=%d%s'></a></li>", totalPage, parameter));
|
||||||
|
sb.append("\r\n");
|
||||||
|
|
||||||
|
sb.append("</ul>");
|
||||||
|
sb.append("\r\n");
|
||||||
|
sb.append("</div>");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
<div class="paging">
|
||||||
|
<a href="#;" onclick="goPreviousPage()" class="prev sp_wadiz" title="이전 페이지"><span class="a11y">이전 페이지</span></a>
|
||||||
|
<a href="#;" onclick="goPage('1')" class="page-number current">1</a>
|
||||||
|
<a href="#;" class="page-number">2</a>
|
||||||
|
<a href="#;" class="page-number">3</a>
|
||||||
|
<a href="#;" class="page-number">4</a>
|
||||||
|
<a href="#;" class="page-number">5</a>
|
||||||
|
<a href="#;" onclick="goNextPage('1')" class="next sp_wadiz" title="다음 페이지"><span class="a11y">다음 페이지</span></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public static int getFrontTotalPage(int pageSize, int totalCount) {
|
||||||
|
|
||||||
|
//int startPage = 1;
|
||||||
|
int endPage = (totalCount + (pageSize - 1)) / pageSize;
|
||||||
|
if (endPage < 1) {
|
||||||
|
endPage = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return endPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String printFrontPager(int pageIndex, int pageSize, int totalCount) {
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
int startPage = 1;
|
||||||
|
int endPage = (totalCount + (pageSize - 1)) / pageSize;
|
||||||
|
if (endPage < 1) {
|
||||||
|
endPage = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append("<div class='paging'>");
|
||||||
|
sb.append("<a href='#;' onclick='pager.goPreviousPage()' class='prev sp_wadiz' title='이전 페이지'><span class='a11y'>이전 페이지</span></a>");
|
||||||
|
|
||||||
|
for (int i = startPage; i <= endPage; i++) {
|
||||||
|
if (pageIndex == i) {
|
||||||
|
sb.append(String.format("<a href='#;' onclick='pager.goPage(%d)' class='page-number current'>%d</a>", i, i));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href='#;' onclick='pager.goPage(%d)' class='page-number'>%d</a>", i, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append("<a href='#;' onclick='pager.goNextPage()' class='next sp_wadiz' title='다음 페이지'><span class='a11y'>다음 페이지</span></a>");
|
||||||
|
sb.append("</div>");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
<div class="paging">
|
||||||
|
<a href="#"><img src="/pub/cms/img/common/btn_pprev.gif" alt="처음페이지"/></a>
|
||||||
|
<a href="#" class="pim"><img src="/pub/cms/img/common/btn_prev.gif" alt="이전페이지"/></a>
|
||||||
|
<a href="#" class="this">1</a>
|
||||||
|
<a href="#">2</a>
|
||||||
|
<a href="#">3</a>
|
||||||
|
<a href="#">4</a>
|
||||||
|
<a href="#">5</a>
|
||||||
|
<a href="#">6</a>
|
||||||
|
<a href="#">7</a>
|
||||||
|
<a href="#">8</a>
|
||||||
|
<a href="#">9</a>
|
||||||
|
<a href="#">10</a>
|
||||||
|
<a href="#" class="pim2"><img src="/pub/cms/img/common/btn_next.gif" alt="다음페이지"/></a>
|
||||||
|
<a href="#"><img src="/pub/cms/img/common/btn_nnext.gif" alt="마지막페이지"/></a>
|
||||||
|
</div><!--// paging -->
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
static final String CMS_FIRST = "<img src='/res/pub/cms/img/common/btn_pprev.gif' alt='처음페이지'/>";
|
||||||
|
static final String CMS_PREVIOUS = "<img src='/res/pub/cms/img/common/btn_prev.gif' alt='이전페이지'/>";
|
||||||
|
static final String CMS_NEXT = "<img src='/res/pub/cms/img/common/btn_next.gif' alt='다음페이지'/>";
|
||||||
|
static final String CMS_LAST = "<img src='/res/pub/cms/img/common/btn_nnext.gif' alt='마지막페이지'/>";
|
||||||
|
|
||||||
|
|
||||||
|
public String printCmsPager(String parameter) {
|
||||||
|
|
||||||
|
if (rowTotal < 1) {
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
sb.append("<div class='paging'>");
|
||||||
|
sb.append(String.format("<a href='?pageIndex=%d%s'>" + CMS_FIRST + "</a>", 1, parameter));
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
|
||||||
|
if (isPrevPage) {
|
||||||
|
sb.append(String.format("<a href='?pageIndex=%d%s' class='pim'>" + CMS_PREVIOUS + "</a>", nowPage - 1, parameter));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href='#' class='pim'>" + CMS_PREVIOUS + "</a>"));
|
||||||
|
}
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
|
||||||
|
for (int i = startPage; i <= endPage; i++) {
|
||||||
|
if (i > startPage) {
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
if (nowPage == i) {
|
||||||
|
sb.append(String.format("<a href='#' class='this'>%d</a>", i));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href='?pageIndex=%d%s'>%d</a>", i, parameter, i));
|
||||||
|
}
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNextPage) {
|
||||||
|
sb.append(String.format("<a href='?pageIndex=%d%s' class='pim2'>" + CMS_NEXT + "</a>", endPage + 1, parameter));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href='#' class='pim2'>" + CMS_NEXT + "</a>"));
|
||||||
|
}
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
|
||||||
|
sb.append(String.format("<a href='?pageIndex=%d%s'>" + CMS_LAST + "</a>", totalPage, parameter));
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
|
||||||
|
sb.append("</div>");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2021.03.21
|
||||||
|
*/
|
||||||
|
public String printFrontPager(String parameter) {
|
||||||
|
|
||||||
|
if (rowTotal < 1) {
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
sb.append("<div class='paging'>");
|
||||||
|
sb.append(String.format("<a href=\"?pageIndex=%d%s\" class='paging-first'><span>처음으로</span></a>", 1, parameter));
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
|
||||||
|
if (isPrevPage) {
|
||||||
|
sb.append(String.format("<a href=\"?pageIndex=%d%s\" class='paging-prev'><span>이전</span></a>", nowPage - 1, parameter));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href='#' class='paging-prev disabled'><span>이전</span></a>"));
|
||||||
|
}
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
|
||||||
|
for (int i = startPage; i <= endPage; i++) {
|
||||||
|
if (i > startPage) {
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
if (nowPage == i) {
|
||||||
|
sb.append(String.format("<a href='#' class='on'><span>%d</span></a>", i));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href=\"?pageIndex=%d%s\"><span>%d</span></a>", i, parameter, i));
|
||||||
|
}
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNextPage) {
|
||||||
|
sb.append(String.format("<a href=\"?pageIndex=%d%s\" class='paging-next'><span>다음</span></a>", endPage + 1, parameter));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href='#' class='paging-next disabled'><span>다음</span></a>"));
|
||||||
|
}
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
|
||||||
|
sb.append(String.format("<a href=\"?pageIndex=%d%s\" class='paging-last'><span>마지막으로</span></a>", totalPage, parameter));
|
||||||
|
sb.append(StringUtils.CRLF);
|
||||||
|
|
||||||
|
sb.append("</div>");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String printHtml() {
|
||||||
|
|
||||||
|
if (rowTotal < 1) {
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
sb.append("<div class='paging'><ul>");
|
||||||
|
|
||||||
|
if (isPrevPage) {
|
||||||
|
sb.append(String.format("<a href='#' onclick='goPage(%d)'><li><img src='/res/front/home/asset/images/board_pre.png'></li></a>", (startPage - 1)));
|
||||||
|
} else {
|
||||||
|
sb.append("<li><img src='/res/front/home/asset/images/board_pre.png'></li>");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = startPage; i <= endPage; i++) {
|
||||||
|
if (i > startPage) {
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nowPage == i) {
|
||||||
|
sb.append(String.format("<li class='cur'>%d</li>", i));
|
||||||
|
} else {
|
||||||
|
sb.append(String.format("<a href='#' onclick='goPage(%d)'><li>%d</li></a>", i, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNextPage) {
|
||||||
|
sb.append(String.format("<a href='#' onclick='goPage(%d)'><li><img src='/res/front/home/asset/images/board_next.png'></li></a>", endPage + 1));
|
||||||
|
} else {
|
||||||
|
sb.append("<li><img src='/res/front/home/asset/images/board_next.png'></li>");
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append("</ul></div>");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
import org.springframework.security.crypto.bcrypt.BCrypt;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class PasswordUtils {
|
||||||
|
|
||||||
|
public static String hashPassword(String plainText){
|
||||||
|
return BCrypt.hashpw(plainText, BCrypt.gensalt());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean equals(String plainText, String hashed) {
|
||||||
|
if (plainText == null || hashed == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return BCrypt.checkpw(plainText, hashed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
|
||||||
|
public class PhoneUtils {
|
||||||
|
|
||||||
|
|
||||||
|
public static String toString(String value) {
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (value.length() == 8) {
|
||||||
|
return value.replaceFirst("^([0-9]{4})([0-9]{4})$", "$1-$2");
|
||||||
|
} else if (value.length() == 12) {
|
||||||
|
return value.replaceFirst("(^[0-9]{4})([0-9]{4})([0-9]{4})$", "$1-$2-$3");
|
||||||
|
}
|
||||||
|
return value.replaceFirst("(^02|[0-9]{3})([0-9]{3,4})([0-9]{4})$", "$1-$2-$3");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import java.security.*;
|
||||||
|
import java.security.spec.RSAPublicKeySpec;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class RSASecureUtils {
|
||||||
|
|
||||||
|
public final static String RSA_WEB_KEY = "_RSA_WEB_Key_"; // RSA session key 이름
|
||||||
|
private final static String RSA_INSTANCE = "RSA"; //인스턴스 형식(RSA/ECB/PKCS1Padding)
|
||||||
|
|
||||||
|
public static void removePrivateKey(HttpSession session){
|
||||||
|
session.removeAttribute(RSA_WEB_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rsa 공개키, 개인키 생성
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
*/
|
||||||
|
public static void initRsa(HttpServletRequest request) {
|
||||||
|
HttpSession session = request.getSession();
|
||||||
|
if(session.getAttribute(RSA_WEB_KEY) != null &&
|
||||||
|
request.getAttribute("RSAModulus") !=null &&
|
||||||
|
request.getAttribute("RSAExponent") !=null
|
||||||
|
){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
KeyPairGenerator generator;
|
||||||
|
try {
|
||||||
|
generator = KeyPairGenerator.getInstance(RSA_INSTANCE);
|
||||||
|
generator.initialize(1024);
|
||||||
|
|
||||||
|
KeyPair keyPair = generator.genKeyPair();
|
||||||
|
KeyFactory keyFactory = KeyFactory.getInstance(RSA_INSTANCE);
|
||||||
|
PublicKey publicKey = keyPair.getPublic();
|
||||||
|
PrivateKey privateKey = keyPair.getPrivate();
|
||||||
|
|
||||||
|
removePrivateKey(session);
|
||||||
|
session.setAttribute(RSA_WEB_KEY, privateKey); // session에 RSA 개인키를 세션에 저장
|
||||||
|
|
||||||
|
RSAPublicKeySpec publicSpec = (RSAPublicKeySpec) keyFactory.getKeySpec(publicKey, RSAPublicKeySpec.class);
|
||||||
|
String publicKeyModulus = publicSpec.getModulus().toString(16);
|
||||||
|
String publicKeyExponent = publicSpec.getPublicExponent().toString(16);
|
||||||
|
|
||||||
|
request.setAttribute("RSAModulus", publicKeyModulus); // rsa modulus 를 request 에 추가
|
||||||
|
request.setAttribute("RSAExponent", publicKeyExponent); // rsa exponent 를 request 에 추가
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 복호화
|
||||||
|
*
|
||||||
|
* @param privateKey
|
||||||
|
* @param securedValue
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static String decryptRsa(PrivateKey privateKey, String securedValue) throws Exception{
|
||||||
|
Cipher cipher = Cipher.getInstance(RSA_INSTANCE);
|
||||||
|
byte[] encryptedBytes = hexToByteArray(securedValue);
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, privateKey);
|
||||||
|
byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
|
||||||
|
return new String(decryptedBytes, "utf-8"); // 문자 인코딩 주의.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16진 문자열을 byte 배열로 변환한다.
|
||||||
|
*
|
||||||
|
* @param hex
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static byte[] hexToByteArray(String hex) {
|
||||||
|
if (hex == null || hex.length() % 2 != 0) { return new byte[] {}; }
|
||||||
|
|
||||||
|
byte[] bytes = new byte[hex.length() / 2];
|
||||||
|
for (int i = 0; i < hex.length(); i += 2) {
|
||||||
|
byte value = (byte) Integer.parseInt(hex.substring(i, i + 2), 16);
|
||||||
|
bytes[(int) Math.floor(i / 2)] = value;
|
||||||
|
}
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class RequestUtils {
|
||||||
|
|
||||||
|
public static String getServerUrl(HttpServletRequest request) {
|
||||||
|
|
||||||
|
if (request.getServerPort() == 80 || request.getServerPort() == 443) {
|
||||||
|
return request.getScheme() + "://" + getHost(request);
|
||||||
|
} else {
|
||||||
|
return request.getScheme() + "://" + getHost(request) + ":" + request.getServerPort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUri(HttpServletRequest request) {
|
||||||
|
return request.getRequestURI();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getHost(HttpServletRequest request) {
|
||||||
|
|
||||||
|
String host = StringUtils.Empty;
|
||||||
|
try {
|
||||||
|
URL url = new URL(request.getRequestURL().toString());
|
||||||
|
host = url.getHost();
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
}
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUserAgent(HttpServletRequest request) {
|
||||||
|
return request.getHeader("User-Agent").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMobileDevice(HttpServletRequest request) {
|
||||||
|
String userAgent = RequestUtils.getUserAgent(request);
|
||||||
|
return (userAgent.contains("iPhone") || userAgent.contains("iPad") || userAgent.contains("Android"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getClientIP(HttpServletRequest request) {
|
||||||
|
|
||||||
|
String ip = request.getHeader("X-FORWARDED-FOR");
|
||||||
|
|
||||||
|
if (ip == null || ip.length() == 0) {
|
||||||
|
ip = request.getHeader("Proxy-Client-IP");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ip == null || ip.length() == 0) {
|
||||||
|
ip = request.getHeader("WL-Proxy-Client-IP"); // 웹로직
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ip == null || ip.length() == 0) {
|
||||||
|
ip = request.getRemoteAddr();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isPcBrowser(HttpServletRequest request) {
|
||||||
|
return !isMobileBrowser(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMobileBrowser(HttpServletRequest request) {
|
||||||
|
|
||||||
|
String ua = request.getHeader("User-Agent").toLowerCase();
|
||||||
|
|
||||||
|
if (ua.matches(".*(android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|pad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino).*")
|
||||||
|
|| ua.substring(0, 4).matches("1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|e\\-|e\\/|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\\-|2|g)|yas\\-|your|zeto|zte\\-")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String URL_API = "/api/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* api경로인지 여부
|
||||||
|
*/
|
||||||
|
public static boolean isApiCall(HttpServletRequest request) {
|
||||||
|
return request.getRequestURI().contains(URL_API);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString(HttpServletRequest request, String name) {
|
||||||
|
if (request.getParameter(name) == null) {
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
return request.getParameter(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getBoolByAttr(HttpServletRequest request, String name) {
|
||||||
|
try {
|
||||||
|
if (request.getAttribute(name) != null) {
|
||||||
|
return (boolean) request.getAttribute(name);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info(e.getMessage());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getStringByAttr(HttpServletRequest request, String name) {
|
||||||
|
try {
|
||||||
|
if (request.getAttribute(name) != null) {
|
||||||
|
return (String) request.getAttribute(name);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info(e.getMessage());
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getInteger(HttpServletRequest request, String name) {
|
||||||
|
String value = request.getParameter(name);
|
||||||
|
if (value != null) {
|
||||||
|
return NumberUtils.toNumber(value);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long getLong(HttpServletRequest request, String name) {
|
||||||
|
String value = request.getParameter(name);
|
||||||
|
if (value != null) {
|
||||||
|
return NumberUtils.toLong(value);
|
||||||
|
}
|
||||||
|
return 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.ns.mobile.website.biz.exception.BizException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.http.ContentDisposition;
|
||||||
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class ResponseUtils {
|
||||||
|
|
||||||
|
private static final String HTML_TITLE = "TITLE";
|
||||||
|
private static final String JS_ALERT = "alert(\"%s\");";
|
||||||
|
private static final String JS_LOCATION = "location.href = \"%s\";";
|
||||||
|
private static final String JS_HISTORY_BACK = "history.back();";
|
||||||
|
|
||||||
|
public static void responseHtml(HttpServletResponse response, String script) {
|
||||||
|
responseHtml(response, script, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void responseHtml(HttpServletResponse response, String script, String body) {
|
||||||
|
try {
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
response.setContentType("text/html;charset=utf-8");
|
||||||
|
|
||||||
|
PrintWriter printWriter = response.getWriter();
|
||||||
|
|
||||||
|
String title = "LANEDU";
|
||||||
|
|
||||||
|
printWriter.write("<!doctype html>");
|
||||||
|
printWriter.write("<html lang='ko'>");
|
||||||
|
printWriter.write(" <head>");
|
||||||
|
printWriter.write(" <title>" + title + "</title>");
|
||||||
|
printWriter.write(" <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>");
|
||||||
|
printWriter.write(" <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>");
|
||||||
|
printWriter.write(" <meta name='viewport' content='user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width'>");
|
||||||
|
printWriter.write(" <meta charset='utf-8'>");
|
||||||
|
printWriter.write(" <script>" + script + "</script>");
|
||||||
|
printWriter.write(" </head>");
|
||||||
|
printWriter.write(" <body>" + body + "</body>");
|
||||||
|
printWriter.write("</html>");
|
||||||
|
printWriter.close();
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("[IOException] error: {}", e.getMessage());
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("[Exception] error: {}", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void htmlAlert(HttpServletResponse response, String msg) {
|
||||||
|
String script = String.format(JS_ALERT, msg);
|
||||||
|
responseHtml(response, script);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void htmlLocation(HttpServletResponse response, String url) {
|
||||||
|
String script = String.format(JS_LOCATION, url);
|
||||||
|
responseHtml(response, script);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void htmlAlertAndHistoryBack(HttpServletResponse response, String msg) {
|
||||||
|
String script = String.format(JS_ALERT, msg) + JS_HISTORY_BACK;
|
||||||
|
responseHtml(response, script);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void htmlAlertAndLocation(HttpServletRequest request, HttpServletResponse response, String msg, String url) {
|
||||||
|
if (RequestUtils.isApiCall(request)) {
|
||||||
|
responseJson(response, false, "", msg);
|
||||||
|
} else {
|
||||||
|
String script = String.format(JS_ALERT, msg) + String.format(JS_LOCATION, url);
|
||||||
|
responseHtml(response, script);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void htmlAlertAndLocation(HttpServletRequest request, HttpServletResponse response, String resultCode, String msg, String url) {
|
||||||
|
if (RequestUtils.isApiCall(request)) {
|
||||||
|
responseJson(response, false, resultCode, msg);
|
||||||
|
} else {
|
||||||
|
String script = String.format(JS_ALERT, msg) + String.format(JS_LOCATION, url);
|
||||||
|
responseHtml(response, script);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void htmlAlertAndKakaoClose(HttpServletResponse response, String msg, String osType) {
|
||||||
|
String script = String.format(JS_ALERT, msg);
|
||||||
|
if ("IOS".equals(osType)) {
|
||||||
|
script += "window.location.href = 'kakaoweb://closeBrowser';";
|
||||||
|
} else if ("ANDROID".equals(osType)) {
|
||||||
|
script += "window.location.href = 'kakaotalk://inappbrowser/close';";
|
||||||
|
}
|
||||||
|
|
||||||
|
responseHtml(response, script);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void responseJsonFailMessage(HttpServletResponse response, String resultCode, String message) {
|
||||||
|
responseJson(response, false, resultCode, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
static class JsonResult {
|
||||||
|
boolean result;
|
||||||
|
String resultCode;
|
||||||
|
String message;
|
||||||
|
|
||||||
|
public JsonResult(String resultCode, String message) {
|
||||||
|
this.result = false;
|
||||||
|
this.resultCode = resultCode;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void responseJson(HttpServletResponse response, boolean result, String resultCode, String message) {
|
||||||
|
try {
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
response.setContentType("application/json;charset=utf-8");
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(String.format("{\"header\": {\"result\": %s, \"message\": \"%s\", \"errCode\": \"%s\"}, \"body\": null}", (result ? "true" : "false"), message, ""));
|
||||||
|
|
||||||
|
PrintWriter printWriter = response.getWriter();
|
||||||
|
printWriter.write(sb.toString());
|
||||||
|
printWriter.close();
|
||||||
|
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
log.error("[JsonProcessingException] error: {}", e.getMessage());
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("[IOException] error: {}", e.getMessage());
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("[Exception] error: {}", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void responseJson(HttpServletResponse response, String json) {
|
||||||
|
try {
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
response.setContentType("application/json;charset=utf-8");
|
||||||
|
|
||||||
|
PrintWriter printWriter = response.getWriter();
|
||||||
|
printWriter.write(json);
|
||||||
|
printWriter.close();
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("[IOException] error: {}", e.getMessage());
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("[Exception] error: {}", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fileDownload(HttpServletResponse response, String filePath, String originalFilename) throws BizException {
|
||||||
|
|
||||||
|
File file = new File(filePath);
|
||||||
|
if (!file.exists()) {
|
||||||
|
throw new BizException(" 요청하신 파일이 존재하지 않습니다. ");
|
||||||
|
}
|
||||||
|
|
||||||
|
String mimeType = URLConnection.guessContentTypeFromName(file.getName());
|
||||||
|
if (mimeType == null) {
|
||||||
|
log.error("mimetype is not detectable, will take default");
|
||||||
|
mimeType = "application/octet-stream";
|
||||||
|
}
|
||||||
|
response.setContentType(mimeType);
|
||||||
|
|
||||||
|
ContentDisposition contentDisposition = ContentDisposition.builder("attachment").filename(originalFilename, StandardCharsets.UTF_8).build();
|
||||||
|
response.setHeader("Content-Disposition", contentDisposition.toString());
|
||||||
|
//response.setHeader("Content-Disposition", String.format("inline; filename=\"" + saveFilename + "\""));
|
||||||
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
response.setContentLength((int) file.length());
|
||||||
|
|
||||||
|
try {
|
||||||
|
FileInputStream fileInputStream = new FileInputStream(file);
|
||||||
|
InputStream inputStream = new BufferedInputStream(fileInputStream);
|
||||||
|
FileCopyUtils.copy(inputStream, response.getOutputStream());
|
||||||
|
inputStream.close();
|
||||||
|
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
log.error("[FileNotFoundException] error: {}", e.getMessage());
|
||||||
|
throw new BizException(" 요청하신 파일이 존재하지 않습니다. ");
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("[IOException] error: {}", e.getMessage());
|
||||||
|
throw new BizException(" IO처리중 문제가 발생하였습니다. ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class StringUtils {
|
||||||
|
|
||||||
|
public static final String NULL = null;
|
||||||
|
public static final String Empty = "";
|
||||||
|
public static final String CRLF = "\r\n";
|
||||||
|
public static final String TAB = "\t";
|
||||||
|
public static final String LINE_BAR = "##############################################";
|
||||||
|
public static final String LINE_BAR3 = CRLF + LINE_BAR + CRLF + LINE_BAR + CRLF + LINE_BAR;
|
||||||
|
|
||||||
|
|
||||||
|
public static final String FORMAT_LOG = "%-30s\t: %s";
|
||||||
|
|
||||||
|
public static final String STR_APPLICATION_JSON = "application/json";
|
||||||
|
|
||||||
|
public static boolean emt(Object obj) {
|
||||||
|
return isEmpty(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEmpty(Object obj) {
|
||||||
|
return org.springframework.util.StringUtils.isEmpty(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEmpty(String obj) {
|
||||||
|
return org.springframework.util.StringUtils.isEmpty(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean nemt(Object obj) {
|
||||||
|
return isNotEmpty(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNotEmpty(Object obj) {
|
||||||
|
return !isEmpty(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNotEmpty(String obj) {
|
||||||
|
return !isEmpty(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Object getTimeStamp() {
|
||||||
|
SimpleDateFormat dayTime = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||||
|
return dayTime.format(new Date(System.currentTimeMillis()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean equals(String val1, String val2) {
|
||||||
|
return val1 != null && val2 != null && val1.equals(val2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean eq(String val1, String val2) {
|
||||||
|
return equals(val1, val2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean neq(String val1, String val2) {
|
||||||
|
return !eq(val1, val2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean notEquals(String val1, String val2) {
|
||||||
|
return !equals(val1, val2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getUuid() {
|
||||||
|
return UUID.randomUUID().toString().replaceAll("-", "").toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUuid(int length) {
|
||||||
|
return UUID.randomUUID().toString().replaceAll("-", "").toLowerCase().substring(0, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString(String value) {
|
||||||
|
return getString(value, StringUtils.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString(String value, String emptyValue) {
|
||||||
|
if (StringUtils.isEmpty(value)) {
|
||||||
|
return emptyValue;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean andNotEmpty(String... args) {
|
||||||
|
if (args != null) {
|
||||||
|
for (int i = 0; i < args.length; i++) {
|
||||||
|
if (isEmpty(args[i])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean orEmpty(String... args) {
|
||||||
|
|
||||||
|
for (String x : args) {
|
||||||
|
if (isEmpty(x)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean orNotEmpty(String... args) {
|
||||||
|
|
||||||
|
for (String x : args) {
|
||||||
|
if (isNotEmpty(x)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean orEquals(String value, String... args) {
|
||||||
|
|
||||||
|
for (int i = 0; i < args.length; i++) {
|
||||||
|
if (StringUtils.equals(value, args[i])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean orContains(String value, String... args) {
|
||||||
|
|
||||||
|
for (int i = 0; i < args.length; i++) {
|
||||||
|
if (value.contains(args[i])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String left(String s, int len) {
|
||||||
|
|
||||||
|
if (isNotEmpty(s)) {
|
||||||
|
if (s.length() >= len ) {
|
||||||
|
return s.substring(0, len);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String leftPad(String s, int n) {
|
||||||
|
return String.format("%1$" + n + "s", s).replace(' ', '0');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 한글2, 영문1
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getKorLength(String str) {
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(str)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int length = str.trim().getBytes().length;
|
||||||
|
try {
|
||||||
|
String eucKrName = new String(str.trim().getBytes("UTF-8"), "EUC-KR");
|
||||||
|
length = eucKrName.length();
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String getComleteWordByJongsung(String name, String firstValue, String secondValue) {
|
||||||
|
char lastName = name.charAt(name.length() - 1);
|
||||||
|
// 한글의 제일 처음과 끝의 범위밖일 경우는 오류
|
||||||
|
if (lastName < 0xAC00 || lastName > 0xD7A3) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String seletedValue = (lastName - 0xAC00) % 28 > 0 ? firstValue : secondValue;
|
||||||
|
return seletedValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String formatReplaceAlls(String value, String... args) {
|
||||||
|
if (args != null) {
|
||||||
|
for(int i = 0; i < args.length; i+=2) {
|
||||||
|
args[i] = "\\{" + args[i] + "\\}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return replaceAlls(value, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String replaceAlls(String value, String... args) {
|
||||||
|
if (args != null) {
|
||||||
|
for(int i = 0; i < args.length; i+=2) {
|
||||||
|
value = value.replaceAll(args[i], args[i+1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
package com.ns.mobile.website.common.util;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public final class ZapUtil {
|
||||||
|
|
||||||
|
public static LocalDateTime convDateTime(String dateStr) {
|
||||||
|
return convDateTime(dateStr,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LocalDateTime convDateTime(String dateStr, int addDays) {
|
||||||
|
|
||||||
|
LocalDateTime date = LocalDateTime.now().plusDays(addDays);
|
||||||
|
if(dateStr==null) return date;
|
||||||
|
if(dateStr.length()<8) return date;
|
||||||
|
|
||||||
|
try{
|
||||||
|
String inDate = dateReFormat(dateStr);
|
||||||
|
System.out.println("...... dateStr : "+dateStr +" >> "+inDate);
|
||||||
|
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
// 문자열 -> Date
|
||||||
|
date = LocalDateTime.parse(inDate, formatter);
|
||||||
|
System.out.println("...... res : " + date); // 2021-06-19T21:05:07
|
||||||
|
}
|
||||||
|
catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String dateReFormat(String bfDate) {
|
||||||
|
|
||||||
|
String dt2 = bfDate.replace("오후", "PM");
|
||||||
|
|
||||||
|
// String dt3 = dt2.replaceAll("[./-:]"," ");
|
||||||
|
String dt3 = dt2.replace("."," ");
|
||||||
|
dt3 = dt3.replace("/"," ");
|
||||||
|
dt3 = dt3.replace("-"," ");
|
||||||
|
dt3 = dt3.replace(":"," ");
|
||||||
|
|
||||||
|
int tt[] = { 2021,8,1, 0,0,0 };
|
||||||
|
String pp[] = dt3.split(" ");
|
||||||
|
|
||||||
|
for(int i=0, j=0;i<pp.length;i++) {
|
||||||
|
int val = convInt(pp[i]);
|
||||||
|
|
||||||
|
ZapUtil.fileLog("test.log", "--> "+i+":"+pp[i]+">"+val+" , j:"+j);
|
||||||
|
|
||||||
|
if(val<0) continue;
|
||||||
|
tt[j++] = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
ZapUtil.fileLog("test.log", tt[0]+","+tt[1]+","+tt[2]+","+tt[3]+","+tt[4]+","+tt[5]);
|
||||||
|
if(dt2.indexOf("PM")>=0) tt[3] += 12;
|
||||||
|
|
||||||
|
String newDate = tt[0]+"-"+convStr2(tt[1])+"-"+convStr2(tt[2])
|
||||||
|
+ " "+convStr2(tt[3])+":"+convStr2(tt[4])+":"+convStr2(tt[5]);
|
||||||
|
|
||||||
|
return newDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
public static int convInt(String str){
|
||||||
|
try{
|
||||||
|
int nn = Integer.parseInt(str);
|
||||||
|
return nn;
|
||||||
|
}
|
||||||
|
catch (Exception e) {}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
public static String convStr2(int val){
|
||||||
|
if(val<10) return "0"+val;
|
||||||
|
return ""+val;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int atoi(String str) {
|
||||||
|
try{
|
||||||
|
return Integer.parseInt(str);
|
||||||
|
}
|
||||||
|
catch(Exception e) {}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------
|
||||||
|
public static boolean isInsideDay(LocalDateTime regDatetime, int days) {
|
||||||
|
|
||||||
|
LocalDateTime passDate = regDatetime.plusDays(days);
|
||||||
|
LocalDateTime today = LocalDateTime.now();
|
||||||
|
|
||||||
|
boolean res = today.isBefore(passDate);
|
||||||
|
|
||||||
|
// fileLog("######## isInsideDay.regDate "+regDatetime);
|
||||||
|
// fileLog("######## isInsideDay.passDate "+passDate);
|
||||||
|
// fileLog("######## isInsideDay.today "+today + " -------> "+res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
// ===========================================================================
|
||||||
|
public static String LogText(int logType, Object clsObj, String dateForm, String msg) {
|
||||||
|
|
||||||
|
String timeStr = "";
|
||||||
|
String cname = "";
|
||||||
|
String msgHdr = "";
|
||||||
|
String logMsg = "";
|
||||||
|
try {
|
||||||
|
if(dateForm!=null) {
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat(dateForm);
|
||||||
|
timeStr = "["+format.format(new Date())+"] ";
|
||||||
|
}
|
||||||
|
if(clsObj!=null) {
|
||||||
|
cname= clsObj.getClass().getName();
|
||||||
|
cname = "["+cname.substring(cname.lastIndexOf(".")+1)+"] ";
|
||||||
|
}
|
||||||
|
if(logType==0) msgHdr = ">>> ";
|
||||||
|
if(logType==1) msgHdr = ".. ";
|
||||||
|
if(logType==2) msgHdr = "-- ";
|
||||||
|
|
||||||
|
logMsg = timeStr + cname + msgHdr + msg;
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return logMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fileLog(boolean stdOut, String fname, String msg) {
|
||||||
|
|
||||||
|
String logMsg = LogText(-1, null, "MM-dd HH:mm:ss", msg) + "\n";
|
||||||
|
try {
|
||||||
|
File file = new File(fname);
|
||||||
|
FileWriter fw = new FileWriter(file, true);
|
||||||
|
fw.write(logMsg);
|
||||||
|
fw.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(stdOut) System.out.print("...... "+logMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fileLog(String fname, String msg) {
|
||||||
|
if(fname==null) {
|
||||||
|
System.out.print("....... "+msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fileLog(true, "/NAS/LANEDU/log/"+fname, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fileLog(String msg) {
|
||||||
|
fileLog(true, "api_test.log", msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fileLog(Object clsObj, String msg) {
|
||||||
|
String cname= clsObj.getClass().getName();
|
||||||
|
fileLog(true, cname+".log", msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.ns.mobile.website.config;
|
||||||
|
|
||||||
|
import com.captcha.botdetect.web.servlet.CaptchaServlet;
|
||||||
|
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class CaptchaConfiguration {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public ServletRegistrationBean captchaServletRegistration() {
|
||||||
|
ServletRegistrationBean srb = new ServletRegistrationBean();
|
||||||
|
srb.setServlet(new CaptchaServlet());
|
||||||
|
srb.addUrlMappings("/botdetectcaptcha");
|
||||||
|
return srb;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.ns.mobile.website.config;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSessionAttributeListener;
|
||||||
|
import javax.servlet.http.HttpSessionBindingEvent;
|
||||||
|
import javax.servlet.http.HttpSessionEvent;
|
||||||
|
import javax.servlet.http.HttpSessionListener;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Configuration
|
||||||
|
public class HttpSessionConfiguration {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public HttpSessionListener httpSessionListener() {
|
||||||
|
|
||||||
|
|
||||||
|
return new HttpSessionListener() {
|
||||||
|
@Override
|
||||||
|
public void sessionCreated(HttpSessionEvent sessionEvent) {
|
||||||
|
log.info("세션 생성, Session ID: {}", sessionEvent.getSession().getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sessionDestroyed(HttpSessionEvent sessionEvent) {
|
||||||
|
log.info("세션 소멸, Session ID: {}", sessionEvent.getSession().getId());
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public HttpSessionAttributeListener httpSessionAttributeListener() {
|
||||||
|
return new HttpSessionAttributeListener() {
|
||||||
|
@Override
|
||||||
|
public void attributeAdded(HttpSessionBindingEvent se) {
|
||||||
|
// This method will be automatically called when session attribute added
|
||||||
|
log.info("Attribute Added following information");
|
||||||
|
log.info("Attribute Name:" + se.getName());
|
||||||
|
log.info("Attribute Value:" + se.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void attributeRemoved(HttpSessionBindingEvent se) {
|
||||||
|
// This method will be automatically called when session attribute removed
|
||||||
|
log.info("attributeRemoved");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void attributeReplaced(HttpSessionBindingEvent se) {
|
||||||
|
// This method will be automatically called when session attribute replace
|
||||||
|
log.info("Attribute Replaced following information");
|
||||||
|
log.info("Attribute Name:" + se.getName());
|
||||||
|
log.info("Attribute Old Value:" + se.getValue());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.ns.mobile.website.config;
|
||||||
|
|
||||||
|
import org.jasypt.encryption.StringEncryptor;
|
||||||
|
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
|
||||||
|
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.web.properties.LaneduProperties;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class JasyptConfig {
|
||||||
|
|
||||||
|
private final LaneduProperties laneduProperties;
|
||||||
|
|
||||||
|
@Bean(name = "jasyptStringEncryptor")
|
||||||
|
public StringEncryptor stringEncryptor() {
|
||||||
|
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
|
||||||
|
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
|
||||||
|
config.setPassword(laneduProperties.getJasyptConfigPassword()); // 암호화할 때 사용하는 키
|
||||||
|
config.setAlgorithm("PBEWithMD5AndDES"); // 암호화 알고리즘
|
||||||
|
config.setKeyObtentionIterations("1000"); // 반복할 해싱 회수
|
||||||
|
config.setPoolSize("1"); // 인스턴스 pool
|
||||||
|
config.setProviderName("SunJCE");
|
||||||
|
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator"); // salt 생성 클래스
|
||||||
|
config.setStringOutputType("base64"); //인코딩 방식
|
||||||
|
encryptor.setConfig(config);
|
||||||
|
return encryptor;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.ns.mobile.website.config;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||||
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
|
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Configuration
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@EnableWebSecurity
|
||||||
|
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public PasswordEncoder getPasswordEncoder() {
|
||||||
|
return new BCryptPasswordEncoder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure(WebSecurity web) throws Exception {
|
||||||
|
|
||||||
|
web.ignoring().antMatchers("/favicon.ico"
|
||||||
|
, "/apple-touch-icon.png"
|
||||||
|
, "/res/**");
|
||||||
|
|
||||||
|
super.configure(web);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
|
|
||||||
|
http.csrf().disable();
|
||||||
|
http.headers().frameOptions().sameOrigin();
|
||||||
|
|
||||||
|
http.authorizeRequests()
|
||||||
|
.antMatchers("/", "/**")
|
||||||
|
.permitAll();
|
||||||
|
|
||||||
|
/*
|
||||||
|
http.logout()
|
||||||
|
.logoutRequestMatcher(new AntPathRequestMatcher("/home/user/logout"))
|
||||||
|
.logoutSuccessUrl("/")
|
||||||
|
.invalidateHttpSession(true);
|
||||||
|
*/
|
||||||
|
|
||||||
|
http.exceptionHandling()
|
||||||
|
.accessDeniedPage("/common/denied");
|
||||||
|
|
||||||
|
super.configure(http);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ns.mobile.website.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.LanEduWebsiteApplication;
|
||||||
|
|
||||||
|
public class ServletInitializer extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
|
return application.sources(LanEduWebsiteApplication.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.ns.mobile.website.config;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ns.mobile.website.web.interceptor.FrontInterceptor;
|
||||||
|
import com.ns.mobile.website.biz.properties.FileUrlProperties;
|
||||||
|
import com.navercorp.lucy.security.xss.servletfilter.XssEscapeServletFilter;
|
||||||
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class WebMvcConfiguration implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
private final FileUrlProperties fileUrlProperties;
|
||||||
|
|
||||||
|
public WebMvcConfiguration(FileUrlProperties fileUrlProperties) {
|
||||||
|
this.fileUrlProperties = fileUrlProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Lucy Xss filter
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public FilterRegistrationBean<XssEscapeServletFilter> getFilterRegistrationBean() {
|
||||||
|
FilterRegistrationBean<XssEscapeServletFilter> filterRegistration = new FilterRegistrationBean<>();
|
||||||
|
filterRegistration.setFilter(new XssEscapeServletFilter());
|
||||||
|
filterRegistration.setOrder(1);
|
||||||
|
filterRegistration.addUrlPatterns("/*");
|
||||||
|
return filterRegistration;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
FrontInterceptor getFrontInterceptor() {
|
||||||
|
return new FrontInterceptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
|
registry.addInterceptor(getFrontInterceptor())
|
||||||
|
.addPathPatterns("/**")
|
||||||
|
.excludePathPatterns("/res/**")
|
||||||
|
.excludePathPatterns("/cms/**")
|
||||||
|
.excludePathPatterns("/wenMedia/**")
|
||||||
|
.excludePathPatterns("/files/**")
|
||||||
|
.excludePathPatterns("/favicon.ico")
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
|
||||||
|
registry.addResourceHandler("/files/**")
|
||||||
|
.addResourceLocations("file:" + fileUrlProperties.getBaseUploadLocation() + "/");
|
||||||
|
|
||||||
|
//.addResourceLocations("file:/Users/parkkyutae/Documents/sources/github/innosysit/innosysit-clean-website/files/")
|
||||||
|
registry.addResourceHandler("/cms/files/**")
|
||||||
|
.addResourceLocations("file:" + fileUrlProperties.getCmsUploadLocation() + "/")
|
||||||
|
.setCachePeriod(60 * 60 * 24 * 365);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.ns.mobile.website.web.auth;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ns.mobile.website.common.util.StringUtils;
|
||||||
|
import com.ns.mobile.website.web.controller.extra.ResultCert;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
import org.apache.catalina.manager.util.SessionUtils;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class CertSessionUtils {
|
||||||
|
|
||||||
|
|
||||||
|
private final static String CERT_VALUE = "cert_value";
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean isCert(HttpSession session) {
|
||||||
|
|
||||||
|
if (session != null && session.getAttribute(CERT_VALUE) != null) {
|
||||||
|
ResultCert resultCert = (ResultCert)session.getAttribute(CERT_VALUE);
|
||||||
|
return resultCert.isSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setCert(HttpSession session, ResultCert resultCert) {
|
||||||
|
session.setAttribute(CERT_VALUE, resultCert);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCertPhone(HttpSession session) {
|
||||||
|
if (session != null && session.getAttribute(CERT_VALUE) != null) {
|
||||||
|
ResultCert resultCert = (ResultCert)session.getAttribute(CERT_VALUE);
|
||||||
|
return resultCert.getPhoneNo();
|
||||||
|
}
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCertName(HttpSession session) {
|
||||||
|
if (session != null && session.getAttribute(CERT_VALUE) != null) {
|
||||||
|
ResultCert resultCert = (ResultCert)session.getAttribute(CERT_VALUE);
|
||||||
|
return resultCert.getName();
|
||||||
|
}
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.ns.mobile.website.web.auth;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ns.mobile.website.common.util.StringUtils;
|
||||||
|
import com.ns.mobile.website.web.controller.extra.ResultCert;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class EmailSessionUtils {
|
||||||
|
|
||||||
|
private final static String EMAIL_VALUE = "email_value";
|
||||||
|
|
||||||
|
public static void set(HttpSession session, String value) {
|
||||||
|
session.setAttribute(EMAIL_VALUE, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get(HttpSession session) {
|
||||||
|
|
||||||
|
if (session != null && session.getAttribute(EMAIL_VALUE) != null) {
|
||||||
|
return (String)session.getAttribute(EMAIL_VALUE);
|
||||||
|
}
|
||||||
|
return StringUtils.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.ns.mobile.website.web.auth;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Target({ElementType.METHOD})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface PublicAccess {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.ns.mobile.website.web.auth;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ns.mobile.website.common.util.StringUtils;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class PwdCheckSessionUtils {
|
||||||
|
|
||||||
|
private final static String PASSWORD_CHECK = "PASSWORD_CHECK";
|
||||||
|
|
||||||
|
public static void set(HttpSession session) {
|
||||||
|
session.setAttribute(PASSWORD_CHECK, "Y");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clear(HttpSession session) {
|
||||||
|
session.removeAttribute(PASSWORD_CHECK);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isOK(HttpSession session) {
|
||||||
|
if (session != null && session.getAttribute(PASSWORD_CHECK) != null) {
|
||||||
|
return "Y".equals(session.getAttribute(PASSWORD_CHECK));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isFail(HttpSession session) {
|
||||||
|
return !isOK(session);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.ns.mobile.website.web.controller;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Controller
|
||||||
|
public class BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.ns.mobile.website.web.controller;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.web.auth.PublicAccess;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Controller
|
||||||
|
public class ErrorController implements org.springframework.boot.web.servlet.error.ErrorController {
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@Override
|
||||||
|
@RequestMapping("/error")
|
||||||
|
public String getErrorPath() {
|
||||||
|
return "common/error";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.ns.mobile.website.web.controller;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.web.auth.PublicAccess;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Controller
|
||||||
|
public class IndexController extends BaseController {
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@GetMapping(value = {"/", "/index"})
|
||||||
|
String index(HttpServletRequest request, HttpSession session) {
|
||||||
|
|
||||||
|
return "redirect:/home";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@GetMapping(value = {"/{siteId}.home", "/{siteId}.page"})
|
||||||
|
String bizIndex(@PathVariable String siteId) {
|
||||||
|
|
||||||
|
return "redirect:/" + siteId + "/home";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@GetMapping(value = {"/policy", "/{siteId}/policy"})
|
||||||
|
String policy(@PathVariable(required = false) String siteId) {
|
||||||
|
|
||||||
|
return "common/policy";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.ns.mobile.website.web.controller.api;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.validation.FieldError;
|
||||||
|
import org.springframework.validation.ObjectError;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
public class RequestError {
|
||||||
|
|
||||||
|
private String field;
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
public static RequestError of(ObjectError e) {
|
||||||
|
|
||||||
|
RequestError requestError = new RequestError();
|
||||||
|
requestError.setMessage(e.getDefaultMessage());
|
||||||
|
requestError.setField(((FieldError) e).getField());
|
||||||
|
|
||||||
|
return requestError;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<RequestError> of(List<ObjectError> errors) {
|
||||||
|
|
||||||
|
List<RequestError> requestErrors = new ArrayList<>();
|
||||||
|
|
||||||
|
if (errors != null) {
|
||||||
|
for (ObjectError error : errors) {
|
||||||
|
requestErrors.add(RequestError.of(error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return requestErrors;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,472 @@
|
|||||||
|
package com.ns.mobile.website.web.controller.extra;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.common.util.RequestUtils;
|
||||||
|
import com.ns.mobile.website.web.auth.CertSessionUtils;
|
||||||
|
import com.ns.mobile.website.web.auth.PublicAccess;
|
||||||
|
import com.ns.mobile.website.web.controller.BaseController;
|
||||||
|
import com.ns.mobile.website.web.properties.LaneduProperties;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Controller
|
||||||
|
public class ExtraCertController extends BaseController {
|
||||||
|
|
||||||
|
private final LaneduProperties laneduProperties;
|
||||||
|
|
||||||
|
private String getNow() {
|
||||||
|
|
||||||
|
return LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSeqNumber() {
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
int seq = (new Random()).nextInt(10000) + 1;
|
||||||
|
|
||||||
|
return String.format("%s%05d"
|
||||||
|
, now.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))
|
||||||
|
, seq);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getTrCertData(String actionType) {
|
||||||
|
|
||||||
|
//tr_cert 데이터 변수 선언 ---------------------------------------------------------------
|
||||||
|
String tr_cert = "";
|
||||||
|
String cpId = "KBZM1052"; // 회원사ID
|
||||||
|
|
||||||
|
String urlCode = "002001"; // URL코드
|
||||||
|
|
||||||
|
urlCode = "004001"; // - localhost - 회원가입
|
||||||
|
urlCode = "005001"; // - localhost:8080 - 회원가입
|
||||||
|
|
||||||
|
urlCode = laneduProperties.getPhoneUrlCode();
|
||||||
|
|
||||||
|
System.out.println("#######################");
|
||||||
|
System.out.println("#######################");
|
||||||
|
System.out.println("#######################");
|
||||||
|
System.out.println(urlCode);
|
||||||
|
|
||||||
|
|
||||||
|
String certNum = getSeqNumber(); // 요청번호 ( 본인인증 요청시 중복되지 않게 생성해야함. (예-시퀀스번호) )
|
||||||
|
String date = getNow(); // 요청일시
|
||||||
|
String certMet = "M"; // 본인인증방법
|
||||||
|
String name = ""; // 성명
|
||||||
|
String phoneNo = ""; // 휴대폰번호
|
||||||
|
String phoneCorp = ""; // 이동통신사
|
||||||
|
String birthDay = ""; // 생년월일
|
||||||
|
String gender = ""; // 성별
|
||||||
|
String nation = ""; // 내외국인 구분
|
||||||
|
String plusInfo = ""; // 추가DATA정보
|
||||||
|
String extendVar = "0000000000000000"; // 확장변수
|
||||||
|
//End-tr_cert 데이터 변수 선언 ---------------------------------------------------------------
|
||||||
|
|
||||||
|
plusInfo = actionType;
|
||||||
|
|
||||||
|
|
||||||
|
String tr_add = "N"; // IFrame사용여부
|
||||||
|
|
||||||
|
|
||||||
|
//01. 한국모바일인증(주) 암호화 모듈 선언
|
||||||
|
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||||
|
|
||||||
|
//02. 1차 암호화 (tr_cert 데이터변수 조합 후 암호화)
|
||||||
|
String enc_tr_cert = "";
|
||||||
|
tr_cert = cpId + "/" + urlCode + "/" + certNum + "/" + date + "/" + certMet + "/" + birthDay + "/" + gender + "/" + name + "/" + phoneNo + "/" + phoneCorp + "/" + nation + "/" + plusInfo + "/" + extendVar;
|
||||||
|
enc_tr_cert = seed.getEnc(tr_cert, "");
|
||||||
|
|
||||||
|
//03. 1차 암호화 데이터에 대한 위변조 검증값 생성 (HMAC)
|
||||||
|
String hmacMsg = "";
|
||||||
|
hmacMsg = seed.getMsg(enc_tr_cert);
|
||||||
|
|
||||||
|
//04. 2차 암호화 (1차 암호화 데이터, HMAC 데이터, extendVar 조합 후 암호화)
|
||||||
|
tr_cert = seed.getEnc(enc_tr_cert + "/" + hmacMsg + "/" + extendVar, "");
|
||||||
|
|
||||||
|
|
||||||
|
return tr_cert;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@GetMapping(value = {"/extra/cert"})
|
||||||
|
public String cert(Model model, HttpServletRequest request) {
|
||||||
|
|
||||||
|
String actionType = RequestUtils.getString(request, "actionType");
|
||||||
|
|
||||||
|
String trCertData = getTrCertData(actionType);
|
||||||
|
String trUrl = laneduProperties.getBaseSiteUrl() + "/extra/cert/result"; // 본인인증서비스 결과수신 POPUP URL
|
||||||
|
|
||||||
|
model.addAttribute("tr_cert", trCertData);
|
||||||
|
model.addAttribute("tr_url", trUrl);
|
||||||
|
model.addAttribute("tr_add", "N");
|
||||||
|
|
||||||
|
return "extra/cert";
|
||||||
|
}
|
||||||
|
|
||||||
|
private Boolean paramChk(String patn, String param) {
|
||||||
|
Pattern pattern = Pattern.compile(patn);
|
||||||
|
Matcher matcher = pattern.matcher(param);
|
||||||
|
return matcher.matches();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ResultCert getTrCertData(String rec_cert, String k_certNum, String clientIp) {
|
||||||
|
|
||||||
|
// 파라미터 유효성 검증
|
||||||
|
if (rec_cert.length() == 0 || k_certNum.length() == 0) {
|
||||||
|
return ResultCert.fail("[오류] 결과값 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 변수선언 --------------------------------------------------------------------------------------------------------
|
||||||
|
//String rec_cert = ""; // 결과수신DATA
|
||||||
|
|
||||||
|
//String k_certNum = ""; // 파라미터로 수신한 요청번호
|
||||||
|
String certNum = ""; // 요청번호
|
||||||
|
String date = ""; // 요청일시
|
||||||
|
String CI = ""; // 연계정보(CI)
|
||||||
|
String DI = ""; // 중복가입확인정보(DI)
|
||||||
|
String phoneNo = ""; // 휴대폰번호
|
||||||
|
String phoneCorp = ""; // 이동통신사
|
||||||
|
String birthDay = ""; // 생년월일
|
||||||
|
String gender = ""; // 성별
|
||||||
|
String nation = ""; // 내국인
|
||||||
|
String name = ""; // 성명
|
||||||
|
String M_name = ""; // 미성년자 성명
|
||||||
|
String M_birthDay = ""; // 미성년자 생년월일
|
||||||
|
String M_Gender = ""; // 미성년자 성별
|
||||||
|
String M_nation = ""; // 미성년자 내외국인
|
||||||
|
String result = ""; // 결과값
|
||||||
|
|
||||||
|
String certMet = ""; // 인증방법
|
||||||
|
String ip = ""; // ip주소
|
||||||
|
String plusInfo = "";
|
||||||
|
|
||||||
|
String encPara = "";
|
||||||
|
String encMsg1 = "";
|
||||||
|
String encMsg2 = "";
|
||||||
|
String msgChk = "";
|
||||||
|
//-----------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
//01. 암호화 모듈 (jar) Loading
|
||||||
|
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||||
|
|
||||||
|
//02. 1차 복호화
|
||||||
|
//수신된 certNum를 이용하여 복호화
|
||||||
|
rec_cert = seed.getDec(rec_cert, k_certNum);
|
||||||
|
|
||||||
|
//03. 1차 파싱
|
||||||
|
int inf1 = rec_cert.indexOf("/", 0);
|
||||||
|
int inf2 = rec_cert.indexOf("/", inf1 + 1);
|
||||||
|
|
||||||
|
encPara = rec_cert.substring(0, inf1); //암호화된 통합 파라미터
|
||||||
|
encMsg1 = rec_cert.substring(inf1 + 1, inf2); //암호화된 통합 파라미터의 Hash값
|
||||||
|
|
||||||
|
//04. 위변조 검증
|
||||||
|
encMsg2 = seed.getMsg(encPara);
|
||||||
|
|
||||||
|
if (encMsg2.equals(encMsg1)) {
|
||||||
|
msgChk = "Y";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msgChk.equals("N")) {
|
||||||
|
//alert("비정상적인 접근입니다.!!<%=msgChk%>");
|
||||||
|
return ResultCert.fail("비정상적인 접근입니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//05. 2차 복호화
|
||||||
|
rec_cert = seed.getDec(encPara, k_certNum);
|
||||||
|
|
||||||
|
System.out.println("##########################################");
|
||||||
|
System.out.println(rec_cert);
|
||||||
|
|
||||||
|
//06. 2차 파싱
|
||||||
|
int info1 = rec_cert.indexOf("/", 0);
|
||||||
|
int info2 = rec_cert.indexOf("/", info1 + 1);
|
||||||
|
int info3 = rec_cert.indexOf("/", info2 + 1);
|
||||||
|
int info4 = rec_cert.indexOf("/", info3 + 1);
|
||||||
|
int info5 = rec_cert.indexOf("/", info4 + 1);
|
||||||
|
int info6 = rec_cert.indexOf("/", info5 + 1);
|
||||||
|
int info7 = rec_cert.indexOf("/", info6 + 1);
|
||||||
|
int info8 = rec_cert.indexOf("/", info7 + 1);
|
||||||
|
int info9 = rec_cert.indexOf("/", info8 + 1);
|
||||||
|
int info10 = rec_cert.indexOf("/", info9 + 1);
|
||||||
|
int info11 = rec_cert.indexOf("/", info10 + 1);
|
||||||
|
int info12 = rec_cert.indexOf("/", info11 + 1);
|
||||||
|
int info13 = rec_cert.indexOf("/", info12 + 1);
|
||||||
|
int info14 = rec_cert.indexOf("/", info13 + 1);
|
||||||
|
int info15 = rec_cert.indexOf("/", info14 + 1);
|
||||||
|
int info16 = rec_cert.indexOf("/", info15 + 1);
|
||||||
|
int info17 = rec_cert.indexOf("/", info16 + 1);
|
||||||
|
int info18 = rec_cert.indexOf("/", info17 + 1);
|
||||||
|
|
||||||
|
certNum = rec_cert.substring(0, info1);
|
||||||
|
date = rec_cert.substring(info1 + 1, info2);
|
||||||
|
CI = rec_cert.substring(info2 + 1, info3);
|
||||||
|
phoneNo = rec_cert.substring(info3 + 1, info4);
|
||||||
|
phoneCorp = rec_cert.substring(info4 + 1, info5);
|
||||||
|
birthDay = rec_cert.substring(info5 + 1, info6);
|
||||||
|
gender = rec_cert.substring(info6 + 1, info7);
|
||||||
|
nation = rec_cert.substring(info7 + 1, info8);
|
||||||
|
name = rec_cert.substring(info8 + 1, info9);
|
||||||
|
result = rec_cert.substring(info9 + 1, info10);
|
||||||
|
certMet = rec_cert.substring(info10 + 1, info11);
|
||||||
|
ip = rec_cert.substring(info11 + 1, info12);
|
||||||
|
M_name = rec_cert.substring(info12 + 1, info13);
|
||||||
|
M_birthDay = rec_cert.substring(info13 + 1, info14);
|
||||||
|
M_Gender = rec_cert.substring(info14 + 1, info15);
|
||||||
|
M_nation = rec_cert.substring(info15 + 1, info16);
|
||||||
|
plusInfo = rec_cert.substring(info16 + 1, info17);
|
||||||
|
DI = rec_cert.substring(info17 + 1, info18);
|
||||||
|
|
||||||
|
//07. CI, DI 복호화
|
||||||
|
CI = seed.getDec(CI, k_certNum);
|
||||||
|
DI = seed.getDec(DI, k_certNum);
|
||||||
|
|
||||||
|
|
||||||
|
// 파라미터 유효성 검증 --------------------------------------------
|
||||||
|
boolean b = true;
|
||||||
|
String regex = "";
|
||||||
|
|
||||||
|
if (certNum.length() == 0 || certNum.length() > 40) {
|
||||||
|
return ResultCert.fail("[오류] 요청번호 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if (date.length() != 14 || !paramChk(regex, date)) {
|
||||||
|
return ResultCert.fail("[오류] 요청일시 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[A-Z]*";
|
||||||
|
if (certMet.length() != 1 || !paramChk(regex, certMet)) {
|
||||||
|
return ResultCert.fail("[오류] 본인인증방법 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if ((phoneNo.length() != 10 && phoneNo.length() != 11) || !paramChk(regex, phoneNo)) {
|
||||||
|
return ResultCert.fail("[오류] 휴대폰번호 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[A-Z]*";
|
||||||
|
if (phoneCorp.length() != 3 || !paramChk(regex, phoneCorp)) {
|
||||||
|
return ResultCert.fail("[오류] 이동통신사 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if (birthDay.length() != 8 || !paramChk(regex, birthDay)) {
|
||||||
|
return ResultCert.fail("[오류] 생년월일 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if (gender.length() != 1 || !paramChk(regex, gender)) {
|
||||||
|
return ResultCert.fail("[오류] 성별 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if (nation.length() != 1 || !paramChk(regex, nation)) {
|
||||||
|
return ResultCert.fail("[오류] 내/외국인 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[\\sA-Za-z가-�R.,-]*";
|
||||||
|
if (name.length() > 60 || !paramChk(regex, name)) {
|
||||||
|
return ResultCert.fail("[오류] 성명 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[A-Z]*";
|
||||||
|
if (result.length() != 1 || !paramChk(regex, result)) {
|
||||||
|
return ResultCert.fail("[오류] 결과값 비정상");
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[\\sA-Za-z가-?.,-]*";
|
||||||
|
if (M_name.length() != 0) {
|
||||||
|
if (M_name.length() > 60 || !paramChk(regex, M_name)) {
|
||||||
|
return ResultCert.fail("[오류] 미성년자 성명 비정상");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if (M_birthDay.length() != 0) {
|
||||||
|
if (M_birthDay.length() != 8 || !paramChk(regex, M_birthDay)) {
|
||||||
|
return ResultCert.fail("[오류] 미성년자 생년월일 비정상");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if (M_Gender.length() != 0) {
|
||||||
|
if (M_Gender.length() != 1 || !paramChk(regex, M_Gender)) {
|
||||||
|
return ResultCert.fail("[오류] 미성년자 성별 비정상");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
regex = "[0-9]*";
|
||||||
|
if (M_nation.length() != 0) {
|
||||||
|
if (M_nation.length() != 1 || !paramChk(regex, M_nation)) {
|
||||||
|
return ResultCert.fail("[오류] 미성년자 내/외국인 비정상");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// End 파라미터 유효성 검증 --------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
// Start - 수신내역 유효성 검증(사설망의 사설 IP로 인해 미사용, 공용망의 경우 확인 후 사용) *********************/
|
||||||
|
// 1. date 값 검증
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.KOREAN); // 현재 서버 시각 구하기
|
||||||
|
String strCurrentTime = formatter.format(new Date());
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
Date toDate = formatter.parse(strCurrentTime);
|
||||||
|
Date fromDate = formatter.parse(date);
|
||||||
|
long timediff = toDate.getTime() - fromDate.getTime();
|
||||||
|
|
||||||
|
if (timediff < -30 * 60 * 1000 || 30 * 60 * 100 < timediff) {
|
||||||
|
//return ResultCert.fail("[오류] 비정상적인 접근입니다. (요청시간경과)");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (ParseException e) {
|
||||||
|
//e.printStackTrace();
|
||||||
|
return ResultCert.fail("[오류] 비정상적인 접근입니다. (요청시간경과)-2");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. ip 값 검증
|
||||||
|
String client_ip = clientIp;//request.getHeader("HTTP_X_FORWARDED_FOR"); // 사용자IP 구하기
|
||||||
|
/*
|
||||||
|
if ( client_ip != null ){
|
||||||
|
if( client_ip.indexOf(",") != -1 )
|
||||||
|
client_ip = client_ip.substring(0,client_ip.indexOf(","));
|
||||||
|
}
|
||||||
|
if ( client_ip==null || client_ip.length()==0 ){
|
||||||
|
client_ip = request.getRemoteAddr();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
// 전화하니까 IP체크 하지 않아도 된다네 ㅡㅡ;;
|
||||||
|
if( !client_ip.equals(ip) ){
|
||||||
|
return ResultCert.fail("[오류] 비정상적인 접근입니다. (IP불일치)");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
ResultCert rValue = ResultCert.success();
|
||||||
|
rValue.setCertNum(certNum);
|
||||||
|
rValue.setDate(date);
|
||||||
|
rValue.setCI(CI);
|
||||||
|
rValue.setPhoneNo(phoneNo);
|
||||||
|
rValue.setPhoneCorp(phoneCorp);
|
||||||
|
rValue.setBirthDay(birthDay);
|
||||||
|
rValue.setGender(gender);
|
||||||
|
rValue.setNation(nation);
|
||||||
|
rValue.setName(name);
|
||||||
|
rValue.setResult(result);
|
||||||
|
rValue.setCertMet(certMet);
|
||||||
|
rValue.setIp(ip);
|
||||||
|
rValue.setM_name(M_name);
|
||||||
|
rValue.setM_birthDay(M_birthDay);
|
||||||
|
rValue.setM_Gender(M_Gender);
|
||||||
|
rValue.setM_nation(M_nation);
|
||||||
|
rValue.setPlusInfo(plusInfo);
|
||||||
|
rValue.setDI(DI);
|
||||||
|
|
||||||
|
rValue.setSuccess(true);
|
||||||
|
|
||||||
|
return rValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//http://lanedu.aircode.kr/extra/cert/result
|
||||||
|
//http://localhost:8081/extra/cert/result
|
||||||
|
@PublicAccess
|
||||||
|
@RequestMapping("/extra/cert/result")
|
||||||
|
public String certResult(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
|
||||||
|
|
||||||
|
String rec_cert = ""; // 결과값(암호화)
|
||||||
|
String certNum = ""; // certNum
|
||||||
|
|
||||||
|
rec_cert = RequestUtils.getString(request, "rec_cert").trim();
|
||||||
|
certNum = RequestUtils.getString(request, "certNum").trim();
|
||||||
|
|
||||||
|
ResultCert resultCert = null;
|
||||||
|
try {
|
||||||
|
resultCert = getTrCertData(rec_cert, certNum, RequestUtils.getClientIP(request));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info(e.getMessage());
|
||||||
|
resultCert = ResultCert.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
//02-2033-8565
|
||||||
|
/*
|
||||||
|
resultCert.setSuccess(true);
|
||||||
|
resultCert.setPhoneNo("01096128903");
|
||||||
|
resultCert.setBirthDay("19760820");
|
||||||
|
resultCert.setName("박규태");
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ("FIND_UID".equals(resultCert.getPlusInfo())) {
|
||||||
|
|
||||||
|
//인증한 핸드폰에 대한 정보가 존재하는지 확인 후 처리
|
||||||
|
// if (!userService.existPhone(resultCert.getPhoneNo())) {
|
||||||
|
// resultCert = ResultCert.fail("가입된 전화번호가 아닙니다.");
|
||||||
|
// model.addAttribute("resultCert", resultCert);
|
||||||
|
// return "extra/cert_result";
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CertSessionUtils.setCert(session, resultCert);
|
||||||
|
|
||||||
|
//ResultCert(
|
||||||
|
// success=true,
|
||||||
|
// errorMessage=null,
|
||||||
|
// encMsg1=null,
|
||||||
|
// encMsg2=null,
|
||||||
|
// certNum=2021070110295605344,
|
||||||
|
// date=20210701102956,
|
||||||
|
// CI=oKnuCufcXakGshtAl37Fxnl8UrbQuPFlC6UoJMhqZo/f2MzZcdOKeTdNyluNqiUxRsj27/E4QobkAIyxtz+ASw==,
|
||||||
|
// DI=MC0GCCqGSIb3DQIJAyEAas6UAn1woyuHzcEY7MVDMCQcR0aO8cXjfpEnCjDpCDE=,
|
||||||
|
// phoneNo=01096128901,
|
||||||
|
// phoneCorp=LGT,
|
||||||
|
// birthDay=19760820,
|
||||||
|
// nation=0,
|
||||||
|
// gender=0,
|
||||||
|
// name=박규태,
|
||||||
|
// result=Y,
|
||||||
|
// certMet=M,
|
||||||
|
// ip=61.74.252.104,
|
||||||
|
// M_name=,
|
||||||
|
// M_birthDay=,
|
||||||
|
// M_Gender=,
|
||||||
|
// M_nation=,
|
||||||
|
// plusInfo=,
|
||||||
|
// rec_cert=null
|
||||||
|
// )
|
||||||
|
|
||||||
|
System.out.println("##################################");
|
||||||
|
System.out.println(resultCert.toString());
|
||||||
|
|
||||||
|
|
||||||
|
model.addAttribute("resultCert", resultCert);
|
||||||
|
|
||||||
|
return "extra/cert_result";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.ns.mobile.website.web.controller.extra;
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
public class ResultCert implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -3895896097653379454L;
|
||||||
|
|
||||||
|
private boolean success;
|
||||||
|
private String errorMessage;
|
||||||
|
|
||||||
|
String encMsg1;//위,변조여부1
|
||||||
|
String encMsg2;//위,변조여부2
|
||||||
|
String certNum;//요청번호
|
||||||
|
String date;//요청일시
|
||||||
|
String CI;//연계정보(CI)
|
||||||
|
String DI;//중복가입확인정보(DI)
|
||||||
|
String phoneNo;//휴대폰번호
|
||||||
|
String phoneCorp;//이동통신사
|
||||||
|
String birthDay;//생년월일
|
||||||
|
String nation;//내국인
|
||||||
|
String gender;//성별
|
||||||
|
|
||||||
|
String name;//성명
|
||||||
|
String result;//결과값
|
||||||
|
String certMet;//인증방법
|
||||||
|
String ip;//ip주소
|
||||||
|
String M_name;//미성년자 성명
|
||||||
|
String M_birthDay;//미성년자 생년월일
|
||||||
|
String M_Gender;//미성년자 성별
|
||||||
|
String M_nation;//미성년자 내외국인
|
||||||
|
String plusInfo;//추가DATA정보
|
||||||
|
String rec_cert;
|
||||||
|
|
||||||
|
public static ResultCert fail(String errorMessage) {
|
||||||
|
return ResultCert.builder()
|
||||||
|
.success(false)
|
||||||
|
.errorMessage(errorMessage)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResultCert success() {
|
||||||
|
return ResultCert.builder()
|
||||||
|
.success(true)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isFail() {
|
||||||
|
return !success;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.ns.mobile.website.web.controller.home;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.service.PhoneService;
|
||||||
|
import com.ns.mobile.website.web.auth.PublicAccess;
|
||||||
|
import com.ns.mobile.website.web.controller.BaseController;
|
||||||
|
import com.ns.mobile.website.web.properties.LaneduProperties;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Controller
|
||||||
|
public class HomeController extends BaseController {
|
||||||
|
|
||||||
|
private final LaneduProperties laneduProperties;
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@RequestMapping(value = {"{siteId}/home"})
|
||||||
|
String home(Model model, HttpServletRequest request, HttpSession session
|
||||||
|
, @PathVariable(required = false) String siteId) {
|
||||||
|
|
||||||
|
model.addAttribute("version", laneduProperties.getVersion());
|
||||||
|
model.addAttribute("siteId",siteId);
|
||||||
|
|
||||||
|
return "home/index";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@RequestMapping(value = {"{siteId}/home/phone/detail/{phoneId}"})
|
||||||
|
String detail(Model model, HttpServletRequest request, HttpSession session, @PathVariable(required = false) String siteId
|
||||||
|
, @PathVariable(required = true) String phoneId) {
|
||||||
|
|
||||||
|
model.addAttribute("phoneId", phoneId);
|
||||||
|
model.addAttribute("siteId",siteId);
|
||||||
|
return "home/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@RequestMapping(value = {"/home/sell/list"})
|
||||||
|
String sellUser(Model model, HttpServletRequest request, HttpSession session) {
|
||||||
|
|
||||||
|
|
||||||
|
return "home/sell/list";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@RequestMapping(value = {"/home/sell/add"})
|
||||||
|
String sellUserAdd(Model model, HttpServletRequest request, HttpSession session) {
|
||||||
|
|
||||||
|
|
||||||
|
return "home/sell/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package com.ns.mobile.website.web.controller.home.api;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.dto.FileUploadDto;
|
||||||
|
import com.ns.mobile.website.biz.dto.PhoneDetailDto;
|
||||||
|
import com.ns.mobile.website.biz.dto.PhoneDto;
|
||||||
|
import com.ns.mobile.website.biz.dto.SellUserDto;
|
||||||
|
import com.ns.mobile.website.biz.entity.FileUpload;
|
||||||
|
import com.ns.mobile.website.biz.entity.Phone;
|
||||||
|
import com.ns.mobile.website.biz.entity.SellUser;
|
||||||
|
import com.ns.mobile.website.biz.model.ResponseData;
|
||||||
|
import com.ns.mobile.website.biz.model.ResponseResult;
|
||||||
|
import com.ns.mobile.website.biz.model.SearchData;
|
||||||
|
import com.ns.mobile.website.biz.model.UploadFileModel;
|
||||||
|
import com.ns.mobile.website.biz.service.FileService;
|
||||||
|
import com.ns.mobile.website.biz.service.PhoneService;
|
||||||
|
import com.ns.mobile.website.biz.service.SellService;
|
||||||
|
import com.ns.mobile.website.common.util.ExcelUtil;
|
||||||
|
import com.ns.mobile.website.web.auth.PublicAccess;
|
||||||
|
import com.ns.mobile.website.web.controller.BaseController;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
public class ApiHomeController extends BaseController {
|
||||||
|
|
||||||
|
private final PhoneService phoneService;
|
||||||
|
private final SellService sellService;
|
||||||
|
private final FileService fileService;
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@PostMapping("/api/phone/list.api")
|
||||||
|
public ResponseEntity<?> list(@RequestBody Phone parameter,HttpServletRequest request, HttpSession session){
|
||||||
|
List<PhoneDto> result = phoneService.selectList(parameter);
|
||||||
|
return ResponseResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@PostMapping("/api/phone/detail.api")
|
||||||
|
public ResponseEntity<?> detail(@RequestBody Phone parameter,HttpServletRequest request, HttpSession session){
|
||||||
|
PhoneDetailDto result = phoneService.select(parameter);
|
||||||
|
return ResponseResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@PostMapping("/api/sell/list.api")
|
||||||
|
public ResponseEntity<?> sellList(@RequestBody SearchData parameter,HttpServletRequest request, HttpSession session){
|
||||||
|
List<SellUserDto> result = sellService.selectList(parameter);
|
||||||
|
return ResponseResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublicAccess
|
||||||
|
@PostMapping("/api/sell/add/list.api")
|
||||||
|
public ResponseEntity<?> addList(@RequestBody SearchData parameter,HttpServletRequest request, HttpSession session){
|
||||||
|
List<FileUploadDto> result = sellService.selectAddList(parameter);
|
||||||
|
return ResponseResult.success(result);
|
||||||
|
}
|
||||||
|
@PublicAccess
|
||||||
|
@PostMapping("/api/sell/del/upload.api")
|
||||||
|
public ResponseData delFileUpload(@RequestBody FileUpload parameter,HttpServletRequest request, HttpSession session){
|
||||||
|
if(!sellService.delFileUpload(parameter)) {
|
||||||
|
return ResponseData.fail("실패");
|
||||||
|
}
|
||||||
|
return ResponseData.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PublicAccess
|
||||||
|
@PostMapping(value = {"/api/sell/add.api"})
|
||||||
|
public ResponseData apiAttachExcelFile(MultipartFile attachFile) {
|
||||||
|
|
||||||
|
UploadFileModel uploadFile = fileService.upload(attachFile);
|
||||||
|
if (!uploadFile.isResult()) {
|
||||||
|
return ResponseData.fail(uploadFile.getMessage());
|
||||||
|
}
|
||||||
|
Map<String,String> account = ExcelUtil.excelToAccountList(uploadFile.getLocalPath());
|
||||||
|
List<SellUser> excelDataList = ExcelUtil.excelToSellList(uploadFile.getLocalPath(), account);
|
||||||
|
FileUpload fileUpload = UploadFileModel.of(uploadFile);
|
||||||
|
if(!sellService.saveList(fileUpload, excelDataList)) {
|
||||||
|
return ResponseData.fail("실패");
|
||||||
|
}
|
||||||
|
return ResponseData.success(excelDataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.ns.mobile.website.web.controller.home.api;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.web.controller.BaseController;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
public class ApiUserController extends BaseController {
|
||||||
|
|
||||||
|
// @PublicAccess
|
||||||
|
// @PostMapping("/api/home/user/join.api")
|
||||||
|
// public ResponseEntity<?> join(@RequestBody @Valid UserJoinInput parameter, Errors errors, HttpServletRequest request, HttpSession session) {
|
||||||
|
//
|
||||||
|
// if (errors.hasErrors()) {
|
||||||
|
// for (ObjectError error : errors.getAllErrors()) {
|
||||||
|
// return ResponseResult.fail(error.getDefaultMessage());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// String certPhone = CertSessionUtils.getCertPhone(session);
|
||||||
|
// if (certPhone == null || certPhone.length() < 1) {
|
||||||
|
// return ResponseResult.fail("휴대폰 인증 정보가 존재하지 않습니다.");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// parameter.setPhone(certPhone);
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// String password = parameter.getPassword();
|
||||||
|
// PrivateKey privateKey = (PrivateKey) session.getAttribute(RSASecureUtils.RSA_WEB_KEY);
|
||||||
|
// parameter.setPassword(RSASecureUtils.decryptRsa(privateKey, password));
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// return ResponseResult.fail("데이터(비밀번호) 처리중 문제가 발생하였습니다.");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //site_type 설정
|
||||||
|
// parameter.setSiteType(SiteUtils.getSiteType(request));
|
||||||
|
// //site_id는 사이트에서 가입되지 않기떄문에 가입시 올라오지 않음
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// ServiceResult<UserDto> result = userService.join(parameter);
|
||||||
|
// return ResponseResult.result(result);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// if (e.getMessage().contains("ConstraintViolationException")) {
|
||||||
|
// return ResponseResult.fail("이미 가입된 아이디 입니다.");
|
||||||
|
// }
|
||||||
|
// return ResponseResult.fail("데이터 처리중 문제가 발생하였습니다.");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.ns.mobile.website.web.filter;
|
||||||
|
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.integration.json.JsonPathUtils;
|
||||||
|
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
public class CookieAttributeFilter implements Filter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||||
|
|
||||||
|
//System.out.println("!FILTER!");
|
||||||
|
|
||||||
|
HttpServletResponse httpServletResponse = (HttpServletResponse) response;
|
||||||
|
chain.doFilter(request, response);
|
||||||
|
addSameSite(httpServletResponse, "None");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(FilterConfig filterConfig) throws ServletException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addSameSite(HttpServletResponse response, String sameSite) {
|
||||||
|
Collection<String> headers = response.getHeaders(HttpHeaders.SET_COOKIE);
|
||||||
|
boolean firstHeader = true;
|
||||||
|
for (String header : headers) {
|
||||||
|
if (firstHeader) {
|
||||||
|
response.setHeader(HttpHeaders.SET_COOKIE, String.format("%s; Secure; %s", header, "SameSite=" + sameSite));
|
||||||
|
firstHeader = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
response.addHeader(HttpHeaders.SET_COOKIE, String.format("%s; Secure; %s", header, "SameSite=" + sameSite));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.ns.mobile.website.web.handler;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.exception.*;
|
||||||
|
import com.ns.mobile.website.biz.model.ResponseResult;
|
||||||
|
import com.ns.mobile.website.common.Res;
|
||||||
|
import com.ns.mobile.website.common.util.RequestUtils;
|
||||||
|
import com.ns.mobile.website.common.util.ResponseUtils;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
import util.SU;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestControllerAdvice
|
||||||
|
public class SiteExceptionHandler {
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
@ExceptionHandler(value = {BizException.class})
|
||||||
|
public void bizExcetpionHandler(CommonException exception, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
|
log.info(exception.getMessage());
|
||||||
|
model.addAttribute("exception", exception);
|
||||||
|
|
||||||
|
if (RequestUtils.isApiCall(request)) {
|
||||||
|
ResponseUtils.responseJsonFailMessage(response, "", exception.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
ResponseUtils.htmlAlertAndHistoryBack(response, exception.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
@ExceptionHandler(value = {NoExistsBizException.class})
|
||||||
|
public void notExistsBizExceptionHandler(CommonException exception, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
|
String message = exception.getMessage();
|
||||||
|
if (SU.isEmpty(message)) {
|
||||||
|
message = "존재하지 않는 회사입니다.";
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info(exception.getMessage());
|
||||||
|
model.addAttribute("exception", exception);
|
||||||
|
|
||||||
|
if (RequestUtils.isApiCall(request)) {
|
||||||
|
ResponseUtils.responseJsonFailMessage(response, "", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
ResponseUtils.htmlAlertAndLocation(request, response, message, "/home");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
@ExceptionHandler(value = {BizApiException.class})
|
||||||
|
public ResponseEntity<?> apiExcetpionHandler(BizApiException exception, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
|
log.info(exception.getMessage());
|
||||||
|
|
||||||
|
return ResponseResult.fail(exception.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
@ExceptionHandler(value = {NotLoginException.class})
|
||||||
|
public void notLoginExcetpionHandler(NotLoginException exception, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
|
if (RequestUtils.isApiCall(request)) {
|
||||||
|
ResponseUtils.responseJsonFailMessage(response, "CMD_GOTO_LOGIN", NotLoginException.MSG_NOT_LOGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
ResponseUtils.htmlAlertAndLocation(request, response, NotLoginException.MSG_NOT_LOGIN, Res.URL_LOGIN_PAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
@ExceptionHandler(value = {NotSelectedCafeException.class})
|
||||||
|
public void notSelectedCafeExcetpionHandler(NotSelectedCafeException exception, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
|
if (RequestUtils.isApiCall(request)) {
|
||||||
|
ResponseUtils.responseJsonFailMessage(response, "", NotSelectedCafeException.MSG_NOT_SELECTED_CAFE);
|
||||||
|
}
|
||||||
|
|
||||||
|
ResponseUtils.htmlAlertAndLocation(request, response, NotSelectedCafeException.MSG_NOT_SELECTED_CAFE, Res.URL_HOME);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
@ExceptionHandler(value = {DuplicateLoginException.class})
|
||||||
|
public void duplicateLoginExceptionHandler(DuplicateLoginException exception, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
|
if (RequestUtils.isApiCall(request)) {
|
||||||
|
ResponseUtils.responseJsonFailMessage(response, "", NotSelectedCafeException.MSG_DUBPLICATE_LOGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
ResponseUtils.htmlAlertAndLocation(request, response, NotSelectedCafeException.MSG_DUBPLICATE_LOGIN, Res.URL_HOME);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.ns.mobile.website.web.interceptor;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.biz.exception.DuplicateLoginException;
|
||||||
|
import com.ns.mobile.website.biz.exception.NotLoginException;
|
||||||
|
import com.ns.mobile.website.common.util.AnnotationUtils;
|
||||||
|
import com.ns.mobile.website.common.util.DateUtils;
|
||||||
|
import com.ns.mobile.website.common.util.InterceptorUtils;
|
||||||
|
import com.ns.mobile.website.common.util.RequestUtils;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class FrontInterceptor implements HandlerInterceptor {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment environment;
|
||||||
|
|
||||||
|
private String currentProfile() {
|
||||||
|
String[] profiles = environment.getActiveProfiles();
|
||||||
|
if (profiles.length == 0) {
|
||||||
|
profiles = environment.getDefaultProfiles();
|
||||||
|
}
|
||||||
|
return profiles[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initAttr(HttpServletRequest request) {
|
||||||
|
request.setAttribute("activeProfile", currentProfile());
|
||||||
|
request.setAttribute("timestamp", DateUtils.getTimeStamp());
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkLogin(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||||
|
|
||||||
|
String url = RequestUtils.getUri(request);
|
||||||
|
if (url.contains("/res/front/") || url.contains("/error")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Method executeMethod = InterceptorUtils.getExecuteMethod(handler);
|
||||||
|
if (executeMethod == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean existGuestAccess = AnnotationUtils.existGuestAccess(executeMethod);
|
||||||
|
if (existGuestAccess) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||||
|
initAttr(request);
|
||||||
|
|
||||||
|
if (!checkLogin(request, response, handler)) {
|
||||||
|
throw new NotLoginException();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.ns.mobile.website.web.properties;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties("lanedu")
|
||||||
|
@ToString
|
||||||
|
@Data
|
||||||
|
public class LaneduProperties {
|
||||||
|
|
||||||
|
private String encryptPassPhrase;
|
||||||
|
private String jasyptConfigPassword;
|
||||||
|
|
||||||
|
private String baseSiteUrl;
|
||||||
|
private String baseB2bSiteUrl;
|
||||||
|
|
||||||
|
private String phoneUrlCode;
|
||||||
|
private String version;
|
||||||
|
private String superpassword;
|
||||||
|
private String uploadFileExtension;
|
||||||
|
|
||||||
|
private String ktapiServerUrl;
|
||||||
|
private String ktapiPortalBizid;
|
||||||
|
private String ktapiSecretKey;
|
||||||
|
private String ktapiServiceIp;
|
||||||
|
private String ktapiServiceDomain;
|
||||||
|
|
||||||
|
private String wenApiUrl;
|
||||||
|
private String wenTransUrl;
|
||||||
|
private String wenPlayerUrl;
|
||||||
|
private String wenOpenapiUrl;
|
||||||
|
|
||||||
|
private String quickLinkUrl;
|
||||||
|
private String b2bQuickLinkUrl;
|
||||||
|
private String vodLinkUrl;
|
||||||
|
private String vodReturnLinkUrl;
|
||||||
|
|
||||||
|
private String smsServerUrl;
|
||||||
|
private String smsClientId;
|
||||||
|
private String smsServiceKey;
|
||||||
|
private String smsTelNum;
|
||||||
|
|
||||||
|
private String mid;
|
||||||
|
private String mid2;
|
||||||
|
private String merchantKey;
|
||||||
|
private String smartroUrl;
|
||||||
|
private String returnSmartroUrl;
|
||||||
|
private String smartroBillUrl;
|
||||||
|
private String smartroCancelUrl;
|
||||||
|
private String billReturnSmartroUrl;
|
||||||
|
private String stopSmartroUrl;
|
||||||
|
private String sspMallId;
|
||||||
|
|
||||||
|
private String smartroJsUrl;
|
||||||
|
private String smartroMjsUrl;
|
||||||
|
private List<String> authPhones;
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.ns.mobile.website.web.schedule;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Component
|
||||||
|
public class Scheduler {
|
||||||
|
|
||||||
|
|
||||||
|
//@Scheduled(cron = "0 0 0 * * ?") /** 매일 자정에 실행 **/
|
||||||
|
//@Scheduled(cron = "0 * * * * ?") /** 매분 실행 **/
|
||||||
|
//@Scheduled(cron = "0 0 4 * * *")
|
||||||
|
//@Scheduled(fixedDelay = 1000 * 60)
|
||||||
|
public void checkMail() {
|
||||||
|
|
||||||
|
/*
|
||||||
|
log.info(StringUtils.LINE_BAR3);
|
||||||
|
log.info(LocalDateTime.now().toString());
|
||||||
|
|
||||||
|
List<MailSchedule> mailScheduleList = mailService.getSendList();
|
||||||
|
if (mailScheduleList != null) {
|
||||||
|
for (MailSchedule x : mailScheduleList) {
|
||||||
|
ServiceResult result = mailComponent.sendMail(x.getFromEmail(), x.getFromUserName(), x.getToEmail(), x.getToUserName(), x.getTitle(), x.getContents());
|
||||||
|
boolean result2 = mailService.setResult(x.getId(), result.isResult(), result.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package util;
|
||||||
|
|
||||||
|
import com.ns.mobile.website.common.util.StringUtils;
|
||||||
|
|
||||||
|
public class SU extends StringUtils {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
driver-class-name: org.mariadb.jdbc.Driver
|
||||||
|
url: jdbc:mariadb://127.0.0.1:3306/phonessayo?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Seoul
|
||||||
|
username: kuhan
|
||||||
|
password: gnfkqhsh11
|
||||||
|
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
bean: jasyptStringEncryptor
|
||||||
|
|
||||||
|
devtools:
|
||||||
|
livereload:
|
||||||
|
enabled: true
|
||||||
|
restart:
|
||||||
|
enabled: false
|
||||||
|
mail:
|
||||||
|
host: smtp.mailplug.co.kr
|
||||||
|
port: 465
|
||||||
|
username: 'test@aircode.com'
|
||||||
|
password: '@aircode1234'
|
||||||
|
properties:
|
||||||
|
mail:
|
||||||
|
smtp:
|
||||||
|
starttls:
|
||||||
|
enable: true
|
||||||
|
auth:
|
||||||
|
true
|
||||||
|
socketFactory:
|
||||||
|
class: 'javax.net.ssl.SSLSocketFactory'
|
||||||
|
|
||||||
|
logging:
|
||||||
|
file:
|
||||||
|
name: ./logs/spring.log
|
||||||
|
|
||||||
|
file-url:
|
||||||
|
upload-path: /files
|
||||||
|
base-upload-location: /NAS/LANEDU/files
|
||||||
|
cms-upload-location: /NAS/LANEDU/files
|
||||||
|
|
||||||
|
lanedu:
|
||||||
|
jasypt-config-password: aircode
|
||||||
|
encrypt-pass-phrase: aircode-lanedu
|
||||||
|
base-site-url: http://localhost:8080
|
||||||
|
base-b2b-site-url: http://meets.localhost:8080
|
||||||
|
phone-url-code: "005001"
|
||||||
|
ktapi-server-url: https://dev.api.kteduon.co.kr
|
||||||
|
ktapi-portal-bizid: kt_on_portal
|
||||||
|
ktapi-secret-key: 7bdb56a020dcf1661e47d00e89b7c71b9309c76746c4edccb01d06929524731d
|
||||||
|
ktapi-service-ip: 203.227.22.192
|
||||||
|
ktapi-service-domain: "on"
|
||||||
|
wen-api-url: http://211.184.184.64:40801
|
||||||
|
wen-trans-url: http://211.184.184.64:40801
|
||||||
|
wen-player-url: http://211.184.184.64:40801
|
||||||
|
wen-openapi-url: http://lanedu.aircode.kr
|
||||||
|
quick-link-url: http://localhost:8080/home/quick/quick-meeting
|
||||||
|
b2b-quick-link-url: http://meets.localhost:8080/home/vod/meeting
|
||||||
|
vod-link-url: http://localhost:8080/home/vod/meeting
|
||||||
|
vod-return-link-url: /home/vod/meeting/end
|
||||||
|
sms-server-url: https://api.apistore.co.kr/ppurio/2
|
||||||
|
sms-client-id: aircode
|
||||||
|
sms-service-key: "MTQ4MjctMTYyNDQzNjc0MTcyNS04NDQzYWVkZS03YjlhLTRkYTctODNhZS1kZTdiOWExZGE3YjU="
|
||||||
|
sms-tel-num: "15882918"
|
||||||
|
mid: "t_eduon01m"
|
||||||
|
mid2: "t_eduon02m"
|
||||||
|
merchant-key: "0/4GFsSd7ERVRGX9WHOzJ96GyeMTwvIaKSWUCKmN3fDklNRGw3CualCFoMPZaS99YiFGOuwtzTkrLo4bR4V+Ow=="
|
||||||
|
smartro-url: "https://tapproval.smartropay.co.kr/payment/approval/urlCallApproval.do"
|
||||||
|
smartro-bill-url: "https://tapproval.smartropay.co.kr/payment/approval/ssbbill.do"
|
||||||
|
smartro-cancel-url: "https://tapproval.smartropay.co.kr/payment/approval/cancel.do"
|
||||||
|
return-smartro-url: "http://localhost:8080/pay/phone?userId="
|
||||||
|
stop-smartro-url: "http://localhost:8080/pay/stop"
|
||||||
|
bill-return-smartro-url: "http://localhost:8080/pay/bill?userId="
|
||||||
|
ssp-mall-id: "SMTSSPAY0p"
|
||||||
|
smartro-js-url: "https://tpay.smartropay.co.kr/asset/js/SmartroPAY-1.0.min.js"
|
||||||
|
smartro-mjs-url: "https://tmpay.smartropay.co.kr/asset/js/SmartroPAY-1.0.min.js"
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
driver-class-name: org.mariadb.jdbc.Driver
|
||||||
|
url: jdbc:mariadb://119.70.122.80:13306/phonessayo?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Seoul
|
||||||
|
username: kuhan
|
||||||
|
password: Gnfkqhsh1!
|
||||||
|
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
bean: jasyptStringEncryptor
|
||||||
|
|
||||||
|
devtools:
|
||||||
|
livereload:
|
||||||
|
enabled: true
|
||||||
|
restart:
|
||||||
|
enabled: false
|
||||||
|
mail:
|
||||||
|
host: smtp.mailplug.co.kr
|
||||||
|
port: 465
|
||||||
|
username: 'test@aircode.com'
|
||||||
|
password: '@aircode1234'
|
||||||
|
properties:
|
||||||
|
mail:
|
||||||
|
smtp:
|
||||||
|
starttls:
|
||||||
|
enable: true
|
||||||
|
auth:
|
||||||
|
true
|
||||||
|
socketFactory:
|
||||||
|
class: 'javax.net.ssl.SSLSocketFactory'
|
||||||
|
|
||||||
|
logging:
|
||||||
|
file:
|
||||||
|
name: ./logs/spring.log
|
||||||
|
|
||||||
|
file-url:
|
||||||
|
upload-path: /files
|
||||||
|
base-upload-location: /NAS/LANEDU/files
|
||||||
|
cms-upload-location: /NAS/LANEDU/files
|
||||||
|
|
||||||
|
lanedu:
|
||||||
|
jasypt-config-password: aircode
|
||||||
|
encrypt-pass-phrase: aircode-lanedu
|
||||||
|
base-site-url: http://localhost:8080
|
||||||
|
base-b2b-site-url: http://meets.localhost:8080
|
||||||
|
phone-url-code: "005001"
|
||||||
|
ktapi-server-url: https://dev.api.kteduon.co.kr
|
||||||
|
ktapi-portal-bizid: kt_on_portal
|
||||||
|
ktapi-secret-key: 7bdb56a020dcf1661e47d00e89b7c71b9309c76746c4edccb01d06929524731d
|
||||||
|
ktapi-service-ip: 203.227.22.192
|
||||||
|
ktapi-service-domain: "on"
|
||||||
|
wen-api-url: http://211.184.184.64:40801
|
||||||
|
wen-trans-url: http://211.184.184.64:40801
|
||||||
|
wen-player-url: http://211.184.184.64:40801
|
||||||
|
wen-openapi-url: http://lanedu.aircode.kr
|
||||||
|
quick-link-url: http://localhost:8080/home/quick/quick-meeting
|
||||||
|
b2b-quick-link-url: http://meets.localhost:8080/home/vod/meeting
|
||||||
|
vod-link-url: http://localhost:8080/home/vod/meeting
|
||||||
|
vod-return-link-url: /home/vod/meeting/end
|
||||||
|
sms-server-url: https://api.apistore.co.kr/ppurio/2
|
||||||
|
sms-client-id: aircode
|
||||||
|
sms-service-key: "MTQ4MjctMTYyNDQzNjc0MTcyNS04NDQzYWVkZS03YjlhLTRkYTctODNhZS1kZTdiOWExZGE3YjU="
|
||||||
|
sms-tel-num: "15882918"
|
||||||
|
mid: "t_eduon01m"
|
||||||
|
mid2: "t_eduon02m"
|
||||||
|
merchant-key: "0/4GFsSd7ERVRGX9WHOzJ96GyeMTwvIaKSWUCKmN3fDklNRGw3CualCFoMPZaS99YiFGOuwtzTkrLo4bR4V+Ow=="
|
||||||
|
smartro-url: "https://tapproval.smartropay.co.kr/payment/approval/urlCallApproval.do"
|
||||||
|
smartro-bill-url: "https://tapproval.smartropay.co.kr/payment/approval/ssbbill.do"
|
||||||
|
smartro-cancel-url: "https://tapproval.smartropay.co.kr/payment/approval/cancel.do"
|
||||||
|
return-smartro-url: "http://localhost:8080/pay/phone?userId="
|
||||||
|
stop-smartro-url: "http://localhost:8080/pay/stop"
|
||||||
|
bill-return-smartro-url: "http://localhost:8080/pay/bill?userId="
|
||||||
|
ssp-mall-id: "SMTSSPAY0p"
|
||||||
|
smartro-js-url: "https://tpay.smartropay.co.kr/asset/js/SmartroPAY-1.0.min.js"
|
||||||
|
smartro-mjs-url: "https://tmpay.smartropay.co.kr/asset/js/SmartroPAY-1.0.min.js"
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user