com.haoxuer.discover.article.data.service.impl.SensitiveWordServiceImpl Maven / Gradle / Ivy
package com.haoxuer.discover.article.data.service.impl;
import com.haoxuer.discover.article.data.entity.SensitiveWord;
import com.haoxuer.discover.article.data.service.SensitiveWordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.haoxuer.discover.data.core.Updater;
import com.haoxuer.discover.article.data.dao.SensitiveWordDao;
import com.haoxuer.discover.data.page.Filter;
import com.haoxuer.discover.data.page.Order;
import com.haoxuer.discover.data.page.Page;
import com.haoxuer.discover.data.page.Pageable;
import java.util.List;
import com.haoxuer.discover.data.utils.FilterUtils;
import org.springframework.context.annotation.Scope;
/**
* Created by imake on 2017年08月15日09:52:13.
*/
@Scope("prototype")
@Service
@Transactional
public class SensitiveWordServiceImpl implements SensitiveWordService {
private SensitiveWordDao dao;
@Override
@Transactional(readOnly = true)
public SensitiveWord findById(Long id) {
return dao.findById(id);
}
@Override
@Transactional
public SensitiveWord save(SensitiveWord bean) {
dao.save(bean);
return bean;
}
@Override
@Transactional
public SensitiveWord update(SensitiveWord bean) {
Updater updater = new Updater(bean);
return dao.updateByUpdater(updater);
}
@Override
@Transactional
public SensitiveWord deleteById(Long id) {
SensitiveWord bean = dao.findById(id);
dao.deleteById(id);
return bean;
}
@Override
@Transactional
public SensitiveWord[] deleteByIds(Long[] ids) {
SensitiveWord[] beans = new SensitiveWord[ids.length];
for (int i = 0,len = ids.length; i < len; i++) {
beans[i] = deleteById(ids[i]);
}
return beans;
}
@Autowired
public void setDao(SensitiveWordDao dao) {
this.dao = dao;
}
@Override
public Page page(Pageable pageable){
return dao.page(pageable);
}
@Override
public Page page(Pageable pageable, Object search) {
List filters= FilterUtils.getFilters(search);
if (filters!=null) {
pageable.getFilters().addAll(filters);
}
return dao.page(pageable);
}
@Override
public List list(int first, Integer size, List filters, List orders) {
return dao.list(first,size,filters,orders);}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy