Documentation
¶
Index ¶
- func GetIndexInfo(c *fiber.Ctx) error
- func GetIndexed(c *fiber.Ctx) error
- func SearchOnChatByGet(c *fiber.Ctx) error
- func SearchOnChatByPost(c *fiber.Ctx) error
- func SearchOnMultiChatByPost(c *fiber.Ctx) error
- func Serve(addr string)
- type SearchOnChatByPostRequest
- type SearchOnMultiChatByPostRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIndexInfo ¶ added in v0.8.0
GetIndexInfo 获取指定聊天的索引信息 @Summary 获取指定聊天的索引信息 @Description 根据聊天ID获取该聊天的索引详细信息 @Tags Chat @Accept json @Produce json @Security ApiKeyAuth @Param chat_id path int true "聊天ID" @Success 200 {object} map[string]interface{} "成功响应" @Success 200 {object} object{status=string,index=database.IndexChat} "成功响应示例" @Failure 400 {object} map[string]string "聊天ID是必需的" @Failure 401 {object} map[string]string "未授权" @Failure 404 {object} map[string]string "未找到指定聊天的索引" @Failure 500 {object} map[string]string "服务器内部错误" @Router /index/{chat_id} [get]
func GetIndexed ¶ added in v0.8.0
GetIndexed 获取所有已索引的聊天 @Summary 获取所有已索引的聊天 @Description 获取系统中所有已索引的聊天列表 @Tags Chat @Accept json @Produce json @Security ApiKeyAuth @Success 200 {object} map[string]interface{} "成功响应" @Success 200 {object} object{status=string,chats=[]database.IndexChat} "成功响应示例" @Failure 401 {object} map[string]string "未授权" @Failure 404 {object} map[string]string "未找到已索引的聊天" @Failure 500 {object} map[string]string "服务器内部错误" @Router /indexed [get]
func SearchOnChatByGet ¶ added in v0.8.0
SearchOnChatByGet 使用GET方法在指定聊天中搜索消息 @Summary 在指定聊天中搜索消息 (GET方法) @Description 使用GET方法在指定聊天中搜索消息,支持分页和过滤 @Tags Search @Accept json @Produce json @Security ApiKeyAuth @Param chat_id path int true "聊天ID" @Param q query string true "搜索查询字符串" @Param offset query int false "偏移量,默认为0" default(0) @Param limit query int false "限制数量,默认为10" default(10) @Param users query string false "用户ID列表,逗号分隔" example("123456,789012") @Param types query string false "消息类型列表,逗号分隔" example("text,photo,video") Enums(text,photo,video,document,voice,audio,poll,story) @Success 200 {object} map[string]interface{} "成功响应" @Success 200 {object} object{status=string,results=types.MessageSearchResponse} "成功响应示例" @Failure 400 {object} map[string]string "请求参数错误" @Failure 401 {object} map[string]string "未授权" @Failure 500 {object} map[string]string "服务器内部错误" @Router /index/{chat_id}/search [get]
func SearchOnChatByPost ¶ added in v0.8.0
SearchOnChatByPost 使用POST方法在指定聊天中搜索消息 @Summary 在指定聊天中搜索消息 (POST方法) @Description 使用POST方法在指定聊天中搜索消息,支持更复杂的搜索参数 @Tags Search @Accept json @Produce json @Security ApiKeyAuth @Param chat_id path int true "聊天ID" @Param request body SearchOnChatByPostRequest true "搜索请求参数" @Success 200 {object} map[string]interface{} "成功响应" @Success 200 {object} object{status=string,results=types.MessageSearchResponse} "成功响应示例" @Failure 400 {object} map[string]string "请求参数错误" @Failure 401 {object} map[string]string "未授权" @Failure 500 {object} map[string]string "服务器内部错误" @Router /index/{chat_id}/search [post]
func SearchOnMultiChatByPost ¶ added in v0.8.0
SearchOnMultiChatByPost 在多个聊天中搜索消息 @Summary 在多个聊天中搜索消息 @Description 在指定的多个聊天中搜索消息,如果未指定聊天ID则搜索所有聊天 @Tags Search @Accept json @Produce json @Security ApiKeyAuth @Param request body SearchOnMultiChatByPostRequest true "多聊天搜索请求参数" @Success 200 {object} map[string]interface{} "成功响应" @Success 200 {object} object{status=string,results=types.MessageSearchResponse} "成功响应示例" @Failure 400 {object} map[string]string "请求参数错误" @Failure 401 {object} map[string]string "未授权" @Failure 500 {object} map[string]string "服务器内部错误" @Router /index/multi-search [post]
Types ¶
type SearchOnChatByPostRequest ¶ added in v0.8.0
type SearchOnChatByPostRequest struct {
Query string `json:"query" validate:"required" example:"search text"` // 搜索查询字符串
Offset int64 `json:"offset" default:"0" example:"0"` // 偏移量,用于分页
Limit int64 `json:"limit" default:"10" example:"10"` // 限制数量,用于分页
Users []int64 `json:"users,omitempty" example:"123456,789012"` // 用户ID过滤列表,可选
Types []string `json:"types,omitempty" example:"text,photo"` // 消息类型过滤列表,可选值:text,photo,video,document,voice,audio,poll,story
}
SearchOnChatByPostRequest 单聊天搜索请求
type SearchOnMultiChatByPostRequest ¶ added in v0.8.0
type SearchOnMultiChatByPostRequest struct {
ChatIDs []int64 `json:"chat_ids" example:"777000,114514"` // 聊天ID列表,如果为空则搜索所有聊天
Query string `json:"query" validate:"required" example:"search text"` // 搜索查询字符串
Offset int64 `json:"offset" default:"0" example:"0"` // 偏移量,用于分页
Limit int64 `json:"limit" default:"10" example:"10"` // 限制数量,用于分页
Users []int64 `json:"users,omitempty" example:"123456,789012"` // 用户ID过滤列表,可选
Types []string `json:"types,omitempty" example:"text,photo"` // 消息类型过滤列表,可选值:text,photo,video,document,voice,audio,poll,story
}
SearchOnMultiChatByPostRequest 多聊天搜索请求