当前位置: 首页 > news >正文

用wordpress建站案例提供响应式网站建设

用wordpress建站案例,提供响应式网站建设,绍兴专业网站建设,百度广告推广springboot发送邮件,内容使用thymeleaf模板引擎排版 1、导入jar包2、yml设置3、收件人以及收件信息设置4、发邮件service5、模版页面6、controller 1、导入jar包 !--发送邮件--dependencygroupIdorg.springframework.boot/groupIdartifac… springboot发送邮件,内容使用thymeleaf模板引擎排版 1、导入jar包2、yml设置3、收件人以及收件信息设置4、发邮件service5、模版页面6、controller 1、导入jar包 !--发送邮件--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-mail/artifactId/dependency !--使用thymeleaf 形式--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-thymeleaf/artifactId/dependency2、yml设置 发件邮箱信息设置 spring:mail:host: smtp.xx.cnport: 465username: 你的邮箱password: 你的密码 # default-encoding: UTF-8protocol: smtpproperties: # 配置以SSL的方式发送, 这个需要使用这种方式并且端口是465mail:smtp:auth: truessl:enable: truesocketFactory:class: com.sun.mail.util.MailSSLSocketFactoryfallback: falsedebug: true 3、收件人以及收件信息设置 Getter Setter public class AcceptMailParam {//标题private String title;//接收人邮件地址private String receiveEmail[];//抄送人邮件地址private String chaoSongPersonEmail[];//附件value 文件的绝对地址/动态模板数据private MapString, Object attachment;//thymeleaf模版引擎页面对象数据邮件排版内存ListOperateDataResultInfoView pageViewList; }页面对象数据展示 Setter Getter public class OperateDataResultInfoView {private Long id;/*** 存储当前年月,eg:202301*/private Integer curMonth;/*** 库名*/private String dbName;/*** 表名*/private String tableName;/*** 计划生成数据量*/private Long planGenDataCnt;/*** 实际生成数据量*/private Long actualGenDataCnt;/*** 备注*/private String remark;private String gmtCreate;private String gmtModified;/* ** 剩余待生成数据量*/private Long remainToGenCnt;/* ** 生成数据成功率(实际生成数量/计划生成数量),单位%*/private BigDecimal genDataSuccessRate;/**模拟生成数据*/public OperateDataResultInfoView() {this.id ThreadLocalRandom.current().nextLong(100L, 999L);this.curMonth DateUtil.getPreMonth();String[] dbAndTableName (dbName id .tableName id).split(\\.);this.dbName dbAndTableName[0];this.tableName dbAndTableName[1];this.planGenDataCnt id ThreadLocalRandom.current().nextLong(10L, 99L);this.actualGenDataCnt id;this.remark null;this.gmtCreate DateUtil.getNowStr();this.gmtModified DateUtil.getNowStr();this.remainToGenCnt (planGenDataCnt - actualGenDataCnt) 0 ? (planGenDataCnt - actualGenDataCnt) : 0;BigDecimal rate new BigDecimal(actualGenDataCnt).divide(new BigDecimal(planGenDataCnt), 4, BigDecimal.ROUND_HALF_UP);this.genDataSuccessRate rate.compareTo(new BigDecimal(1)) 0 ? new BigDecimal(100) : rate.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);} }4、发邮件service public interface SendMailService {/*** 邮件内容排版调试*/AcceptMailParam getMailContentAndSendMail(Integer curMonth); }/*** 获取指定月份的邮件【邮件内容生成数据的结果集 信息】* 次月1日8点 发送*/Overridepublic AcceptMailParam getMailContentAndSendMail(Integer curMonth) {AcceptMailParam acceptMailParam new AcceptMailParam();ListOperateDataResultInfoView pageViewList new ArrayList();for (int i 0; i 10; i) {pageViewList.add(new OperateDataResultInfoView());}Collections.sort(pageViewList, Comparator.comparing(OperateDataResultInfoView::getId).reversed());acceptMailParam.setPageViewList(pageViewList);String[] emails {xxx1qq.com};String[] chaoSongPerson {xx2qq.com};//收件人支持多人acceptMailParam.setReceiveEmail(emails);//抄送人支持多人acceptMailParam.setChaoSongPersonEmail(chaoSongPerson);acceptMailParam.setTitle(统计业务表生成数据结果);//添加附件MapString, Object map new HashMap();//key为邮件附件文件名称路径改为你的服务器路径即可可添加不同类型文件map.put(1-test1.zip, /Users/gina/xx/data/test2.zip);map.put(2-test2.xlsx, /Users/gina/xx/data/test1.xlsx);acceptMailParam.setAttachment(map);//调试邮件内容排版时此处可注释掉。//this.sendTemplateMail(acceptMailParam,/mail/list);return acceptMailParam;}5、模版页面 在resources下在路径templates/mail/下添加文件list.html !DOCTYPE htmlhtml xmlns:thhttp://www.thymeleaf.orgstyletr.odd td {background-color: #f0faaa;}td.number {text-align: right;}table {width: 100%;border: 1px solid #000;border-collapse: collapse;}table tbody tr td, table thead tr th {padding: 2px 10px;border-left: 1px dotted #000000;vertical-align: top;line-height: 20px;}table tbody tr, table thead tr {border-bottom: 1px solid #000000;}table th {background-color: #99cc33;}table tbody tr td a, table tbody tr td a:hover {text-decoration: none;font-weight: bold;background-color: #352726;padding: 2px 10px;color: #f0faaa;margin-left: 10px;text-transform: uppercase;border: 0px;}/styleheadtitle统计业务表生成数据结果/titlemeta http-equivContent-Type contenttext/html; charsetUTF-8 //headbodyh1统计业务表生成数据结果/h1tabletrth生成月份/thth库名/thth表名/thth计划生成(条)/thth实际生成(条)/thth成功率%/thth未生成(条)/thth创建时间/thth更新时间/thth备注/th/trtr th:eacho : ${pageViewList} th:class${o.id % 2 0}? odd td th:text${o.curMonth} /tdtd th:text${o.dbName} /tdtd th:text${o.tableName} /tdtd th:text${o.planGenDataCnt} /tdtd th:text${o.actualGenDataCnt}/tdtd th:text${o.genDataSuccessRate}/tdtd th:text${o.remainToGenCnt}/tdtd th:text${o.gmtCreate}/tdtd th:text${o.gmtModified}/tdtd th:text${o.remark}/td/tr/table/body /html6、controller Controller Slf4j public class SendMailController {/*** 调试生成的页面样式不发邮件* 数据处理结果集view*/Resourceprivate SendMailService sendMailService;/** 点此可直接访问* http://localhost:8081/sendMail?curMonth202311*/RequestMapping(sendMail)public String sendMail(Model model, RequestParam(name curMonth) Integer curMonth) {try {AcceptMailParam acceptMailParam sendMailService.getMailContentAndSendMail(curMonth);model.addAttribute(title, acceptMailParam.getTitle());model.addAttribute(pageViewList, acceptMailParam.getPageViewList());} catch (Exception e) {log.error(sendMail fail ,msg{}, e.getMessage());}return mail/list;} }7、启动服务后访问页面展示 邮箱内容样式为 有对thymeleaf感兴趣的同学可通过中文官网去了解thymeleaf中文官网
http://www.zqtcl.cn/news/474195/

