WIP
This commit is contained in:
@@ -6,6 +6,10 @@ dependencies {
|
||||
|
||||
annotationProcessor('org.springframework.boot:spring-boot-configuration-processor')
|
||||
implementation('org.springframework.boot:spring-boot-starter-web')
|
||||
|
||||
implementation(group: 'io.swagger', name: 'swagger-annotations', version: '1.5.21')
|
||||
implementation(group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2')
|
||||
implementation(group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2')
|
||||
}
|
||||
|
||||
tasks.named('compileJava') {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package ru.di9.mirror.web.config;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@EnableWebMvc
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Bean
|
||||
public Docket api() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.di9.mirror.web.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
@@ -23,6 +25,7 @@ import java.util.Optional;
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequestMapping(path = "/maven")
|
||||
@Api("API:DOCS")
|
||||
public class MavenController {
|
||||
private final StorageService storageService;
|
||||
|
||||
@@ -30,6 +33,7 @@ public class MavenController {
|
||||
this.storageService = storageService;
|
||||
}
|
||||
|
||||
@ApiOperation("get file")
|
||||
@GetMapping(path = "/{*path}")
|
||||
public ResponseEntity<Resource> mavenGetFile(@PathVariable("path") String httpPath) {
|
||||
ResponseEntity<Resource> responseEntity;
|
||||
|
||||
@@ -2,7 +2,7 @@ server:
|
||||
address: 127.0.0.1
|
||||
port: 8080
|
||||
|
||||
debug: false
|
||||
debug: true
|
||||
|
||||
maven:
|
||||
storage: './storage'
|
||||
|
||||
Reference in New Issue
Block a user