|
@@ -17,6 +17,7 @@ type RagEtaReportAbstract struct {
|
|
|
QuestionContent string `gorm:"column:question_content" description:"questionContent"`
|
|
|
Version int `gorm:"column:version" description:"版本号"`
|
|
|
Tags string `gorm:"column:tags" description:"标签"`
|
|
|
+ TagsName string `gorm:"column:tags_name" description:"标签名,多个用英文逗号隔开"`
|
|
|
VectorKey string `gorm:"column:vector_key" description:"向量key标识"`
|
|
|
ModifyTime time.Time `gorm:"column:modify_time" description:"modifyTime"`
|
|
|
CreateTime time.Time `gorm:"column:create_time" description:"createTime"`
|
|
@@ -36,6 +37,7 @@ var RagEtaReportAbstractColumns = struct {
|
|
|
QuestionContent string
|
|
|
Version string
|
|
|
Tags string
|
|
|
+ TagsName string
|
|
|
VectorKey string
|
|
|
ModifyTime string
|
|
|
CreateTime string
|
|
@@ -47,6 +49,7 @@ var RagEtaReportAbstractColumns = struct {
|
|
|
QuestionContent: "question_content",
|
|
|
Version: "version",
|
|
|
Tags: "tags",
|
|
|
+ TagsName: "tags_name",
|
|
|
VectorKey: "vector_key",
|
|
|
ModifyTime: "modify_time",
|
|
|
CreateTime: "create_time",
|
|
@@ -134,13 +137,14 @@ func (m *RagEtaReportAbstract) GetByRagEtaReportIdAndQuestionId(articleId, quest
|
|
|
|
|
|
type RagEtaReportAbstractView struct {
|
|
|
RagEtaReportAbstractId int `gorm:"primaryKey;column:rag_eta_report_abstract_id" description:"-"`
|
|
|
- RagEtaReportId int `gorm:"column:rag_eta_report_id" description:"ETA报告id"` //
|
|
|
+ RagEtaReportId int `gorm:"column:rag_eta_report_id" description:"ETA报告id"`
|
|
|
Abstract string `gorm:"column:abstract;type:longtext;comment:摘要内容;" description:"摘要内容"`
|
|
|
- QuestionId int `gorm:"column:question_id" description:"提示词Id"` //
|
|
|
+ QuestionId int `gorm:"column:question_id" description:"提示词Id"`
|
|
|
QuestionContent string `gorm:"column:question_content" description:"questionContent"`
|
|
|
- Version int `gorm:"column:version" description:"版本号"` //
|
|
|
- Tags string `gorm:"column:tags" description:"标签"` //
|
|
|
- VectorKey string `gorm:"column:vector_key" description:"向量key标识"` //
|
|
|
+ Version int `gorm:"column:version" description:"版本号"`
|
|
|
+ Tags string `gorm:"column:tags" description:"标签"`
|
|
|
+ TagsName string `gorm:"column:tags_name" description:"标签名,多个用英文逗号隔开"`
|
|
|
+ VectorKey string `gorm:"column:vector_key" description:"向量key标识"`
|
|
|
ModifyTime string `gorm:"column:modify_time;type:datetime;default:NULL;" description:"modify_time"`
|
|
|
CreateTime string `gorm:"column:create_time;type:datetime;default:NULL;" description:"create_time"`
|
|
|
Title string `gorm:"column:title;type:varchar(255);comment:标题;" description:"标题"`
|
|
@@ -154,6 +158,7 @@ type RagEtaReportAbstractItem struct {
|
|
|
QuestionContent string `gorm:"column:question_content" description:"questionContent"`
|
|
|
Version int `gorm:"column:version" description:"版本号"`
|
|
|
Tags string `gorm:"column:tags" description:"标签"`
|
|
|
+ TagsName string `gorm:"column:tags_name" description:"标签名,多个用英文逗号隔开"`
|
|
|
VectorKey string `gorm:"column:vector_key" description:"向量key标识"`
|
|
|
ModifyTime time.Time `gorm:"column:modify_time;type:datetime;default:NULL;" description:"modify_time"`
|
|
|
CreateTime time.Time `gorm:"column:create_time;type:datetime;default:NULL;" description:"create_time"`
|
|
@@ -172,6 +177,7 @@ func (m *RagEtaReportAbstractItem) ToView() RagEtaReportAbstractView {
|
|
|
Title: m.Title,
|
|
|
QuestionId: m.QuestionId,
|
|
|
Tags: m.Tags,
|
|
|
+ TagsName: m.TagsName,
|
|
|
QuestionContent: m.QuestionContent,
|
|
|
}
|
|
|
}
|
|
@@ -190,9 +196,7 @@ func (m *RagEtaReportAbstract) GetListByPlatformCondition(field, condition strin
|
|
|
field = "*"
|
|
|
}
|
|
|
sqlStr := fmt.Sprintf(`SELECT %s FROM %s AS a
|
|
|
- JOIN wechat_article AS b ON a.rag_eta_report_id=b.rag_eta_report_id
|
|
|
- JOIN wechat_platform AS c ON b.wechat_platform_id=c.wechat_platform_id
|
|
|
- WHERE 1=1 AND b.is_deleted=0 %s order by a.modify_time DESC,a.rag_eta_report_abstract_id DESC LIMIT ?,?`, field, m.TableName(), condition)
|
|
|
+ WHERE 1=1 %s order by a.modify_time DESC,a.rag_eta_report_abstract_id DESC LIMIT ?,?`, field, m.TableName(), condition)
|
|
|
pars = append(pars, startSize, pageSize)
|
|
|
err = global.DbMap[utils.DbNameAI].Raw(sqlStr, pars...).Find(&items).Error
|
|
|
|
|
@@ -202,9 +206,7 @@ func (m *RagEtaReportAbstract) GetListByPlatformCondition(field, condition strin
|
|
|
func (m *RagEtaReportAbstract) GetCountByPlatformCondition(condition string, pars []interface{}) (total int, err error) {
|
|
|
var intNull sql.NullInt64
|
|
|
sqlStr := fmt.Sprintf(`SELECT COUNT(1) total FROM %s AS a
|
|
|
- JOIN wechat_article AS b ON a.rag_eta_report_id=b.rag_eta_report_id
|
|
|
- JOIN wechat_platform AS c ON b.wechat_platform_id=c.wechat_platform_id
|
|
|
- WHERE 1=1 AND b.is_deleted=0 %s`, m.TableName(), condition)
|
|
|
+ WHERE 1=1 %s`, m.TableName(), condition)
|
|
|
err = global.DbMap[utils.DbNameAI].Raw(sqlStr, pars...).Scan(&intNull).Error
|
|
|
if err == nil && intNull.Valid {
|
|
|
total = int(intNull.Int64)
|
|
@@ -220,7 +222,7 @@ func (m *RagEtaReportAbstract) GetPageListByPlatformCondition(condition string,
|
|
|
return
|
|
|
}
|
|
|
if total > 0 {
|
|
|
- items, err = m.GetListByPlatformCondition(`a.rag_eta_report_abstract_id,a.rag_eta_report_id,a.content AS abstract,a.version,a.vector_key,b.title,b.link,a.modify_time,a.create_time`, condition, pars, startSize, pageSize)
|
|
|
+ items, err = m.GetListByPlatformCondition(``, condition, pars, startSize, pageSize)
|
|
|
}
|
|
|
|
|
|
return
|