im

package
v0.0.0-...-db099c4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChatList

func ChatList(c *gin.Context)

@Summary 会话列表 @Description @Tags 私信 @Accept json @Produce json @Param lastMId query string true "消息id,用于分页" @Success 200 {object} handler.Response "{"code":0,"message":"OK","data":null}" @Router /im/chatlist [get]

func Msg

func Msg(c *gin.Context)

@Summary 收消息 @Description @Tags 私信 @Accept json @Produce json @Param lastMId query string true "消息id,用于分页" @Success 200 {object} handler.Response "{"code":0,"message":"OK","data":null}" @Router /im/chatlist [get]

func MsgList

func MsgList(c *gin.Context)

@Summary 会话消息列表 @Description 拉取指定会话中的消息列表(默认返回最新的20条),主要是拉取历史消息,下拉获取更多历史消息,增量消息通过/im/msg来获取,是否有新消息通过sync/status(定期轮询接口)中的has_new_msg来判断 @Tags 私信 @Accept json @Produce json @Param lastCMId query string false "分页参数, 默认为0, 为0时获取最新数据,否则获取历史消息" @Success 200 {object} handler.Response "{"code":0,"message":"OK","data":null}" @Router /im/msg/list [get]

func Send

func Send(c *gin.Context)

@Summary 发送消息 @Description 内容使用json格式,eg: {"user_id": 200002, "msg_type":1, "content": "聊天的内容或者图片key"} @Tags 私信 @Accept json @Produce json @Param user_id body int true "聊天对象的uid" @Param msg_type body string true "消息类型 1:文本消息 2:图片 3:音频消息 4:视频消息 51:系统通知文本消息 101:文章卡片消息" @Param content body string true "消息内容,如果是文字则为内子内容,如果是图片(音频或视频)则为图片key(音频或视频)" @Param width body int false "上传图片的宽度" @Param height body int false "上传图片的高度" @Success 200 {object} handler.Response "{"code":0,"message":"OK","data":null}" @Router /im/send [post]

Types

type SendRequest

type SendRequest struct {
	UserId   uint64 `json:"user_id"`
	MsgType  int    `json:"msg_type"`
	Content  string `json:"content"`
	LocalMId uint64 `json:"local_m_id"`
	Width    int    `json:"width"`
	Height   int    `json:"height"`
	Duration int    `json:"duration"`
}

Jump to

Keyboard shortcuts

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