Skip to content

Commit

Permalink
upgrade swagger to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudFonzam committed Jul 6, 2023
1 parent 755903b commit 819d939
Show file tree
Hide file tree
Showing 97 changed files with 956 additions and 727 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
<artifactId>modelmapper</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
Expand Down
25 changes: 12 additions & 13 deletions src/main/java/org/isf/accounting/dto/BillDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@

import org.isf.patient.dto.PatientDTO;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;

@ApiModel(description = "Class representing a bill")
@Schema(description = "Class representing a bill")
public class BillDTO {

private Integer id;
Expand All @@ -40,43 +39,43 @@ public class BillDTO {
private Integer listId;

@NotNull
@ApiModelProperty(notes = "Date of bill creation", example="2020-03-19T14:58:00.000Z", position = 1)
@Schema(description = "Date of bill creation", example="2020-03-19T14:58:00.000Z", format = "LocalDateTime")
private LocalDateTime date;

@NotNull
@ApiModelProperty(notes = "Date of bill updated", example="2020-03-19T14:58:00.000Z", position = 2)
@Schema(description = "Date of bill updated", example="2020-03-19T14:58:00.000Z", format = "LocalDateTime")
private LocalDateTime update;

@NotNull
@ApiModelProperty(notes = "boolean which tells if a price list is applied", example="true", position = 3)
@Schema(description = "boolean which tells if a price list is applied", example="true")
private boolean isList;

@NotNull
@ApiModelProperty(notes = "Price list name", example="Basic", position = 4)
@Schema(description = "Price list name", example="Basic")
private String listName;

@NotNull
@ApiModelProperty(notes = "Is bill belongs to a patient?", example="true", position = 5)
@Schema(description = "Is bill belongs to a patient?", example="true")
private boolean patientTrue;

@NotNull
@ApiModelProperty(notes = "patient name", example="Mario Rossi", position = 6)
@Schema(description = "patient name", example="Mario Rossi")
private String patName;

@NotNull
@ApiModelProperty(notes = "Bill status", example="O", position = 7)
@Schema(description = "Bill status", example="O")
private String status;

@NotNull
@ApiModelProperty(notes = "Bill Amount", example="1000", position = 8)
@Schema(description = "Bill Amount", example="1000")
private Double amount;

@NotNull
@ApiModelProperty(notes = "Bill balance", example="1500", position = 9)
@Schema(description = "Bill balance", example="1500")
private Double balance;

@NotNull
@ApiModelProperty(notes = "user name who create the bill", example="admin", position = 10)
@Schema(description = "user name who create the bill", example="admin")
private String user;

public Integer getId() {
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/org/isf/accounting/dto/BillItemsDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,47 +23,47 @@

import javax.validation.constraints.NotNull;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.AccessMode;

@ApiModel(description = "Class representing a billItem")
@Schema(description = "Class representing a billItem")
public class BillItemsDTO {

private Integer id;

@ApiModelProperty(notes = "Bill id", example="", position = 1)
@Schema(description = "Bill id", example="")
private Integer billId;

@ApiModelProperty(notes = "check if it is a price", example="true", position = 2)
@Schema(description = "check if it is a price", example="true")
private boolean isPrice;

@NotNull
@ApiModelProperty(notes = "The price Id", example="104", position = 3)
@Schema(description = "The price Id", example="104")
private String priceId;

@NotNull
@ApiModelProperty(notes = "item description", example="Acetone 99 % 1ltr", position = 4)
@Schema(description = "item description", example="Acetone 99 % 1ltr")
private String itemDescription;

@NotNull
@ApiModelProperty(notes = "item amount", example="1000", position = 5)
@Schema(description = "item amount", example="1000")
private double itemAmount;

@NotNull
@ApiModelProperty(notes = "item quantity", example="1", position = 6)
@Schema(description = "item quantity", example="1")
private int itemQuantity;

@NotNull
@ApiModelProperty(notes = "item display code", example="Acetone", position = 7)
@Schema(description = "item display code", example="Acetone")
private String itemDisplayCode;

@NotNull
@ApiModelProperty(notes = "item id", example="3", position = 8)
@Schema(description = "item id", example="3")
private String itemId;

private volatile int hashCode;

@ApiModelProperty(hidden=true)
@Schema(accessMode = AccessMode.READ_ONLY)
public int getHashCode() {
return hashCode;
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/isf/accounting/dto/BillPaymentsDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@

import javax.validation.constraints.NotNull;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.AccessMode;

@ApiModel(description = "Class representing a billPayment")
@Schema(description = "Class representing a billPayment")
public class BillPaymentsDTO {

private Integer id;

@NotNull
@ApiModelProperty(notes = "Bill id", example="", position = 1)
@Schema(description = "Bill id", example="")
private Integer billId;

@NotNull
@ApiModelProperty(notes = "date of payment", example="2020-03-19T14:58:00.000Z", position = 2)
@Schema(description = "date of payment", example="2020-03-19T14:58:00.000Z")
private LocalDateTime date;

@NotNull
@ApiModelProperty(notes = "the payment amount", example="500", position = 3)
@Schema(description = "the payment amount", example="500")
private double amount;

@NotNull
@ApiModelProperty(notes = "the current user", example="admin", position = 4)
@Schema(description = "the current user", example="admin")
private String user;

private volatile int hashCode;
Expand All @@ -71,7 +71,7 @@ public String getUser() {
return this.user;
}

@ApiModelProperty(hidden=true)
@Schema(accessMode = AccessMode.READ_ONLY)
public int getHashCode() {
return hashCode;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/isf/accounting/dto/FullBillDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@

import javax.validation.constraints.NotNull;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;

public class FullBillDTO {

@NotNull
@ApiModelProperty(notes = "bill element", position = 1)
@Schema(description = "bill element")
private BillDTO bill;

@NotNull
@ApiModelProperty(notes = "list of bill items elements", position = 2)
@Schema(description = "list of bill items elements")
private List<BillItemsDTO> billItems;

@ApiModelProperty(notes = "list of bill payments elements", position = 3)
@Schema(description = "list of bill payments elements")
private List<BillPaymentsDTO> billPayments;

public BillDTO getBill() {
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/org/isf/accounting/rest/BillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.Authorization;

@RestController
@Api(value="/bills",produces = MediaType.APPLICATION_JSON_VALUE, authorizations = {@Authorization(value="apiKey")})
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;

@RestController(value = "/bills")
@OpenAPIDefinition(
info = @Info(title = "bills API", version = "1.0.0"),
security = {
@SecurityRequirement(name = "apiKey")
}
)
public class BillController {

private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(BillController.class);
Expand Down
63 changes: 32 additions & 31 deletions src/main/java/org/isf/admission/dto/AdmissionDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,93 +35,94 @@
import org.isf.pregtreattype.dto.PregnantTreatmentTypeDTO;
import org.isf.ward.dto.WardDTO;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.AccessMode;

/**
* @author gildas
*/
public class AdmissionDTO {

@ApiModelProperty(notes = "admission key", example = "12", position = 1)
@Schema(description = "admission key", example = "12")
private int id;

@NotNull
@ApiModelProperty(notes = "if admitted or not", example = "0", position = 2)
@Schema(description = "if admitted or not", example = "0")
private int admitted;

@NotNull
@ApiModelProperty(notes = "type of admission", example = "N", position = 3)
@Schema(description = "type of admission", example = "N")
private String type;

@ApiModelProperty(notes = "ward", position = 4)
@Schema(description = "ward")
private WardDTO ward;

@NotNull
@ApiModelProperty(notes = "a progr. in year for each ward", example = "1", position = 5)
@Schema(description = "a progr. in year for each ward", example = "1")
private int yProg;

@ApiModelProperty(notes = "patient", position = 6)
@Schema(description = "patient")
private PatientDTO patient;

@NotNull
@ApiModelProperty(notes = "admission date", position = 7)
@Schema(description = "admission date", format = "LocalDateTime")
private LocalDateTime admDate;

@ApiModelProperty(notes = "admission type", position = 8)
@Schema(description = "admission type")
private AdmissionTypeDTO admType;

@ApiModelProperty(notes = "FromHealthUnit", position = 9)
@Schema(description = "FromHealthUnit")
private String FHU;

@ApiModelProperty(notes = "disease in ", position = 10)
@Schema(description = "disease in ")
private DiseaseDTO diseaseIn;

@ApiModelProperty(notes = "disease out ", position = 11)
@Schema(description = "disease out ")
private DiseaseDTO diseaseOut1;

@ApiModelProperty(notes = "disease out ", position = 12)
@Schema(description = "disease out ")
private DiseaseDTO diseaseOut2;

@ApiModelProperty(notes = "disease out ", position = 13)
@Schema(description = "disease out ")
private DiseaseDTO diseaseOut3;

@ApiModelProperty(notes = "operation ", position = 14)
@Schema(description = "operation ")
private OperationDTO operation;

@ApiModelProperty(notes = "operation date", position = 15)
@Schema(description = "operation date", format = "LocalDateTime")
private LocalDateTime opDate;

@ApiModelProperty(notes = "operation result value is 'P' or 'N' ", example = "N", position = 16)
@Schema(description = "operation result value is 'P' or 'N' ", example = "N")
private String opResult;

@ApiModelProperty(notes = "discharge date", position = 17)
@Schema(description = "discharge date", format = "LocalDateTime")
private LocalDateTime disDate;

@ApiModelProperty(notes = "disChargeType", position = 18)
@Schema(description = "disChargeType")
private DischargeTypeDTO disType;

@ApiModelProperty(notes = "free note", position = 19)
@Schema(description = "free note")
private String note;

@ApiModelProperty(notes = "transfusional unit", position = 20)
@Schema(description = "transfusional unit")
private Float transUnit;

@ApiModelProperty(notes = "visit date", position = 21)
@Schema(description = "visit date", format = "LocalDateTime")
private LocalDateTime visitDate;

@ApiModelProperty(notes = "treatmentType ", position = 22)
@Schema(description = "treatmentType ")
private PregnantTreatmentTypeDTO pregTreatmentType;

@ApiModelProperty(notes = "delivery date", position = 23)
@Schema(description = "delivery date", format = "LocalDateTime")
private LocalDateTime deliveryDate;

@ApiModelProperty(notes = "delivery type", position = 24)
@Schema(description = "delivery type")
private DeliveryTypeDTO deliveryType;

@ApiModelProperty(notes = "delivery type ", position = 25)
@Schema(description = "delivery type ")
private DeliveryResultTypeDTO deliveryResult;

@ApiModelProperty(notes = "weight", position = 26)
@Schema(description = "weight")
private Float weight;

private LocalDateTime ctrlDate1;
Expand All @@ -130,16 +131,16 @@ public class AdmissionDTO {

private LocalDateTime abortDate;

@ApiModelProperty(notes = "weight", position = 30)
@Schema(description = "weight")
private String userID;

private int hashCode;

@ApiModelProperty(notes = "lock", example = "0", position = 31)
@Schema(description = "lock", example = "0")
private int lock;

@NotNull
@ApiModelProperty(notes = "flag record deleted, values are 'Y' OR 'N' ", example = "N", position = 32)
@Schema(description = "flag record deleted, values are 'Y' OR 'N' ", example = "N")
private String deleted;

public int getId() {
Expand Down Expand Up @@ -266,7 +267,7 @@ public String getDeleted() {
return this.deleted;
}

@ApiModelProperty(hidden=true)
@Schema(accessMode = AccessMode.READ_ONLY)
public int getHashCode() {
return hashCode;
}
Expand Down
Loading

0 comments on commit 819d939

Please sign in to comment.