refactor: 移除冗余中间类型和不必要代码
- 移除 ScheduledTestOutcome 中间类型,RunTestBackground 直接返回 *ScheduledTestResult - 简化 SaveResult 直接接受 *ScheduledTestResult - 移除 handler 中不必要的 nil 检查 - 移除前端 ScheduledTestsPanel 中多余的 String() 转换 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,9 +47,6 @@ func (h *ScheduledTestHandler) ListByAccount(c *gin.Context) {
|
||||
response.InternalError(c, err.Error())
|
||||
return
|
||||
}
|
||||
if plans == nil {
|
||||
plans = []*service.ScheduledTestPlan{}
|
||||
}
|
||||
c.JSON(http.StatusOK, plans)
|
||||
}
|
||||
|
||||
@@ -154,8 +151,5 @@ func (h *ScheduledTestHandler) ListResults(c *gin.Context) {
|
||||
response.InternalError(c, err.Error())
|
||||
return
|
||||
}
|
||||
if results == nil {
|
||||
results = []*service.ScheduledTestResult{}
|
||||
}
|
||||
c.JSON(http.StatusOK, results)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user