Parcourir la source

chore: remove unused query module

weipengtao il y a 3 mois
Parent
commit
673856cd1f

+ 0 - 1
pom.xml

@@ -12,7 +12,6 @@
         <module>common</module>
         <module>web</module>
         <module>api</module>
-        <module>query</module>
     </modules>
 
     <properties>

+ 0 - 31
query/.gitignore

@@ -1,31 +0,0 @@
-HELP.md
-target/
-!.mvn/wrapper/maven-wrapper.jar
-!**/src/main/**
-!**/src/test/**
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-build/
-
-### VS Code ###
-.vscode/

+ 0 - 4
query/README.md

@@ -1,4 +0,0 @@
-# 工程简介
-
-# 延伸阅读
-

+ 0 - 90
query/pom.xml

@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>seecoder-devcloud-query</artifactId>
-    <version>0.1.0</version>
-    <description>Demo project for Spring Boot</description>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>8</source>
-                    <target>8</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-    <parent>
-        <groupId>cn.seecoder</groupId>
-        <version>0.1.0</version>
-        <artifactId>seecoder-devcloud-parent</artifactId>
-    </parent>
-
-    <properties>
-        <java.version>1.8</java.version>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <spring-boot.version>2.3.4.RELEASE</spring-boot.version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.mybatis.spring.boot</groupId>
-            <artifactId>mybatis-spring-boot-starter-test</artifactId>
-            <version>2.1.4</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.mybatis.spring.boot</groupId>
-            <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>2.1.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</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>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.13</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-dependencies</artifactId>
-                <version>${spring-boot.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-</project>

+ 0 - 25
query/src/main/java/cn/seecoder/query/Application.java

@@ -1,25 +0,0 @@
-package cn.seecoder.query;
-
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
-import org.springframework.stereotype.Repository;
-
-import java.time.ZoneId;
-import java.util.TimeZone;
-
-/**
- * @author PuHong Weng
- * @date 2021/4/17
- * @description:
- */
-@SpringBootApplication(exclude = {HibernateJpaAutoConfiguration.class})
-@MapperScan(basePackages = {"cn.seecoder.query.dao"}, annotationClass = Repository.class)
-public class Application {
-	public static void main(String[] args) {
-		// 强制写入默认时区
-		TimeZone.setDefault(TimeZone.getTimeZone(ZoneId.of("GMT+8")));
-		SpringApplication.run(Application.class, args);
-	}
-}

+ 0 - 40
query/src/main/java/cn/seecoder/query/Response.java

@@ -1,40 +0,0 @@
-package cn.seecoder.query;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * @author PuHong Weng
- * @date 2021/2/1
- * @description:
- */
-@Data
-public class Response<T> implements Serializable {
-
-	private Integer code;
-
-	private String msg;
-
-	private T data;
-
-	public Response(Integer code, String msg, T data) {
-		this.code = code;
-		this.msg = msg;
-		this.data = data;
-	}
-
-
-	public static Response<Object> buildSuccess() {
-		return new Response<Object>(200, "", null);
-	}
-
-
-	public static <T> Response<T> buildSuccess(T result) {
-		return new Response<T>(200, "", result);
-	}
-
-	public static Response<Object> buildFailure(Integer code, String message) {
-		return new Response<Object>(code, message, null);
-	}
-}

+ 0 - 20
query/src/main/java/cn/seecoder/query/dao/QueryMapper.java

@@ -1,20 +0,0 @@
-package cn.seecoder.query.dao;
-
-import cn.seecoder.query.model.CommitDTO;
-import org.apache.ibatis.annotations.Select;
-import org.springframework.stereotype.Repository;
-
-import java.sql.Timestamp;
-import java.util.List;
-
-/**
- * @author PuHong Weng
- * @date 2021/4/16
- * @description:
- */
-@Repository
-public interface QueryMapper {
-
-	@Select("select * from commit where timestamp>=start and timestamp<end")
-	List<CommitDTO> selectCommits(Timestamp start, Timestamp end);
-}

+ 0 - 41
query/src/main/java/cn/seecoder/query/facade/QueryController.java

@@ -1,41 +0,0 @@
-package cn.seecoder.query.facade;
-
-import cn.seecoder.query.Response;
-import cn.seecoder.query.dao.QueryMapper;
-import cn.seecoder.query.model.CommitDTO;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.sql.Timestamp;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.List;
-
-/**
- * @author PuHong Weng
- * @date 2021/4/16
- * @description:
- */
-@RestController
-@RequestMapping("/query")
-public class QueryController {
-
-	private final QueryMapper queryMapper;
-
-	@Autowired
-	public QueryController(QueryMapper queryMapper) {
-		this.queryMapper = queryMapper;
-	}
-
-	@GetMapping("/commits")
-	public Response<List<CommitDTO>> queryCommits(@Param("startAt") String startAt, @Param("endAt") String endAt) throws ParseException {
-		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		Timestamp startTime = new Timestamp(simpleDateFormat.parse(startAt).getTime());
-		Timestamp endTime = new Timestamp(simpleDateFormat.parse(endAt).getTime());
-		return Response.buildSuccess(queryMapper.selectCommits(startTime, endTime));
-	}
-
-}

