Skip to content

Commit

Permalink
perf($ApiGateway): rename module Gateway to API Gateway
Browse files Browse the repository at this point in the history
  - remove module `API Portal`
  - rename module `Gateway` to `API Gateway`

BREAKING CHANGE: remove module `API Portal`; rename module `Gateway` to
`API Gateway`
  • Loading branch information
Johnny Miller (锺俊) committed Dec 22, 2020
1 parent d29ba21 commit c367ca3
Show file tree
Hide file tree
Showing 131 changed files with 100 additions and 4,662 deletions.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions gateway/pom.xml → api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<modelVersion>4.0.0</modelVersion>

<!-- Sub-module Basics -->
<artifactId>gateway</artifactId>
<name>Muscle and Fitness Server :: Gateway</name>
<description>Gateway for Muscle and Fitness microservices.</description>
<artifactId>api-gateway</artifactId>
<name>Muscle and Fitness Server :: API Gateway</name>
<description>API Gateway for Muscle and Fitness microservices.</description>
<parent>
<groupId>com.jmsoftware.maf</groupId>
<artifactId>muscle-and-fitness-server</artifactId>
Expand Down Expand Up @@ -62,7 +62,7 @@
<jvmFlag>-Dfile.encoding=${project.build.sourceEncoding}</jvmFlag>
</jvmFlags>
<ports>
<port>${gateway.port}</port>
<port>${api-gateway.port}</port>
</ports>
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
</container>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.jmsoftware.maf.gateway;
package com.jmsoftware.maf.apigateway;

import com.jmsoftware.maf.gateway.universal.configuration.ProjectProperty;
import com.jmsoftware.maf.gateway.universal.configuration.ServerConfiguration;
import com.jmsoftware.maf.apigateway.universal.configuration.ProjectProperty;
import com.jmsoftware.maf.apigateway.universal.configuration.ServerConfiguration;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.boot.SpringApplication;
Expand All @@ -15,31 +15,30 @@
import java.util.TimeZone;

