Skip to content

Instantly share code, notes, and snippets.

@linhvovn
Last active February 2, 2019 11:33
Show Gist options
  • Save linhvovn/3e7aa0a1556eee30ef2cd236a729e6ed to your computer and use it in GitHub Desktop.
Save linhvovn/3e7aa0a1556eee30ef2cd236a729e6ed to your computer and use it in GitHub Desktop.
@Service
public class LanguageService implements LanguageServiceInf {
@Autowired
private LanguageRepository languageRepository;
@Override
public Map<String, String> getAllMessageByLocale(String locale) {
List<LanguageEntity> langList = languageRepository.findAllByLocale(locale);
return langList
.stream()
.collect(Collectors.toMap(x -> x.getKey(), x -> x.getContent()));
}
//....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment