-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Feature][Connector-V2][My Hours]Add My Hours Source Connector #3162
Conversation
ObjectMapper om = new ObjectMapper(); | ||
Map<String, String> contentMap = om.readValue(content, Map.class); | ||
return contentMap.get(MyHoursSourceConfig.ACCESSTOKEN); |
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.
ObjectMapper om = new ObjectMapper(); | |
Map<String, String> contentMap = om.readValue(content, Map.class); | |
return contentMap.get(MyHoursSourceConfig.ACCESSTOKEN); | |
Map<String, String> contentMap = JsonUtils.toMap(content); | |
return contentMap.get(MyHoursSourceConfig.ACCESSTOKEN); |
return contentMap.get(MyHoursSourceConfig.ACCESSTOKEN); | ||
} | ||
} | ||
log.error("login http client execute exception, http response status code:[{}], content:[{}]", response.getCode(), response.getContent()); |
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.
If get token failed, I think should throw exception there not print error message, because without token connector will generate data failed.
bodyParams.put(MyHoursSourceConfig.PASSWORD, password); | ||
bodyParams.put(MyHoursSourceConfig.CLIENTID, MyHoursSourceConfig.API); | ||
ObjectMapper om = new ObjectMapper(); | ||
String body = om.writeValueAsString(bodyParams); |
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.
String body = om.writeValueAsString(bodyParams); | |
String body = JsonUtils.toJsonString(bodyParams); |
|
||
import lombok.Data; | ||
|
||
@Data |
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.
Remove useless annotation.
import java.util.Map; | ||
|
||
@Data | ||
@SuppressWarnings("MagicNumber") |
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.
Why add this annotation?
BTW, I think it is important to standardize commit messages. |
Thanks for your review and advice.I will fix it. |
Hi, @TaoZex Thanks for your contribution.
|
Thanks for your advice. |
Purpose of this pull request
#3018 My Hours Source Connector




Check list
New License Guide