Sfoglia il codice sorgente

增加短信登录

wwh 3 settimane fa
parent
commit
efd4540953

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

@@ -30,11 +30,6 @@
30 30
             <groupId>org.springframework.boot</groupId>
31 31
             <artifactId>spring-boot-starter-validation</artifactId>
32 32
         </dependency>
33
-        <dependency>
34
-            <groupId>com.h2database</groupId>
35
-            <artifactId>h2</artifactId>
36
-            <scope>test</scope>
37
-        </dependency>
38 33
         <dependency>
39 34
             <groupId>org.springframework.boot</groupId>
40 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 3
 import org.mybatis.spring.annotation.MapperScan;
4 4
 import org.springframework.context.annotation.Configuration;
5
+import org.springframework.context.annotation.Profile;
5 6
 
6 7
 /**
7 8
  * MyBatis-Plus Mapper 扫描配置。
8 9
  * <p>扫描 fe-dao 模块下所有 Mapper 接口,MyBatis-Plus 全局配置见 application-dev.yml。</p>
9 10
  */
10 11
 @Configuration
12
+@Profile("!test")
11 13
 @MapperScan("com.huimv.employment.dao.mapper")
12 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 1
 package com.huimv.employment;
2 2
 
3
+import com.huimv.employment.dao.mapper.FeUserMapper;
3 4
 import org.junit.jupiter.api.Test;
4 5
 import org.springframework.boot.test.context.SpringBootTest;
5 6
 import org.springframework.boot.test.mock.mockito.MockBean;
@@ -13,6 +14,9 @@ class FeApplicationTests {
13 14
     @MockBean
14 15
     private StringRedisTemplate stringRedisTemplate;
15 16
 
17
+    @MockBean
18
+    private FeUserMapper feUserMapper;
19
+
16 20
     @Test
17 21
     void contextLoads() {
18 22
     }

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

@@ -1,15 +1,9 @@
1 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 2
   autoconfigure:
12 3
     exclude:
4
+      - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
5
+      - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
6
+      - com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
13 7
       - org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
14 8
 
15 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
-);