package service import ( cm "app.yhyue.com/moapp/jybase/common" . "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/entity" "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledgeclient" "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/util" ) type CommonPhrasesService struct{} // CommonPhrasesAdd 客服话术添加 func (c *CommonPhrasesService) CommonPhrasesAdd(param *knowledgeclient.CommonPhrasesAddReq) int64 { insertData := map[string]interface{}{ "entId": param.EntId, "appId": param.AppId, "classify": param.Classify, "content": param.Content, } in := Mysql.Insert(util.COMMONPHRASES, insertData) return in } // CommonPhrasesInfo 客服话术详情 func (c *CommonPhrasesService) CommonPhrasesInfo(id int64) (data *knowledgeclient.CommonPhrases, ok bool) { info := Mysql.FindOne(util.COMMONPHRASES, map[string]interface{}{"id": id}, "", "") if info != nil && *info != nil && len(*info) > 0 { data.Id = cm.Int64All((*info)["id"]) data.Classify = cm.Int64All((*info)["classify"]) data.Content = cm.ObjToString((*info)["content"]) return data, true } return nil, false } // CommonPhrasesDel 客服话术删除 func (c *CommonPhrasesService) CommonPhrasesDel(id int64) bool { ok := Mysql.Delete(util.COMMONPHRASES, map[string]interface{}{"id": id}) return ok } // CommonPhrasesList 客服话术列表 /*func (c *CommonPhrasesService) CommonPhrasesList(param *knowledgeclient.CommonPhrasesListReq) { var commonPhrasesList knowledgeclient.CommonPhrasesList var data []*knowledgeclient.CommonPhrases count := Mysql.Count(util.COMMONPHRASES, map[string]interface{}{"status": 0}) if count > 0 { dataList := Mysql.Find(util.COMMONPHRASES, map[string]interface{}{"status": 0},"","desc id", cm.IntAll((param.PageIndex-1)*param.PageSize), cm.IntAll(param.PageSize)) } }*/