Skip to content
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

[R4R]add query option to getTokens api, resolve issue #57 #58

Merged
merged 2 commits into from
Jul 22, 2019

Conversation

unclezoro
Copy link
Contributor

No description provided.

@unclezoro unclezoro changed the title [R4R]add query option to getTokens api, resolve [R4R]add query option to getTokens api, resolve #57 Jul 18, 2019
@unclezoro unclezoro changed the title [R4R]add query option to getTokens api, resolve #57 [R4R]add query option to getTokens api, resolve issue #57 Jul 18, 2019
ackratos
ackratos previously approved these changes Jul 22, 2019
}

func (param *OrdersQuery) Check() error {
if param.Limit != nil && *param.Limit <= 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we check offset

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, added.

// OrdersQuery definition
type OrdersQuery struct {
Offset *uint32 `json:"offset,omitempty,string"` //Option
Limit *uint32 `json:"limit,omitempty,string"` //Option
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use pointer?

Copy link
Contributor Author

@unclezoro unclezoro Jul 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field is optional, use can not assign them so that will use default by backend service.
If not use pointer, will always send a query parameter to backend service

HaoyangLiu
HaoyangLiu previously approved these changes Jul 22, 2019
yutianwu
yutianwu previously approved these changes Jul 22, 2019
@unclezoro unclezoro dismissed stale reviews from yutianwu and HaoyangLiu via 4fd89b9 July 22, 2019 05:33
@ackratos ackratos self-requested a review July 22, 2019 05:35
@unclezoro unclezoro merged commit 2946491 into master Jul 22, 2019
@unclezoro unclezoro deleted the tokenoption branch April 20, 2020 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants