Skip to content

[Improve][Connector-V2][My Hours]Add http method enum && Improve My Hours connector option rule#3390

Merged
EricJoy2048 merged 8 commits intoapache:devfrom
TaoZex:improve_myhours_option_rule
Nov 15, 2022
Merged

[Improve][Connector-V2][My Hours]Add http method enum && Improve My Hours connector option rule#3390
EricJoy2048 merged 8 commits intoapache:devfrom
TaoZex:improve_myhours_option_rule

Conversation

@TaoZex
Copy link
Copy Markdown
Contributor

@TaoZex TaoZex commented Nov 11, 2022

Purpose of this pull request

1.Add http method enum

320ee1850f1caeeda7502ba8422bfc1

2.Improve My Hours connector option rule.

1668146404507

Check list

.optional(MyHoursSourceConfig.METHOD)
.optional(MyHoursSourceConfig.HEADERS)
.optional(MyHoursSourceConfig.PARAMS)
.conditional(Condition.of(HttpConfig.METHOD, "post"), MyHoursSourceConfig.BODY)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use enum type option.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, please use enum type option.

@TaoZex TaoZex changed the title [Improve][Connector-V2][My Hours]Improve My Hours connector option rule [Improve][Connector-V2][My Hours]Add http method enum && Improve My Hours connector option rule Nov 11, 2022
@TaoZex TaoZex requested a review from EricJoy2048 November 12, 2022 04:55

package org.apache.seatunnel.connectors.seatunnel.http.config;

public enum Method {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

HttpRequestMethod is better.

this.setMethod(method);
} else {
this.setMethod(HttpConfig.METHOD_DEFAULT_VALUE);
this.setMethod(Method.GET);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

HttpConfig.METHOD.defaultValue() is better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I have fixed it.

@TaoZex
Copy link
Copy Markdown
Contributor Author

TaoZex commented Nov 14, 2022

@EricJoy2048 @Hisoka-X PTAL

.stringType()
.defaultValue(METHOD_DEFAULT_VALUE)
public static final Option<HttpRequestMethod> METHOD = Options.key("method")
.objectType(HttpRequestMethod.class)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please use enumType

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your advice.I have fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants