Skip to content

Commit

Permalink
Merge branch 'release/0.0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Feb 2, 2022
2 parents e9ac134 + bdbe951 commit 230ca4c
Show file tree
Hide file tree
Showing 55 changed files with 1,085 additions and 472 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Java CI with Maven
on:
push:
branches:
- 'master'
- 'main'
- 'feature/**'
paths-ignore:
- '**.md'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/twitter-together.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
tweet:
name: Tweet
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: checkout master
- name: checkout main
uses: actions/checkout@v2
- name: Tweet
uses: gr2m/twitter-together@v1.x
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# [0.0.7](https://github.com/johnnymillergh/muscle-and-fitness-server/compare/0.0.6...0.0.7) (2022-02-02)


### Build System

* **$Bash:** support log to files ([8e876cf](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/8e876cf89ea403e835709afbc42cae669240d32d))


### Features

* **$OpenAPI:** integrate with OpenAPI 3 and Swagger ([f94ac9b](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/f94ac9b729708317a64b759c3474f9e82f7e8503))
* **$OpenFeign:** create an aspect for Feign log ([0808500](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/0808500841e9c4d2f4b6bbbf53fd8e0204ea5388))
* **$Pagination:** create functional pagination response composer ([6d4dbbb](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/6d4dbbb1add8a4181d857cf96abc1065b9478345))
* **$𝛌:** support predicator's retryFunction ([b1c4a06](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/b1c4a06a48c7372322ae6bded20997dc565e055d))


### Performance Improvements

* **$POM:** update dependencies ([fd29a5e](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/fd29a5edce26ae51c5a4bf59a2359bae799193eb))
* **$POM:** update dependencies ([c8f6817](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/c8f6817d259727296d39c3877126d53e782701f0))
* **$SpringBoot:** update Spring Boot and Spring Cloud ([3ac4ad9](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/3ac4ad9cc5f53226f4b0179bf9fd0aa5c0fbd890))


### Reverts

* **$Startup:** each application should have construction method ([57d3fe3](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/57d3fe34224441ceeaa07a87d21d3198a314f5ac))


### BREAKING CHANGES

* **$Bash:** support log to files



# [0.0.6](https://github.com/johnnymillergh/muscle-and-fitness-server/compare/0.0.5...0.0.6) (2021-10-02)


Expand Down
35 changes: 30 additions & 5 deletions api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.jmsoftware.maf</groupId>
<artifactId>muscle-and-fitness-server</artifactId>
<version>0.0.6</version>
<version>0.0.7</version>
</parent>

<!-- Build Settings -->
Expand Down Expand Up @@ -106,7 +106,7 @@
<to>
<image>docker.io/ijohnnymiller/${project.parent.artifactId}.${project.artifactId}</image>
<tags>
<tag>${project.version}</tag>
<tag>${git.commit.id.abbrev}-${project.version}</tag>
</tags>
</to>
<container>
Expand All @@ -132,6 +132,31 @@
</pluginExtensions>
</configuration>
</plugin>

<!-- https://github.com/git-commit-id/git-commit-id-maven-plugin -->
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<id>get-the-git-info</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
</configuration>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -163,9 +188,9 @@
</dependency>

<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>${knife4j.version}</version>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webflux-ui</artifactId>
<version>${springdoc-openapi-ui.version}</version>
</dependency>

<!-- Test -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package com.jmsoftware.maf.apigateway.universal.configuration;

import cn.hutool.core.collection.CollUtil;
import com.jmsoftware.maf.reactivespringcloudstarter.property.MafProjectProperties;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springdoc.core.AbstractSwaggerUiConfigProperties;
import org.springdoc.core.GroupedOpenApi;
import org.springdoc.core.SwaggerUiConfigProperties;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
* <h1>OpenApiConfiguration</h1>
* <p>
* Change description here.
*
* @author Johnny Miller (鍾俊), email: johnnysviva@outlook.com, 2/1/22 11:51 PM
**/
@Slf4j
@Configuration
@RequiredArgsConstructor
public class OpenApiConfiguration {
private static final String SWAGGER_API_URI = "/v3/api-docs";
private final SwaggerConfiguration swaggerConfiguration;
private final SwaggerUiConfigProperties swaggerUiConfigProperties;
private final MafProjectProperties mafProjectProperties;
private final DiscoveryClient discoveryClient;

@Bean
public OpenAPI openApi() {
val projectArtifactId = this.mafProjectProperties.getProjectArtifactId();
val version = this.mafProjectProperties.getVersion();
val developerEmail = this.mafProjectProperties.getDeveloperEmail();
val developerUrl = this.mafProjectProperties.getDeveloperUrl();
return new OpenAPI()
.info(
new Info()
.title(String.format("API for %s@%s", projectArtifactId, version))
.description(
String.format("%s, artifact ID: %s, environment: %s",
this.mafProjectProperties.getDescription(),
projectArtifactId,
this.mafProjectProperties.getEnvironment())
)
.contact(
new Contact()
.name(this.mafProjectProperties.getDeveloperName())
.email(developerEmail)
.url(developerUrl)
)
.version(version)
.license(new License().name("LinkedIn").url(developerUrl))
);
}

@Bean
public List<GroupedOpenApi> groupedOpenApiList() {
val services = CollUtil.newArrayList(this.discoveryClient.getServices());
services.add(this.mafProjectProperties.getProjectArtifactId());
val groups = CollUtil.<GroupedOpenApi>newArrayList();
this.swaggerUiConfigProperties.setUrls(CollUtil.newHashSet());
services.forEach(serviceName -> {
if (!CollUtil.contains(this.swaggerConfiguration.getIgnoredServiceIds(), serviceName)) {
log.warn("Found discovery client. Service name: {}", serviceName);
groups.add(GroupedOpenApi.builder().pathsToMatch("/" + serviceName + "/**").group(serviceName).build());
val swaggerUrl = new AbstractSwaggerUiConfigProperties.SwaggerUrl();
swaggerUrl.setUrl(serviceName + SWAGGER_API_URI);
swaggerUrl.setName(serviceName);
this.swaggerUiConfigProperties.getUrls().add(swaggerUrl);
}
});
return groups;
}
}

This file was deleted.

This file was deleted.

7 changes: 4 additions & 3 deletions api-gateway/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ server:

spring:
profiles:
active: @env@
active: @environment@
mvc:
throw-exception-if-no-handler-found: true
jackson:
Expand Down Expand Up @@ -94,9 +94,10 @@ maf:
- "/actuator/**"
- "/*/druid/**"
- "/swagger-resources/**"
- "/v2/api-docs/**"
- "/*/v2/api-docs/**"
- "/v3/api-docs/**"
- "/*/v3/api-docs/**"
- "/webjars/**"
- "/*/webjars/**"
- "/doc.html"
- "/oss-center/**"
- "/swagger-ui.html"
Loading

0 comments on commit 230ca4c

Please sign in to comment.