fix(smoke): 修复首页 AI 建议降级与节点索引
This commit is contained in:
@@ -3,6 +3,7 @@ package handler
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"math"
|
||||
"net/http"
|
||||
"strings"
|
||||
@@ -140,8 +141,8 @@ func (h *SmokeHandler) Home(c *gin.Context) {
|
||||
case errors.Is(err, smokeservice.ErrNoSmokeLogs):
|
||||
adviceCard.Status = "no_data"
|
||||
default:
|
||||
c.JSON(http.StatusInternalServerError, model.Error(http.StatusInternalServerError, "获取 AI 建议失败,请稍后重试"))
|
||||
return
|
||||
log.Printf("[smoke_home] ai advice degraded uid=%d date=%s err=%v", user.ID, adviceDate.Format(dateLayout), err)
|
||||
adviceCard.Status = "unavailable"
|
||||
}
|
||||
} else if record != nil {
|
||||
adviceCard.Message = record.Advice
|
||||
|
||||
Reference in New Issue
Block a user