feat: swagger
This commit is contained in:
@@ -5,6 +5,7 @@ import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.microprofile.openapi.annotations.media.Schema;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -14,18 +15,31 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class MeData {
|
||||
@Schema(description = "L'identifiant du membre.", example = "1")
|
||||
private long id;
|
||||
@Schema(description = "Le nom du membre.", example = "Dupont")
|
||||
private String lname = "";
|
||||
@Schema(description = "Le prénom du membre.", example = "Jean")
|
||||
private String fname = "";
|
||||
@Schema(description = "La catégorie du membre.", example = "SENIOR")
|
||||
private String categorie;
|
||||
@Schema(description = "Le nom du club du membre.", example = "Association sportive")
|
||||
private String club;
|
||||
@Schema(description = "Le genre du membre.", example = "Homme")
|
||||
private String genre;
|
||||
@Schema(description = "Le numéro de licence du membre.", example = "12345")
|
||||
private int licence;
|
||||
@Schema(description = "Le pays du membre.", example = "FR")
|
||||
private String country;
|
||||
@Schema(description = "La date de naissance du membre.")
|
||||
private Date birth_date;
|
||||
@Schema(description = "L'adresse e-mail du membre.", example = "jean.dupont@example.com")
|
||||
private String email;
|
||||
@Schema(description = "Le rôle du membre dans l'association.", example = "MEMBRE")
|
||||
private String role;
|
||||
@Schema(description = "Le grade d'arbitrage du membre.", example = "N/A")
|
||||
private String grade_arbitrage;
|
||||
@Schema(description = "La liste des licences du membre.")
|
||||
private List<SimpleLicence> licences;
|
||||
|
||||
public void setMembre(MembreModel membreModel) {
|
||||
|
||||
@@ -5,16 +5,21 @@ import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.eclipse.microprofile.openapi.annotations.media.Schema;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SimpleAffiliation {
|
||||
Long id;
|
||||
Long club;
|
||||
int saison;
|
||||
boolean validate;
|
||||
@Schema(description = "L'identifiant de l'affiliation.", example = "1")
|
||||
private Long id;
|
||||
@Schema(description = "L'identifiant du club associé à l'affiliation.", example = "123")
|
||||
private Long club;
|
||||
@Schema(description = "La saison de l'affiliation.", example = "2022")
|
||||
private int saison;
|
||||
@Schema(description = "Indique si l'affiliation est validée ou non.", example = "true")
|
||||
private boolean validate;
|
||||
|
||||
public static SimpleAffiliation fromModel(AffiliationModel model) {
|
||||
if (model == null)
|
||||
|
||||
@@ -7,6 +7,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.microprofile.openapi.annotations.media.Schema;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -17,19 +18,33 @@ import java.util.Map;
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SimpleClub {
|
||||
@Schema(description = "L'identifiant unique du club.", example = "1")
|
||||
private Long id;
|
||||
@Schema(description = "Identifiant long du club (UUID)", example = "b94f3167-3f6a-449c-a73b-ec84202bf07e")
|
||||
private String clubId;
|
||||
@Schema(description = "Le nom du club.", example = "Association sportive")
|
||||
private String name;
|
||||
@Schema(description = "Le pays du club.", example = "FR")
|
||||
private String country;
|
||||
@Schema(description = "Les contacts du club", example = "{\"SITE\": \"www.test.com\", \"COURRIEL\": \"test@test.com\"}")
|
||||
private Map<Contact, String> contact;
|
||||
@Schema(description = "Liste des lieux d'entraînement", example = "[{\"text\":\"addr 1\",\"lng\":2.24654,\"lat\":52.4868658},{\"text\":\"addr 2\",\"lng\":2.88654,\"lat\":52.7865456}]")
|
||||
private String training_location;
|
||||
@Schema(description = "Liste des jours et horaires d'entraînement (jours 0-6, 0=>lundi) (temps en minute depuis 00:00, 122=>2h02)", example = "[{\"day\":0,\"time_start\":164,\"time_end\":240},{\"day\":3,\"time_start\":124,\"time_end\":250}]")
|
||||
private String training_day_time;
|
||||
@Schema(description = "Contact interne du club", example = "john.doe@test.com")
|
||||
private String contact_intern;
|
||||
@Schema(description = "Adresse postale du club", example = "1 rue de l'exemple, 75000 Paris")
|
||||
private String address;
|
||||
@Schema(description = "RNA du club", example = "W123456789")
|
||||
private String RNA;
|
||||
@Schema(description = "Numéro SIRET du club", example = "12345678901234")
|
||||
private Long SIRET;
|
||||
@Schema(description = "Numéro d'affiliation du club", example = "12345")
|
||||
private Long no_affiliation;
|
||||
@Schema(description = "Club international", example = "false")
|
||||
private boolean international;
|
||||
@Schema(description = "Une map contenant les contacts possible pout un club.")
|
||||
private HashMap<String, String> contactMap = null;
|
||||
|
||||
public static SimpleClub fromModel(ClubModel model) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.eclipse.microprofile.openapi.annotations.media.Schema;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -13,10 +14,15 @@ import lombok.Setter;
|
||||
@NoArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SimpleClubList {
|
||||
@Schema(description = "Identifiant du club", example = "1")
|
||||
Long id;
|
||||
@Schema(description = "Nom du club", example = "Club de test")
|
||||
String name;
|
||||
@Schema(description = "Pays du club", example = "FR")
|
||||
String country;
|
||||
@Schema(description = "Numéro SIRET du club", example = "12345678901234")
|
||||
Long siret;
|
||||
@Schema(description = "Numéro d'affiliation du club", example = "12345")
|
||||
Long no_affiliation;
|
||||
|
||||
public static SimpleClubList fromModel(ClubModel model) {
|
||||
|
||||
@@ -5,16 +5,22 @@ import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.eclipse.microprofile.openapi.annotations.media.Schema;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SimpleLicence {
|
||||
@Schema(description = "ID de la licence", example = "1")
|
||||
Long id;
|
||||
@Schema(description = "ID du membre", example = "1")
|
||||
Long membre;
|
||||
@Schema(description = "Saison de la licence", example = "2024")
|
||||
int saison;
|
||||
@Schema(description = "Nom du médecin sur certificat médical.", example = "M. Jean")
|
||||
String certificate;
|
||||
@Schema(description = "Validation de la licence", example = "true")
|
||||
boolean validate;
|
||||
|
||||
public static SimpleLicence fromModel(LicenceModel model) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.eclipse.microprofile.openapi.annotations.media.Schema;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -18,19 +19,33 @@ import java.util.Date;
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SimpleMembre {
|
||||
@Schema(description = "L'identifiant du membre.", example = "1")
|
||||
private long id;
|
||||
@Schema(description = "L'identifiant long du membre (userID).", example = "e81d1d35-d897-421e-8086-6c5e74d13c6e")
|
||||
private String userId;
|
||||
@Schema(description = "Le nom du membre.", example = "Dupont")
|
||||
private String lname = "";
|
||||
@Schema(description = "Le prénom du membre.", example = "Jean")
|
||||
private String fname = "";
|
||||
@Schema(description = "La catégorie du membre.", example = "SENIOR")
|
||||
private Categorie categorie;
|
||||
@Schema(description = "Le club du membre.")
|
||||
private SimpleClubModel club;
|
||||
@Schema(description = "Le genre du membre.", example = "H")
|
||||
private Genre genre;
|
||||
@Schema(description = "Le numéro de licence du membre.", example = "12345")
|
||||
private int licence;
|
||||
@Schema(description = "Le pays du membre.", example = "FR")
|
||||
private String country;
|
||||
@Schema(description = "La date de naissance du membre.")
|
||||
private Date birth_date;
|
||||
@Schema(description = "L'adresse e-mail du membre.", example = "jean.dupont@example.com")
|
||||
private String email;
|
||||
@Schema(description = "Le rôle du membre dans l'association.", example = "MEMBRE")
|
||||
private RoleAsso role;
|
||||
@Schema(description = "Le grade d'arbitrage du membre.", example = "N/A")
|
||||
private GradeArbitrage grade_arbitrage;
|
||||
@Schema(hidden = true)
|
||||
private String url_photo;
|
||||
|
||||
public static SimpleMembre fromModel(MembreModel model) {
|
||||
|
||||
@@ -15,15 +15,25 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SimpleReqAffiliation {
|
||||
@Schema(description = "Identifiant de la demande d'affiliation", example = "1")
|
||||
Long id;
|
||||
@Schema(description = "Identifiant du club", example = "1")
|
||||
Long club;
|
||||
@Schema(description = "Nom du club si club similar trouver (même siret)", example = "Association sportive")
|
||||
String club_name;
|
||||
@Schema(description = "Identifiant du club affilié", example = "1")
|
||||
Long club_no_aff;
|
||||
@Schema(description = "Nom du club demander", example = "Association sportive")
|
||||
String name;
|
||||
@Schema(description = "Numéro SIRET de l'association", example = "12345678901234")
|
||||
long siret;
|
||||
@Schema(description = "Numéro RNA de l'association", example = "W123456789")
|
||||
String RNA;
|
||||
@Schema(description = "Adresse de l'association", example = "1 rue de l'exemple, 75000 Paris")
|
||||
String address;
|
||||
@Schema(description = "Liste des membres pour la demande d'affiliation")
|
||||
List<AffiliationMember> members;
|
||||
@Schema(description = "Saison de l'affiliation", example = "2025")
|
||||
int saison;
|
||||
|
||||
public static SimpleReqAffiliation fromModel(AffiliationRequestModel model) {
|
||||
|
||||
@@ -5,15 +5,20 @@ import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.eclipse.microprofile.openapi.annotations.media.Schema;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SimpleReqAffiliationResume {
|
||||
@Schema(description = "L'identifiant de la demande d'affiliation.", example = "1")
|
||||
Long id;
|
||||
@Schema(description = "Le nom de l'association.", example = "Association sportive")
|
||||
String name;
|
||||
@Schema(description = "Le numéro SIRET de l'association.", example = "12345678901234")
|
||||
long siret;
|
||||
@Schema(description = "La saison de l'affiliation.", example = "2025")
|
||||
int saison;
|
||||
|
||||
public static SimpleReqAffiliationResume fromModel(AffiliationRequestModel model) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.quarkus.security.identity.SecurityIdentity;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.eclipse.microprofile.jwt.JsonWebToken;
|
||||
import org.eclipse.microprofile.openapi.annotations.media.Schema;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -14,14 +15,23 @@ import java.util.Set;
|
||||
@Builder
|
||||
@RegisterForReflection
|
||||
public class UserInfo {
|
||||
@Schema(description = "L'identifiant de l'utilisateur.", example = "1234567890")
|
||||
String id;
|
||||
@Schema(description = "Le nom complet de l'utilisateur.", example = "John Doe")
|
||||
String name;
|
||||
@Schema(description = "Le prénom de l'utilisateur.", example = "John")
|
||||
String givenName;
|
||||
@Schema(description = "Le nom de famille de l'utilisateur.", example = "Doe")
|
||||
String familyName;
|
||||
@Schema(description = "L'adresse e-mail de l'utilisateur.", example = "jihn.doe@test.fr")
|
||||
String email;
|
||||
@Schema(description = "L'adresse e-mail de l'utilisateur a été vérifiée.", example = "true")
|
||||
boolean emailVerified;
|
||||
@Schema(description = "La date d'expiration du token d'accès.")
|
||||
long expiration;
|
||||
@Schema(description = "La liste des groupes de l'utilisateur.")
|
||||
List<String> groups;
|
||||
@Schema(description = "La liste des rôles de l'utilisateur.")
|
||||
Set<String> roles;
|
||||
|
||||
public static UserInfo makeUserInfo(JsonWebToken accessToken, SecurityIdentity securityIdentity) {
|
||||
|
||||
Reference in New Issue
Block a user