package edu.prlab.tyler.iotgateway.cloud.services;

import edu.prlab.tyler.iotgateway.cloud.pojo.auth.SensitiveUser;
import edu.prlab.tyler.iotgateway.cloud.repositories.SensitiveUserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class SensitiveUserService  {
    private SensitiveUserRepository repository;

    @Autowired
    public SensitiveUserService(SensitiveUserRepository repository) {
        this.repository = repository;
    }

    public Optional<SensitiveUser> add(SensitiveUser pojo) {
        return Optional.of(repository.saveAndFlush(pojo));
    }
}
