| /** | 
|  * Copyright (c) 2018 人人开源 All rights reserved. | 
|  * | 
|  * https://www.renren.io | 
|  * | 
|  * 版权所有,侵权必究! | 
|  */ | 
|   | 
| package com.zt.modules.message.service; | 
|   | 
| import java.util.List; | 
|   | 
| import org.springframework.stereotype.Service; | 
|   | 
| import com.alibaba.fastjson.JSON; | 
| import com.zt.common.db.query.QueryFilter; | 
| import com.zt.common.service.BaseService; | 
| import com.zt.modules.message.dao.SysMailLogDao; | 
| import com.zt.modules.message.model.SysMailLog; | 
|   | 
| /** | 
|  * 邮件发送记录 | 
|  * | 
|  * @author Mark sunlightcs@gmail.com | 
|  */ | 
| @Service | 
| public class SysMailLogService extends BaseService<SysMailLogDao, SysMailLog> { | 
|   | 
|   | 
|     public List<SysMailLog> page(QueryFilter queryFilter) { | 
|         return this.query(queryFilter); | 
|     } | 
|   | 
|     /** | 
|      * 保存邮件发送记录 | 
|      * | 
|      * @param templateId | 
|      *            模板ID | 
|      * @param from | 
|      *            发送者 | 
|      * @param to | 
|      *            收件人 | 
|      * @param cc | 
|      *            抄送 | 
|      * @param subject | 
|      *            主题 | 
|      * @param content | 
|      *            邮件正文 | 
|      * @param status | 
|      *            状态 | 
|      */ | 
|     public void insert(Long templateId, String from, String[] to, String[] cc, String subject, String content, | 
|             Integer status) { | 
|         SysMailLog log = new SysMailLog(); | 
|         log.setTemplateId(templateId); | 
|         log.setMailFrom(from); | 
|         log.setMailTo(JSON.toJSONString(to)); | 
|         if (cc != null) { | 
|             log.setMailCc(JSON.toJSONString(cc)); | 
|         } | 
|         log.setSubject(subject); | 
|         log.setContent(content); | 
|         log.setStatus(status); | 
|         baseDao.insert(log); | 
|     } | 
| } |