|
@@ -626,7 +626,7 @@ func syncESAndSendMessage(reports []reportDao.Report) (err error) {
|
|
if !success {
|
|
if !success {
|
|
logger.Error("更新es失败,reportId::%d,err:%v", report.ID, err)
|
|
logger.Error("更新es失败,reportId::%d,err:%v", report.ID, err)
|
|
}
|
|
}
|
|
- if report.Status == reportDao.StatusUnPublish {
|
|
|
|
|
|
+ if report.Status == reportDao.StatusUnPublish || report.Status == reportDao.StatusDeleted {
|
|
//隐藏热度搜索
|
|
//隐藏热度搜索
|
|
err = userDao.HiddenFlows(report.ID, message.ReportSourceType)
|
|
err = userDao.HiddenFlows(report.ID, message.ReportSourceType)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -665,8 +665,9 @@ func syncESAndSendMessage(reports []reportDao.Report) (err error) {
|
|
//生产meta信息
|
|
//生产meta信息
|
|
logger.Info("生成推送META信息")
|
|
logger.Info("生成推送META信息")
|
|
for _, report := range reports {
|
|
for _, report := range reports {
|
|
- if report.Status == reportDao.StatusUnPublish {
|
|
|
|
- logger.Info("报告取消发布,不需要生成推送消息")
|
|
|
|
|
|
+ if report.Status == reportDao.StatusUnPublish || report.Status == reportDao.StatusDeleted {
|
|
|
|
+ logger.Info("报告取消发布或删除" +
|
|
|
|
+ ",不需要生成推送消息")
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
var From string
|
|
var From string
|
|
@@ -792,7 +793,10 @@ func InitHTReportList(list []ht.HTReport) (noRecord bool, err error) {
|
|
}
|
|
}
|
|
|
|
|
|
func htStatus(status int, isDelete int) reportDao.ReportStatus {
|
|
func htStatus(status int, isDelete int) reportDao.ReportStatus {
|
|
- if isDelete == 1 || status != ht.Publish {
|
|
|
|
|
|
+ if isDelete == 1 {
|
|
|
|
+ return reportDao.StatusDeleted
|
|
|
|
+ }
|
|
|
|
+ if status != ht.Publish {
|
|
return reportDao.StatusUnPublish
|
|
return reportDao.StatusUnPublish
|
|
}
|
|
}
|
|
return reportDao.StatusPublish
|
|
return reportDao.StatusPublish
|
|
@@ -1176,3 +1180,7 @@ func GetReportListById(reportIds []int) (reportList []ReportDTO, err error) {
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func DeleteReport(reportId int) (err error) {
|
|
|
|
+ return reportDao.DeleteReport(reportId)
|
|
|
|
+}
|