Selaa lähdekoodia

system JAR 依赖管理

liubo 3 vuotta sitten
vanhempi
commit
006e84ba42

+ 28 - 3
pom.xml

@@ -23,7 +23,7 @@
     </modules>
 
     <properties>
-        <zd.version>3.1.0</zd.version>
+        <zd.version>${version}</zd.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
         <java.version>1.8</java.version>
@@ -104,11 +104,11 @@
             </dependency>
 
             <!--  SpringBoot 监控客户端 -->
-            <dependency>
+            <!--<dependency>
                 <groupId>de.codecentric</groupId>
                 <artifactId>spring-boot-admin-starter-client</artifactId>
                 <version>${spring-boot-admin.version}</version>
-            </dependency>
+            </dependency>-->
 
             <!-- FastDFS 分布式文件系统 -->
             <dependency>
@@ -310,6 +310,31 @@
                 <artifactId>pinyin4j</artifactId>
                 <version>${pinyin4j.version}</version>
             </dependency>
+
+            <dependency>
+                <groupId>com.zd.core</groupId>
+                <artifactId>common-core</artifactId>
+                <version>${zd.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.zd.swagger</groupId>
+                <artifactId>common-swagger</artifactId>
+                <version>${zd.version}</version>
+                <scope>compile</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>com.zd.base</groupId>
+                <artifactId>zd-base-api</artifactId>
+                <version>${zd.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.zd.laboratory</groupId>
+                <artifactId>zd-laboratory-api</artifactId>
+                <version>${zd.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

+ 0 - 61
zd-modules/zd-modules-system/pom.xml

@@ -37,13 +37,6 @@
             <artifactId>spring-boot-starter-actuator</artifactId>
         </dependency>
 
-        <!-- Swagger UI -->
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger-ui</artifactId>
-            <version>${swagger.fox.version}</version>
-        </dependency>
-
         <!-- Mysql Connector -->
         <dependency>
             <groupId>mysql</groupId>
@@ -53,67 +46,22 @@
         <dependency>
             <groupId>com.zd.core</groupId>
             <artifactId>common-core</artifactId>
-            <version>3.1.0</version>
         </dependency>
 
         <dependency>
             <groupId>com.zd.swagger</groupId>
             <artifactId>common-swagger</artifactId>
-            <version>3.1.0</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>com.zd.base</groupId>
             <artifactId>zd-base-api</artifactId>
-            <version>3.1.0</version>
         </dependency>
 
         <dependency>
             <groupId>com.zd.laboratory</groupId>
             <artifactId>zd-laboratory-api</artifactId>
-            <version>3.1.0</version>
-        </dependency>
-        <!-- zd Common DataSource -->
-        <!--<dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-datasource</artifactId>
-        </dependency>-->
-
-        <!-- zd Common DataScope -->
-        <!--<dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-datascope</artifactId>
-        </dependency>
-
-        &lt;!&ndash; zd Common Log &ndash;&gt;
-        <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-log</artifactId>
-        </dependency>-->
-
-        <!-- zd Common Swagger -->
-        <!-- <dependency>
-            <groupId>com.zd</groupId>
-            <artifactId>zd-common-swagger</artifactId>
-        </dependency>-->
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.junit.vintage</groupId>
-                    <artifactId>junit-vintage-engine</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>com.github.xiaoymin</groupId>
-            <artifactId>knife4j-annotations</artifactId>
-            <version>3.0.3</version>
-            <scope>compile</scope>
         </dependency>
     </dependencies>
 
@@ -131,15 +79,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <!-- 打包时跳过test插件,不运行test测试用例 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>${maven-surefire-plugin.version}</version>
-                <configuration>
-                    <skipTests>true</skipTests>
-                </configuration>
-            </plugin>
         </plugins>
     </build>
 </project>

+ 0 - 10
zd-modules/zd-modules-system/src/main/resources/banner.txt

@@ -1,10 +0,0 @@
-Spring Boot Version: ${spring-boot.version}
-Spring Application Name: ${spring.application.name}
-                            _                           _                    
-                           (_)                         | |                   
- _ __  _   _   ___   _   _  _  ______  ___  _   _  ___ | |_   ___  _ __ ___  
-| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \ 
-| |   | |_| || (_) || |_| || |        \__ \| |_| |\__ \| |_ |  __/| | | | | |
-|_|    \__,_| \___/  \__, ||_|        |___/ \__, ||___/ \__| \___||_| |_| |_|
-                      __/ |                  __/ |                           
-                     |___/                  |___/                            

+ 0 - 81
zd-modules/zd-modules-system/src/test/java/com/zd/system/base/BaseControllerTest.java

@@ -1,81 +0,0 @@
-package com.zd.system.base;
-
-import com.alibaba.fastjson.JSON;
-import org.junit.jupiter.api.TestInstance;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.http.HttpHeaders;
-import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.util.Assert;
-import org.springframework.web.client.RestTemplate;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 测试controller 基类
- *
- * @Author: zhoupan
- * @Date: 2021/09/08/8:39
- * @Description:
- */
-//@ActiveProfiles("junittest")
-@TestInstance(TestInstance.Lifecycle.PER_CLASS)
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@AutoConfigureMockMvc
-public class BaseControllerTest extends AbstractTransactionalJUnit4SpringContextTests {
-
-    protected final Logger log = LoggerFactory.getLogger(this.getClass());
-    @Autowired
-    public MockMvc mockMvc;
-
-
-    private String bearer = "Bearer ";
-
-    public static HttpHeaders httpHeaders = new HttpHeaders();
-
-    /**
-     * 登录
-     *
-     * @param username
-     * @param password
-     * @throws Exception
-     */
-    public void beforeAll(String username, String password, boolean f) throws Exception {
-//mockMve 没办法指定主机地址,所以这里改成手动请求
-//        MvcResult mvcResult = mockMvc
-//                .perform(MockMvcRequestBuilders.get("http://localhost:8080/code"))
-//                .andReturn();
-        //不再重复登录
-        if (!f && httpHeaders.containsKey("Authorization")) {
-            return;
-        }
-        RestTemplate restTemplate = new RestTemplate();
-        //创建请求头
-
-        String url = "http://localhost:8080/auth/login";
-        Map<String, String> map = new HashMap<>(2);
-        map.put("username", username);
-        map.put("password", password);
-        String body = restTemplate.postForEntity(url, map, String.class).getBody();
-        Map<String, Object> parse = (Map<String, Object>) JSON.parse(body);
-        Assert.isTrue(parse.get("code").toString().equals("200"), "登录失败:" + parse.get("msg"));
-        //拿到token
-        Map<String, String> data = (Map<String, String>) JSON.parse(parse.get("data").toString());
-        httpHeaders.put("Authorization", Collections.singletonList(bearer + data.get("access_token")));
-        //采用模拟方式-即不走网关
-        httpHeaders.put("user_id", Collections.singletonList(data.get("user_id")));
-        httpHeaders.put("username", Collections.singletonList(data.get("username")));
-
-    }
-
-    public void beforeAll(String username, String password) throws Exception {
-        beforeAll(username, password, false);
-
-    }
-}

+ 0 - 62
zd-modules/zd-modules-system/src/test/java/com/zd/system/controller/SysTeacherControllerTest.java

@@ -1,62 +0,0 @@
-package com.zd.system.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.zd.system.base.BaseControllerTest;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.springframework.http.MediaType;
-import org.springframework.test.web.servlet.MvcResult;
-import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
-import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PutMapping;
-
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/09/11/15:54
- * @Description:
- */
-@DisplayName("教职工管理")
-class SysTeacherControllerTest extends BaseControllerTest {
-
-    /**
-     * controller 前缀
-     */
-    private String cp = "/user/teacher";
-
-    /**
-     * 测试前置方法
-     *
-     * @throws Exception
-     */
-    @BeforeAll
-    void init() throws Exception {
-        //使用账号登陆
-        beforeAll("admin", "admin123");
-    }
-
-    @Test
-    @DisplayName("获取教职工列表")
-    void list() throws Exception {
-        MvcResult mvcResult = (MvcResult) mockMvc
-                .perform(MockMvcRequestBuilders.get(cp + "/list").headers(httpHeaders).accept(MediaType.APPLICATION_JSON_UTF8))
-                .andDo(print())
-                .andExpect(status().isOk())
-                .andExpect(MockMvcResultMatchers.jsonPath("$.rows").isArray())
-                .andExpect(MockMvcResultMatchers.jsonPath("$.code").value(200))
-                .andReturn();
-        logger.debug("获取教职工列表-测试结果:" + mvcResult.getResponse().getContentAsString());
-
-    }
-
-
-}