Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

Joburgess 5 gadi atpakaļ
vecāks
revīzija
b2f0209fcc

+ 1 - 1
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/AuthServerApplication.java

@@ -16,7 +16,7 @@ import com.spring4all.swagger.EnableSwagger2Doc;
 
 @SpringBootApplication
 @EnableDiscoveryClient
-@EnableFeignClients({"com.keao.edu.auth.api.client"})
+@EnableFeignClients({"com.keao.edu"})
 @MapperScan("com.keao.edu.auth.dal.dao")
 @ComponentScan(basePackages="com.keao.edu")
 @Configuration

+ 1 - 2
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/service/impl/SysUserServiceImpl.java

@@ -145,8 +145,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implem
 	@Transactional(rollbackFor = Exception.class)
 	public SysUserInfo initUser(LoginEntity loginEntity) {
 		if(StringUtils.equalsIgnoreCase(loginEntity.getClientId(),"STUDENT")){
-//			eduUserFeignService.studentApply(new Student(loginEntity.getOrganId(),loginEntity.getPhone()));
-			eduUserFeignService.getExamRoom(1);
+			eduUserFeignService.studentApply(loginEntity.getOrganId(),loginEntity.getPhone());
 			return queryUserInfoByPhone(loginEntity.getPhone());
 		}
 		throw new UsernameNotFoundException("404.9");

+ 8 - 3
edu-cms/pom.xml

@@ -26,16 +26,20 @@
 		</dependency>
 		
 		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-web</artifactId>
+		</dependency>
+		
+		<dependency>
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
 		</dependency>
-
-		<!-- swagger-spring-boot -->
+		
 		<dependency>
 			<groupId>com.spring4all</groupId>
 			<artifactId>swagger-spring-boot-starter</artifactId>
 		</dependency>
-
+		
 		<dependency>
 			<groupId>com.alibaba</groupId>
 			<artifactId>druid-spring-boot-starter</artifactId>
@@ -45,6 +49,7 @@
 			<groupId>mysql</groupId>
 			<artifactId>mysql-connector-java</artifactId>
 		</dependency>
+		
 	</dependencies>
 
 	<build>

+ 1 - 1
edu-cms/src/main/java/com/keao/edu/cms/CmsServerApplication.java

@@ -17,7 +17,7 @@ import com.spring4all.swagger.EnableSwagger2Doc;
 @EnableDiscoveryClient
 @EnableFeignClients("com.keao.edu")
 @ComponentScan("com.keao.edu")
-@MapperScan("com.keao.edu.common.dal.dao")
+@MapperScan("com.keao.edu.cms.dal.dao")
 @Configuration
 @EnableSwagger2Doc
 public class CmsServerApplication {

+ 28 - 3
edu-cms/src/main/resources/application.yml

@@ -26,9 +26,9 @@ spring:
     
   datasource:
     name: test
-    url: jdbc:mysql://47.99.212.176:3306/edu_saas?useUnicode=true&characterEncoding=UTF8&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://47.114.176.40:3306/edu_saas?useUnicode=true&characterEncoding=UTF8&serverTimezone=Asia/Shanghai
     username: edu_saas
-    password: edu_saas
+    password: dayaDataOnline@2019
     # 使用druid数据源
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: com.mysql.cj.jdbc.Driver
@@ -45,7 +45,24 @@ spring:
     testOnReturn: false
     poolPreparedStatements: true
     maxOpenPreparedStatements: 20
-    
+
+  redis:
+    host: 47.114.176.40
+    port: 6379
+    password: dyym
+    database: 1
+    #连接超时时间(毫秒)
+    timeout: 10000
+    jedis:
+      pool:
+        #连接池最大连接数(使用负值表示没有限制)
+        max-active: 10
+        #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1
+        #连接池中的最大空闲连接
+        max-idle: 10
+        #连接池中的最小空闲连接
+        min-idle: 1
 
 mybatis:
     mapperLocations: classpath:config/config/*.xml
@@ -77,3 +94,11 @@ management:
 ribbon:  
     ReadTimeout: 60000  
     ConnectTimeout: 60000
+
+message:
+  debugMode: false
+
+user:
+  server:
+    context:
+      path: http://admin.dayaedu.com/

+ 4 - 22
edu-cms/src/main/resources/logback-spring.xml

@@ -29,27 +29,9 @@
 
 	<logger name="com.keao.edu" level="INFO" />
 
-	<!--开发环境:打印控制台 -->
-	<springProfile name="dev">
-		<root level="INFO">
-			<appender-ref ref="stdout" />
-			<appender-ref ref="file" />
-		</root>
-	</springProfile>
-	
-	<springProfile name="test">
-		<root level="INFO">
-			<appender-ref ref="stdout" />
-			<appender-ref ref="file" />
-		</root>
-	</springProfile>
-
-	<!--生产环境:输出到文件 -->
-	<springProfile name="prod">
-		<root level="WARN">
-			<appender-ref ref="stdout" />
-			<appender-ref ref="file" />
-		</root>
-	</springProfile>
+	<root level="INFO">
+		<appender-ref ref="stdout" />
+		<appender-ref ref="file" />
+	</root>
 
 </configuration>

+ 5 - 6
edu-common/pom.xml

@@ -69,11 +69,10 @@
 			<groupId>com.vdurmont</groupId>
 			<artifactId>emoji-java</artifactId>
 		</dependency>
-        <dependency>
-            <groupId>io.swagger</groupId>
-            <artifactId>swagger-annotations</artifactId>
-            <version>1.5.20</version>
-            <scope>compile</scope>
-        </dependency>
+		
+		<dependency>
+			<groupId>com.spring4all</groupId>
+			<artifactId>swagger-spring-boot-starter</artifactId>
+		</dependency>
 	</dependencies>
 </project>

+ 4 - 5
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/EduUserFeignService.java

@@ -4,19 +4,18 @@ package com.keao.edu.user.api.client;
 import com.keao.edu.common.config.FeignConfiguration;
 import com.keao.edu.user.api.client.fallback.EduUserFeignServiceFallback;
 import com.keao.edu.user.api.entity.ExamRoom;
-import com.keao.edu.user.api.entity.Student;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 
-@FeignClient(name = "user-server", configuration = { FeignConfiguration.class }, fallback = EduUserFeignServiceFallback.class)
+@FeignClient(contextId = "eduUserFeignService", name = "user-server", configuration = { FeignConfiguration.class }, fallback = EduUserFeignServiceFallback.class)
 public interface EduUserFeignService {
 
 	@RequestMapping(value = "examRoom/get", method = RequestMethod.GET)
 	ExamRoom getExamRoom(Integer id);
 
-	@PostMapping(value = "student/apply", consumes = MediaType.APPLICATION_JSON_VALUE)
-	Object studentApply(Student student);
+	@PostMapping(value = "student/apply")
+	Object studentApply(@RequestParam("organId") Integer organId, @RequestParam("phone") String phone);
 }

+ 2 - 2
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/fallback/EduUserFeignServiceFallback.java

@@ -10,12 +10,12 @@ import org.springframework.web.bind.annotation.RequestParam;
 public class EduUserFeignServiceFallback implements EduUserFeignService {
 
 	@Override
-	public ExamRoom getExamRoom(@RequestParam("id") Integer id){
+	public ExamRoom getExamRoom(Integer id){
 		return null;
 	}
 
 	@Override
-	public Object studentApply(Student student) {
+	public Object studentApply(Integer organId, String phone) {
 		return null;
 	}
 

+ 4 - 15
edu-user/edu-user-server/pom.xml

@@ -22,15 +22,6 @@
 		</dependency>
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-autoconfigure</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-commons</artifactId>
-			<scope>compile</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-web</artifactId>
 		</dependency>
 		<dependency>
@@ -50,12 +41,10 @@
 			<groupId>javax.servlet</groupId>
 			<artifactId>javax.servlet-api</artifactId>
 		</dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid</artifactId>
-            <version>1.1.10</version>
-            <scope>compile</scope>
-        </dependency>
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>druid-spring-boot-starter</artifactId>
+		</dependency>
 		<dependency>
 			<groupId>mysql</groupId>
 			<artifactId>mysql-connector-java</artifactId>

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/UserServerApplication.java

@@ -15,7 +15,7 @@ import org.springframework.web.client.RestTemplate;
 
 @SpringBootApplication
 @EnableDiscoveryClient
-@EnableFeignClients({"com.keao.edu.user.api.client"})
+@EnableFeignClients({"com.keao.edu"})
 @MapperScan({"com.keao.edu.user.dao"})
 @ComponentScan(basePackages="com.keao.edu")
 @Configuration

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/config/ResourceServerConfig.java

@@ -25,7 +25,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
 		http.authorizeRequests()
-				.antMatchers("/v2/api-docs", "/su/**")
+				.antMatchers("/v2/api-docs", "/su/**","/student/apply")
 				.permitAll()
 				.anyRequest().authenticated().and().csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler)
 				.authenticationEntryPoint(baseAuthenticationEntryPoint).and();

+ 2 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentController.java

@@ -40,8 +40,8 @@ public class StudentController extends BaseController {
 
 	@ApiOperation(value = "学员报名")
 	@PostMapping(value = "apply")
-	public HttpResponseResult apply(@RequestBody Student student) {
-		studentService.addStudent(student);
+	public HttpResponseResult apply(Integer organId,String phone) {
+		studentService.addStudent(new Student(organId,phone));
 		return succeed();
 	}
 }

+ 0 - 5
pom.xml

@@ -98,11 +98,6 @@
 			</dependency>
 
 			<dependency>
-				<groupId>com.baomidou</groupId>
-				<artifactId>mybatis-plus</artifactId>
-			</dependency>
-
-			<dependency>
 				<groupId>org.springframework.social</groupId>
 				<artifactId>spring-social-security</artifactId>
 				<version>1.1.6.RELEASE</version>