package cache import ( "eta/eta_api/utils" "fmt" ) type WechatArticleOp struct { Source string WechatPlatformId int } // AddWechatArticleOpToCache // @Description: 将公众号文章操作加入缓存 // @param wechatPlatformId // @param source // @return bool func AddWechatArticleOpToCache(wechatPlatformId int, source string) bool { record := new(WechatArticleOp) record.Source = source record.WechatPlatformId = wechatPlatformId if utils.Re == nil { err := utils.Rc.LPush(utils.CACHE_WECHAT_PLATFORM_ARTICLE, record) utils.FileLog.Info(fmt.Sprintf("将公众号文章操作 加入缓存 AddWechatArticleOpToCache LPush: 操作类型:%s,公众号id:%d", source, wechatPlatformId)) if err != nil { fmt.Println("AddWechatArticleOpToCache LPush Err:" + err.Error()) } return true } return false } // AddWechatArticleLlmOpToCache // @Description: 将公众号文章llm操作加入缓存 // @param wechatPlatformId // @param source // @return bool func AddWechatArticleLlmOpToCache(wechatPlatformId int, source string) bool { record := new(WechatArticleOp) record.Source = source record.WechatPlatformId = wechatPlatformId if utils.Re == nil { err := utils.Rc.LPush(utils.CACHE_WECHAT_PLATFORM_ARTICLE_KNOWLEDGE, record) utils.FileLog.Info(fmt.Sprintf("将公众号文章llm操作加入缓存 加入缓存 AddWechatArticleLlmOpToCache LPush: 操作类型:%s,公众号id:%d", source, wechatPlatformId)) if err != nil { fmt.Println("AddWechatArticleOpToCache LPush Err:" + err.Error()) } return true } return false } type RagEtaReportOpOp struct { Source string ReportId int ReportChapterId int } // RagEtaReportOpToCache // @Description: 将eta报告入知识库操作加入缓存 // @author: Roc // @datetime 2025-04-07 15:05:22 // @param reportId int // @param reportChapterId int // @param source string // @return bool func RagEtaReportOpToCache(reportId, reportChapterId int, source string) bool { record := new(RagEtaReportOpOp) record.Source = source record.ReportId = reportId record.ReportChapterId = reportChapterId if utils.Re == nil { err := utils.Rc.LPush(utils.CACHE_ETA_REPORT_KNOWLEDGE, record) utils.FileLog.Info(fmt.Sprintf("将eta报告入知识库操作加入缓存 加入缓存 RagEtaReportOpToCache LPush: 操作类型:%s,报告id:%d,章节id:%d", source, reportId, reportChapterId)) if err != nil { fmt.Println("RagEtaReportOpToCache LPush Err:" + err.Error()) } return true } return false }