package com.springboot.auth.authorization.service.impl;

import com.springboot.auth.authorization.entity.Company;
import com.springboot.auth.authorization.entity.User;
import com.springboot.auth.authorization.provider.OrganizationProvider;
import com.springboot.auth.authorization.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private OrganizationProvider organizationProvider;

    @Override
    public User getUserByUsernameOrMobile(String payload) {
        return organizationProvider.getUserByUsernameOrMobile(payload).getData();
    }

    @Override
    public List<Company> getUserAllCompany(String userId) {
        return organizationProvider.getUserAllCompany(userId).getData();
    }
}
