@Test public void createTemplateTest() { Integer sign = 4; String templateCode = "SMS_137110043"; String template = "验证码#code#，您正在登录，若非本人操作，请勿泄露。"; smsService.addTemplate( sign, templateCode, template, SmsPlatformEnum.AliYun.getValue(), SmsTypeEnum.VERIFICATION_CODE.getValue()); }
@Override @Transactional public void addTemplate(Integer smsSignId, String templateCode, String template, Integer platform, Integer smsType) { SmsSignDO smsSignDO = smsSignMapper.selectOne( new QueryWrapper<SmsSignDO>().eq("id", smsSignId)); if (smsSignDO == null) { throw new ServiceException(AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getCode(), AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getMessage()); } smsTemplateMapper.insert( (SmsTemplateDO) new SmsTemplateDO() .setId(null) .setSmsSignId(smsSignId) .setTemplateCode(templateCode) .setTemplate(template) .setPlatform(platform) .setSmsType(smsType) .setApplyStatus(SmsApplyStatusEnum.SUCCESS.getValue()) .setApplyMessage("") .setDeleted(DeletedStatusEnum.DELETED_NO.getValue()) .setCreateTime(new Date()) ); }
SmsServiceImpl implements SmsService { @Override @Transactional public void addTemplate(Integer smsSignId, String templateCode, String template, Integer platform, Integer smsType) { SmsSignDO smsSignDO = smsSignMapper.selectOne( new QueryWrapper<SmsSignDO>().eq("id", smsSignId)); if (smsSignDO == null) { throw new ServiceException(AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getCode(), AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getMessage()); } smsTemplateMapper.insert( (SmsTemplateDO) new SmsTemplateDO() .setId(null) .setSmsSignId(smsSignId) .setTemplateCode(templateCode) .setTemplate(template) .setPlatform(platform) .setSmsType(smsType) .setApplyStatus(SmsApplyStatusEnum.SUCCESS.getValue()) .setApplyMessage("") .setDeleted(DeletedStatusEnum.DELETED_NO.getValue()) .setCreateTime(new Date()) ); } }
SmsServiceImpl implements SmsService { @Override @Transactional public void addTemplate(Integer smsSignId, String templateCode, String template, Integer platform, Integer smsType) { SmsSignDO smsSignDO = smsSignMapper.selectOne( new QueryWrapper<SmsSignDO>().eq("id", smsSignId)); if (smsSignDO == null) { throw new ServiceException(AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getCode(), AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getMessage()); } smsTemplateMapper.insert( (SmsTemplateDO) new SmsTemplateDO() .setId(null) .setSmsSignId(smsSignId) .setTemplateCode(templateCode) .setTemplate(template) .setPlatform(platform) .setSmsType(smsType) .setApplyStatus(SmsApplyStatusEnum.SUCCESS.getValue()) .setApplyMessage("") .setDeleted(DeletedStatusEnum.DELETED_NO.getValue()) .setCreateTime(new Date()) ); }  }
SmsServiceImpl implements SmsService { @Override @Transactional public void addTemplate(Integer smsSignId, String templateCode, String template, Integer platform, Integer smsType) { SmsSignDO smsSignDO = smsSignMapper.selectOne( new QueryWrapper<SmsSignDO>().eq("id", smsSignId)); if (smsSignDO == null) { throw new ServiceException(AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getCode(), AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getMessage()); } smsTemplateMapper.insert( (SmsTemplateDO) new SmsTemplateDO() .setId(null) .setSmsSignId(smsSignId) .setTemplateCode(templateCode) .setTemplate(template) .setPlatform(platform) .setSmsType(smsType) .setApplyStatus(SmsApplyStatusEnum.SUCCESS.getValue()) .setApplyMessage("") .setDeleted(DeletedStatusEnum.DELETED_NO.getValue()) .setCreateTime(new Date()) ); }  @Override PageSmsSignBO pageSmsSign(PageQuerySmsSignDTO queryDTO); @Override PageSmsTemplateBO pageSmsTemplate(PageQuerySmsTemplateDTO queryDTO); @Override @Transactional void addSign(String sign, Integer platform); @Override SmsSignBO getSign(Integer signId); @Override @Transactional void updateSign(Integer id, String newSign, Integer platform); @Override void deleteSign(Integer id); @Override @Transactional void addTemplate(Integer smsSignId, String templateCode,
                            String template, Integer platform, Integer smsType); @Override SmsTemplateBO getTemplate(Integer id, Integer platform); @Override @Transactional void updateTemplate(Integer id, Integer smsSignId, String templateCode,
                               String template, Integer platform, Integer smsType); @Override @Transactional void deleteTemplate(Integer id); @Override void singleSend(String mobile, Integer smsTemplateId, Map<String, String> params); @Override void batchSend(List<String> mobileList, Integer smsTemplateId, Map<String, String> params); }
SmsServiceImpl implements SmsService { @Override @Transactional public void addTemplate(Integer smsSignId, String templateCode, String template, Integer platform, Integer smsType) { SmsSignDO smsSignDO = smsSignMapper.selectOne( new QueryWrapper<SmsSignDO>().eq("id", smsSignId)); if (smsSignDO == null) { throw new ServiceException(AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getCode(), AdminErrorCodeEnum.SMS_SIGN_NOT_EXISTENT.getMessage()); } smsTemplateMapper.insert( (SmsTemplateDO) new SmsTemplateDO() .setId(null) .setSmsSignId(smsSignId) .setTemplateCode(templateCode) .setTemplate(template) .setPlatform(platform) .setSmsType(smsType) .setApplyStatus(SmsApplyStatusEnum.SUCCESS.getValue()) .setApplyMessage("") .setDeleted(DeletedStatusEnum.DELETED_NO.getValue()) .setCreateTime(new Date()) ); }  @Override PageSmsSignBO pageSmsSign(PageQuerySmsSignDTO queryDTO); @Override PageSmsTemplateBO pageSmsTemplate(PageQuerySmsTemplateDTO queryDTO); @Override @Transactional void addSign(String sign, Integer platform); @Override SmsSignBO getSign(Integer signId); @Override @Transactional void updateSign(Integer id, String newSign, Integer platform); @Override void deleteSign(Integer id); @Override @Transactional void addTemplate(Integer smsSignId, String templateCode,
                            String template, Integer platform, Integer smsType); @Override SmsTemplateBO getTemplate(Integer id, Integer platform); @Override @Transactional void updateTemplate(Integer id, Integer smsSignId, String templateCode,
                               String template, Integer platform, Integer smsType); @Override @Transactional void deleteTemplate(Integer id); @Override void singleSend(String mobile, Integer smsTemplateId, Map<String, String> params); @Override void batchSend(List<String> mobileList, Integer smsTemplateId, Map<String, String> params);  }