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

CWMVUE-611 - Adding in endpoint to get time range map for measurments #975

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

rma-bryson
Copy link
Collaborator

Updated measurement retrieval to use XML api. Fixed issues with quality. Introduced TimeExtents object.

@rma-bryson rma-bryson force-pushed the feature/CWMSVUE-611_Measurements branch from 6876dd0 to 5f57059 Compare December 12, 2024 17:53
Copy link
Contributor

@MikeNeilson MikeNeilson left a comment

Choose a reason for hiding this comment

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

Overall structure looks good. There a few "readability" areas that I think should be addressed.

{
Timestamp retval = null;
if(date != null)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

The curlies on this are wrong.

Also this would probably read easier just doing a return date !=null ? Timestamp.from(date) : null;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to fix brackets and used a ternary

@Schema(description = "Last update in the timeseries")
@JsonFormat(shape = Shape.STRING)
ZonedDateTime lastUpdate;

@SuppressWarnings("unused") // required so JAXB can initialize and marshal
private TimeSeriesExtents() {
super(new Builder());
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just... odd.

The constructor should just take a builder and thus both constructors should be private. We appear to be mixing builder/non-builder patterns here and a rather odd way..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree. I tried to preserve the existing TimeSeriesExtents object as much as possible, while making the new TimeExtents object follow the builder pattern of our other dtos. I would be in favor of updating the TimeSeriesExtents to use a builder pattern.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated the TimeSeriesExtents to use a builder pattern for consistency

MikeNeilson
MikeNeilson previously approved these changes Dec 13, 2024
Copy link
Contributor

@MikeNeilson MikeNeilson left a comment

Choose a reason for hiding this comment

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

That looks a lot better.

cwms-data-api/src/main/java/cwms/cda/data/dao/JooqDao.java Outdated Show resolved Hide resolved
rma-bryson and others added 3 commits December 13, 2024 13:07
…. Updated measurement retrieval to use XML api. Fixed issues with quality. Introduced TimeExtents object.
…apis in extending TimeExtents. Code refactor.
Co-authored-by: Mike Neilson <[email protected]>
@rma-bryson rma-bryson force-pushed the feature/CWMSVUE-611_Measurements branch from 523536a to 9f7984a Compare December 13, 2024 21:08
@rma-bryson rma-bryson merged commit 631ac79 into develop Dec 13, 2024
2 of 3 checks passed
@rma-bryson rma-bryson deleted the feature/CWMSVUE-611_Measurements branch December 13, 2024 21:17
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.

2 participants