mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-03 16:45:59 +08:00
feat: Integrate Comprehensive E2E Testing for GoChat (#1906)
* feat: create e2e test readme Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: fix markdown file * feat: add openim make lint * feat: add git chglog pull request * feat: add git chglog pull request * fix: fix openim api err code * fix: fix openim api err code * fix: fix openim api err code * feat: Improve CICD * feat: Combining GitHub and Google Workspace for Effective Project Management' * feat: fix openim tools error code * feat: fix openim tools error code * feat: add openim error handle * feat: add openim error handle * feat: optimize tim white prom code return err * feat: fix openim tools error code * style: format openim server code style * feat: add openim optimize commit code * feat: add openim optimize commit code * feat: add openim auto format code * feat: add openim auto format code * feat: add openim auto format code * feat: add openim auto format code * feat: add openim auto format code * feat: format openim code * feat: Some of the notes were translated * feat: Some of the notes were translated * feat: update openim server code * feat: optimize openim reset code * feat: optimize openim reset code --------- Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
@@ -66,12 +66,12 @@ func Post(ctx context.Context, url string, header map[string]string, data any, t
|
||||
|
||||
jsonStr, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errs.Wrap(err, "Post: JSON marshal failed")
|
||||
}
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewBuffer(jsonStr))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errs.Wrap(err, "Post: NewRequestWithContext failed")
|
||||
}
|
||||
|
||||
if operationID, _ := ctx.Value(constant.OperationID).(string); operationID != "" {
|
||||
@@ -84,13 +84,13 @@ func Post(ctx context.Context, url string, header map[string]string, data any, t
|
||||
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errs.Wrap(err, "Post: client.Do failed")
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
result, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errs.Wrap(err, "Post: ReadAll failed")
|
||||
}
|
||||
|
||||
return result, nil
|
||||
@@ -102,7 +102,10 @@ func PostReturn(ctx context.Context, url string, header map[string]string, input
|
||||
return err
|
||||
}
|
||||
err = json.Unmarshal(b, output)
|
||||
return err
|
||||
if err != nil {
|
||||
return errs.Wrap(err, "PostReturn: JSON unmarshal failed")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func callBackPostReturn(ctx context.Context, url, command string, input interface{}, output callbackstruct.CallbackResp, callbackConfig config.CallBackConfig) error {
|
||||
@@ -127,7 +130,6 @@ func callBackPostReturn(ctx context.Context, url, command string, input interfac
|
||||
}
|
||||
if err := output.Parse(); err != nil {
|
||||
log.ZWarn(ctx, "callback parse failed", err, "url", url, "input", input, "response", string(b))
|
||||
return err
|
||||
}
|
||||
log.ZInfo(ctx, "callback success", "url", url, "input", input, "response", string(b))
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user