history

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type History

type History struct {
	ID       string               `json:"id"`       // 消息 ID
	Sender   schema.ProfilePublic `json:"sender"`   // 消息发送者
	Receiver schema.ProfilePublic `json:"receiver"` // 消息接受者
	Type     ws.TypeResponseUser  `json:"type"`     // 消息类型
	Payload  interface{}          `json:"payload"`  // 消息体
	Date     string               `json:"date"`     // 消息时间
}

func GetHistory

func GetHistory(userID string, txs ...*gorm.DB) ([]History, error)

获取某个用户的聊天记录

func SessionItemToMap

func SessionItemToMap(sessionItems []model.CustomerSessionItem) ([]History, error)

type Session

type Session struct {
	Id        string               `json:"id"`         // 会话 ID
	User      schema.ProfilePublic `json:"user"`       // 用户信息
	Waiter    schema.ProfilePublic `json:"waiter"`     // 客服信息
	History   []History            `json:"history"`    // 历史消息
	CreatedAt string               `json:"created_at"` // 创建会话的时间
}

func GetWaiterSession

func GetWaiterSession(waiterID string, txs ...*gorm.DB) (result []Session, err error)

获取客服最近的聊天记录

Jump to

Keyboard shortcuts

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