260115_01_ENH : Front 연동 테스트 완료 및 대량발송 결과 다운로드 구현 완료
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.kri.notihub.server.controller;
|
||||
|
||||
import com.kri.common.webmvc.RequestUserContext;
|
||||
import com.kri.notihub.server.common.enums.ChannelType;
|
||||
import com.kri.notihub.server.dto.template.TemplateBasicDto;
|
||||
import com.kri.notihub.server.dto.template.TemplateDto;
|
||||
import com.kri.notihub.server.dto.template.TemplateSummaryDto;
|
||||
@@ -25,9 +26,12 @@ public class TemplateController {
|
||||
private final FileService fileService;
|
||||
|
||||
@Operation(summary = "템플릿 목록 조회")
|
||||
@GetMapping("/list/{itrntPrjctCd}")
|
||||
public List<TemplateSummaryDto> getTemplateList(@PathVariable String itrntPrjctCd) {
|
||||
return templateService.getTemplateList(itrntPrjctCd);
|
||||
@GetMapping("/list/{chnnlTy}/{itrntPrjctCd}")
|
||||
public List<TemplateSummaryDto> getTemplateList(
|
||||
@PathVariable ChannelType chnnlTy,
|
||||
@PathVariable String itrntPrjctCd
|
||||
) {
|
||||
return templateService.getTemplateList(chnnlTy, itrntPrjctCd);
|
||||
}
|
||||
|
||||
@Operation(summary = "템플릿 단건 조회")
|
||||
@@ -37,19 +41,23 @@ public class TemplateController {
|
||||
}
|
||||
|
||||
@Operation(summary = "템플릿 생성")
|
||||
@PutMapping("/{itrntPrjctCd}")
|
||||
public long createTemplate(
|
||||
@PathVariable String itrntPrjctCd,
|
||||
@PutMapping
|
||||
public TemplateDto createTemplate(
|
||||
@Valid @RequestBody TemplateBasicDto template,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
String newHtml = fileService.syncOnSave(
|
||||
itrntPrjctCd,
|
||||
template.getTmplatBody()
|
||||
);
|
||||
template.setTmplatBody(newHtml);
|
||||
TemplateDto newTmplat = templateService.createTemplate(template.getItrntPrjctCd(), template, ctx.getUserId());
|
||||
|
||||
return templateService.createTemplate(itrntPrjctCd, template, ctx.getUserId());
|
||||
String newHtml = fileService.syncOnSave(
|
||||
newTmplat.getItrntPrjctCd(),
|
||||
newTmplat.getTmplatIdx(),
|
||||
newTmplat.getTmplatBody()
|
||||
);
|
||||
newTmplat.setTmplatBody(newHtml);
|
||||
|
||||
templateService.updateTemplateBodyWithCreate(newTmplat);
|
||||
|
||||
return newTmplat;
|
||||
}
|
||||
|
||||
@Operation(summary = "시나리오 이미지 업로드")
|
||||
@@ -59,13 +67,14 @@ public class TemplateController {
|
||||
}
|
||||
|
||||
@Operation(summary = "템플릿 수정")
|
||||
@PatchMapping()
|
||||
@PatchMapping
|
||||
public TemplateDto updateTemplate(
|
||||
@Valid @RequestBody TemplateDto template,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
String newHtml = fileService.syncOnSave(
|
||||
template.getItrntPrjctCd(),
|
||||
template.getTmplatIdx(),
|
||||
template.getTmplatBody()
|
||||
);
|
||||
template.setTmplatBody(newHtml);
|
||||
|
||||
Reference in New Issue
Block a user