add Swagger module
This commit is contained in:
32
swagger/pom.xml
Normal file
32
swagger/pom.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>sydney.cheng</groupId>
|
||||
<artifactId>ec-microservice-commons</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>cheng.edward</groupId>
|
||||
<artifactId>ec-microservice-commons-swagger</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<!-- Dependency Versions -->
|
||||
<springdoc-openapi-starter-common.version>2.6.0</springdoc-openapi-starter-common.version>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-common</artifactId>
|
||||
<version>${springdoc-openapi-starter-common.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,17 @@
|
||||
package cheng.edward.microservice.commons.swagger.config;
|
||||
|
||||
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
||||
import io.swagger.v3.oas.annotations.info.Info;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityScheme;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@OpenAPIDefinition(info = @Info(title = "MediRecords Secure Message API", version = "v1"))
|
||||
@SecurityScheme(
|
||||
name = "Authentication Token",
|
||||
type = SecuritySchemeType.HTTP,
|
||||
scheme = "bearer"
|
||||
)
|
||||
public class SwaggerConfiguration {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package cheng.edward.microservice.commons.swagger.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
|
||||
@SecurityRequirement(name = "Authentication Token")
|
||||
public interface SecuredController {
|
||||
}
|
||||
Reference in New Issue
Block a user