-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: refactor(*): return FileHeader in the File method #436
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -252,7 +252,7 @@ func (g *FileParameterGenerator) Validate(name string, defaultValue interface{}, | |||
// Generate generates an object by data from value container. | |||
func (g *FileParameterGenerator) Generate(ctx context.Context, vc ValueContainer, consumers []Consumer, | |||
name string, target reflect.Type) (interface{}, error) { | |||
file, ok := vc.File(name) | |||
file, _, ok := vc.File(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样的话我怎么才能拿到这个 header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你想从业务函数那里直接拿到吗,那里是拿不到的,那儿只有一个位置,也不可能对应两个参数
service.HTTPContextFrom(ctx)
转换 context 可以取到这个值
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那是不是返回 FileHeader 更好,因为 File 可以通过 FileHeader.Open()
拿到
What this PR does / why we need it:
Add your description
Which issue(s) this PR is related to (optional, link to 3rd issue(s)):
Fixes #
Reference to #
Special notes for your reviewer:
/cc @whalecold
Release note: