• Y
  • List All
  • Feedback
    • This Project
    • All Projects
Profile Account settings Log out
  • Favorite
  • Project
  • All
Loading...
  • Log in
  • Sign up
chominsoo4245 / mjon_git star
Forked from hylee / mjon_git
  • Project homeH
  • CodeC
  • IssueI
  • Pull requestP
  • Review R
  • MilestoneM
  • BoardB
  • Files
  • Commit
  • Branches
mjon_gitsrcmainjavaitnletkakaokakaoCommkakaoApiKakaoApiJsonSave.java
Download as .zip file
File name
Commit message
Commit date
DATABASE
mjon_git
2023-06-12
src/main
회원상세 팝업 문자종류 수정
2023-10-05
.codetogether.ignore
mjon_git
2023-06-12
.gitignore
gitignore 적용
2023-06-12
pom.xml
mjon_git
2023-06-12
File name
Commit message
Commit date
java
문자 슬랙 알림 기능 수정 - 예약 문자 발송시 스미싱 의심 안내 태그 표시기능 추가
2023-10-04
resources
주소록 단일등록시 번호중복 체크로직 보완
2023-09-18
webapp
회원상세 팝업 문자종류 수정
2023-10-05
File name
Commit message
Commit date
egovframework
mjon_git
2023-06-12
itn
문자 슬랙 알림 기능 수정 - 예약 문자 발송시 스미싱 의심 안내 태그 표시기능 추가
2023-10-04
File name
Commit message
Commit date
com
사용자 회원가입 입력항목 XSS 필터링 예외 항목 추가 - 회원아이디, 이메일 정보, 추천인 아이디, 회원명(회사명)
2023-08-21
let
문자 슬랙 알림 기능 수정 - 예약 문자 발송시 스미싱 의심 안내 태그 표시기능 추가
2023-10-04
web
메인페이지 이런 키워드는 어때요? 기능 추가
2023-09-05
File name
Commit message
Commit date
cop
이지우 - 취약점 조치(세금계산서 발행 시 본인 ID로만 등록, 본인 게시글만 수정, 환불 시 보유 금액 비교 추가)
2023-08-02
crypto/web
mjon_git
2023-06-12
fax
주소록 대량등록 TXT파일 업로드시 파일저장경로 수정
2023-08-29
hangulparser
mjon_git
2023-06-12
kakao
알림톡 목록에 발송승인, 발송취소 버튼 추가
2023-09-20
komoran
mjon_git
2023-06-12
lett
선택한 그림문자의 우선선위 변경 기능 추가
2023-09-05
mail
휴면회원으로 지정 기준날짜 변경
2023-07-25
main
이준호 문자온 커밋 - IP 받아오는 방식 수정
2023-07-28
mjo
문자 슬랙 알림 기능 수정 - 예약 문자 발송시 스미싱 의심 안내 태그 표시기능 추가
2023-10-04
module/base
mjon_git
2023-06-12
org
mjon_git
2023-06-12
schdlr/service
AGENT별 Kakao 발송건수 통계 스케쥴러 실행시간 변경
2023-08-31
sec
mjon_git
2023-06-12
solr
mjon_git
2023-06-12
sts
mjon_git
2023-06-12
sym
관리자방문수 관리 쿼리 성능개선, 기간검색 시작일 초기값 설정 추가
2023-09-13
uat
아이디찾기 일부 결과값 오류 수정
2023-09-21
uss
회원상세 알림톡목록 쿼리조건 수정
2023-09-04
utl
이준호 문자온 커밋 - IP 받아오는 방식 수정
2023-07-28
File name
Commit message
Commit date
admin
알림톡 목록에 발송승인, 발송취소 버튼 추가
2023-09-20
kakaoComm
알림톡 전송목록에 금일/금월/금년 통계 추가
2023-07-31
user
발송결과 문자 휴대폰번호 하이픈(-) 추가
2023-09-14
File name
Commit message
Commit date
kakaoApi
mjon_git
2023-06-12
KakaoButtonVO.java
mjon_git
2023-06-12
KakaoCommentVO.java
mjon_git
2023-06-12
KakaoItemVO.java
mjon_git
2023-06-12
KakaoReturnVO.java
mjon_git
2023-06-12
KakaoSendUtil.java
mjon_git
2023-06-12
KakaoServiceCommon.java
mjon_git
2023-06-12
KakaoVO.java
알림톡 전송목록에 금일/금월/금년 통계 추가
2023-07-31
File name
Commit message
Commit date
service
mjon_git
2023-06-12
KakaoApiImageUpload.java
mjon_git
2023-06-12
KakaoApiJsonSave.java
mjon_git
2023-06-12
KakaoApiProfile.java
mjon_git
2023-06-12
KakaoApiProfileCategory.java
mjon_git
2023-06-12
KakaoApiTemplate.java
mjon_git
2023-06-12
KakaoApiTemplateCategory.java
mjon_git
2023-06-12
KakaoFTJsonSave.java
mjon_git
2023-06-12
hylee 2023-06-12 785e892 mjon_git UNIX
Raw Open in browser Change history
package itn.let.kakao.kakaoComm.kakaoApi; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.List; import org.json.simple.JSONObject; import org.json.simple.JSONArray; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import itn.com.cmm.util.StringUtil; import itn.let.kakao.kakaoComm.KakaoButtonVO; import itn.let.kakao.kakaoComm.KakaoReturnVO; import itn.let.kakao.kakaoComm.KakaoVO; @Component public class KakaoApiJsonSave { @Autowired KakaoApiTemplate kakaoApiTemplate; /** 비즈 JSON 파일저장 경로*/ @Value("#{globalSettings['Globals.mjon.kakao.dir']}") private String mjonBizJsonDir; static String json; @SuppressWarnings("unchecked") public String kakaoApiJsonSave(KakaoVO kakaoVO, String[] varValInfo) { // json파일 저장 Date nowDate = new Date(); SimpleDateFormat todayFrom = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat timeFrom = new SimpleDateFormat("HHmmss"); String jsonFileName = mjonBizJsonDir+"/"+kakaoVO.getUserId()+"/"+todayFrom.format(nowDate)+"/"+kakaoVO.getSendType(); // 아이디/날짜/타입 String fileName = timeFrom.format(nowDate)+"_"+kakaoVO.getDestPhone()+".json"; try { File userIdFile = new File(jsonFileName); if(!userIdFile.exists()) { userIdFile.mkdirs(); // 없으면 하위 디렉토리 까지 생성 jsonFileName = jsonFileName +"/"+fileName; }else { jsonFileName = jsonFileName +"/"+fileName; System.out.println("jsonFileName : "+jsonFileName); File file1 = new File(jsonFileName); if (file1.isFile()) { return jsonFileName; } } KakaoReturnVO templateDetail = kakaoApiTemplate.selectKakaoApiTemplateDetail(kakaoVO); // 버튼리스트 JSON 생성 JSONArray buttonList = new JSONArray(); for(KakaoButtonVO buttonInfoVO : templateDetail.getButtonList()) { JSONObject buttonInfo = new JSONObject(); buttonInfo.put("name", buttonInfoVO.getName()); buttonInfo.put("type", buttonInfoVO.getLinkType()); if(buttonInfoVO.getLinkType().equals("WL")) { buttonInfo.put("url_mobile", buttonInfoVO.getLinkMo()); buttonInfo.put("url_pc", buttonInfoVO.getLinkPc()); }else if(buttonInfoVO.getLinkType().equals("AL")) { buttonInfo.put("scheme_ios", buttonInfoVO.getLinkIos()); buttonInfo.put("scheme_android", buttonInfoVO.getLinkAnd()); }else if(buttonInfoVO.getLinkType().equals("BC")) { // 상담톡 진행시 등록해야함 }else if(buttonInfoVO.getLinkType().equals("BT")) { // 봇 전환 시 전달 } buttonList.add(buttonInfo); } // 강조유형 JSON 생성 JSONObject templateDetailInfo = new JSONObject(); String emphasizeType = templateDetail.getTemplateEmphasizeType(); if(emphasizeType.equals("TEXT")) { String templateTitle = templateDetail.getTemplateTitle(); if(kakaoVO.getVarNmList().size() != 0) { String[] varNm = new String[kakaoVO.getVarNmList().size()]; int q=0; for(String temp : kakaoVO.getVarNmList()) { temp = temp.replaceAll("\\#\\{" , "§§"); temp = temp.replaceAll("\\}" , "§"); varNm[q] = temp; q++; } List<String[]> varValList = kakaoVO.getVarValList(); // value 값 templateTitle = templateTitle.replaceAll(String.valueOf((char)13), ""); templateTitle = templateTitle.replaceAll("\\#\\{" , "§§"); templateTitle = templateTitle.replaceAll("\\}" , "§"); for(int i=0; i < varNm.length; i++) { for(int j=0; j < varValInfo.length; j++) { if (templateTitle.indexOf(varNm[i]) > -1) { if(varValInfo[j] != null) { templateTitle = templateTitle.replaceAll(varNm[i] , StringUtil.getString(varValInfo[j])); }else { templateTitle = templateTitle.replaceAll(varNm[i] , ""); } } } } templateDetailInfo.put("title", templateTitle); }else { templateDetailInfo.put("title", templateTitle); } }else if(emphasizeType.equals("IMAGE")) { templateDetailInfo.put("msg_type", "ai"); }else if(emphasizeType.equals("NONE")) { } JSONObject jo = new JSONObject(); if(buttonList.size() != 0) { jo.put("button", buttonList); } if(templateDetailInfo.size() != 0) { jo.put("extra", templateDetailInfo); } // 입력 json 데이터를 파일로 변경 String jsonStr = jo.toString(); System.out.println("jsonFileName : "+jsonFileName); File outPut = new File(jsonFileName); outPut.createNewFile(); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outPut), "utf-8")); bw.write(jsonStr); bw.close(); } catch (IOException e) { System.out.println("json 생성 실패"); e.printStackTrace(); } return jsonFileName; } }

          
        
    
    
Copyright Yona authors & © NAVER Corp. & NAVER LABS Supported by NAVER CLOUD PLATFORM

or
Sign in with github login with Google Sign in with Google
Reset password | Sign up