Add runtime restore and temp asset cleanup
This commit is contained in:
@@ -134,6 +134,33 @@ func (s *Server) updatePlatformDynamicPriority(w http.ResponseWriter, r *http.Re
|
||||
writeJSON(w, http.StatusOK, item)
|
||||
}
|
||||
|
||||
// restorePlatformModelRuntimeStatus godoc
|
||||
// @Summary 恢复平台模型运行状态
|
||||
// @Description 管理端手动解除平台模型停用、模型冷却、平台冷却或平台禁用状态,使其重新参与路由。
|
||||
// @Tags runtime
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
// @Param platformModelID path string true "平台模型 ID"
|
||||
// @Success 200 {object} store.ModelRateLimitStatus
|
||||
// @Failure 401 {object} ErrorEnvelope
|
||||
// @Failure 403 {object} ErrorEnvelope
|
||||
// @Failure 404 {object} ErrorEnvelope
|
||||
// @Failure 500 {object} ErrorEnvelope
|
||||
// @Router /api/admin/runtime/model-rate-limits/{platformModelID}/restore [post]
|
||||
func (s *Server) restorePlatformModelRuntimeStatus(w http.ResponseWriter, r *http.Request) {
|
||||
item, err := s.store.RestorePlatformModelRuntimeStatus(r.Context(), r.PathValue("platformModelID"))
|
||||
if err != nil {
|
||||
if store.IsNotFound(err) {
|
||||
writeError(w, http.StatusNotFound, "platform model not found")
|
||||
return
|
||||
}
|
||||
s.logger.Error("restore platform model runtime status failed", "error", err)
|
||||
writeError(w, http.StatusInternalServerError, "restore platform model runtime status failed")
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusOK, item)
|
||||
}
|
||||
|
||||
// createRuntimePolicySet godoc
|
||||
// @Summary 创建运行策略集
|
||||
// @Description 管理端创建运行策略集,policyKey 和 name 必填。
|
||||
|
||||
Reference in New Issue
Block a user