update swagger configure

This commit is contained in:
Mohd-Arham
2025-12-09 18:30:22 +05:30
parent 74e4f86d67
commit 13bfd34bbd
11 changed files with 322 additions and 119 deletions
@@ -0,0 +1,28 @@
package com.billpaymentservice.bbps.util;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
@Target({ ElementType.METHOD }) // where this annotation can be applied
@Retention(RetentionPolicy.RUNTIME) // available at runtime
@Documented
@ApiResponses({
@ApiResponse(responseCode = BBPSConstant.BADREQUEST_STR, description = "Bad request, invalid input data"),
// @ApiResponse(responseCode = ApplicationConstant.USER_UNAUTHORIZED_STR,
// description = "Unauthorized"),
@ApiResponse(responseCode = BBPSConstant.NOTFOUND_STR, description = "Resource not found"),
@ApiResponse(responseCode = BBPSConstant.INTERNALSERVER_ERROR_STR, description = "Internal server error"),
// 401 UNAUTHORIZED
@ApiResponse(responseCode = BBPSConstant.USER_UNAUTHORIZED_STR, description = "Unauthorized", content = @Content(mediaType = "application/json", schema = @Schema(example = "{ \"error\": \"Unauthorized\", \"message\": \"Missing or invalid token\" }"))), })
public @interface ApiDocCommonResponses {
}
@@ -93,7 +93,7 @@ public class BBPSConstant {
public static final String API_COMPLAINT_STATUS = "COMPLAINT_STATUS";
public static final String API_VIEW_COMPLAINT_HISTORY = "View_Complaint_History";
public static final String API_VIEW_COMPLAINT_BY_ID = "View_Complaint_By_ID";
public static final String API_GET_ALL_MASTER_OPTIONS = "View All Options Fetch By Id";
public static final String API_GET_ALL_MASTER_OPTIONS = "View_All_Options_Fetch_By_Id";
public static final String API_CHECK_TXN_STATUS = "CheckTxnStatus";
public static final String API_VIEW_ALL_COMPLAINTS_BY_STATUS = "View_All_Complaint_By_Status_Type";
public static final String API_VIEW_ALL_COMPLAINTS_BY_USER_ID = "View_All_Complaint_By_USER_ID";
@@ -213,4 +213,11 @@ public class BBPSConstant {
public static final String callbackurl = "https://11.godemo.in/BBPS/payment/callback/startPayment";
public static final String companyName = "testing.com";
// Swagger Configure status code using
public static final String BADREQUEST_STR = "300";
public static final String NOTFOUND_STR = "404";
public static final String INTERNALSERVER_ERROR_STR = "600";
public static final String USER_UNAUTHORIZED_STR = "401";
public static final String OK_STR = "200";
}