package com.jiayue.ipfcst.console.service;

import com.jiayue.ipfcst.common.data.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 系统日志业务层
 *
 * @author zzy
 * @version 1.0
 * @since 2019/8/7 9:32
 */
@Service
@Slf4j
public class SysLogService extends BaseService {

//    private final SysLogRepository sysLogRepository;
//
//    @Autowired
//    public SysLogService(SysLogRepository sysLogRepository) {
//        this.sysLogRepository = sysLogRepository;
//    }
//
//    /**
//     * 查询系统日志
//     * @param sTime 开始时间
//     * @param eTime 结束时间
//     * @param page 页码
//     * @param size 每页记录数
//     * @return 分页结果
//     */
//    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
//    public Page<SysLog> get(final Date sTime,final Date eTime,final Integer page,final Integer size){
//
//        Specification<SysLog> querySpeci = (Specification<SysLog>) (root, criteriaQuery, criteriaBuilder) -> {
//            List<Predicate> predicates = new ArrayList<>();
//
//            predicates.add(criteriaBuilder.between(root.get("time"), sTime, eTime));
//
//            return criteriaBuilder.and(predicates.toArray(new Predicate[predicates.size()]));
//        };
//        return this.sysLogRepository.findAll(querySpeci, PageRequest.of(page - 1, size));
//    }
}
