Skip to content

Commit 2579872

Browse files
committed
CountryService.suggestCountryForUser(): add comments.
No code changes.
1 parent 065ee85 commit 2579872

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/ru/mystamps/web/service/CountryServiceImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public List<Object[]> getStatisticsOf(Integer collectionId, String lang) {
174174
public String suggestCountryForUser(Integer userId) {
175175
Validate.isTrue(userId != null, "User id must be non null");
176176

177+
// if user created a series with a country, let's suggest this country to him
177178
String slug = countryDao.findCountryOfLastCreatedSeriesByUser(userId);
178179
if (slug != null) {
179180
LOG.info(
@@ -184,6 +185,8 @@ public String suggestCountryForUser(Integer userId) {
184185
return slug;
185186
}
186187

188+
// user has never created a country but most of the series in his collection
189+
// belong to a specific country, let's suggest this country to him
187190
slug = countryDao.findPopularCountryInCollection(userId);
188191
if (slug != null) {
189192
LOG.info(

0 commit comments

Comments
 (0)