send

package
v0.0.0-...-7465321 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHistory

func AddHistory(msg *message)

func GetUIDByPhone

func GetUIDByPhone(ctx *gin.Context)

GetUIDByPhone

@Tags			send
@Description	get user's uid by he or she's phone number
@Description	https://github.com/veops/messenger?tab=readme-ov-file#查询用户ID
@Accept			json
@Produce		json
@Param			body	body		getUIDByPhoneReq	true	" "
@Success		200		{object}	map[string]string	"a map with phone as key and uid as value"
@Router			/v1/uid/getbyphone [POST]

func PushMessage

func PushMessage(ctx *gin.Context)

PushMessage

@Tags			send
@Description	send a new message
@Description	https://github.com/veops/messenger?tab=readme-ov-file#发送消息
@Accept			json
@Produce		json
@Param			body	body		message				true	" "
@Success		200		{object}	map[string]string	"a map with msg info, eg. {msg:ok}"
@Router			/v1/message [POST]

func QueryHistory

func QueryHistory(ctx *gin.Context)

QueryHistory

@Tags			send
@Description	query message history
@Param			page_index	query		int		true	"page_index"
@Param			page_size	query		int		true	"page_size"
@Param			start		query		int		false	"start time"
@Param			end			query		int		false	"end time"
@Param			status		query		string	false	"false failed, true sent successfully"
@Param			sender		query		string	false	"sender name"
@Param			content		query		string	false	"content"
@Success		200			{object}	map[string]any
@Router			/v1/history [GET]

func RecordEmailReq

func RecordEmailReq(msg *message, m *gomail.Message)

func RecordHttpReq

func RecordHttpReq(msg *message) resty.PreRequestHook

func RecordResp

func RecordResp(msg *message, err error, resp *resty.Response)

func Start

func Start() error

Types

type History

type History struct {
	Id         int    `gorm:"column:id" json:"id"`
	Message    string `gorm:"column:message" json:"message"`
	Err        string `gorm:"column:err" json:"err"`
	Req        string `gorm:"column:req" json:"req"`
	Resp       string `gorm:"column:resp" json:"resp"`
	Status     bool   `gorm:"column:status" json:"status"`
	ReceivedAt int64  `gorm:"column:received_at" json:"received_at"`
	CreatedAt  int64  `gorm:"column:created_at" json:"created_at"`
}

func (History) TableName

func (History) TableName() string

Jump to

Keyboard shortcuts

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