Startes Swagger Documentation
This commit is contained in:
parent
ea006b3915
commit
742d2b5d66
@ -7,7 +7,7 @@ plugins {
|
|||||||
apply plugin: 'io.spring.dependency-management'
|
apply plugin: 'io.spring.dependency-management'
|
||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
apply plugin: 'com.moowork.node'
|
apply plugin: 'com.moowork.node'
|
||||||
apply plugin: 'war'
|
//apply plugin: 'war'
|
||||||
|
|
||||||
group = 'de.hhn.labsw'
|
group = 'de.hhn.labsw'
|
||||||
version = '0.0.1-SNAPSHOT'
|
version = '0.0.1-SNAPSHOT'
|
||||||
@ -47,13 +47,17 @@ dependencies {
|
|||||||
compile group: 'org.springframework.security', name: 'spring-security-core', version: '5.1.4.RELEASE'
|
compile group: 'org.springframework.security', name: 'spring-security-core', version: '5.1.4.RELEASE'
|
||||||
//compile group: 'at.favre.lib', name: 'bcrypt', version: '{latest-version}'
|
//compile group: 'at.favre.lib', name: 'bcrypt', version: '{latest-version}'
|
||||||
|
|
||||||
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
|
//providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
|
||||||
|
|
||||||
//JWT
|
//JWT
|
||||||
compile 'io.jsonwebtoken:jjwt-api:0.10.5'
|
compile 'io.jsonwebtoken:jjwt-api:0.10.5'
|
||||||
runtime 'io.jsonwebtoken:jjwt-impl:0.10.5',
|
runtime 'io.jsonwebtoken:jjwt-impl:0.10.5',
|
||||||
'io.jsonwebtoken:jjwt-jackson:0.10.5'
|
'io.jsonwebtoken:jjwt-jackson:0.10.5'
|
||||||
|
|
||||||
|
compile "io.springfox:springfox-swagger2:2.9.2"
|
||||||
|
|
||||||
|
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.0.2'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
node {
|
node {
|
||||||
|
|||||||
@ -61,8 +61,8 @@
|
|||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
user: {
|
user: {
|
||||||
email: "volkmann@geocaching.de",
|
email: "",
|
||||||
password: "0123456789",
|
password: "",
|
||||||
//token: "",
|
//token: "",
|
||||||
// evalAuthentication: false
|
// evalAuthentication: false
|
||||||
},
|
},
|
||||||
|
|||||||
@ -6,8 +6,15 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
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;
|
||||||
|
|
||||||
@SpringBootApplication(exclude = { SecurityAutoConfiguration.class })
|
@SpringBootApplication(exclude = { SecurityAutoConfiguration.class })
|
||||||
|
@EnableSwagger2
|
||||||
public class Application extends SpringBootServletInitializer{
|
public class Application extends SpringBootServletInitializer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -18,4 +25,13 @@ public class Application extends SpringBootServletInitializer{
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Application.class, args);
|
SpringApplication.run(Application.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Docket swagger(){
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.select()
|
||||||
|
.apis(RequestHandlerSelectors.any())
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@CrossOrigin(origins = "*", allowedHeaders = "*") // only for dev purpose
|
@CrossOrigin(origins = "*", allowedHeaders = "*") // only for dev purpose
|
||||||
@RequestMapping("/api/allCaches")
|
@RequestMapping(value = "/api/allCaches", method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity getAllCaches() {
|
public ResponseEntity getAllCaches() {
|
||||||
return ResponseEntity.status(200).body(new Gson().toJson(cacheRepository.findAll()));
|
return ResponseEntity.status(200).body(new Gson().toJson(cacheRepository.findAll()));
|
||||||
|
|||||||
@ -20,7 +20,7 @@ public class VerificationUtil {
|
|||||||
public static void fetchPublicKey() {
|
public static void fetchPublicKey() {
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
try {
|
try {
|
||||||
PublicKey response = restTemplate.getForObject("http://seserver.se.hs-heilbronn.de:8090/buga19usermanagement/token/publickey", PublicKey.class);
|
PublicKey response = restTemplate.getForObject("http://seserver.se.hs-heilbronn.de:9080/buga19usermanagement/token/publickey", PublicKey.class);
|
||||||
byte[] decodedKey = Base64.getDecoder().decode(response.getMessage());
|
byte[] decodedKey = Base64.getDecoder().decode(response.getMessage());
|
||||||
KeyFactory factory = KeyFactory.getInstance("RSA");
|
KeyFactory factory = KeyFactory.getInstance("RSA");
|
||||||
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(decodedKey);
|
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(decodedKey);
|
||||||
|
|||||||
@ -5,4 +5,5 @@ spring.jmx.default-domain=buga19geocaching
|
|||||||
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
|
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
|
||||||
spring.jooq.sql-dialect=org.hibernate.dialect.MariaDBDialect
|
spring.jooq.sql-dialect=org.hibernate.dialect.MariaDBDialect
|
||||||
spring.jpa.hibernate.ddl-auto=update
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
spring.jpa.show-sql=true
|
spring.jpa.show-sql=true
|
||||||
|
debug=true
|
||||||
Loading…
Reference in New Issue
Block a user