use of com.github.lybgeek.elasticsearch.annotation.EsOperate in project springboot-learning by lyb-geek.
the class ShortUrlServiceImpl method listShortUrls.
@Override
@EsOperate(type = OperateType.QUERY, indexName = ElasticsearchConstant.SHORT_URL_INDEX)
public List<ShortUrlDTO> listShortUrls(ShortUrlDTO shortUrlDTO) {
ShortUrl shortUrl = BeanMapperUtil.map(shortUrlDTO, ShortUrl.class);
List<ShortUrl> shortUrls = shortUrlDao.listShortUrls(shortUrl);
return BeanMapperUtil.mapList(shortUrls, ShortUrlDTO.class);
}
use of com.github.lybgeek.elasticsearch.annotation.EsOperate in project springboot-learning by lyb-geek.
the class ShortUrlServiceImpl method saveShortUrl.
@Override
@EsOperate(type = OperateType.ADD, indexName = ElasticsearchConstant.SHORT_URL_INDEX)
public ShortUrlDTO saveShortUrl(ShortUrlDTO shortUrlDTO) {
ShortUrl shortUrl = BeanMapperUtil.map(shortUrlDTO, ShortUrl.class);
ShortUrl dbShortUrl = shortUrlDao.save(shortUrl);
return BeanMapperUtil.map(dbShortUrl, ShortUrlDTO.class);
}