backend con panel admin funcional
Some checks failed
Deploy Spring Boot App / build-and-deploy (push) Has been cancelled
Some checks failed
Deploy Spring Boot App / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.example.fercoganbackend.service;
|
||||
|
||||
import com.example.fercoganbackend.entity.Cabana;
|
||||
import com.example.fercoganbackend.repository.CabanaRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
public class CabanaService {
|
||||
|
||||
@Autowired
|
||||
private CabanaRepository cabanaRepository;
|
||||
|
||||
public List<Cabana> findAll() {
|
||||
return cabanaRepository.findAll();
|
||||
}
|
||||
|
||||
public Optional<Cabana> findById(Long id) {
|
||||
return cabanaRepository.findById(id);
|
||||
}
|
||||
|
||||
public Cabana save(Cabana remate) {
|
||||
return cabanaRepository.save(remate);
|
||||
}
|
||||
|
||||
public void delete(Long id) {
|
||||
cabanaRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.example.fercoganbackend.service;
|
||||
|
||||
import com.example.fercoganbackend.entity.Lote;
|
||||
import com.example.fercoganbackend.repository.LoteRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
public class LoteService {
|
||||
|
||||
@Autowired
|
||||
private LoteRepository loteRepository;
|
||||
|
||||
public List<Lote> findAll() {
|
||||
return loteRepository.findAll();
|
||||
}
|
||||
|
||||
public Optional<Lote> findById(Long id) {
|
||||
return loteRepository.findById(id);
|
||||
}
|
||||
|
||||
public Lote save(Lote remate) {
|
||||
return loteRepository.save(remate);
|
||||
}
|
||||
|
||||
public void delete(Long id) {
|
||||
loteRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.example.fercoganbackend.service;
|
||||
|
||||
import com.example.fercoganbackend.entity.Puja;
|
||||
import com.example.fercoganbackend.repository.PujaRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
public class PujaService {
|
||||
|
||||
@Autowired
|
||||
private PujaRepository pujaRepository;
|
||||
|
||||
public List<Puja> findAll() {
|
||||
return pujaRepository.findAll();
|
||||
}
|
||||
|
||||
public Optional<Puja> findById(Long id) {
|
||||
return pujaRepository.findById(id);
|
||||
}
|
||||
|
||||
public Puja save(Puja remate) {
|
||||
return pujaRepository.save(remate);
|
||||
}
|
||||
|
||||
public void delete(Long id) {
|
||||
pujaRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.example.fercoganbackend.service;
|
||||
|
||||
import com.example.fercoganbackend.entity.Remate;
|
||||
import com.example.fercoganbackend.repository.RemateRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
public class RemateService {
|
||||
|
||||
@Autowired
|
||||
private RemateRepository remateRepository;
|
||||
|
||||
public List<Remate> findAll() {
|
||||
return remateRepository.findAll();
|
||||
}
|
||||
|
||||
public Optional<Remate> findById(Long id) {
|
||||
return remateRepository.findById(id);
|
||||
}
|
||||
|
||||
public Remate save(Remate remate) {
|
||||
return remateRepository.save(remate);
|
||||
}
|
||||
|
||||
public void delete(Long id) {
|
||||
remateRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class UsuarioDetailsService implements UserDetailsService {
|
||||
@@ -18,6 +20,7 @@ public class UsuarioDetailsService implements UserDetailsService {
|
||||
private final UsuarioRepository usuarioRepository;
|
||||
private final Logger logger = LoggerFactory.getLogger(UsuarioDetailsService.class);
|
||||
|
||||
|
||||
public UsuarioDetailsService(UsuarioRepository usuarioRepository) {
|
||||
this.usuarioRepository = usuarioRepository;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ public class UsuarioService {
|
||||
private final UsuarioRepository repo;
|
||||
private final PasswordEncoder encoder;
|
||||
|
||||
public List<Usuario> getAll(){
|
||||
return repo.findAll();
|
||||
}
|
||||
public UsuarioService(UsuarioRepository repo, PasswordEncoder encoder) {
|
||||
this.repo = repo;
|
||||
this.encoder = encoder;
|
||||
|
||||
Reference in New Issue
Block a user