|
@@ -10,16 +10,16 @@ import (
|
|
|
|
|
|
|
|
|
type RagEtaReportAbstract struct {
|
|
|
- RagEtaReportAbstractID int `gorm:"primaryKey;column:rag_eta_report_abstract_id" json:"-"`
|
|
|
- RagEtaReportID int `gorm:"column:rag_eta_report_id" json:"ragEtaReportId"`
|
|
|
- Content string `gorm:"column:content" json:"content"`
|
|
|
- QuestionID int `gorm:"column:question_id" json:"questionId"`
|
|
|
- QuestionContent string `gorm:"column:question_content" json:"questionContent"`
|
|
|
- Version int `gorm:"column:version" json:"version"`
|
|
|
- Tags string `gorm:"column:tags" json:"tags"`
|
|
|
- VectorKey string `gorm:"column:vector_key" json:"vectorKey"`
|
|
|
- ModifyTime time.Time `gorm:"column:modify_time" json:"modifyTime"`
|
|
|
- CreateTime time.Time `gorm:"column:create_time" json:"createTime"`
|
|
|
+ RagEtaReportAbstractId int `gorm:"primaryKey;column:rag_eta_report_abstract_id" description:"-"`
|
|
|
+ RagEtaReportId int `gorm:"column:rag_eta_report_id" description:"ETA报告id"`
|
|
|
+ Content string `gorm:"column:content" description:"摘要内容"`
|
|
|
+ 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标识"`
|
|
|
+ ModifyTime time.Time `gorm:"column:modify_time" description:"modifyTime"`
|
|
|
+ CreateTime time.Time `gorm:"column:create_time" description:"createTime"`
|
|
|
}
|
|
|
|
|
|
|
|
@@ -29,10 +29,10 @@ func (m *RagEtaReportAbstract) TableName() string {
|
|
|
|
|
|
|
|
|
var EtaReportAbstractColumns = struct {
|
|
|
- RagEtaReportAbstractID string
|
|
|
- RagEtaReportID string
|
|
|
+ RagEtaReportAbstractId string
|
|
|
+ RagEtaReportId string
|
|
|
Content string
|
|
|
- QuestionID string
|
|
|
+ QuestionId string
|
|
|
QuestionContent string
|
|
|
Version string
|
|
|
Tags string
|
|
@@ -40,10 +40,10 @@ var EtaReportAbstractColumns = struct {
|
|
|
ModifyTime string
|
|
|
CreateTime string
|
|
|
}{
|
|
|
- RagEtaReportAbstractID: "rag_eta_report_abstract_id",
|
|
|
- RagEtaReportID: "rag_eta_report_id",
|
|
|
+ RagEtaReportAbstractId: "rag_eta_report_abstract_id",
|
|
|
+ RagEtaReportId: "rag_eta_report_id",
|
|
|
Content: "content",
|
|
|
- QuestionID: "question_id",
|
|
|
+ QuestionId: "question_id",
|
|
|
QuestionContent: "question_content",
|
|
|
Version: "version",
|
|
|
Tags: "tags",
|
|
@@ -71,13 +71,13 @@ func (m *RagEtaReportAbstract) Del() (err error) {
|
|
|
}
|
|
|
|
|
|
func (m *RagEtaReportAbstract) GetById(id int) (item *RagEtaReportAbstract, err error) {
|
|
|
- err = global.DbMap[utils.DbNameAI].Where(fmt.Sprintf("%s = ?", EtaReportAbstractColumns.RagEtaReportAbstractID), id).First(&item).Error
|
|
|
+ err = global.DbMap[utils.DbNameAI].Where(fmt.Sprintf("%s = ?", EtaReportAbstractColumns.RagEtaReportAbstractId), id).First(&item).Error
|
|
|
|
|
|
return
|
|
|
}
|
|
|
|
|
|
func (m *RagEtaReportAbstract) GetByIdList(idList []int) (items []*RagEtaReportAbstract, err error) {
|
|
|
- err = global.DbMap[utils.DbNameAI].Where(fmt.Sprintf("%s in (?) ", EtaReportAbstractColumns.RagEtaReportAbstractID), idList).Find(&items).Error
|
|
|
+ err = global.DbMap[utils.DbNameAI].Where(fmt.Sprintf("%s in (?) ", EtaReportAbstractColumns.RagEtaReportAbstractId), idList).Find(&items).Error
|
|
|
|
|
|
return
|
|
|
}
|
|
@@ -97,7 +97,7 @@ func (m *RagEtaReportAbstract) DelByIdList(idList []int) (err error) {
|
|
|
if len(idList) <= 0 {
|
|
|
return
|
|
|
}
|
|
|
- sqlStr := fmt.Sprintf(`delete from %s where %s in (?)`, m.TableName(), EtaReportAbstractColumns.RagEtaReportAbstractID)
|
|
|
+ sqlStr := fmt.Sprintf(`delete from %s where %s in (?)`, m.TableName(), EtaReportAbstractColumns.RagEtaReportAbstractId)
|
|
|
err = global.DbMap[utils.DbNameAI].Exec(sqlStr, idList).Error
|
|
|
|
|
|
return
|
|
@@ -112,7 +112,7 @@ func (m *RagEtaReportAbstract) DelByIdList(idList []int) (err error) {
|
|
|
|
|
|
|
|
|
func (m *RagEtaReportAbstract) GetByRagEtaReportId(id int) (item *RagEtaReportAbstract, err error) {
|
|
|
- err = global.DbMap[utils.DbNameAI].Where(fmt.Sprintf("%s = ?", EtaReportAbstractColumns.RagEtaReportID), id).Order(fmt.Sprintf(`%s DESC`, EtaReportAbstractColumns.RagEtaReportAbstractID)).First(&item).Error
|
|
|
+ err = global.DbMap[utils.DbNameAI].Where(fmt.Sprintf("%s = ?", EtaReportAbstractColumns.RagEtaReportId), id).Order(fmt.Sprintf(`%s DESC`, EtaReportAbstractColumns.RagEtaReportAbstractId)).First(&item).Error
|
|
|
|
|
|
return
|
|
|
}
|
|
@@ -127,60 +127,57 @@ func (m *RagEtaReportAbstract) GetByRagEtaReportId(id int) (item *RagEtaReportAb
|
|
|
|
|
|
|
|
|
func (m *RagEtaReportAbstract) GetByRagEtaReportIdAndQuestionId(articleId, questionId int) (item *RagEtaReportAbstract, err error) {
|
|
|
- err = global.DbMap[utils.DbNameAI].Where(fmt.Sprintf("%s = ? AND %s = ? ", EtaReportAbstractColumns.RagEtaReportID, EtaReportAbstractColumns.QuestionID), articleId, questionId).Order(fmt.Sprintf(`%s DESC`, WechatArticleAbstractColumns.WechatArticleAbstractID)).First(&item).Error
|
|
|
+ err = global.DbMap[utils.DbNameAI].Where(fmt.Sprintf("%s = ? AND %s = ? ", EtaReportAbstractColumns.RagEtaReportId, EtaReportAbstractColumns.QuestionId), articleId, questionId).Order(fmt.Sprintf(`%s DESC`, WechatArticleAbstractColumns.WechatArticleAbstractID)).First(&item).Error
|
|
|
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-type EtaReportAbstractView struct {
|
|
|
- RagEtaReportAbstractID int `gorm:"primaryKey;column:rag_eta_report_abstract_id" json:"-"`
|
|
|
- RagEtaReportID int `gorm:"column:rag_eta_report_id" json:"ragEtaReportId"`
|
|
|
+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"`
|
|
|
Abstract string `gorm:"column:abstract;type:longtext;comment:摘要内容;" description:"摘要内容"`
|
|
|
- QuestionID int `gorm:"column:question_id" json:"questionId"`
|
|
|
- QuestionContent string `gorm:"column:question_content" json:"questionContent"`
|
|
|
- Version int `gorm:"column:version" json:"version"`
|
|
|
- Tags string `gorm:"column:tags" json:"tags"`
|
|
|
- VectorKey string `gorm:"column:vector_key" json:"vectorKey"`
|
|
|
+ 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标识"`
|
|
|
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:"标题"`
|
|
|
- Link string `gorm:"column:link;type:varchar(255);comment:链接;" description:"链接"`
|
|
|
}
|
|
|
|
|
|
type RagEtaReportAbstractItem struct {
|
|
|
- RagEtaReportAbstractID int `gorm:"primaryKey;column:rag_eta_report_abstract_id" json:"-"`
|
|
|
- RagEtaReportID int `gorm:"column:rag_eta_report_id" json:"ragEtaReportId"`
|
|
|
+ RagEtaReportAbstractId int `gorm:"primaryKey;column:rag_eta_report_abstract_id" description:"-"`
|
|
|
+ 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" json:"questionId"`
|
|
|
- QuestionContent string `gorm:"column:question_content" json:"questionContent"`
|
|
|
- Version int `gorm:"column:version" json:"version"`
|
|
|
- Tags string `gorm:"column:tags" json:"tags"`
|
|
|
- VectorKey string `gorm:"column:vector_key" json:"vectorKey"`
|
|
|
+ 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标识"`
|
|
|
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"`
|
|
|
Title string `gorm:"column:title;type:varchar(255);comment:标题;" description:"标题"`
|
|
|
- Link string `gorm:"column:link;type:varchar(255);comment:链接;" description:"链接"`
|
|
|
}
|
|
|
|
|
|
-func (m *RagEtaReportAbstractItem) ToView() EtaReportAbstractView {
|
|
|
- return EtaReportAbstractView{
|
|
|
- RagEtaReportAbstractID: m.RagEtaReportAbstractID,
|
|
|
- RagEtaReportID: m.RagEtaReportID,
|
|
|
+func (m *RagEtaReportAbstractItem) ToView() RagEtaReportAbstractView {
|
|
|
+ return RagEtaReportAbstractView{
|
|
|
+ RagEtaReportAbstractId: m.RagEtaReportAbstractId,
|
|
|
+ RagEtaReportId: m.RagEtaReportId,
|
|
|
Abstract: m.Abstract,
|
|
|
Version: m.Version,
|
|
|
VectorKey: m.VectorKey,
|
|
|
ModifyTime: utils.DateStrToDateTimeStr(m.ModifyTime),
|
|
|
CreateTime: utils.DateStrToDateTimeStr(m.CreateTime),
|
|
|
Title: m.Title,
|
|
|
- Link: m.Link,
|
|
|
- QuestionID: m.QuestionID,
|
|
|
+ QuestionId: m.QuestionId,
|
|
|
Tags: m.Tags,
|
|
|
QuestionContent: m.QuestionContent,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func (m *RagEtaReportAbstract) EtaReportAbstractItem(list []*RagEtaReportAbstractItem) (etaReportAbstractViewList []EtaReportAbstractView) {
|
|
|
- etaReportAbstractViewList = make([]EtaReportAbstractView, 0)
|
|
|
+func (m *RagEtaReportAbstract) EtaReportAbstractItem(list []*RagEtaReportAbstractItem) (etaReportAbstractViewList []RagEtaReportAbstractView) {
|
|
|
+ etaReportAbstractViewList = make([]RagEtaReportAbstractView, 0)
|
|
|
|
|
|
for _, v := range list {
|
|
|
etaReportAbstractViewList = append(etaReportAbstractViewList, v.ToView())
|