UserMessage

package
v5.2.21 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//OpenAnalysis 是否启动analysis
	OpenAnalysis = false
	//OpenSub 是否启动订阅
	OpenSub = false
)

Functions

func DeleteByID

func DeleteByID(args *ArgsDeleteByID) (err error)

DeleteByID 删除ID

func DeleteByReceive

func DeleteByReceive(args *ArgsDeleteByReceive) (err error)

DeleteByReceive 删除ID

func DeleteBySend

func DeleteBySend(args *ArgsDeleteBySend) (err error)

DeleteBySend 删除ID

func GetReceiveCountByUserID

func GetReceiveCountByUserID(userID int64) (count int64)

GetReceiveCountByUserID 获取用户收到的消息数量

func Init

func Init()

func UpdateAudit

func UpdateAudit(args *ArgsUpdateAudit) (err error)

UpdateAudit 审核消息

func UpdateByID

func UpdateByID(args *ArgsUpdateByID) (err error)

UpdateByID 更新消息内容 必须是草稿状态

func UpdatePost

func UpdatePost(args *ArgsUpdatePost) (err error)

UpdatePost 推送提交

func UpdateReceiveRead

func UpdateReceiveRead(args *ArgsUpdateReceiveRead) (err error)

UpdateReceiveRead 已经阅读

func UpdateReceiveReads

func UpdateReceiveReads(args *ArgsUpdateReceiveReads) (err error)

UpdateReceiveReads 批量设置已读

Types

type ArgsCreate

type ArgsCreate struct {
	//预计发送时间
	WaitSendAt time.Time `db:"wait_send_at" json:"waitSendAt" check:"isoTime" empty:"true"`
	//发送人
	// 如果为0则为系统消息,同时自动跳过时间差验证机制
	SendUserID int64 `db:"send_user_id" json:"sendUserID" check:"id"`
	//接收人
	ReceiveUserID int64 `db:"receive_user_id" json:"receiveUserID" check:"id"`
	//标题
	Title string `db:"title" json:"title" check:"des" min:"1" max:"300"`
	//内容
	Content string `db:"content" json:"content" check:"des" min:"1" max:"1500"`
	//附件文件列
	Files pq.Int64Array `db:"files" json:"files" check:"ids" empty:"true"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}

ArgsCreate 创建新的消息参数

type ArgsDeleteByID

type ArgsDeleteByID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
}

ArgsDeleteByID 接收人删除参数

type ArgsDeleteByReceive

type ArgsDeleteByReceive struct {
	//IDs
	IDs pq.Int64Array `db:"ids" json:"ids" check:"ids"`
	//接收人
	ReceiveUserID int64 `db:"receive_user_id" json:"receiveUserID" check:"id" empty:"true"`
}

ArgsDeleteByReceive 接收人删除参数

type ArgsDeleteBySend

type ArgsDeleteBySend struct {
	//IDs
	IDs pq.Int64Array `db:"ids" json:"ids" check:"ids"`
	//发送人ID
	SendUserID int64 `db:"send_user_id" json:"sendUserID" check:"id" empty:"true"`
}

ArgsDeleteBySend 删除ID参数

type ArgsGetByID

type ArgsGetByID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//发送人ID
	SendUserID int64 `db:"send_user_id" json:"sendUserID" check:"id" empty:"true"`
	//接收人ID
	ReceiveUserID int64 `db:"receive_user_id" json:"receiveUserID" check:"id" empty:"true"`
}

ArgsGetByID 获取ID参数

type ArgsGetList

type ArgsGetList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//发送用户ID
	SendUserID int64 `db:"send_user_id" json:"sendUserID" check:"id" empty:"true"`
	//预计发送时间
	WaitSendAt time.Time `db:"wait_send_at" json:"waitSendAt" check:"isoTime" empty:"true"`
	//发送状态
	// 发送完成后,发送人无法删除,接收人可以标记已读或删除,具体其他字段完成该操作
	// 0 草稿; 1 等待审核; 2 发送成功
	Status int `db:"status" json:"status"`
	//接收人ID
	ReceiveUserID int64 `db:"receive_user_id" json:"receiveUserID" check:"id" empty:"true"`
	//接收人阅读时间
	ReceiveReadAt time.Time `db:"receive_read_at" json:"receiveReadAt" check:"isoTime" empty:"true"`
	//接收人删除状态
	ReceiveDeleteAt time.Time `db:"receive_delete_at" json:"receiveDeleteAt" check:"isoTime" empty:"true"`
	//是否被删除
	NeedIsRemove bool `json:"needIsRemove" check:"bool" empty:"true"`
	IsRemove     bool `db:"is_remove" json:"isRemove" check:"bool" empty:"true"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetList 获取列表参数

type ArgsUpdateAudit

type ArgsUpdateAudit struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
}

