|
@@ -47,7 +47,7 @@ func GetReportContentSub(content string) (contentSub string, err error) {
|
|
|
}
|
|
|
|
|
|
// PublishDayWeekReport 发布晨周报
|
|
|
-func PublishDayWeekReport(reportInfo *models.Report) (tips string, err error) {
|
|
|
+func PublishDayWeekReport(reportInfo *models.Report) (tips string, err error, errMsg string) {
|
|
|
reportId := reportInfo.Id
|
|
|
if reportInfo.State == 2 {
|
|
|
return
|
|
@@ -61,6 +61,7 @@ func PublishDayWeekReport(reportInfo *models.Report) (tips string, err error) {
|
|
|
chapterLen := len(chapters)
|
|
|
if chapterLen <= 0 {
|
|
|
tips = "报告章节为空,不可发布"
|
|
|
+ errMsg = tips
|
|
|
err = errors.New(tips)
|
|
|
return
|
|
|
}
|
|
@@ -74,6 +75,7 @@ func PublishDayWeekReport(reportInfo *models.Report) (tips string, err error) {
|
|
|
for _, chapter := range chapterList {
|
|
|
if chapter.PublishState == 1 {
|
|
|
tips = "还存在未发布的章节"
|
|
|
+ errMsg = tips
|
|
|
err = errors.New(tips)
|
|
|
return
|
|
|
}
|
|
@@ -206,7 +208,7 @@ func PublishTodayDayReport() (err error) {
|
|
|
return
|
|
|
}
|
|
|
if todayReport != nil {
|
|
|
- if _, tmpErr := PublishDayWeekReport(todayReport); tmpErr != nil {
|
|
|
+ if _, tmpErr, _ := PublishDayWeekReport(todayReport); tmpErr != nil {
|
|
|
err = tmpErr
|
|
|
return
|
|
|
}
|