mss

package
v0.0.0-...-1960156 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2015 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

*

  • Copyright 2015 @ z3q.net.
  • name : error
  • author : jarryliu
  • date : 2015-07-27 09:22
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : mail_task
  • author : jarryliu
  • date : 2015-07-27 09:36
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : mail_template
  • author : jarryliu
  • date : 2015-07-26 21:31
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : msg_data
  • author : jarryliu
  • date : 2015-07-26 21:59
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : msg_template
  • author : jarryliu
  • date : 2015-07-26 21:57
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : msg_manager
  • author : jarryliu
  • date : 2015-07-26 21:30
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : mss_rep
  • author : jarryliu
  • date : 2015-07-27 08:46
  • description :
  • history :

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupportMessageType *domain.DomainError = domain.NewDomainError(
		"err_not_support_message_type", "不支持的消息类型")

	ErrNotEnabled *domain.DomainError = domain.NewDomainError(
		"err_template_not_enabled", "模板未启用")

	ErrTemplateUsed *domain.DomainError = domain.NewDomainError(
		"err_template_used", "模板被使用,无法删除")
)

Functions

This section is empty.

Types

type IMsgTemplate

type IMsgTemplate interface {
	// 应用数据
	ApplyData(MsgData)
	// 加入到发送对列
	JoinQueen(to []string) error
}

type IMssManager

type IMssManager interface {
	// 发送消息
	Send(tpl IMsgTemplate, d MsgData, to []string) error

	// 获取邮箱模板
	GetMailTemplate(int) *MailTemplate

	// 保存邮箱模版
	SaveMailTemplate(*MailTemplate) (int, error)

	// 获取所有的邮箱模版
	GetMailTemplates() []*MailTemplate

	// 删除邮件模板
	DeleteMailTemplate(int) error

	// 创建消息模版对象
	CreateMsgTemplate(v interface{}) (IMsgTemplate, error)
}

Message send manager

type IMssRep

type IMssRep interface {
	// 获取邮箱模板
	GetMailTemplate(partnerId, id int) *MailTemplate
	// 保存邮箱模版
	SaveMailTemplate(*MailTemplate) (int, error)
	// 获取所有的邮箱模版
	GetMailTemplates(partnerId int) []*MailTemplate
	// 删除邮件模板
	DeleteMailTemplate(partnerId, id int) error
	// 加入到发送对列
	JoinMailTaskToQueen(*MailTask) error
}

type MailTask

type MailTask struct {
	// 编号
	Id int `db:"id" pk:"yes" auto:"yes"`
	// 任务编号,无任务为0
	TaskId int `db:"task_id"`
	// 商户编号
	PartnerId int `db:"partner_id"`
	// 发送至
	SendTo string `db:"send_to"`
	// 主题
	Subject string `db:"subject"`
	// 内容
	Body string `db:"body"`
	// 是否发送(0,1)
	IsSend int `db:"is_send"`
	// 是否失败(0,1)
	IsFailed int `db:"is_failed"`
	// 创建时间
	CreateTime int64 `db:"create_time"`
	// 发送时间
	SendTime int64 `db:"update_time`
}

type MailTemplate

type MailTemplate struct {
	// 编号
	Id int `db:"id" pk:"yes" auto:"yes"`
	// 商户编号
	PartnerId int `db:"partner_id"`
	// 名称
	Name string `db:"name"`
	// 主题
	Subject string `db:"subject"`
	// 内容
	Body string `db:"body"`

	// 是否启用
	Enabled int `db:"enabled"`

	// 创建时间
	CreateTime int64 `db:"create_time"`
	// 更新时间
	UpdateTime int64 `db:"update_time"`
}

邮件模版

type MsgData

type MsgData map[string]string

消息数据

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL