Skip to content

Commit

Permalink
Revert "Merge branch 'master' into fix/1012_fdp"
Browse files Browse the repository at this point in the history
This reverts commit 3ff4954, reversing
changes made to 0c8d4b0.
  • Loading branch information
MindHunter86 committed Sep 26, 2024
1 parent cc60511 commit b02a2aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (*Proxy) unmarshalApiResponse(c *fiber.Ctx, rsp *fasthttp.Response) (ok boo
}
defer utils.ReleaseApiResponseWOData(apirsp)

if apirsp.Status && (apirsp.Error == nil || apirsp.Error.Code == "0") {
if apirsp.Status && (apirsp.Error == nil || apirsp.Error.Code == 0) {
ok = true
return
}
Expand All @@ -160,7 +160,7 @@ func (*Proxy) unmarshalApiResponse(c *fiber.Ctx, rsp *fasthttp.Response) (ok boo
rlog(c).Trace().Msgf("%+v", apirsp.Error)
}

rlog(c).Info().Msgf("api server respond with %s - %s", apirsp.Error.Code, apirsp.Error.Message)
rlog(c).Info().Msgf("api server respond with %d - %s", apirsp.Error.Code, apirsp.Error.Message)
return
}

Expand Down
7 changes: 3 additions & 4 deletions internal/utils/apiv1_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package utils

import (
"io"
"strconv"
"sync"

"github.com/mailru/easyjson"
Expand All @@ -23,7 +22,7 @@ type (
Code string
}
ApiError struct {
Code string
Code int
Message string
Description string
}
Expand All @@ -43,7 +42,7 @@ func AcquireApiResponseWOData() *ApiResponseWOData {

func ReleaseApiResponseWOData(ar *ApiResponseWOData) {
ar.Status = false
ar.Error.Code, ar.Error.Message, ar.Error.Description = "", "", ""
ar.Error.Code, ar.Error.Message, ar.Error.Description = 0, "", ""
apiResponseWODataPool.Put(ar)
}

Expand Down Expand Up @@ -73,7 +72,7 @@ func RespondWithApiError(status int, msg, desc string, w io.Writer) (e error) {
defer ReleaseApiResponse(apirsp)

apirsp.Error.Code, apirsp.Error.Message, apirsp.Error.Description =
strconv.Itoa(status), msg, desc
status, msg, desc
apirsp.Data = nil

var buf []byte
Expand Down
4 changes: 2 additions & 2 deletions internal/utils/apiv1_response_easyjson.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b02a2aa

Please sign in to comment.