mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 02:32:20 +09:00
템플릿 반려 팝업 작업
This commit is contained in:
@@ -81,4 +81,25 @@ public class ChannelMgtController {
|
||||
|
||||
return channelService.tmpltListExcel(tmpltListExcelReqDto, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 4. 25.
|
||||
* auth : ckr
|
||||
* desc : 알림톡 템플릿 목록 조회
|
||||
* @param tmpltListReqDto
|
||||
* @return
|
||||
* @
|
||||
*/
|
||||
@ApiOperation(value = "tmpltRejectList", notes = "알림톡 템플릿 반려 목록 조회")
|
||||
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||
@RequestMapping(value = "tmpltRejectList", method = { RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public TmpltListResDto tmpltRejectList(@RequestBody @Valid TmpltListReqDto tmpltListReqDto, BindingResult bindingResult) {
|
||||
|
||||
if (validComponents.validParameter(bindingResult)) {
|
||||
return new TmpltListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
return channelService.tmpltRejectList(tmpltListReqDto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
package kr.co.uplus.ez.api.channelMgt;
|
||||
|
||||
import kr.co.uplus.ez.api.channelMgt.dto.*;
|
||||
import kr.co.uplus.ez.common.components.WebClientRequestService;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.Const;
|
||||
import kr.co.uplus.ez.common.data.Paging;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class ChannelMgtService {
|
||||
@@ -25,6 +33,15 @@ public class ChannelMgtService {
|
||||
@Autowired
|
||||
@Qualifier("sqlSessionTemplateDb2")
|
||||
private SqlSessionTemplate sqlSessionSlave;
|
||||
|
||||
@Autowired
|
||||
WebClientRequestService clientRequestService;
|
||||
|
||||
@Value("${hubeasy-api.domain:http://localhost:7070/}")
|
||||
String apiDomain;
|
||||
|
||||
@Value("${hubeasy-api.url.alTolkTemplet:api/v1/kko/template/get}")
|
||||
String apiUrlAlTolkTemplet;
|
||||
|
||||
/**
|
||||
* date : 2022. 4. 25.
|
||||
@@ -82,4 +99,47 @@ public class ChannelMgtService {
|
||||
|
||||
return new TmpltListExcelResDto(ApiResponseCode.SUCCESS, tmpltListRes);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* desc : 알림톡 템플릿 반려 목록 조회
|
||||
* @param tmpltListReqDto
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public TmpltListResDto tmpltRejectList(TmpltListReqDto tmpltListReqDto) {
|
||||
RjtTmpltListRes tmpltListRes = new RjtTmpltListRes();
|
||||
Map<Object, Object> apiResultMap = null;
|
||||
List<Map<Object,Object>> rjtDataListMap = null;
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
String callUrl = apiDomain + apiUrlAlTolkTemplet;
|
||||
jsonObject.put("senderKey", tmpltListReqDto.getSndrprofKey());
|
||||
jsonObject.put("templateKey", tmpltListReqDto.getTmpltKey());
|
||||
|
||||
try {
|
||||
|
||||
apiResultMap = (Map<Object, Object>) clientRequestService.callBySyncPost(callUrl, jsonObject);
|
||||
|
||||
if("0000".equals(apiResultMap.get("retCode"))) {
|
||||
Map<Object, Object> dataMap = (Map<Object, Object>) apiResultMap.get("data");
|
||||
Map<Object, Object> dataTempMap = (Map<Object, Object>) dataMap.get("list");
|
||||
|
||||
if(dataTempMap.get("comments") != null && !"".equals(dataTempMap.get("comments"))) {
|
||||
rjtDataListMap = (List<Map<Object, Object>>) dataTempMap.get("comments");
|
||||
tmpltListRes.setList(rjtDataListMap);
|
||||
}
|
||||
return new TmpltListResDto(ApiResponseCode.SUCCESS, tmpltListRes);
|
||||
}else {
|
||||
return new TmpltListResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
}
|
||||
return new TmpltListResDto(ApiResponseCode.SUCCESS, tmpltListRes);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -31,4 +31,9 @@ public class TmpltInfo implements Serializable {
|
||||
private String sendProfile;
|
||||
@ApiModelProperty(example = "20220320", name = "최종수정일자", dataType = "String")
|
||||
private String lastChgDt;
|
||||
|
||||
@ApiModelProperty(example = "da17d231bbf13f83174a36a4bb0353476ae012b3", name = "발신프로필_키", dataType = "String")
|
||||
private String sndrprofKey;
|
||||
@ApiModelProperty(example = "TPizuOloiF", name = "템플릿_키", dataType = "String")
|
||||
private String tmpltKey;
|
||||
}
|
||||
|
||||
@@ -28,4 +28,9 @@ public class TmpltListReqDto implements Serializable {
|
||||
private String channelAuthMenuNo;
|
||||
@ApiModelProperty(example = "test", name = "사용자아이디", dataType = "int")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(example = "da17d231bbf13f83174a36a4bb0353476ae012b3", name = "발신프로필_키", dataType = "String")
|
||||
private String sndrprofKey;
|
||||
@ApiModelProperty(example = "TPizuOloiF", name = "템플릿_키", dataType = "String")
|
||||
private String tmpltKey;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ public class TmpltListResDto extends ResponseMessage implements Serializable {
|
||||
|
||||
// 데이터.
|
||||
private TmpltListRes data;
|
||||
private RjtTmpltListRes rjtData;
|
||||
|
||||
public TmpltListResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
@@ -30,4 +31,9 @@ public class TmpltListResDto extends ResponseMessage implements Serializable {
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public TmpltListResDto(ApiResponseCode returnStr, RjtTmpltListRes rjtData) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.rjtData = rjtData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class WebClientRequestService {
|
||||
public Object callBySyncPost(String uri, Object param) {
|
||||
Date startTime = new Date();
|
||||
Object result = webClient.post().uri(uri).bodyValue(param).retrieve().bodyToMono(Object.class).block();
|
||||
log.info("callBySyncPost duration Time : {}", (new Date().getTime() - startTime.getTime()) / 1000f);
|
||||
log.debug("callBySyncPost duration Time : {}", (new Date().getTime() - startTime.getTime()) / 1000f);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user