79 lines
2.9 KiB
Go
79 lines
2.9 KiB
Go
package dto
|
|
|
|
import (
|
|
"rag/consts/keyword"
|
|
|
|
"gitea.com/red-future/common/beans"
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/os/gtime"
|
|
)
|
|
|
|
// CreateKeywordReq 创建关键词请求
|
|
type CreateKeywordReq struct {
|
|
g.Meta `path:"/create" method:"post" tags:"关键词管理" summary:"创建关键词" dc:"创建关键词"`
|
|
|
|
DatasetId int64 `json:"datasetId" v:"required#数据集ID不能为空"`
|
|
DocumentId int64 `json:"documentId" v:"required#文档ID不能为空"`
|
|
Word string `json:"word" v:"required#名称不能为空"`
|
|
Weight int16 `json:"weight" v:"required#权重不能为空"`
|
|
KeywordType keyword.KeywordType `json:"keywordType" v:"required#类型不能为空"`
|
|
}
|
|
|
|
// CreateKeywordRes 创建关键词响应
|
|
type CreateKeywordRes struct {
|
|
Id int64 `json:"id,string"`
|
|
}
|
|
|
|
// UpdateKeywordReq 更新关键词请求
|
|
type UpdateKeywordReq struct {
|
|
g.Meta `path:"/update" method:"put" tags:"关键词管理" summary:"更新关键词" dc:"更新关键词"`
|
|
|
|
Id int64 `json:"id" v:"required#ID不能为空"`
|
|
Word string `json:"word"`
|
|
Weight int16 `json:"weight"`
|
|
}
|
|
|
|
// DeleteKeywordReq 删除关键词请求
|
|
type DeleteKeywordReq struct {
|
|
g.Meta `path:"/delete" method:"delete" tags:"关键词管理" summary:"删除关键词" dc:"删除关键词"`
|
|
|
|
Id int64 `json:"id" v:"required#ID不能为空"`
|
|
}
|
|
|
|
// GetKeywordReq 获取关键词请求
|
|
type GetKeywordReq struct {
|
|
g.Meta `path:"/get" method:"get" tags:"关键词管理" summary:"获取关键词详情" dc:"获取关键词详情"`
|
|
|
|
Id int64 `json:"id" v:"required#ID不能为空"`
|
|
}
|
|
|
|
// ListKeywordReq 关键词列表请求
|
|
type ListKeywordReq struct {
|
|
g.Meta `path:"/list" method:"get" tags:"关键词管理" summary:"获取关键词列表" dc:"分页查询关键词列表,支持多条件筛选"`
|
|
|
|
Page *beans.Page `json:"page"`
|
|
DatasetId int64 `json:"datasetId"`
|
|
DocumentId int64 `json:"documentId"`
|
|
Word string `json:"word"`
|
|
Words []string `json:"words"`
|
|
Keyword string `json:"keyword" dc:"关键词搜索"`
|
|
KeywordType keyword.KeywordType `json:"keywordType"`
|
|
}
|
|
|
|
// ListKeywordRes 关键词列表响应
|
|
type ListKeywordRes struct {
|
|
List []*KeywordVO `json:"list"`
|
|
Total int `json:"total"`
|
|
}
|
|
|
|
type KeywordVO struct {
|
|
Id int64 `json:"id,string" dc:"id"`
|
|
Word string `json:"word" dc:"关键词名称"`
|
|
Weight int16 `json:"weight" dc:"权重"`
|
|
KeywordType keyword.KeywordType `json:"keywordType" dc:"类型"`
|
|
DatasetId int64 `json:"datasetId,string" dc:"数据集ID"`
|
|
DocumentId int64 `json:"documentId,string" dc:"文档ID"`
|
|
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
|
}
|