ArgsUpdateAudit 审核消息参数

type ArgsUpdateByID

type ArgsUpdateByID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//发送人ID
	// 用于验证
	SendUserID int64 `db:"send_user_id" json:"sendUserID" check:"id" empty:"true"`
	//接收人
	ReceiveUserID int64 `db:"receive_user_id" json:"receiveUserID" check:"id"`
	//预计发送时间
	WaitSendAt time.Time `db:"wait_send_at" json:"waitSendAt" check:"isoTime" empty:"true"`
	//标题
	Title string `db:"title" json:"title" check:"des" min:"1" max:"300"`
	//内容
	Content string `db:"content" json:"content" check:"des" min:"1" max:"1500"`
	//附件文件列
	Files pq.Int64Array `db:"files" json:"files" check:"ids" empty:"true"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}

ArgsUpdateByID 更新消息内容参数 只有发送人在草稿状态下可以编辑消息

type ArgsUpdatePost

type ArgsUpdatePost struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//发送人ID
	// 用于验证
	SendUserID int64 `db:"send_user_id" json:"sendUserID" check:"id" empty:"true"`
}

ArgsUpdatePost 推送提交参数

type ArgsUpdateReceiveRead

type ArgsUpdateReceiveRead struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//接收人
	ReceiveUserID int64 `db:"receive_user_id" json:"receiveUserID" check:"id" empty:"true"`
}

ArgsUpdateReceiveRead 已经阅读参数

type ArgsUpdateReceiveReads

type ArgsUpdateReceiveReads struct {
	//IDs
	IDs pq.Int64Array `db:"ids" json:"ids" check:"ids"`
	//接收人
	ReceiveUserID int64 `db:"receive_user_id" json:"receiveUserID" check:"id" empty:"true"`
}

ArgsUpdateReceiveReads 批量设置已读参数

type FieldsMessage

type FieldsMessage struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//更新时间
	UpdateAt time.Time `db:"update_at" json:"updateAt"`
	//删除时间
	// 发送人删除状态
	DeleteAt time.Time `db:"delete_at" json:"deleteAt"`
	//预计发送时间
	WaitSendAt time.Time `db:"wait_send_at" json:"waitSendAt"`
	//发送状态
	// 发送完成后,发送人无法删除,接收人可以标记已读或删除,具体其他字段完成该操作
	// 0 草稿; 1 等待审核; 2 发送成功
	Status int `db:"status" json:"status"`
	//发送人
	SendUserID int64 `db:"send_user_id" json:"sendUserID"`
	//接收人
	ReceiveUserID int64 `db:"receive_user_id" json:"receiveUserID"`
	//接收人阅读时间
	ReceiveReadAt time.Time `db:"receive_read_at" json:"receiveReadAt"`
	//接收人删除状态
	ReceiveDeleteAt time.Time `db:"receive_delete_at" json:"receiveDeleteAt"`
	//标题
	Title string `db:"title" json:"title"`
	//内容
	Content string `db:"content" json:"content"`
	//附件文件列
	Files pq.Int64Array `db:"files" json:"files"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}

func Create

func Create(args *ArgsCreate) (data FieldsMessage, err error)

Create 创建新的消息

func GetByID

func GetByID(args *ArgsGetByID) (data FieldsMessage, err error)

GetByID 获取ID

func GetList

func GetList(args *ArgsGetList) (dataList []FieldsMessage, dataCount int64, err error)

GetList 获取列表

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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