-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
109 changed files
with
3,020 additions
and
707 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"cSpell.words": [ | ||
"Archivage", | ||
"Choisir", | ||
"effet" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DB_URL=jdbc:mysql://suivie-physique-master.cbsqw4oegule.us-east-1.rds.amazonaws.com/sp | ||
MAIL_HOST=sandbox.smtp.mailtrap.io | ||
ACTIVE_PROFILE=dev | ||
JAR_VERSION=0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../sp/auth/audit/ApplicationAuditAware.java → ...a/com/sp/audit/ApplicationAuditAware.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
backend/src/main/java/com/sp/auth/schema/AuthenticationResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package com.sp.auth.schema; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
public class AuthenticationResponse { | ||
private String token; | ||
@JsonProperty("access_token") | ||
private String accessToken; | ||
@JsonProperty("refresh_token") | ||
private String refreshToken; | ||
} |
12 changes: 12 additions & 0 deletions
12
backend/src/main/java/com/sp/auth/schema/RefreshTokenRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.sp.auth.schema; | ||
|
||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
public class RefreshTokenRequest { | ||
private String refreshToken; | ||
private String accessToken; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/main/java/com/sp/auth/service/UserDetailsServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/main/java/com/sp/filter/JwtAuthenticationFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
backend/src/main/java/com/sp/gestion/archivage/controller/ArchiveController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.sp.gestion.archivage.controller; | ||
|
||
|
||
import com.sp.gestion.archivage.schema.ArchiveResponse; | ||
import com.sp.gestion.archivage.service.ArchiveService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.apache.coyote.Response; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/archive") | ||
@RequiredArgsConstructor | ||
public class ArchiveController { | ||
|
||
private final ArchiveService archiveService; | ||
|
||
@GetMapping("/all") | ||
public ResponseEntity<List<ArchiveResponse>> getAllArchives() { | ||
return ResponseEntity.ok(this.archiveService.getAllArchives()); | ||
} | ||
|
||
} |
61 changes: 61 additions & 0 deletions
61
backend/src/main/java/com/sp/gestion/archivage/model/Archive.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.sp.gestion.archivage.model; | ||
|
||
|
||
import com.sp.gestion.suivie_physique.model.Valeur; | ||
import com.sp.users.model.User; | ||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.hibernate.annotations.GenericGenerator; | ||
import org.springframework.data.annotation.CreatedBy; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedBy; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Entity | ||
@Table(name = "_archive") | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class Archive { | ||
@Id | ||
@GeneratedValue(strategy= GenerationType.AUTO,generator="native") | ||
@GenericGenerator(name = "native",strategy = "native") | ||
private Long id; | ||
|
||
private LocalDateTime dateArchive; | ||
|
||
@OneToMany(mappedBy = "archive", cascade = CascadeType.ALL, fetch = FetchType.LAZY) | ||
private List<Valeur> valeurs; | ||
|
||
|
||
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) | ||
private ArchiveType type; | ||
|
||
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) | ||
private User archivist; | ||
|
||
@CreatedBy | ||
@Column(name = "created_by", updatable = false) | ||
private String createdBy; | ||
|
||
@CreatedDate | ||
@Column(name = "created_date", updatable = false) | ||
private LocalDateTime createdDate; | ||
|
||
@LastModifiedDate | ||
@Column(name = "last_modified_date") | ||
private LocalDateTime lastModifiedDate; | ||
|
||
@LastModifiedBy | ||
@Column(name = "last_modified_by") | ||
private String lastModifiedBy; | ||
} |
6 changes: 6 additions & 0 deletions
6
backend/src/main/java/com/sp/gestion/archivage/model/ArchiveRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.sp.gestion.archivage.model; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface ArchiveRepository extends JpaRepository<Archive, Long> { | ||
} |
Oops, something went wrong.