离校基础代码项目首次提交
diff --git a/leaveschool/basics-data/pom.xml b/leaveschool/basics-data/pom.xml
new file mode 100644
index 0000000..9694742
--- /dev/null
+++ b/leaveschool/basics-data/pom.xml
@@ -0,0 +1,127 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>com.supwisdom.leaveschool</groupId>
+ <artifactId>leaveschool-parent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>com.supwisdom.leaveschool</groupId>
+ <artifactId>leaveschool-basics-data</artifactId>
+ <packaging>jar</packaging>
+
+
+ <dependencies>
+
+ <dependency>
+ <groupId>com.supwisdom.leaveschool</groupId>
+ <artifactId>leaveschool-common</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+
+ <!-- 微服务 健康监控 -->
+ <!-- <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ </dependency> -->
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+
+
+ <dependency>
+ <groupId>com.supwisdom.infras</groupId>
+ <artifactId>infras-mvc</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.supwisdom.infras</groupId>
+ <artifactId>infras-object-mapper</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.supwisdom.infras</groupId>
+ <artifactId>infras-i18n</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.supwisdom.infras</groupId>
+ <artifactId>infras-lang</artifactId>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>com.supwisdom.infras</groupId>
+ <artifactId>infras-pinyin</artifactId>
+ </dependency>
+ -->
+
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-core</artifactId>
+ </dependency>
+
+
+
+
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Test things -->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/BasicsdataApplication.java b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/BasicsdataApplication.java
new file mode 100644
index 0000000..97589b4
--- /dev/null
+++ b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/BasicsdataApplication.java
@@ -0,0 +1,19 @@
+package com.supwisdom.leaveschool.basicsdata;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+import com.supwisdom.infras.data.jpa.EnableInfrasDataJpa;
+
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+@SpringBootApplication
+@EnableInfrasDataJpa
+@EnableSwagger2
+public class BasicsdataApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(BasicsdataApplication.class, args);
+ }
+
+}
diff --git a/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/Repository/DictionaryTypeRepository.java b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/Repository/DictionaryTypeRepository.java
new file mode 100644
index 0000000..496ccaf
--- /dev/null
+++ b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/Repository/DictionaryTypeRepository.java
@@ -0,0 +1,12 @@
+package com.supwisdom.leaveschool.basicsdata.Repository;
+
+import org.springframework.stereotype.Repository;
+
+import com.supwisdom.leaveschool.basicsdata.domain.DictionaryType;
+import com.supwisdom.leaveschool.common.repository.BaseJpaRepository;
+
+@Repository
+public interface DictionaryTypeRepository extends BaseJpaRepository<DictionaryType> {
+
+
+}
diff --git a/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/api/Api1DictionaryTypeController.java b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/api/Api1DictionaryTypeController.java
new file mode 100644
index 0000000..896d4b5
--- /dev/null
+++ b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/api/Api1DictionaryTypeController.java
@@ -0,0 +1,24 @@
+package com.supwisdom.leaveschool.basicsdata.api;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.supwisdom.leaveschool.basicsdata.Repository.DictionaryTypeRepository;
+import com.supwisdom.leaveschool.basicsdata.domain.DictionaryType;
+import com.supwisdom.leaveschool.common.controller.api.CrudApiController;
+
+@RestController
+@RequestMapping("/api/v1/basics-data/dictionary-types")
+public class Api1DictionaryTypeController extends CrudApiController<DictionaryType, DictionaryTypeRepository> {
+
+ @Autowired
+ private DictionaryTypeRepository dictionaryTypeRepository;
+
+ @Override
+ protected DictionaryTypeRepository getRepository() {
+ return dictionaryTypeRepository;
+ }
+
+
+}
diff --git a/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/config/FilterConfig.java b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/config/FilterConfig.java
new file mode 100644
index 0000000..cf62f61
--- /dev/null
+++ b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/config/FilterConfig.java
@@ -0,0 +1,14 @@
+package com.supwisdom.leaveschool.basicsdata.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+@Configuration
+public class FilterConfig extends WebMvcConfigurerAdapter{
+
+ @Override
+ public void addCorsMappings(CorsRegistry registry) {
+ registry.addMapping("/**");
+ }
+}
diff --git a/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/config/Swagger2Config.java b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/config/Swagger2Config.java
new file mode 100644
index 0000000..624384b
--- /dev/null
+++ b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/config/Swagger2Config.java
@@ -0,0 +1,41 @@
+package com.supwisdom.leaveschool.basicsdata.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+
+/**
+ * @author xiehuibing
+ * @ClassName com.supwisdom.framework.config.Swgger2
+ * @Description
+ * @date 2018-07-23
+ */
+@Configuration
+public class Swagger2Config {
+
+ @Bean
+ public Docket createRestApi() {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .apiInfo(apiInfo())
+ .select()
+ .apis(RequestHandlerSelectors.any())
+// .apis(RequestHandlerSelectors.basePackage("org.supwisdom"))
+// .paths(PathSelectors.any())
+ .paths(PathSelectors.ant("/api/**"))
+ .build();
+ }
+
+ private ApiInfo apiInfo() {
+ return new ApiInfoBuilder()
+ .title("离校微服务系统API文档")
+ .description("restful风格,离校微服务系统API文档")
+// .termsOfServiceUrl("http://127.0.0.1:8081/")
+ .version("1.0")
+ .build();
+ }
+}
diff --git a/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/domain/DictionaryType.java b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/domain/DictionaryType.java
new file mode 100644
index 0000000..3b4ea35
--- /dev/null
+++ b/leaveschool/basics-data/src/main/java/com/supwisdom/leaveschool/basicsdata/domain/DictionaryType.java
@@ -0,0 +1,69 @@
+package com.supwisdom.leaveschool.basicsdata.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+import com.supwisdom.leaveschool.common.domain.ABaseDomain;
+
+/**
+ * 字典类型表
+ * @author Administrator
+ *
+ */
+@Entity
+@Table(name = "TB_B_DICTIONARY_TYPE")
+public class DictionaryType extends ABaseDomain {
+
+
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7355785282419690119L;
+
+ /**
+ * 类型码
+ */
+ @Column(name = "CODE", unique = true)
+ private String code;
+
+ /**
+ * 名称
+ */
+ @Column(name = "NAME")
+ private String name;
+
+ /**
+ * 是否可用,1 可用,0 不可用,默认:1
+ */
+ @Column(name = "ENABLED")
+ private boolean enabled = true;
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+
+
+}
diff --git a/leaveschool/basics-data/src/main/resources/application.yml b/leaveschool/basics-data/src/main/resources/application.yml
new file mode 100644
index 0000000..f3efab4
--- /dev/null
+++ b/leaveschool/basics-data/src/main/resources/application.yml
@@ -0,0 +1,44 @@
+server:
+ port: 10020
+
+## logging
+logging:
+ level:
+ root: INFO
+ org.springframework.web: TRACE
+ org.springframework.data.jpa: TRACE
+ com.supwisdom.infras.security: DEBUG
+ com.supwisdom.leaveschool: DEBUG
+
+spring:
+ application:
+ name: sample-user
+ datasource:
+ driver-class-name: com.mysql.jdbc.Driver
+ url: jdbc:mysql://172.50.10.15:3306/lixiao_basics_data?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull
+ username: lixiao_basics_data
+ password: 111111
+ jpa:
+ hibernate:
+ ddl-auto: none
+ naming:
+ physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
+ show-sql: true
+
+infras:
+ mvc:
+# 自定义error输出的例子
+ custom-error:
+ enabled: true
+ error-map:
+ org.springframework.validation.BindException: Customized Bind Error Reason
+ include-message: true
+ include-errors: true
+ include-error: true
+ include-exception: true
+ include-path: true
+ include-timestamp: true
+ include-status: true
+ data:
+ jpa:
+ basePackages: com.supwisdom.leaveschool.basicsdata.repository