models

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	FileName string `json:"fileName,omitempty"`
	URL      string `json:"url,omitempty"`
}

type Files

type Files []*File

Files Files

func (*Files) Scan

func (p *Files) Scan(data interface{}) error

Scan 实现方法

func (Files) Value

func (p Files) Value() (driver.Value, error)

Value 实现方法

type MessageList

type MessageList struct {
	ID    string
	Title string

	Content string

	CreatorID string

	CreatorName string

	//  1、系统消息 2、通知通告
	Types constant.MessageTypes
	// 1、草稿  2、发送中  3、 已发送
	Status constant.MessageStatus
	// 接收人
	Receivers Receivers
	// 总人数
	SendNum int
	// 成功人数
	Success int
	// 失败人数
	Fail int
	// 消息附件
	Files Files

	CreatedAt int64
}

MessageList MessageList

type MessageRepo

type MessageRepo interface {
	Create(*gorm.DB, *MessageList) error

	Get(*gorm.DB, string) (*MessageList, error)

	Delete(*gorm.DB, string) error

	List(*gorm.DB, int8, int8, string, int, int) ([]*MessageList, int64, error)

	UpdateCount(*gorm.DB, *MessageList) error
}

MessageRepo MessageRepo

type Receiver

type Receiver struct {
	// Type 1: 人员 2:部门
	Type ReceiverType `json:"type,omitempty"`
	ID   string       `json:"id,omitempty"`
	Name string       `json:"name,omitempty"`
}

Receiver receiver 定义

type ReceiverType

type ReceiverType int64
const Department ReceiverType = 2

type Receivers

type Receivers []*Receiver

Receivers Receivers

func (*Receivers) Scan

func (p *Receivers) Scan(data interface{}) error

Scan 实现方法

func (Receivers) Value

func (p Receivers) Value() (driver.Value, error)

Value 实现方法

type Record

type Record struct {
	ID string

	ListID string

	ReceiverID string

	ReceiverName string

	Types constant.MessageTypes

	ReadStatus constant.ReadStatus // 1 not read    2 read

	CreatedAt int64
}

Record 消息记录

type RecordRepo

type RecordRepo interface {
	Create(*gorm.DB, *Record) error

	GetByID(*gorm.DB, string) (*Record, error)

	GetNumber(*gorm.DB, string) ([]*Result, error)

	UpdateReadStatus(*gorm.DB, string) error

	DeleteByIDs(*gorm.DB, []string) error

	ReadByIDs(*gorm.DB, []string) error

	List(*gorm.DB, int, int, int, int, string) ([]*Record, int64, error)

	ReadByID(*gorm.DB, string) error

	GetByCondition(*gorm.DB, string, string) (*Record, error)
}

RecordRepo 消息实体操作接口定义

type Result

type Result struct {
	Total int64
	Types constant.MessageTypes
}

Result 未读条数结果集定义

type Template

type Template struct {
	ID        string
	Name      string
	Title     string
	Content   string
	CreateBy  string
	Status    int
	CreatedAt int64
	UpdatedAt int64
}

Template tempalate

type TemplateRepo

type TemplateRepo interface {
	Create(*gorm.DB, *Template) error
	UpdateTemplate(*gorm.DB, *Template) error
	Get(*gorm.DB, string) (*Template, error)
	Delete(*gorm.DB, string) error
	QueryTemplate(*gorm.DB, string, int, int) ([]*Template, int64, error)
}

TemplateRepo TemplateRepo

type WSConnet

type WSConnet struct {
	UserID    string
	UUID      string
	IP        string
	CreatedAt int64
}

WSConnet WSConnet

type WSConnetRepo

type WSConnetRepo interface {
	Create(*WSConnet) error

	Get(userID string) ([]*WSConnet, error)

	Renewal(userID string) error

	Delete(userID, UUID string) error

	Expire(userID string) error
}

WSConnetRepo WSConnetRepo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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