service

package
v0.0.0-...-3d0adf2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : interface.go # Created : 2019/1/10 11:33 # Last Modified : 2019/1/10 11:33 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : public.go # Created : 2019/1/14 10:36 # Last Modified : 2019/1/14 10:36 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : service.go # Created : 2019/1/16 10:24 # Last Modified : 2019/1/16 10:24 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : sms.go # Created : 2019/1/16 10:27 # Last Modified : 2019/1/16 10:27 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : template.go # Created : 2019/1/15 15:21 # Last Modified : 2019/1/15 15:21 # Describe : # # ====================================================

Index

Constants

This section is empty.

Variables

View Source
var TemplateImpl templateImpl

Functions

func NewMsgServiceImpl

func NewMsgServiceImpl() msgServiceImpl

NewMsgServiceImpl 初始化消息service

Types

type ArgParams

type ArgParams map[string]string

type Cache

type Cache interface {
	RPushEmail(context.Context, []byte) error
	RPushWeChat(context.Context, []byte) error
	RPushSms(context.Context, []byte) error
}

type Marshaler

type Marshaler interface {
	Marshal() ([]byte, error)
	Unmarshal([]byte) error
}

type Messager

type Messager interface {
	Marshaler
	GetId() string
	GetContent() string
	SetContent(string)
	GetStatus() meta.Status
	SetStatus(meta.Status)
	SetResult(meta.Result)
	SetCreatedAt(string)
	SetUpdatedAt(string)
	GetSendTo() string
	SetSendTo(string)
	SetArguments(string)
	GetArguments() string
	SetTemplate(string)
	GetTemplate() string
	SetSendTime(string)
	GetSendTime() string
	GetVersion() int32
	SetVersion(int32)
}

type Meta

type Meta interface {
	GetId() string
	// 验证参数
	Validated() error
	Marshaler
	// 转换必要的参数,请在validated调用后再使用
	Transfer(bool)
	// 获取延迟发送的时间,请在Transfer调用后使用
	Delay() int64
	// 返回参数
	GetArguments() string
	// 返回模板
	GetTemplate() string

	GetSendTo() string
	SetSendTo(string)
	GetSendTime() string
	ValidateEdit() error
}

type MqFunc

type MqFunc func(context.Context, []byte, int64) error

type MsgService

type MsgService interface {
	Produce(ctx context.Context, m Meta) (string, error)
	Detail(ctx context.Context, id string) (Marshaler, error)
	Cancel(ctx context.Context, id string) error
	Edit(ctx context.Context, m Meta) error
}

MsgService 用于消息的增删改查

Jump to

Keyboard shortcuts

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