refactor: Rename DuckDuckGo test function for consistency and improve code readability; format error handling code for better clarity

This commit is contained in:
wizardchen
2025-12-01 17:32:43 +08:00
parent b10e262ce5
commit be411affdb
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -103,7 +103,8 @@ func (h *FAQHandler) UpdateEntryTagBatch(c *gin.Context) {
c.Error(errors.NewBadRequestError("请求参数不合法").WithDetails(err.Error()))
return
}
if err := h.knowledgeService.UpdateFAQEntryTagBatch(ctx, secutils.SanitizeForLog(c.Param("id")), req.Updates); err != nil {
if err := h.knowledgeService.UpdateFAQEntryTagBatch(ctx,
secutils.SanitizeForLog(c.Param("id")), req.Updates); err != nil {
logger.ErrorWithFields(ctx, err, nil)
c.Error(err)
return
@@ -122,7 +123,8 @@ func (h *FAQHandler) UpdateEntryStatusBatch(c *gin.Context) {
c.Error(errors.NewBadRequestError("请求参数不合法").WithDetails(err.Error()))
return
}
if err := h.knowledgeService.UpdateFAQEntryStatusBatch(ctx, secutils.SanitizeForLog(c.Param("id")), req.Updates); err != nil {
if err := h.knowledgeService.UpdateFAQEntryStatusBatch(ctx,
secutils.SanitizeForLog(c.Param("id")), req.Updates); err != nil {
logger.ErrorWithFields(ctx, err, nil)
c.Error(err)
return