cloudwego / hertz

Go HTTP framework with high-performance and strong-extensibility for building micro-services.
https://www.cloudwego.io
Apache License 2.0
5.31k stars 520 forks source link

fix(hz): fix some problems with hz client code #1053

Closed Skyenought closed 9 months ago

Skyenought commented 9 months ago

What type of PR is this?

fix

Check the PR title.

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:

  1. Assert all 'api.any' to 'api.post' when generate client code
  2. Add addHeaders() method to prevent the generated code from failing to compile

zh(optional):

  1. 在hz client 生成文件时, 将 api.any 全部转换为 api.post 注解
  2. 增加 addHeaders() 方法,防止生成代码无法通过编译

(Optional) Which issue(s) this PR fixes:

(Optional) The PR that updates user documentation:

https://github.com/cloudwego/cloudwego.github.io/pull/939

Skyenought commented 9 months ago

image genClient 不是只有在 client 命令下才执行的嘛😂

Skyenought commented 9 months ago

@FGYFFFF

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (0d25abe) 82.49% compared to head (171b252) 82.54%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1053 +/- ## =========================================== + Coverage 82.49% 82.54% +0.04% =========================================== Files 98 98 Lines 10025 10025 =========================================== + Hits 8270 8275 +5 + Misses 1258 1254 -4 + Partials 497 496 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Skyenought commented 9 months ago

不好意思, 手快了