refactor: Update function signatures across multiple files to improve readability by adding context parameters and enhancing code structure

This commit is contained in:
wizardchen
2025-11-28 16:17:52 +08:00
parent 135e33eca4
commit eb8bfddfd1
89 changed files with 1453 additions and 522 deletions
+10 -5
View File
@@ -61,11 +61,11 @@ func hideSensitiveInfo(model *types.Model) *types.Model {
// CreateModelRequest defines the structure for model creation requests
// Contains all fields required to create a new model in the system
type CreateModelRequest struct {
Name string `json:"name" binding:"required"`
Type types.ModelType `json:"type" binding:"required"`
Source types.ModelSource `json:"source" binding:"required"`
Name string `json:"name" binding:"required"`
Type types.ModelType `json:"type" binding:"required"`
Source types.ModelSource `json:"source" binding:"required"`
Description string `json:"description"`
Parameters types.ModelParameters `json:"parameters" binding:"required"`
Parameters types.ModelParameters `json:"parameters" binding:"required"`
}
// CreateModel handles the HTTP request to create a new model
@@ -109,7 +109,12 @@ func (h *ModelHandler) CreateModel(c *gin.Context) {
return
}
logger.Infof(ctx, "Model created successfully, ID: %s, Name: %s", secutils.SanitizeForLog(model.ID), secutils.SanitizeForLog(model.Name))
logger.Infof(
ctx,
"Model created successfully, ID: %s, Name: %s",
secutils.SanitizeForLog(model.ID),
secutils.SanitizeForLog(model.Name),
)
// Hide sensitive information for builtin models (though newly created models are unlikely to be builtin)
responseModel := hideSensitiveInfo(model)