package org.cmh.backend.UserManagement.service;

import org.cmh.backend.UserManagement.model.User;
import org.cmh.backend.UserManagement.repository.UserRepositoryTemp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceTemp {
    @Autowired
    private UserRepositoryTemp userRepository;

    public User getUserByUsername(String username) {
        return userRepository.findByName(username);
    }
    public User getUserByAccountAndPassword(String name,String password){return userRepository.findByAccountAndPassword(name,password);}

    public User registerUser(User user) {
        User savedUser = userRepository.save(user);
        return savedUser;
    }


}
