db

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func DeleteByDingTalkConversationID

func DeleteByDingTalkConversationID(dingTalkConversation_id string) error

Delete

func FindOne

func FindOne(filter map[string]interface{}, chat *Chat) error

Find

func Initialize

func Initialize()

func Save

func Save(c *Chat) error

Create

Types

type Chat

type Chat struct {
	gorm.Model
	SenderID               string   `gorm:"type:varchar(128);not null;comment:'发送者ID'" json:"sender_id"`
	SenderNick             string   `gorm:"type:varchar(50);not null;comment:'发送者昵称'" json:"sender_nick"`
	DingTalkConversationID string   `gorm:"type:varchar(128);not null;comment:'钉钉会话ID'" json:"ding_talk_conversation_id"`
	MessageID              string   `gorm:"type:varchar(128);not null;comment:'消息ID'" json:"message_id"`
	ConversationID         string   `gorm:"type:varchar(128);not null;comment:'会话ID'" json:"conversation_id"`
	ConversationMode       ChatMode `gorm:"type:int;not null;comment:'消息模式1问题2回答'" json:"conversation_mode"`
	ConversationType       string   `gorm:"type:int;not null;comment:'消息类型1私聊2群聊'" json:"conversation_type"`
	Content                string   `gorm:"type:varchar(255);not null;comment:'消息内容'" json:"content"`
}

type ChatListParams

type ChatListParams struct {
	SenderID string `form:"sender_id" json:"sender_id"`
}

type ChatMode

type ChatMode uint
const ANSWER_MODE ChatMode = 2
const QUESTION_MODE ChatMode = 1

Jump to

Keyboard shortcuts

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