add
This commit is contained in:
@@ -137,6 +137,26 @@ func DeleteHandler(c *gin.Context) {
|
|||||||
return
|
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 {
|
if err := tx.Commit(); err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
@@ -165,4 +185,4 @@ func DeleteHandler(c *gin.Context) {
|
|||||||
Success: true,
|
Success: true,
|
||||||
Message: "删除成功",
|
Message: "删除成功",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user