This commit is contained in:
vipg
2025-11-19 16:43:03 +08:00
parent e33a5e36ad
commit 73c498ea37

View File

@@ -137,6 +137,26 @@ func DeleteHandler(c *gin.Context) {
return
}
// 新增3.4 更新flag表软删除国旗信息
_, err = tx.Exec("UPDATE country_flag SET deleted = TRUE WHERE country_id = $1", req.CountryID)
if err != nil {
tx.Rollback()
zap.L().Error("❌ country_flag表更新失败",
zap.String("req_id", reqID),
zap.String("country_id", req.CountryID),
zap.Error(err),
)
c.JSON(http.StatusInternalServerError, DeleteResponse{
Success: false,
Message: "删除国旗信息失败",
})
return
}
zap.L().Debug("📝 flag表软删除成功",
zap.String("req_id", reqID),
zap.String("country_id", req.CountryID),
)
// 提交事务
if err := tx.Commit(); err != nil {
tx.Rollback()
@@ -165,4 +185,4 @@ func DeleteHandler(c *gin.Context) {
Success: true,
Message: "删除成功",
})
}
}