/**
* <h1>GatewayApplication</h1>
* <h1>ApiGatewayApplication</h1>
* <p>
* Change description here.
*
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com
* @date 2/15/20 3:56 PM
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com, date: 12/22/2020 3:39 PM
**/
@Slf4j
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
@EnableReactiveFeignClients
public class GatewayApplication {
public class ApiGatewayApplication {
private static final String LINE_SEPARATOR = System.lineSeparator();
private static ProjectProperty projectProperty;
private static ServerConfiguration serverConfiguration;

public GatewayApplication(ProjectProperty projectProperty, ServerConfiguration serverConfiguration) {
GatewayApplication.projectProperty = projectProperty;
GatewayApplication.serverConfiguration = serverConfiguration;
public ApiGatewayApplication(ProjectProperty projectProperty, ServerConfiguration serverConfiguration) {
ApiGatewayApplication.projectProperty = projectProperty;
ApiGatewayApplication.serverConfiguration = serverConfiguration;
}

public static void main(String[] args) {
val startInstant = Instant.now();
SpringApplication.run(GatewayApplication.class, args);
SpringApplication.run(ApiGatewayApplication.class, args);
val endInstant = Instant.now();
val duration = Duration.between(startInstant, endInstant);
log.info("🥳 Congratulations! 🎉");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.remoteapi;
package com.jmsoftware.maf.apigateway.remoteapi;

import com.jmsoftware.maf.common.bean.ResponseBodyBean;
import com.jmsoftware.maf.common.domain.authcenter.permission.GetPermissionListByUserIdResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.security;
package com.jmsoftware.maf.apigateway.security;

import com.jmsoftware.maf.muscleandfitnessserverreactivespringbootstarter.util.ResponseUtil;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.jmsoftware.maf.gateway.security;
package com.jmsoftware.maf.apigateway.security;

import cn.hutool.core.util.StrUtil;
import com.jmsoftware.maf.apigateway.remoteapi.AuthCenterRemoteApi;
import com.jmsoftware.maf.common.bean.ResponseBodyBean;
import com.jmsoftware.maf.common.domain.authcenter.user.GetUserByLoginTokenResponse;
import com.jmsoftware.maf.common.exception.BusinessException;
import com.jmsoftware.maf.gateway.remoteapi.AuthCenterRemoteApi;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.jmsoftware.maf.gateway.security;
package com.jmsoftware.maf.apigateway.security;

import cn.hutool.core.util.StrUtil;
import com.jmsoftware.maf.gateway.security.configuration.JwtConfiguration;
import com.jmsoftware.maf.apigateway.security.configuration.JwtConfiguration;
import com.jmsoftware.maf.muscleandfitnessserverreactivespringbootstarter.configuration.MafConfiguration;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.security;
package com.jmsoftware.maf.apigateway.security;

import com.jmsoftware.maf.common.exception.SecurityException;
import io.jsonwebtoken.Claims;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.jmsoftware.maf.gateway.security;
package com.jmsoftware.maf.apigateway.security;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.jmsoftware.maf.apigateway.security.configuration.JwtConfiguration;
import com.jmsoftware.maf.apigateway.universal.configuration.Constants;
import com.jmsoftware.maf.apigateway.universal.configuration.RedisService;
import com.jmsoftware.maf.common.constant.HttpStatus;
import com.jmsoftware.maf.common.exception.SecurityException;
import com.jmsoftware.maf.gateway.security.configuration.JwtConfiguration;
import com.jmsoftware.maf.gateway.universal.configuration.Constants;
import com.jmsoftware.maf.gateway.universal.configuration.RedisService;
import io.jsonwebtoken.*;
import io.jsonwebtoken.security.Keys;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.jmsoftware.maf.gateway.security;
package com.jmsoftware.maf.apigateway.security;

import cn.hutool.core.util.StrUtil;
import com.jmsoftware.maf.apigateway.remoteapi.AuthCenterRemoteApi;
import com.jmsoftware.maf.common.bean.ResponseBodyBean;
import com.jmsoftware.maf.common.domain.authcenter.permission.PermissionType;
import com.jmsoftware.maf.common.exception.BusinessException;
import com.jmsoftware.maf.gateway.remoteapi.AuthCenterRemoteApi;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.security;
package com.jmsoftware.maf.apigateway.security;

import com.jmsoftware.maf.muscleandfitnessserverreactivespringbootstarter.util.ResponseUtil;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.security;
package com.jmsoftware.maf.apigateway.security;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.security;
package com.jmsoftware.maf.apigateway.security;

import com.jmsoftware.maf.muscleandfitnessserverreactivespringbootstarter.configuration.MafConfiguration;
import com.jmsoftware.maf.muscleandfitnessserverreactivespringbootstarter.filter.AccessLogFilter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.jmsoftware.maf.gateway.security.configuration;
package com.jmsoftware.maf.apigateway.security.configuration;

import com.jmsoftware.maf.gateway.universal.configuration.ProjectProperty;
import com.jmsoftware.maf.apigateway.universal.configuration.ProjectProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.universal.configuration;
package com.jmsoftware.maf.apigateway.universal.configuration;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.apiportal.universal.configuration;
package com.jmsoftware.maf.apigateway.universal.configuration;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.universal.configuration;
package com.jmsoftware.maf.apigateway.universal.configuration;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.universal.configuration;
package com.jmsoftware.maf.apigateway.universal.configuration;

import lombok.extern.slf4j.Slf4j;
import lombok.val;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.apiportal.universal.service;
package com.jmsoftware.maf.apigateway.universal.configuration;

import java.io.Serializable;
import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.universal.configuration;
package com.jmsoftware.maf.apigateway.universal.configuration;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.universal.configuration;
package com.jmsoftware.maf.apigateway.universal.configuration;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.universal.configuration;
package com.jmsoftware.maf.apigateway.universal.configuration;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -27,7 +27,6 @@
* <p>
* https://blog.csdn.net/ttzommed/article/details/81103609
* <p>
* TODO: Refactor this class.
*
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com
* @date 2/15/20 5:40 PM
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.universal.configuration;
package com.jmsoftware.maf.apigateway.universal.configuration;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.config.ResourceHandlerRegistry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.jmsoftware.maf.gateway.universal.controller;
package com.jmsoftware.maf.apigateway.universal.controller;

import com.jmsoftware.maf.apigateway.remoteapi.AuthCenterRemoteApi;
import com.jmsoftware.maf.apigateway.universal.domain.ValidationTestPayload;
import com.jmsoftware.maf.apigateway.universal.service.CommonService;
import com.jmsoftware.maf.common.bean.ResponseBodyBean;
import com.jmsoftware.maf.gateway.remoteapi.AuthCenterRemoteApi;
import com.jmsoftware.maf.gateway.universal.domain.ValidationTestPayload;
import com.jmsoftware.maf.gateway.universal.service.CommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.universal.controller;
package com.jmsoftware.maf.apigateway.universal.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jmsoftware.maf.gateway.universal.domain;
package com.jmsoftware.maf.apigateway.universal.domain;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package com.jmsoftware.maf.apigateway.universal;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.jmsoftware.maf.gateway.universal.service;
package com.jmsoftware.maf.apigateway.universal.service;

import com.jmsoftware.maf.gateway.universal.domain.ValidationTestPayload;
import com.jmsoftware.maf.apigateway.universal.domain.ValidationTestPayload;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.jmsoftware.maf.gateway.universal.service.impl;
package com.jmsoftware.maf.apigateway.universal.service.impl;

import com.jmsoftware.maf.gateway.universal.configuration.ProjectProperty;
import com.jmsoftware.maf.gateway.universal.domain.ValidationTestPayload;
import com.jmsoftware.maf.gateway.universal.service.CommonService;
import com.jmsoftware.maf.apigateway.universal.configuration.ProjectProperty;
import com.jmsoftware.maf.apigateway.universal.domain.ValidationTestPayload;
import com.jmsoftware.maf.apigateway.universal.service.CommonService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package com.jmsoftware.maf.apigateway.universal.util;
10 changes: 10 additions & 0 deletions api-gateway/src/main/resources/application-development-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eureka:
client:
serviceUrl:
defaultZone: http://maf.service-registry.dev:8760/eureka/

spring:
zipkin:
base-url: http://maf.open-zipkin.dev:9411
devtools:
add-properties: true
10 changes: 10 additions & 0 deletions api-gateway/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eureka:
client:
serviceUrl:
defaultZone: http://maf.service-registry.production:8760/eureka/

spring:
zipkin:
base-url: http://maf.open-zipkin.production:9411
devtools:
add-properties: false
10 changes: 10 additions & 0 deletions api-gateway/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eureka:
client:
serviceUrl:
defaultZone: http://maf.service-registry.stage:8760/eureka/

spring:
zipkin:
base-url: http://maf.open-zipkin.stage:9411
devtools:
add-properties: false
10 changes: 10 additions & 0 deletions api-gateway/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eureka:
client:
serviceUrl:
defaultZone: http://maf.service-registry.test:8760/eureka/

spring:
zipkin:
base-url: http://maf.open-zipkin.test:9411
devtools:
add-properties: false
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
port: @gateway.port@
port: @api-gateway.port@
tomcat:
uri-encoding: @project.build.sourceEncoding@

Expand Down Expand Up @@ -93,7 +93,6 @@ project:
developer-email: @developerEmail@
developer-url: @developerUrl@


maf:
configuration:
ignored-url:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.jmsoftware.maf.apiportal;
package com.jmsoftware.maf.apigateway;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class ApiPortalApplicationTests {
class ApiGatewayApplicationTests {

@Test
void contextLoads() {
Expand Down
Loading

0 comments on commit c367ca3

Please sign in to comment.