chore(init): Scaffold video platform microservices
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package com.nuaa.video.gateway;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
public class GatewayApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GatewayApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
server:
|
||||
port: 9000
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: video-gateway
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: public
|
||||
group: DEFAULT_GROUP
|
||||
gateway:
|
||||
discovery:
|
||||
locator:
|
||||
enabled: true
|
||||
lower-case-service-id: true
|
||||
routes:
|
||||
- id: video-auth
|
||||
uri: lb://video-auth
|
||||
predicates:
|
||||
- Path=/auth/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: video-user
|
||||
uri: lb://video-user
|
||||
predicates:
|
||||
- Path=/user/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: video-content
|
||||
uri: lb://video-content
|
||||
predicates:
|
||||
- Path=/content/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: video-comment
|
||||
uri: lb://video-comment
|
||||
predicates:
|
||||
- Path=/comment/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: video-recommend
|
||||
uri: lb://video-recommend
|
||||
predicates:
|
||||
- Path=/recommend/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: video-admin
|
||||
uri: lb://video-admin
|
||||
predicates:
|
||||
- Path=/admin/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
sentinel:
|
||||
transport:
|
||||
dashboard: localhost:8080
|
||||
port: 8719
|
||||
eager: true
|
||||
scg:
|
||||
fallback:
|
||||
mode: response
|
||||
response-body: '{"code":500,"message":"服务不可用,请稍后再试"}'
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.nuaa.video.gateway;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public AppTest( String testName )
|
||||
{
|
||||
super( testName );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite( AppTest.class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testApp()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user