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:
5
pom.xml
5
pom.xml
@@ -30,8 +30,8 @@
|
|||||||
</developer>
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
<scm>
|
<scm>
|
||||||
<connection/>
|
<connection></connection>
|
||||||
<developerConnection/>
|
<developerConnection>scm:git:https://gitea.gofwd.group/Forward_Group/ballistic-builder-spring.git</developerConnection>
|
||||||
<tag/>
|
<tag/>
|
||||||
<url/>
|
<url/>
|
||||||
</scm>
|
</scm>
|
||||||
@@ -79,6 +79,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.postgresql</groupId>
|
<groupId>org.postgresql</groupId>
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
|
<version>42.7.7</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package group.goforward.ballistic;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param <T>
|
||||||
|
*/
|
||||||
public class ApiResponse<T> {
|
public class ApiResponse<T> {
|
||||||
|
|
||||||
private static final String API_SUCCESS = "success";
|
private static final String API_SUCCESS = "success";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package group.goforward.ballistic.controllers;
|
package group.goforward.ballistic.controllers;
|
||||||
|
|
||||||
import group.goforward.ballistic.model.Psa;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -14,10 +14,10 @@ import java.util.UUID;
|
|||||||
@RequestMapping("/api/psa")
|
@RequestMapping("/api/psa")
|
||||||
public class PsaController {
|
public class PsaController {
|
||||||
|
|
||||||
private final PsaService psaService;
|
private final PsaServiceImpl psaService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public PsaController(PsaService psaService) {
|
public PsaController(PsaServiceImpl psaService) {
|
||||||
this.psaService = psaService;
|
this.psaService = psaService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package group.goforward.ballistic.model;
|
package group.goforward.ballistic.repos;
|
||||||
|
|
||||||
|
import group.goforward.ballistic.model.Account;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -1,40 +1,17 @@
|
|||||||
package group.goforward.ballistic.services;
|
package group.goforward.ballistic.services;
|
||||||
|
|
||||||
import group.goforward.ballistic.model.Psa;
|
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.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@Service
|
public interface PsaService {
|
||||||
public class PsaService implements group.goforward.ballistic.services.impl.PsaService {
|
List<Psa> findAll();
|
||||||
|
|
||||||
private final PsaRepository psaRepository;
|
Optional<Psa> findById(UUID id);
|
||||||
|
|
||||||
@Autowired
|
Psa save(Psa psa);
|
||||||
public PsaService(PsaRepository psaRepository) {
|
|
||||||
this.psaRepository = psaRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
void deleteById(UUID id);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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