| @@ -49,9 +49,12 @@ public class WechatWeappDraftTemplateController { | |||||
| } | } | ||||
| @PostMapping("/addToTemplate") | @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 { | try { | ||||
| openService.getWxOpenComponentService().addToTemplate(draftId); | |||||
| openService.getWxOpenComponentService().addToTemplate(template.getDraftId()); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } catch (WxErrorException e) { | } catch (WxErrorException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -60,9 +63,12 @@ public class WechatWeappDraftTemplateController { | |||||
| } | } | ||||
| @PostMapping("/deleteTemplate") | @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 { | try { | ||||
| openService.getWxOpenComponentService().deleteTemplate(templateId); | |||||
| openService.getWxOpenComponentService().deleteTemplate(template.getTemplateId()); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } catch (WxErrorException e) { | } catch (WxErrorException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||