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

Exclude hidden links from get all links #73

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

ivshapovalov
Copy link
Contributor

@ivshapovalov ivshapovalov commented Jan 14, 2018

close #62 or issue #49

query.addCriteria(Criteria.where("hidden").is(false));
List<Link> result = mongoTemplate.find(query, Link.class, mongoCollectionName);
log.info("Found {} active links in database", result);
return result;
Copy link

Choose a reason for hiding this comment

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

i doubt that this is a good idea to apply filters to getAllLinks() method at repository level.
what about a new one like getAllNotHiddenLinks or anything similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly. Thanks

private String url;

@ApiModelProperty(value = "Flag that means link is hidden or active")
Copy link

Choose a reason for hiding this comment

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

i'd remove final part "or active". if you want to use it as a substitute for "not hidden", there are a lot of more evident words like open, public, visible, apparent so on. but as for me its better to use a simple negation: "Flag that means the link is hidden or not".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right

Benkoff
Benkoff previously approved these changes Jan 17, 2018
…n-links-from-get-all-links

# Conflicts:
#	links/src/main/java/juja/microservices/links/config/CorsConfig.java
#	links/src/main/java/juja/microservices/links/controller/LinksController.java
#	links/src/main/java/juja/microservices/links/model/Link.java
#	links/src/main/java/juja/microservices/links/model/SaveLinkRequest.java
#	links/src/main/java/juja/microservices/links/repository/impl/LinksRepositoryImpl.java
#	links/src/test/java/juja/microservices/links/controller/LinksControllerTest.java
#	links/src/test/java/juja/microservices/links/service/LinksServiceTest.java
    "hidden".ne(true) obtain links without "hidden" fields
    we suppose that links without "hidden" field are equals
    links with hidden default value 'false'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants