|
@@ -1,22 +1,26 @@
|
|
|
package com.style24.core.biz.thirdparty;
|
|
package com.style24.core.biz.thirdparty;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Collection;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.annotation.PostConstruct;
|
|
|
|
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.core.env.Environment;
|
|
import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import com.google.gson.Gson;
|
|
|
import com.style24.core.biz.dao.SsgDirectMessageDao;
|
|
import com.style24.core.biz.dao.SsgDirectMessageDao;
|
|
|
import com.style24.core.biz.dao.TscAnswerPhaseDao;
|
|
import com.style24.core.biz.dao.TscAnswerPhaseDao;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.persistence.domain.AnswerPhase;
|
|
import com.style24.persistence.domain.AnswerPhase;
|
|
|
import com.style24.persistence.domain.SsgDirectMessage;
|
|
import com.style24.persistence.domain.SsgDirectMessage;
|
|
|
|
|
|
|
|
|
|
+import lombok.Data;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
@@ -130,20 +134,19 @@ public class SsgKakaoSender {
|
|
|
dm.setFcallback(callbackTelNo);
|
|
dm.setFcallback(callbackTelNo);
|
|
|
|
|
|
|
|
// 버튼생성
|
|
// 버튼생성
|
|
|
-// if (StringUtils.isNotBlank(dm.getButtonNm())) {
|
|
|
|
|
-// JSONObject button = new JSONObject();
|
|
|
|
|
-// button.put("name", dm.getButtonNm());
|
|
|
|
|
-// button.put("type", "WL");
|
|
|
|
|
-// button.put("url_mobile", domainUrl + dm.getButtonUrl());
|
|
|
|
|
-//
|
|
|
|
|
-// JSONObject jsonData = new JSONObject();
|
|
|
|
|
-// jsonData.put("button", button);
|
|
|
|
|
-//
|
|
|
|
|
-// JSONArray jsonArray = new JSONArray();
|
|
|
|
|
-// jsonArray.add(button);
|
|
|
|
|
-//
|
|
|
|
|
-// dm.setFkkobutton(jsonArray.toString());
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(ansPhase.getButtonNm())) {
|
|
|
|
|
+ Button button = new Button();
|
|
|
|
|
+ button.setName(ansPhase.getButtonNm());
|
|
|
|
|
+ button.setType("WL");
|
|
|
|
|
+ button.setUrl_pc(ansPhase.getButtonUrl());
|
|
|
|
|
+ button.setUrl_mobile(ansPhase.getButtonUrl());
|
|
|
|
|
+
|
|
|
|
|
+ Collection<Button> buttonList = new ArrayList<>();
|
|
|
|
|
+ buttonList.add(button);
|
|
|
|
|
+
|
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
|
+ dm.setFkkobutton("\"button\":" + gson.toJson(buttonList));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 카카오 알림톡 발송
|
|
// 카카오 알림톡 발송
|
|
|
dmDao.createKakao(dm);
|
|
dmDao.createKakao(dm);
|
|
@@ -186,13 +189,14 @@ public class SsgKakaoSender {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 답변문구 조회
|
|
* 답변문구 조회
|
|
|
|
|
+ * 어드민의 "운영관리 > 사이트설정 > 답변문구관리" 화면에서 등록/수정 시 answerPhase 캐시를 삭제
|
|
|
* @param ansSq - 답변일련번호
|
|
* @param ansSq - 답변일련번호
|
|
|
* @param replaceInfo - 메시지내용 중 대체할 정보
|
|
* @param replaceInfo - 메시지내용 중 대체할 정보
|
|
|
* @return
|
|
* @return
|
|
|
* @author gagamel
|
|
* @author gagamel
|
|
|
* @since 2020. 11. 9
|
|
* @since 2020. 11. 9
|
|
|
*/
|
|
*/
|
|
|
- @Cacheable(value = "common", key = "'answerPhase-'.concat(#ansSq)")
|
|
|
|
|
|
|
+ @Cacheable(value = "answerPhase", key = "#ansSq")
|
|
|
public AnswerPhase getAnswerPhase(Integer ansSq, GagaMap replaceInfo) {
|
|
public AnswerPhase getAnswerPhase(Integer ansSq, GagaMap replaceInfo) {
|
|
|
AnswerPhase ansPhase = ansPhaseDao.getAnswerPhase(ansSq);
|
|
AnswerPhase ansPhase = ansPhaseDao.getAnswerPhase(ansSq);
|
|
|
ansPhase.setAnsContent(GagaStringUtil.replace(this.mergeData(ansPhase.getAnsContent(), replaceInfo), ">", ">"));
|
|
ansPhase.setAnsContent(GagaStringUtil.replace(this.mergeData(ansPhase.getAnsContent(), replaceInfo), ">", ">"));
|
|
@@ -249,4 +253,12 @@ public class SsgKakaoSender {
|
|
|
return keyList;
|
|
return keyList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Data
|
|
|
|
|
+ class Button {
|
|
|
|
|
+ private String name;
|
|
|
|
|
+ private String type;
|
|
|
|
|
+ private String url_pc;
|
|
|
|
|
+ private String url_mobile;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|