Skip to content

Exclude hidden links from get all links#73

Open
ivshapovalov wants to merge 14 commits intoJujaLabs:developfrom
ivshapovalov:49-exclude-hidden-links-from-get-all-links
Open

Exclude hidden links from get all links#73
ivshapovalov wants to merge 14 commits intoJujaLabs:developfrom
ivshapovalov:49-exclude-hidden-links-from-get-all-links

Conversation

@ivshapovalov
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Exactly. Thanks

@ApiModelProperty(value = "URL of saved link", required = true)
private String url;

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

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
Copy Markdown
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