package com.weavi.service;

import com.weavi.entity.User;
import com.weavi.repository.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewUserService {
    @Autowired
    UserDao userDao;

    public User FindNameAndPsw(String username, String password) {
        return userDao.findByUsernameAndPassword(username, password);
    }
    public void save(User user1) {
        userDao.save(user1);
    }
    public List<User> findByName(String username) {
        return userDao.findByUsername(username);
    }

    public void delete(int id){
        userDao.delete(id);
    }
}
