Adding the first interation of the example projects
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package ro.stefan;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SwaggerGroupingExampleApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SwaggerGroupingExampleApp.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package ro.stefan.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
@Configuration
|
||||
public class SpringFoxConfig {
|
||||
|
||||
@Bean
|
||||
public Docket api1() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.groupName("address")
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("ro.stefan.external.apis.address"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public Docket api2() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.groupName("accouting")
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("ro.stefan.external.apis.accounting"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package ro.stefan.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class BookController {
|
||||
|
||||
@GetMapping("/books")
|
||||
public List<String> getBooks(){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package ro.stefan.external.apis.accounting.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class AccountingController {
|
||||
|
||||
@GetMapping("/accounts")
|
||||
public List<String> getAccounts(){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package ro.stefan.external.apis.address.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class AddressController {
|
||||
|
||||
@GetMapping("/addresses")
|
||||
public List<String> getAddresses(){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
16
SwaggerGroupingExample/src/main/java/ro/stefan/external/apis/loan/controller/LoanController.java
vendored
Normal file
16
SwaggerGroupingExample/src/main/java/ro/stefan/external/apis/loan/controller/LoanController.java
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
package ro.stefan.external.apis.loan.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "loan")
|
||||
public class LoanController {
|
||||
|
||||
@GetMapping("/loan")
|
||||
public String getLoanDetails() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package ro.stefan.external.apis.security.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "security")
|
||||
public class SecurityController {
|
||||
@GetMapping("/user")
|
||||
public String getUser() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user