yonge 5 years ago
parent
commit
3916e873a4

+ 25 - 0
mec-education/src/main/java/com/ym/mec/education/EducationApplication.java

@@ -0,0 +1,25 @@
+package com.ym.mec.education;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+import com.spring4all.swagger.EnableSwagger2Doc;
+
+@SpringBootApplication
+@EnableDiscoveryClient
+@EnableFeignClients("com.ym.mec")
+@MapperScan("com.ym.mec.biz.dal.dao")
+@ComponentScan(basePackages = "com.ym.mec")
+@Configuration
+@EnableSwagger2Doc
+public class EducationApplication {
+	public static void main(String[] args) {
+		SpringApplication.run(EducationApplication.class, args);
+	}
+
+}

+ 3 - 0
mec-gateway/mec-gateway-web/src/main/java/com/ym/mec/gateway/web/config/SwaggerDocumentConfig.java

@@ -22,6 +22,9 @@ public class SwaggerDocumentConfig implements SwaggerResourcesProvider {
 		resources.add(swaggerResource("CMS服务", "/cms-server/v2/api-docs", "2.0"));
 		resources.add(swaggerResource("WEB服务", "/web-server/v2/api-docs", "2.0"));
 		resources.add(swaggerResource("TASK服务", "/task-server/v2/api-docs", "2.0"));
+		resources.add(swaggerResource("STUDENT服务", "/student-server/v2/api-docs", "2.0"));
+		resources.add(swaggerResource("TEACHER服务", "/teacher-server/v2/api-docs", "2.0"));
+		resources.add(swaggerResource("EDUCATION服务", "/education-server/v2/api-docs", "2.0"));
 		return resources;
 	}
 

+ 9 - 4
mec-gateway/mec-gateway-web/src/main/resources/application.yml

@@ -41,12 +41,17 @@ zuul:
       ##加上下面参数,可将header信息传递至下游
       #sensitiveHeaders: 
     api-web:
-      ### 以 /api-auth/访问转发到会员服务
       path: /api-web/**
       serviceId: web-server
-      #url: http://localhost:8001/
-      ##加上下面参数,可将header信息传递至下游
-      #sensitiveHeaders: 
+    api-teacher:
+      path: /api-teacher/**
+      serviceId: teacher-server
+    api-student:
+      path: /api-student/**
+      serviceId: student-server
+    api-education:
+      path: /api-education/**
+      serviceId: education-server
   #忽略某个微服务
   ignored-services: eureka-server
   #重试

+ 25 - 0
mec-student/src/main/java/com/ym/mec/student/StudentApplication.java

@@ -0,0 +1,25 @@
+package com.ym.mec.student;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+import com.spring4all.swagger.EnableSwagger2Doc;
+
+@SpringBootApplication
+@EnableDiscoveryClient
+@EnableFeignClients("com.ym.mec")
+@MapperScan("com.ym.mec.biz.dal.dao")
+@ComponentScan(basePackages = "com.ym.mec")
+@Configuration
+@EnableSwagger2Doc
+public class StudentApplication {
+	public static void main(String[] args) {
+		SpringApplication.run(StudentApplication.class, args);
+	}
+
+}

+ 25 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/TeacherApplication.java

@@ -0,0 +1,25 @@
+package com.ym.mec.teacher;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+import com.spring4all.swagger.EnableSwagger2Doc;
+
+@SpringBootApplication
+@EnableDiscoveryClient
+@EnableFeignClients("com.ym.mec")
+@MapperScan("com.ym.mec.biz.dal.dao")
+@ComponentScan(basePackages = "com.ym.mec")
+@Configuration
+@EnableSwagger2Doc
+public class TeacherApplication {
+	public static void main(String[] args) {
+		SpringApplication.run(TeacherApplication.class, args);
+	}
+
+}