Skip to content

Commit

Permalink
perf($VarAndVal): synchronize codes
Browse files Browse the repository at this point in the history
CommonController.java
Swagger2Configuration.java
  • Loading branch information
johnnymillergh committed May 8, 2020
1 parent 941a87a commit e94b1d1
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jmsoftware.authcenter.universal.configuration;

import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
Expand Down Expand Up @@ -39,11 +40,11 @@ public Docket createRestApi() {
}

private ApiInfo apiInfo() {
var projectArtifactId = projectProperty.getProjectArtifactId();
var version = projectProperty.getVersion();
var developerEmail = projectProperty.getDeveloperEmail();
var developerUrl = projectProperty.getDeveloperUrl();
var environmentAlias = projectProperty.getEnvironmentAlias();
val projectArtifactId = projectProperty.getProjectArtifactId();
val version = projectProperty.getVersion();
val developerEmail = projectProperty.getDeveloperEmail();
val developerUrl = projectProperty.getDeveloperUrl();
val environmentAlias = projectProperty.getEnvironmentAlias();
return new ApiInfoBuilder()
.title(String.format("API for %s@%s (%s)",
projectArtifactId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
Expand All @@ -30,7 +31,7 @@ public class CommonController {
@GetMapping("/app-info")
@ApiOperation(value = "/app-info", notes = "Retrieve application information")
public ResponseBodyBean<Map<String, Object>> applicationInformation() {
var data = commonService.getApplicationInfo();
val data = commonService.getApplicationInfo();
redisService.set("appInfo", data.toString());
return ResponseBodyBean.ofSuccess(data, "Succeed to retrieve app info.");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jmsoftware.exercisemis.universal.configuration;

import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
Expand Down Expand Up @@ -39,11 +40,11 @@ public Docket createRestApi() {
}

private ApiInfo apiInfo() {
var projectArtifactId = projectProperty.getProjectArtifactId();
var version = projectProperty.getVersion();
var developerEmail = projectProperty.getDeveloperEmail();
var developerUrl = projectProperty.getDeveloperUrl();
var environmentAlias = projectProperty.getEnvironmentAlias();
val projectArtifactId = projectProperty.getProjectArtifactId();
val version = projectProperty.getVersion();
val developerEmail = projectProperty.getDeveloperEmail();
val developerUrl = projectProperty.getDeveloperUrl();
val environmentAlias = projectProperty.getEnvironmentAlias();
return new ApiInfoBuilder()
.title(String.format("API for %s@%s (%s)",
projectArtifactId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
Expand All @@ -28,7 +29,7 @@ public class CommonController {
@GetMapping("/app-info")
@ApiOperation(value = "/app-info", notes = "Retrieve application information")
public ResponseBodyBean<Map<String, Object>> applicationInformation() {
var data = commonService.getApplicationInfo();
val data = commonService.getApplicationInfo();
return ResponseBodyBean.ofSuccess(data, "Succeed to retrieve app info.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
Expand All @@ -28,7 +29,7 @@ public class CommonController {
@GetMapping("/app-info")
@ApiOperation(value = "/app-info", notes = "Retrieve application information")
public ResponseBodyBean<Map<String, Object>> applicationInformation() {
var data = commonService.getApplicationInfo();
val data = commonService.getApplicationInfo();
return ResponseBodyBean.ofSuccess(data, "Succeed to retrieve app info.");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jmsoftware.musclemis.universal.configuration;

import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
Expand Down Expand Up @@ -39,11 +40,11 @@ public Docket createRestApi() {
}

private ApiInfo apiInfo() {
var projectArtifactId = projectProperty.getProjectArtifactId();
var version = projectProperty.getVersion();
var developerEmail = projectProperty.getDeveloperEmail();
var developerUrl = projectProperty.getDeveloperUrl();
var environmentAlias = projectProperty.getEnvironmentAlias();
val projectArtifactId = projectProperty.getProjectArtifactId();
val version = projectProperty.getVersion();
val developerEmail = projectProperty.getDeveloperEmail();
val developerUrl = projectProperty.getDeveloperUrl();
val environmentAlias = projectProperty.getEnvironmentAlias();
return new ApiInfoBuilder()
.title(String.format("API for %s@%s (%s)",
projectArtifactId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
Expand All @@ -28,7 +29,7 @@ public class CommonController {
@GetMapping("/app-info")
@ApiOperation(value = "/app-info", notes = "Retrieve application information")
public ResponseBodyBean<Map<String, Object>> applicationInformation() {
var data = commonService.getApplicationInfo();
val data = commonService.getApplicationInfo();
return ResponseBodyBean.ofSuccess(data, "Succeed to retrieve app info.");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jmsoftware.serviceregistry.universal.configuration;

import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
Expand Down Expand Up @@ -39,11 +40,11 @@ public Docket createRestApi() {
}

private ApiInfo apiInfo() {
var projectArtifactId = projectProperty.getProjectArtifactId();
var version = projectProperty.getVersion();
var developerEmail = projectProperty.getDeveloperEmail();
var developerUrl = projectProperty.getDeveloperUrl();
var environmentAlias = projectProperty.getEnvironmentAlias();
val projectArtifactId = projectProperty.getProjectArtifactId();
val version = projectProperty.getVersion();
val developerEmail = projectProperty.getDeveloperEmail();
val developerUrl = projectProperty.getDeveloperUrl();
val environmentAlias = projectProperty.getEnvironmentAlias();
return new ApiInfoBuilder()
.title(String.format("API for %s@%s (%s)",
projectArtifactId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
Expand All @@ -28,7 +29,7 @@ public class CommonController {
@GetMapping("/app-info")
@ApiOperation(value = "/app-info", notes = "Retrieve application information")
public ResponseBodyBean<Map<String, Object>> applicationInformation() {
var data = commonService.getApplicationInfo();
val data = commonService.getApplicationInfo();
return ResponseBodyBean.ofSuccess(data, "Succeed to retrieve app info.");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jmsoftware.springbootadmin.universal.configuration;

import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
Expand Down Expand Up @@ -39,11 +40,11 @@ public Docket createRestApi() {
}

private ApiInfo apiInfo() {
var projectArtifactId = projectProperty.getProjectArtifactId();
var version = projectProperty.getVersion();
var developerEmail = projectProperty.getDeveloperEmail();
var developerUrl = projectProperty.getDeveloperUrl();
var environmentAlias = projectProperty.getEnvironmentAlias();
val projectArtifactId = projectProperty.getProjectArtifactId();
val version = projectProperty.getVersion();
val developerEmail = projectProperty.getDeveloperEmail();
val developerUrl = projectProperty.getDeveloperUrl();
val environmentAlias = projectProperty.getEnvironmentAlias();
return new ApiInfoBuilder()
.title(String.format("API for %s@%s (%s)",
projectArtifactId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
Expand All @@ -28,7 +29,7 @@ public class CommonController {
@GetMapping("/app-info")
@ApiOperation(value = "/app-info", notes = "Retrieve application information")
public ResponseBodyBean<Map<String, Object>> applicationInformation() {
var data = commonService.getApplicationInfo();
val data = commonService.getApplicationInfo();
return ResponseBodyBean.ofSuccess(data, "Succeed to retrieve app info.");
}

Expand Down

0 comments on commit e94b1d1

Please sign in to comment.