cloudwego / hertz

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

fix(hz): router import error for 'api.service_gen_dir' #1127

Closed FGYFFFF closed 1 month ago

FGYFFFF commented 2 months ago

What type of PR is this?

fix

Check the PR title.

(Optional) Translate the PR title into Chinese.

修复指定 'api.service_gen_dir' 时的路由 import 错误的问题

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

en: fix router import error for 'api.service_gen_dir' zh(optional): 修复指定 'api.service_gen_dir' 时的路由 import 错误的问题 当我们如下定义 IDL 的时候,生成的 handler 路径与 'api.service_gen_dir' 一致;在生成路由的没有去解析这个路径的 import,导致生产的 import 路径有问题

service Hertz2 {
    Resp Method1(1: MultiTypeReq request) (api.get="/a/b/c");
}(

     api.service_gen_dir="/handle2/ss/ss/trt"
 )

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

(Optional) The PR that updates user documentation:

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 82.80%. Comparing base (9162dd1) to head (164973c). Report is 11 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1127 +/- ## =========================================== + Coverage 82.75% 82.80% +0.05% =========================================== Files 98 98 Lines 10044 10062 +18 =========================================== + Hits 8312 8332 +20 + Misses 1241 1240 -1 + Partials 491 490 -1 ```

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