mysql_mail_log.go 664 B

123456789101112131415161718192021222324
  1. package dao
  2. import (
  3. "go-common/app/admin/ep/merlin/model"
  4. pkgerr "github.com/pkg/errors"
  5. )
  6. // InsertMailLog insert mail log.
  7. func (d *Dao) InsertMailLog(ml *model.MailLog) (err error) {
  8. return pkgerr.WithStack(d.db.Create(&ml).Error)
  9. }
  10. // DelMailLog delete mail log.
  11. func (d *Dao) DelMailLog(receiverName string) (err error) {
  12. err = pkgerr.WithStack(d.db.Where("receiver_name=?", receiverName).Delete(model.MailLog{}).Error)
  13. return
  14. }
  15. // FindMailLog find mail log.
  16. func (d *Dao) FindMailLog(receiverName string) (mailLogs []*model.MailLog, err error) {
  17. err = pkgerr.WithStack(d.db.Where("receiver_name=?", receiverName).Find(&mailLogs).Error)
  18. return
  19. }