mirror of
https://gitea.gofwd.group/Forward_Group/ballistic-builder-spring.git
synced 2025-12-06 02:56:44 -05:00
package-infos and a few other changes
This commit is contained in:
@@ -2,6 +2,9 @@ package group.goforward.ballistic;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @param <T>
|
||||
*/
|
||||
public class ApiResponse<T> {
|
||||
|
||||
private static final String API_SUCCESS = "success";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package group.goforward.ballistic.controllers;
|
||||
|
||||
import group.goforward.ballistic.model.Psa;
|
||||
import group.goforward.ballistic.services.PsaService;
|
||||
import group.goforward.ballistic.services.impl.PsaServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -14,10 +14,10 @@ import java.util.UUID;
|
||||
@RequestMapping("/api/psa")
|
||||
public class PsaController {
|
||||
|
||||
private final PsaService psaService;
|
||||
private final PsaServiceImpl psaService;
|
||||
|
||||
@Autowired
|
||||
public PsaController(PsaService psaService) {
|
||||
public PsaController(PsaServiceImpl psaService) {
|
||||
this.psaService = psaService;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package group.goforward.ballistic.model;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface AccountRepository extends JpaRepository<Account, UUID> {
|
||||
package group.goforward.ballistic.repos;
|
||||
|
||||
import group.goforward.ballistic.model.Account;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface AccountRepository extends JpaRepository<Account, UUID> {
|
||||
}
|
||||
@@ -1,40 +1,17 @@
|
||||
package group.goforward.ballistic.services;
|
||||
|
||||
import group.goforward.ballistic.model.Psa;
|
||||
import group.goforward.ballistic.repos.PsaRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class PsaService implements group.goforward.ballistic.services.impl.PsaService {
|
||||
public interface PsaService {
|
||||
List<Psa> findAll();
|
||||
|
||||
private final PsaRepository psaRepository;
|
||||
Optional<Psa> findById(UUID id);
|
||||
|
||||
@Autowired
|
||||
public PsaService(PsaRepository psaRepository) {
|
||||
this.psaRepository = psaRepository;
|
||||
}
|
||||
Psa save(Psa psa);
|
||||
|
||||
@Override
|
||||
public List<Psa> findAll() {
|
||||
return psaRepository.findAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Psa> findById(UUID id) {
|
||||
return psaRepository.findById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Psa save(Psa psa) {
|
||||
return psaRepository.save(psa);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(UUID id) {
|
||||
psaRepository.deleteById(id);
|
||||
}
|
||||
void deleteById(UUID id);
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package group.goforward.ballistic.services.impl;
|
||||
|
||||
import group.goforward.ballistic.model.Psa;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface PsaService {
|
||||
List<Psa> findAll();
|
||||
|
||||
Optional<Psa> findById(UUID id);
|
||||
|
||||
Psa save(Psa psa);
|
||||
|
||||
void deleteById(UUID id);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package group.goforward.ballistic.services.impl;
|
||||
import group.goforward.ballistic.model.Psa;
|
||||
import group.goforward.ballistic.repos.PsaRepository;
|
||||
import group.goforward.ballistic.services.PsaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class PsaServiceImpl implements PsaService {
|
||||
|
||||
private final PsaRepository psaRepository;
|
||||
|
||||
@Autowired
|
||||
public PsaServiceImpl(PsaRepository psaRepository) {
|
||||
this.psaRepository = psaRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Psa> findAll() {
|
||||
return psaRepository.findAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Psa> findById(UUID id) {
|
||||
return psaRepository.findById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Psa save(Psa psa) {
|
||||
return psaRepository.save(psa);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(UUID id) {
|
||||
psaRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user