Przeglądaj źródła

增加短信登录

wwh 4 tygodni temu
rodzic
commit
efd4540953

+ 0 - 5
huimv-employment/fe-api/pom.xml

@@ -30,11 +30,6 @@
30
             <groupId>org.springframework.boot</groupId>
30
             <groupId>org.springframework.boot</groupId>
31
             <artifactId>spring-boot-starter-validation</artifactId>
31
             <artifactId>spring-boot-starter-validation</artifactId>
32
         </dependency>
32
         </dependency>
33
-        <dependency>
34
-            <groupId>com.h2database</groupId>
35
-            <artifactId>h2</artifactId>
36
-            <scope>test</scope>
37
-        </dependency>
38
         <dependency>
33
         <dependency>
39
             <groupId>org.springframework.boot</groupId>
34
             <groupId>org.springframework.boot</groupId>
40
             <artifactId>spring-boot-starter-test</artifactId>
35
             <artifactId>spring-boot-starter-test</artifactId>

+ 2 - 0
huimv-employment/fe-api/src/main/java/com/huimv/employment/config/MybatisConfig.java

@@ -2,12 +2,14 @@ package com.huimv.employment.config;
2
 
2
 
3
 import org.mybatis.spring.annotation.MapperScan;
3
 import org.mybatis.spring.annotation.MapperScan;
4
 import org.springframework.context.annotation.Configuration;
4
 import org.springframework.context.annotation.Configuration;
5
+import org.springframework.context.annotation.Profile;
5
 
6
 
6
 /**
7
 /**
7
  * MyBatis-Plus Mapper 扫描配置。
8
  * MyBatis-Plus Mapper 扫描配置。
8
  * <p>扫描 fe-dao 模块下所有 Mapper 接口,MyBatis-Plus 全局配置见 application-dev.yml。</p>
9
  * <p>扫描 fe-dao 模块下所有 Mapper 接口,MyBatis-Plus 全局配置见 application-dev.yml。</p>
9
  */
10
  */
10
 @Configuration
11
 @Configuration
12
+@Profile("!test")
11
 @MapperScan("com.huimv.employment.dao.mapper")
13
 @MapperScan("com.huimv.employment.dao.mapper")
12
 public class MybatisConfig {
14
 public class MybatisConfig {
13
 }
15
 }

+ 4 - 0
huimv-employment/fe-api/src/test/java/com/huimv/employment/FeApplicationTests.java

@@ -1,5 +1,6 @@
1
 package com.huimv.employment;
1
 package com.huimv.employment;
2
 
2
 
3
+import com.huimv.employment.dao.mapper.FeUserMapper;
3
 import org.junit.jupiter.api.Test;
4
 import org.junit.jupiter.api.Test;
4
 import org.springframework.boot.test.context.SpringBootTest;
5
 import org.springframework.boot.test.context.SpringBootTest;
5
 import org.springframework.boot.test.mock.mockito.MockBean;
6
 import org.springframework.boot.test.mock.mockito.MockBean;
@@ -13,6 +14,9 @@ class FeApplicationTests {
13
     @MockBean
14
     @MockBean
14
     private StringRedisTemplate stringRedisTemplate;
15
     private StringRedisTemplate stringRedisTemplate;
15
 
16
 
17
+    @MockBean
18
+    private FeUserMapper feUserMapper;
19
+
16
     @Test
20
     @Test
17
     void contextLoads() {
21
     void contextLoads() {
18
     }
22
     }

+ 3 - 9
huimv-employment/fe-api/src/test/resources/application-test.yml

@@ -1,15 +1,9 @@
1
 spring:
1
 spring:
2
-  datasource:
3
-    url: jdbc:h2:mem:fe_test;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE
4
-    driver-class-name: org.h2.Driver
5
-    username: sa
6
-    password:
7
-  sql:
8
-    init:
9
-      mode: always
10
-      schema-locations: classpath:schema-h2.sql
11
   autoconfigure:
2
   autoconfigure:
12
     exclude:
3
     exclude:
4
+      - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
5
+      - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
6
+      - com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
13
       - org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
7
       - org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
14
 
8
 
15
 fe:
9
 fe:

+ 0 - 17
huimv-employment/fe-api/src/test/resources/schema-h2.sql

@@ -1,17 +0,0 @@
1
-CREATE TABLE IF NOT EXISTS fe_user (
2
-  id BIGINT AUTO_INCREMENT PRIMARY KEY,
3
-  openid VARCHAR(64) NOT NULL,
4
-  unionid VARCHAR(64),
5
-  user_type VARCHAR(20) NOT NULL DEFAULT 'enterprise',
6
-  nickname VARCHAR(64),
7
-  avatar_url VARCHAR(512),
8
-  mobile_enc CLOB,
9
-  mobile_mask VARCHAR(20),
10
-  session_key VARCHAR(128),
11
-  status VARCHAR(20) NOT NULL DEFAULT 'active',
12
-  last_login_at TIMESTAMP,
13
-  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
14
-  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
15
-  del_flag TINYINT NOT NULL DEFAULT 0,
16
-  UNIQUE (openid, del_flag)
17
-);