相关文章:

  • 淘宝客导购网站营销推广软件有哪些
  • 专做写字楼出租的网站建设银行北京招聘网站
  • 龙华观澜网站建设酒店网站建设策划
  • 淄博网站排名做版权保护的网站
  • 专业轻电商网站建设公司新闻发布的网站
  • 设计型网站营销存在的问题及改进
  • 南通建设企业网站wordpress 位置地图
  • 无锡本地网站有哪些手机拍摄720全景软件
  • 泉州晋江网站建设费用东莞市住房和城乡建设局门户网站
  • 苏州网站建设哪家便宜平谷手机网站设计
  • 建设项目一次公示网站嘉兴新站seo外包
  • 电子商务网站模板 html专业网站建设服务报价
  • 网页设计和网站建设的区别研发一款app要多少钱
  • seo网站建设方案建个企业网站需要多少钱
  • 搭建网站的软件网页动态设计
  • 好的界面建筑网站甘孜网站建设
  • 电子商务网站创建过程网站排名提升软件
  • 青岛企业如何建网站购买网站建站
  • 广东自考网站建设管理网站做ddns解析
  • 网站建设分类如何重启网站服务器
  • 新蒲建设集团网站怎么把源码做网站
  • 嘉兴建设局网站在线制作头像框
  • 苏州行业网站建设服务网页制作需要学什么技术
  • 二 网站建设的重要性东莞seo建站优化收费
  • 农业公司注册流程及费用快排seo排名软件
  • 响应式中文网站欣赏机wordpress
  • 如何建网站并做推广亚马逊网站怎么做推广
  • 做好网站建设总结免费开发app平台下载
  • 哈尔滨建站免费模板app网站开发要多少钱
  • 大连网站设计九首选仟亿科技怎么做百度网站会显示图片在旁边