|
|
|
@@ -49,9 +49,12 @@ public class WechatWeappDraftTemplateController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/addToTemplate") |
|
|
|
public ResultData addToTemplate(Long draftId) { |
|
|
|
public ResultData addToTemplate(@RequestBody WxOpenMaCodeTemplate template) { |
|
|
|
if(template == null || template.getDraftId() == null) { |
|
|
|
return new ResultData(Result.ERROR, "draftId is null"); |
|
|
|
} |
|
|
|
try { |
|
|
|
openService.getWxOpenComponentService().addToTemplate(draftId); |
|
|
|
openService.getWxOpenComponentService().addToTemplate(template.getDraftId()); |
|
|
|
return new ResultData(); |
|
|
|
} catch (WxErrorException e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
@@ -60,9 +63,12 @@ public class WechatWeappDraftTemplateController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/deleteTemplate") |
|
|
|
public ResultData deleteTemplate(Long templateId) { |
|
|
|
public ResultData deleteTemplate(@RequestBody WxOpenMaCodeTemplate template) { |
|
|
|
if(template == null || template.getTemplateId() == null) { |
|
|
|
return new ResultData(Result.ERROR, "templateId is null"); |
|
|
|
} |
|
|
|
try { |
|
|
|
openService.getWxOpenComponentService().deleteTemplate(templateId); |
|
|
|
openService.getWxOpenComponentService().deleteTemplate(template.getTemplateId()); |
|
|
|
return new ResultData(); |
|
|
|
} catch (WxErrorException e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
|