package com.tykj.dev.device.user.subject.service.impl;

import com.tykj.dev.device.user.subject.dao.UserLogDao;
import com.tykj.dev.device.user.subject.entity.UserLog;
import com.tykj.dev.device.user.subject.service.UserLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zjm
 * @version 1.0.0
 * @ClassName UserLogServiceImpl.java
 * @Description TODO
 * @createTime 2020年12月01日 15:46:00
 */
@Service
public class UserLogServiceImpl implements UserLogService {
    @Autowired
    UserLogDao userLogDao;
    @Override
    public UserLog save(UserLog userLog) {
        return userLogDao.save(userLog);
    }

    @Override
    public boolean delete(Integer id) {
        return false;
    }

    @Override
    public List<UserLog> findAll() {
        return userLogDao.findAll();
    }

    @Override
    public UserLog update(UserLog userLog) {
        return userLogDao.save(userLog);
    }

    @Override
    public List<UserLog> findAllByuserID(Integer userId) {
        return userLogDao.findAllByUserIdOrderByTimeAsc(userId);
    }
}