+ 0 - 19
query/src/main/java/cn/seecoder/query/model/CommitDTO.java

@@ -1,19 +0,0 @@
-package cn.seecoder.query.model;
-
-import lombok.Data;
-
-/**
- * @author LiXueSong
- * @date 2021/4/16
- * @description:
- */
-@Data
-public class CommitDTO {
-	private String id;
-	private String timestamp;
-	private String gitlabUsername;
-	private String relatedType;
-	private Integer relatedId;
-	private Integer projectId;
-	private String email;
-}

+ 0 - 4
query/src/main/resources/application.properties

@@ -1,4 +0,0 @@
-spring.datasource.url=jdbc:mysql://192.168.99.105:30006/devcloud?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
-spring.datasource.password=root
-spring.datasource.username=root
-mybatis.configuration.map-underscore-to-camel-case=true

+ 0 - 59
query/src/test/java/cn/seecoder/query/dao/QueryMapperTest.java

@@ -1,59 +0,0 @@
-// package cn.seecoder.query.dao;
-//
-// import cn.seecoder.query.Application;
-// import org.junit.runner.RunWith;
-// import org.mybatis.spring.annotation.MapperScan;
-// import org.springframework.beans.factory.annotation.Autowired;
-// import org.springframework.boot.test.context.SpringBootTest;
-// import org.springframework.stereotype.Repository;
-// import org.springframework.test.context.junit4.SpringRunner;
-//
-/// **
-// * @author PuHong Weng
-// * @date 2021/4/16
-// * @description:
-// */
-//@SpringBootTest(classes = Application.class)
-//@RunWith(SpringRunner.class)
-//@MapperScan(basePackages = {"cn.seecoder.query.dao"}, annotationClass = Repository.class)
-// class QueryMapperTest {
-//
-//    private final QueryMapper queryMapper;
-//
-//    @Autowired
-//    QueryMapperTest(QueryMapper queryMapper) {
-//        this.queryMapper = queryMapper;
-//    }
-//
-////    @Test
-////    void selectCommits() {
-////        try{
-////
-////            System.out.println(queryMapper.selectCommits());
-////        }catch (Exception e){
-////            e.printStackTrace();
-////            Assert.fail();
-////        }
-////    }
-////
-////    @Test
-////    void selectBugLists() {
-////        try{
-////            System.out.println(queryMapper.selectBugLists());
-////        }catch (Exception e){
-////            e.printStackTrace();
-////            Assert.fail();
-////        }
-////    }
-////
-////    @Test
-////    void selectTreeLeaf() {
-////        try{
-////
-////            System.out.println(queryMapper.selectTreeLeaf());
-////        }catch (Exception e){
-////            e.printStackTrace();
-////            Assert.fail();
-////        }
-////    }
-//}

+ 0 - 5
web/pom.xml

@@ -60,11 +60,6 @@
             <version>2.5.0</version>
         </dependency>
 
-        <!--        <dependency>-->
-        <!--            <groupId>cn.seecoder</groupId>-->
-        <!--            <artifactId>seecoder-devcloud-query</artifactId>-->
-        <!--            <version>0.1.0</version>-->
-        <!--        </dependency>-->
         <dependency>
             <groupId>cn.seecoder</groupId>
             <artifactId>seecoder-devcloud-api</artifactId>

+ 1 - 1
web/src/main/java/cn/seecoder/web/DevcloudWebApplication.java

@@ -16,7 +16,7 @@ import java.util.TimeZone;
 @EnableScheduling
 @EnableAsync
 @SpringBootApplication(exclude = {HibernateJpaAutoConfiguration.class})
-@MapperScan(basePackages = {"cn.seecoder.web", "cn.seecoder.query"}, annotationClass = Repository.class)
+@MapperScan(basePackages = "cn.seecoder.web", annotationClass = Repository.class)
 @EnableTransactionManagement // 开始事务
 public class DevcloudWebApplication {
 

+ 0 - 1
web/src/main/java/cn/seecoder/web/infrastructure/config/WebSecurityConfig.java

@@ -183,7 +183,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 				.antMatchers("/**/*api-docs*/**").permitAll()
 				.antMatchers("/**/hook").permitAll()
 				.antMatchers("/**/sonar_hook").permitAll()
-				.antMatchers("/**/query/**").permitAll()
 				// 跨域的 Options 请求进行放行
 				.requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
 //                .antMathcers("/**").hasAnyRole(WebSecurityConstants.STUDENT_ROLE, WebSecurityConstants.ADMIN_ROLE, WebSecurityConstants.TEACHER_ROLE)