data

package
v0.0.0-...-8293e18 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewMongo

func NewMongo(cfg *conf.Data, log *zap.SugaredLogger) *mongo.Client

func NewRecordRepo

func NewRecordRepo(data *Data, log *zap.SugaredLogger) service.RecordRepo

func NewTemplateRepo

func NewTemplateRepo(data *Data, log *zap.SugaredLogger) service.TemplateRepo

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

func NewData

func NewData(db *mongo.Client, log *zap.SugaredLogger) (*Data, func(), error)

type Record

type Record struct {
	Id         primitive.ObjectID `bson:"_id,omitempty"`
	SendTime   int64              `bson:"send_time"`
	Receivers  []string           `bson:"receivers"`
	TemplateId string             `bson:"template_id"`
	Name       string             `bson:"name"`
	Content    string             `bson:"content"`
	IsSuccess  int8               `bson:"is_success"`
	Message    string             `bson:"message"`
}

func (*Record) Database

func (r *Record) Database() string

func (*Record) TableName

func (r *Record) TableName() string

type Template

type Template struct {
	Id      primitive.ObjectID `bson:"_id,omitempty"`
	Name    string             `bson:"name"`
	Subject string             `bson:"subject"`
	Content string             `bson:"content"`
}

func (*Template) Database

func (t *Template) Database() string

func (*Template) TableName

func (t *Template) TableName() string

Jump to

Keyboard shortcuts

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