diff --git a/README.md b/README.md index 3197e9c..d5d7226 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,82 @@ -# bf - --- 쿼리작업중 -SELECT -smc_no, -a.name, -gender, -birthday, -weight_birth, -height_birth, -weight, -height, -allergie, -append_src_img_file, -append_300_img_file, -now(), -'1642860993576' -FROM tbl_bf_family_baby a -INNER JOIN tbl_sync_log b on a.member_id = b.member_id and b.check_num = '1323' and DATE_ADD(b.reg_dt, INTERVAL 180 second) > now() -LIMIT 1; - -select * from tbl_sync_log; -select * from tbl_bf_family; -select * from tbl_bf_family_baby; - -select DATE_ADD(now(), INTERVAL 10 second) from tbl_bf_family_baby; - -select check_num, member_id, reg_dt, DATE_ADD(reg_dt, INTERVAL 10 second) from tbl_sync_log where DATE_ADD(reg_dt, INTERVAL 100 second) > now(); - -select * from tbl_bf_family_baby_order; -select * from tbl_member where name = '김엄마'; -select * from tbl_member where name = '김종환'; - - --- 세션 회원아이디 GET -HttpSession session = request.getSession(false); -DataMap rm_mem = (DataMap) session.getAttribute(ConstantSystem.SESSION_RM_MEMBER); -paramMap.put("member_id", RenaStringUtil.getData(rm_mem, "member_id")); \ No newline at end of file +# 계정정보 + - 어드민 운영서버 : [http://devops.lookylooks.ai:14288/bf/admin/index.do](http://devops.lookylooks.ai:14288/bf/admin/index.do) + - 프론트 운영서버 : [http://devops.lookylooks.ai:14288/bf/m/login/view_login.do](http://devops.lookylooks.ai:14288/bf/m/login/view_login.do) + - 계정정보 : imcloud / imc1234 + +# DB정보 + - http://devops.lookylooks.ai:14236 + - id : imcloud + - pw : imc1234 + + +---------------------------------------------------------------------------- 참고 쿼리 ---------------------------------------------------------------------------- +# 일상기록 삭제 + delete from tbl_bf_daily_nutrition where smc_no = 73; + delete from tbl_bf_daily_nutrition_1 where smc_no = 73; + delete from tbl_bf_daily_nutrition_2 where smc_no = 73; + delete from tbl_bf_daily_nutrition_3 where smc_no = 73; + delete from tbl_bf_daily_nutrition_4 where smc_no = 73; + delete from tbl_bf_daily_nutrition_5 where smc_no = 73; + delete from tbl_bf_daily_nutrition_6 where smc_no = 73; + delete from tbl_bf_daily_nutrition_7 where smc_no = 73; + delete from tbl_bf_daily_nutrition_8 where smc_no = 73; + delete from tbl_bf_daily_nutrition_9 where smc_no = 73; + delete from tbl_bf_daily_nutrition_10 where smc_no = 73; + +# 동기화 관련 + select * from tbl_bf_family where member_id = 'renamaestro'; + select smc_no, member_id from tbl_bf_family_baby where member_id = 'renamaestro'; + select * from tbl_bf_family_baby_disease where smc_no in(2,3); + select * from tbl_bf_family_baby_order where smc_no in(2,3); + +# 회원정보 삭제 + delete from tbl_member where name = '김종환'; + delete from tbl_member_confirm where member_id = '1642055604247'; + delete from tbl_bf_family_disease where bf_no = '5'; + delete from tbl_bf_family where member_id = '1642055604247'; + delete from tbl_bf_family_baby where member_id = '1642055604247'; + delete from tbl_bf_family_baby_disease where smc_no = '72'; + +# 세션 회원아이디 GET + HttpSession session = request.getSession(false); + DataMap rm_mem = (DataMap) session.getAttribute(ConstantSystem.SESSION_RM_MEMBER); + paramMap.put("member_id", RenaStringUtil.getData(rm_mem, "member_id")); + +#메모리 - 일간분석 +select + DATE_FORMAT(a.reg_dt, '%H') as hour, + count(*) as cnt +from tbl_bf_family_match a +inner join tbl_bf_daily_nutrition b on a.smc_no = b.smc_no +inner join tbl_bf_family_match c on a.smc_no = c.smc_no +where + a.member_id = '1642861413918' + and DATE_FORMAT(b.reg_dt, '%Y-%m-%d') = DATE_FORMAT(now(), '%Y-%m-%d') +group by DATE_FORMAT(b.reg_dt, '%H'); + +#메모리 - 주간분석 +select + DATE_FORMAT(b.reg_dt, '%Y-%m-%d %H') as day, + count(*) as cnt +from tbl_bf_family_match a +inner join tbl_bf_daily_nutrition b on a.smc_no = b.smc_no +inner join tbl_bf_family_match c on a.smc_no = c.smc_no +where + a.member_id = '1642861413918' + and b.reg_dt between STR_TO_DATE('2022-02-15 00:00:00','%Y-%m-%d %H:%i:%s') and STR_TO_DATE('2022-02-15 23:59:59','%Y-%m-%d %H:%i:%s') +group by DATE_FORMAT(b.reg_dt, '%Y-%m-%d %H') +order by DATE_FORMAT(b.reg_dt, '%Y-%m-%d %H') asc; + +#메모리 - 타임라인(모유, 각 카테고리별 수치 및 시간간격 계산해야됨.) +select + DATE_FORMAT(b.reg_dt, '%Y-%m-%d %H:%i:%s') as reg_date, + d.title, + b.dn_no, + (select eat_qty from tbl_bf_daily_nutrition_1 tn1 where tn1.dn_no = b.dn_no) as eat_qty +from tbl_bf_family_match a +inner join tbl_bf_daily_nutrition b on a.smc_no = b.smc_no +inner join tbl_bf_family_match c on a.smc_no = c.smc_no +inner join tbl_code_item_str d on b.nutirition_cd_no = d.cd_no +where + a.member_id = '1642861413918' + and DATE_FORMAT(b.reg_dt,'%Y-%m-%d') = STR_TO_DATE('2022-02-15','%Y-%m-%d') ; diff --git a/ddl_20220205.txt b/ddl_20220205.txt index 4806aea..dabefc2 100644 --- a/ddl_20220205.txt +++ b/ddl_20220205.txt @@ -63,23 +63,3 @@ alter table tbl_bf_family_baby_disease add disease_text varchar(255) comment ' -- tbl_bf_family_baby 테이블 member_id 컬럼값 필수 삭제 alter table tbl_bf_family_baby modify member_id varchar(30) comment '회원아이디'; --- tbl_db_home_bf_recommend : 추천 홈메이드 이유식 -CREATE TABLE `tbl_db_home_bf_recommend` ( - `smc_no` int(11) NOT NULL COMMENT '아이 SMC_NO', - `dhb_no` int(11) NOT NULL COMMENT '홈메이드 이유식 정보 KEY', - `order_no` int(11) DEFAULT NULL COMMENT '노출순서', - `reg_dt` datetime DEFAULT NULL COMMENT '등록일자', - PRIMARY KEY (`smc_no`,`dhb_no`) -) ENGINE=InnoDB DEFAULT CHARSET=euckr COMMENT='아이별 추천 홈메이드 이유식 정보'; - - --- tbl_db_bf_ingre_recommend : 아이별 추천 식재료 -CREATE TABLE `tbl_db_bf_ingre_recommend` ( - `smc_no` int(11) NOT NULL COMMENT '아이 SMC_NO', - `dbi_no` int(11) NOT NULL COMMENT '이유식 식재료 KEY', - `order_no` int(11) DEFAULT NULL COMMENT '노출순서', - `reg_dt` datetime DEFAULT NULL COMMENT '등록일자', - PRIMARY KEY (`smc_no`,`dbi_no`) -) ENGINE=InnoDB DEFAULT CHARSET=euckr COMMENT='아이별 추천 이유식 식재료'; - - diff --git a/src/main/java/com/backoffice/api/ApiSMSController.java b/src/main/java/com/backoffice/api/ApiSMSController.java index 789384d..b10eaf3 100644 --- a/src/main/java/com/backoffice/api/ApiSMSController.java +++ b/src/main/java/com/backoffice/api/ApiSMSController.java @@ -2,13 +2,14 @@ package com.backoffice.api; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - +import com.backoffice.constants.ConstantSystem; import com.backoffice.admin.bf.ConstantBF; import com.backoffice.admin.member.member_issued_pwd.A_Member_issued_pwdBO; import com.backoffice.api.bo.APIMemberBO; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ModelAttribute; @@ -30,16 +31,14 @@ import com.renastudio.creative.web.util.date.DateUtil; @RequestMapping(value="/api/sms") public class ApiSMSController extends AbstractControllerManager{ private static Log log = LogFactory.getLog(ApiSMSController.class); - public final String TAG = this.getClass().getName(); - public final String SMS_STATUS_READY = "SMS_STATUS_READY"; public final String SMS_STATUS_SEND_SUCCESS = "SMS_STATUS_SEND_SUCCESS"; public final String SMS_STATUS_SEND_FAIL = "SMS_STATUS_SEND_FAIL"; public final String SMS_STATUS_CHECK_SUCCESS = "SMS_STATUS_CHECK_SUCCESS"; public final String SMS_STATUS_CHECK_FAIL = "SMS_STATUS_CHECK_FAIL"; - - public final String SEND_PHONE_NUM = "1644-8863"; +// public final String SEND_PHONE_NUM = "1644-8863"; + public final String SEND_PHONE_NUM = ConstantSystem.API_SENDNUM; @Autowired APIMemberBO aPIMemberBO; @@ -53,13 +52,17 @@ public class ApiSMSController extends AbstractControllerManager{ arr[1] = "테스트"; // 발송 결과 확인을 위한 고객이 생성 관리 하는 Unique Key (MAX 40byte) (해당 키를 이용하여 어떤 발송 건인지에 대한 구분을 해줌. 겹치지 않을만한 무작위 문자열) arr[2] = "폰 인증"; // LMS 발송 시 제목으로 사용 SMS 발송 시는 수신자에게 내용이 보이지 않습니다. arr[3] = "[쿨시스템] 테스트"; // 본문 (90byte 제한: SMS의 경우) - arr[4] = "02-762-8977"; // 발신 번호(010-0000-0000 or 01000000000) +// arr[4] = "02-762-8977"; // 발신 번호(010-0000-0000 or 01000000000) + arr[4] = ConstantSystem.API_SENDNUM; // 발신 번호(010-0000-0000 or 01000000000) arr[5] = "01093386094"; // 수신 번호(010-0000-0000 or 01000000000) arr[6] = "0"; // 예약 일자 "2013-07-30 12:00:00" 또는 "0" 0 또는 빈값(null)은 즉시 발송 - String api_id = "qoolsystem"; - String api_key = "35623e599bfc533c90ebd4d48a800791"; +// String api_id = "qoolsystem"; +// String api_key = "35623e599bfc533c90ebd4d48a800791"; + String api_id = ConstantSystem.API_ID; + String api_key = ConstantSystem.API_KEY; + ApiClass api = new ApiClass(api_id, api_key); String responseXml = null; @@ -159,8 +162,11 @@ public class ApiSMSController extends AbstractControllerManager{ arr[5] = phone_num; // 수신 번호(010-0000-0000 or 01000000000) arr[6] = "0"; // 예약 일자 "2013-07-30 12:00:00" 또는 "0" 0 또는 빈값(null)은 즉시 발송 - String api_id = "qoolsystem"; - String api_key = "35623e599bfc533c90ebd4d48a800791"; +// String api_id = "qoolsystem"; +// String api_key = "35623e599bfc533c90ebd4d48a800791"; + String api_id = ConstantSystem.API_ID; + String api_key = ConstantSystem.API_KEY; + ApiClass api = new ApiClass(api_id, api_key); String responseXml = null; diff --git a/src/main/java/com/backoffice/constants/ConstantSystem.java b/src/main/java/com/backoffice/constants/ConstantSystem.java index 23185dc..6de5163 100644 --- a/src/main/java/com/backoffice/constants/ConstantSystem.java +++ b/src/main/java/com/backoffice/constants/ConstantSystem.java @@ -9,7 +9,7 @@ import com.renastudio.creative.web.util.PropertyUtil; */ public class ConstantSystem { public static String PROPERTIES_NAME = "bf.properties"; - + public static String PLATFORM_VERSION = ""; public static String SERVER_TP_KOR = ""; @@ -91,6 +91,12 @@ public class ConstantSystem { public static String NAVER_CALLBACK_URL = ""; public static String KAKAP_CALLBACK_URL = ""; + public static String API_ID = ""; + public static String API_KEY = ""; + public static String API_SENDNUM = ""; + + + public static final String M_KEY = "376d69737379787568616e6765a65a61"; static { @@ -123,6 +129,10 @@ public class ConstantSystem { NAVER_CALLBACK_URL = PropertyUtil.getProperty(PROPERTIES_FILE, "social.callback.naver"); KAKAP_CALLBACK_URL = PropertyUtil.getProperty(PROPERTIES_FILE, "social.callback.kakao"); + API_ID = PropertyUtil.getProperty(PROPERTIES_FILE, "sms.api_id"); + API_KEY = PropertyUtil.getProperty(PROPERTIES_FILE, "sms.api_key"); + API_SENDNUM = PropertyUtil.getProperty(PROPERTIES_FILE, "sms.api_sendnum"); + SERVER_NAME_SHORT_URL = SERVER_NAME + "/c/"; // } diff --git a/src/main/resources/bf.properties b/src/main/resources/bf.properties index b89d982..679e0eb 100644 --- a/src/main/resources/bf.properties +++ b/src/main/resources/bf.properties @@ -1,24 +1,17 @@ -########## Environment ########## -#개발서버 : 45.50.165.220 - -URL_BASE=http://devops.lookylooks.ai:14280 -#URL_BASE=http://qoolsystem.com +########## 개발 Environment ########## #URL_BASE=http://dev.bf.co.kr:8080 +URL_BASE=http://devops.lookylooks.ai:14280 SERVER_TP_KOR=개발 SERVER_TP=DEV -#system.domain=http://qoolsystem.com +#system.domain=http://dev.bf.co.kr:8080 system.domain=http://devops.lookylooks.ai:14280 - SERVER_NAME=bf - PLATFORM_VERSION = 1.0 PLATFORM_NAME = 백오피스 COMPANY_NAME = 가온앤 COMPANY_MAIL = renamaestro@gmail.com - system.servername=bf REAL_BACKOFFICE=bf - AGENT_LOGO_IMG= AGENT_HOMEPAGE_LINK=http:// AGENT_HOMEPAGE_NAME=가온앤 @@ -39,19 +32,15 @@ maxIdle=10 minIdle=10 maxWaitMillis=3600000 maxWaitTime=3600000 - poolPreparedStatements=true validationQuery=select 1 - maximumActiveConnections=10 maximumIdleConnections=10 - logAbandoned=true removeAbandoned=true removeAbandonedTimeout=30000 defaultTransactionIsolation=2 - social.url.naverApiUrl=https://openapi.naver.com/v1/nid/me social.url.kakaoApiUrl=https://kapi.kakao.com/v2/user/me social.key.naverAppKey=SGrtulQWT7DeFmD3XDNN @@ -59,7 +48,15 @@ social.key.kakaoAppKey=ef79482743cf57124cdf45f88bfbb9fe social.callback.naver=/m/login/nhnLogin_callback social.callback.kakao=/m/login/kakaoLogin_callback.do +sms.api_id=gaonn0509 +sms.api_key=040ec316ad13c59031b5c4c30cdec923 +sms.api_sendnum=02-762-8977 + mysql_driver=net.sf.log4jdbc.DriverSpy mysql_url=jdbc:log4jdbc:mysql://devops.lookylooks.ai:14236/babyfeed mysql_username=imcloud mysql_password=imc1234 + +#mysql_url=jdbc:log4jdbc:mysql://115.85.181.214:3306/babyfeed +#mysql_username=root +#mysql_password=123qwe!@# \ No newline at end of file