Search in sources :

Example 1 with EsOperate

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);
}
Also used : ShortUrl(com.github.lybgeek.shorturl.model.ShortUrl) EsOperate(com.github.lybgeek.elasticsearch.annotation.EsOperate)

Example 2 with EsOperate

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);
}
Also used : ShortUrl(com.github.lybgeek.shorturl.model.ShortUrl) EsOperate(com.github.lybgeek.elasticsearch.annotation.EsOperate)

Aggregations

EsOperate (com.github.lybgeek.elasticsearch.annotation.EsOperate)2 ShortUrl (com.github.lybgeek.shorturl.model.ShortUrl)2