Files
new-api/controller/missing_models.go

28 lines
592 B
Go
Raw Normal View History

package controller
import (
2025-08-10 12:11:31 +08:00
"net/http"
"one-api/model"
2025-08-10 12:11:31 +08:00
"github.com/gin-gonic/gin"
)
// GetMissingModels returns the list of model names that are referenced by channels
// but do not have corresponding records in the models meta table.
// This helps administrators quickly discover models that need configuration.
func GetMissingModels(c *gin.Context) {
2025-08-10 12:11:31 +08:00
missing, err := model.GetMissingModels()
if err != nil {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": err.Error(),
})
return
}
2025-08-10 12:11:31 +08:00
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": missing,
})
}