add qcxg7a2b

This commit is contained in:
2025-08-03 23:30:30 +08:00
parent f991ad94d3
commit bce55a3bb2
6 changed files with 75 additions and 23 deletions

View File

@@ -73,9 +73,10 @@ func (h *ApiHandler) HandleApiCall(c *gin.Context) {
// 3. 调用应用服务
transactionId, encryptedResp, err := h.appService.CallApi(c.Request.Context(), &cmd)
if err != nil {
// 根据错误类型返回对应的错误码
// 根据错误类型返回对应的错误码和预定义错误消息
errorCode := api.GetErrorCode(err)
response := dto.NewErrorResponse(errorCode, err.Error(), transactionId)
errorMessage := api.GetErrorMessage(err)
response := dto.NewErrorResponse(errorCode, errorMessage, transactionId)
c.JSON(200, response) // API调用接口统一返回200状态码
return
}