package cn.iselab.mooctest.user.rpc;

import cn.iselab.mooctest.rpc.user.api.UserService;
import cn.iselab.mooctest.rpc.user.data.UserDTO;
import cn.iselab.mooctest.user.web.logic.UserLogic;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author sean
 * @date 2018-03-03.
 */
@Service(version = "1.0.0")
@Component
public class UserRPC implements UserService {

    @Autowired
    private UserLogic userLogic;

    @Override
    public UserDTO getUserByEmail(String s) {
        return userLogic.getUserByEmail(s);
    }

    @Override
    public UserDTO getUserByMobile(String s) {
        return userLogic.getUserByMobile(s);
    }

    @Override
    public UserDTO getUserById(Long userId) {
        return userLogic.getUserById(userId);
    }

    @Override
    public Boolean checkPassword(UserDTO userDTO) {
        return userLogic.checkPassword(userDTO);
    }

    @Override
    public UserDTO save(UserDTO userDTO) {
        return userLogic.save(userDTO);
    }

    @Override
    public UserDTO updateUser(UserDTO userDTO) {
        return userLogic.updateUser(userDTO);
    }

    @Override
    public List<UserDTO> getUserByFuzzyName(UserDTO userDTO) {
        return userLogic.getUserByFuzzyName(userDTO);
    }

    @Override
    public List<UserDTO> getUserByFuzzyEmail(UserDTO userDTO) {
        return userLogic.getUserByFuzzyEmail(userDTO);
    }

    @Override
    public List<UserDTO> getUserByFuzzyNameOrEmail(UserDTO userDTO) {
        return userLogic.getUserByFuzzyNameOrEmail(userDTO);
    }

    @Override
    public List<UserDTO> getUserByFuzzySchool(UserDTO var1){
        return null;
    }

    @Override
    public List<UserDTO> getUserByFuzzyProvince(UserDTO var1){
        return null;
    }

    @Override
    public List<UserDTO> getUserByFuzzyCity(UserDTO var1){
        return null;
    }

    @Override
    public List<UserDTO> findAll(List<Long> list) {
        return userLogic.findAll(list);
    }

    @Override
    public List<UserDTO> findByEmails(List<String> list) {
        return userLogic.findByEmails(list);
    }
}
