@@ -0,0 +1,1780 @@
+package com.orgsin.sbe.application.service.impl;%0A%0Aimport com.google.common.collect.Lists;%0Aimport com.orgsin.sbe.application.service.CryptoCurrencyService;%0Aimport com.orgsin.sbe.domain.model.CryptoCurrency;%0Aimport com.orgsin.sbe.domain.model.CryptoCurrencyRepository;%0Aimport org.apache.commons.lang.ArrayUtils;%0Aimport org.apache.commons.lang.StringUtils;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.stereotype.Service;%0A%0Aimport java.util.List;%0A%0A/**%0A * Created by ogasawara.shinnosuke on 2017/06/21.%0A */%0A@Service%0Apublic class CryptoCurrencyServiceImpl implements CryptoCurrencyService %7B%0A%0A    @Autowired%0A    private CryptoCurrencyRepository repository;%0A%0A    @Override%0A    public List%3CCryptoCurrency%3E findByModel(CryptoCurrency cryptoCurrency) %7B%0A        if (StringUtils.isNotBlank(cryptoCurrency.getName())) return repository.findByName(cryptoCurrency.getName());%0A        if (StringUtils.isNotBlank(cryptoCurrency.getMarketCapitalization())) return repository.findByMarketCapitalization(cryptoCurrency.getMarketCapitalization());%0A        if (StringUtils.isNotBlank(cryptoCurrency.getDetail())) return repository.findByDetail(cryptoCurrency.getDetail());%0A        if (cryptoCurrency.getKeywords() != null && !cryptoCurrency.getKeywords().isEmpty()) return repository.findByKeywords(cryptoCurrency.getKeywords());%0A        return Lists.newArrayList(repository.findAll());%0A    %7D%0A%0A    @Override%0A    public CryptoCurrency findById(String id) %7B%0A        return repository.findById(id).orElse(new CryptoCurrency());%0A    %7D%0A%0A    @Override%0A    public CryptoCurrency save(CryptoCurrency cryptoCurrency) %7B%0A        return repository.save(cryptoCurrency);%0A    %7D%0A%0A    @Override%0A    public void delete(String id) %7B%0A        repository.deleteById(id);%0A    %7D%0A%7D%0A

Create CryptoCurrencyServiceImpl.java