fix: prevent empty name/description from overwriting on partial update

This commit is contained in:
Trae AI
2026-06-18 23:10:17 +08:00
parent d0bb788e67
commit a32d3bc863
@@ -365,8 +365,12 @@ func handleUpdateApplication(c *gin.Context) {
fmt.Printf("更新应用前: ID=%d, EncryptType=%s, EncryptKey=%s\n", app.ID, app.EncryptType, app.EncryptKey)
app.Name = req.Name
app.Description = req.Description
if req.Name != "" {
app.Name = req.Name
}
if req.Description != "" {
app.Description = req.Description
}
if req.BillingType != "" {
app.BillingType = req.BillingType
}