Skip to content

Commit bd71640

Browse files
authored
Merge pull request #41 from 1906522096/master
支持oracle和任意类型id
2 parents 3f732a7 + 3870818 commit bd71640

28 files changed

+3106
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="Spring" name="Spring">
5+
<configuration />
6+
</facet>
7+
</component>
8+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
9+
<output url="file://$MODULE_DIR$/target/classes" />
10+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
11+
<content url="file://$MODULE_DIR$">
12+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
13+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
14+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
15+
<excludeFolder url="file://$MODULE_DIR$/target" />
16+
</content>
17+
<orderEntry type="inheritedJdk" />
18+
<orderEntry type="sourceFolder" forTests="false" />
19+
<orderEntry type="library" name="apijson-server2.7.2" level="project" />
20+
<orderEntry type="library" name="apijson-library-2.1.0-SNAPSHOT" level="project" />
21+
<orderEntry type="library" name="Maven: org.jyaml:jyaml:1.3" level="project" />
22+
<orderEntry type="library" name="Maven: ojdbc6:ojdbc6:1.0" level="project" />
23+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.4.1.RELEASE" level="project" />
24+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.4.1.RELEASE" level="project" />
25+
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.3.RELEASE" level="project" />
26+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.4.1.RELEASE" level="project" />
27+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:1.4.1.RELEASE" level="project" />
28+
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.7" level="project" />
29+
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.21" level="project" />
30+
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.21" level="project" />
31+
<orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.21" level="project" />
32+
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.3.RELEASE" level="project" />
33+
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
34+
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.4.1.RELEASE" level="project" />
35+
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:1.4.1.RELEASE" level="project" />
36+
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.4.1.RELEASE" level="project" />
37+
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.2.0" level="project" />
38+
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.2.1" level="project" />
39+
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.1" level="project" />
40+
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.3" level="project" />
41+
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
42+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
43+
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:2.5.0" level="project" />
44+
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" />
45+
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
46+
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
47+
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
48+
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.3.0" level="project" />
49+
<orderEntry type="library" scope="TEST" name="Maven: org.json:json:20140107" level="project" />
50+
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.3.3.RELEASE" level="project" />
51+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.4.1.RELEASE" level="project" />
52+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.4.1.RELEASE" level="project" />
53+
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.5" level="project" />
54+
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.5" level="project" />
55+
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.5" level="project" />
56+
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.2.4.Final" level="project" />
57+
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
58+
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" />
59+
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.1" level="project" />
60+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.3" level="project" />
61+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.3" level="project" />
62+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.3" level="project" />
63+
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.3.RELEASE" level="project" />
64+
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.3.RELEASE" level="project" />
65+
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.3.RELEASE" level="project" />
66+
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.3.RELEASE" level="project" />
67+
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.3.RELEASE" level="project" />
68+
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.21" level="project" />
69+
</component>
70+
</module>
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>apijson.demo.server</groupId>
7+
<artifactId>apijson-demo</artifactId>
8+
<version>2.1.0-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>APIJSONDemo</name>
12+
<description>Demo project for APIJSON Server</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.4.1.RELEASE</version>
18+
<relativePath/> <!-- lookup parent from repository -->
19+
</parent>
20+
21+
<properties>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24+
<java.version>1.8</java.version>
25+
</properties>
26+
27+
<dependencies>
28+
<dependency>
29+
<groupId>org.jyaml</groupId>
30+
<artifactId>jyaml</artifactId>
31+
<version>1.3</version>
32+
</dependency>
33+
34+
<dependency>
35+
<groupId>ojdbc6</groupId>
36+
<artifactId>ojdbc6</artifactId>
37+
<version>1.0</version>
38+
</dependency>
39+
40+
41+
<!--<dependency>-->
42+
<!--<groupId>mysql</groupId>-->
43+
<!--<artifactId>mysql-connector-java</artifactId>-->
44+
<!--<version>5.1.40</version>-->
45+
<!--</dependency>-->
46+
47+
<dependency>
48+
<groupId>org.springframework.boot</groupId>
49+
<artifactId>spring-boot-starter</artifactId>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.springframework.boot</groupId>
53+
<artifactId>spring-boot-starter-test</artifactId>
54+
<scope>test</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.springframework.boot</groupId>
58+
<artifactId>spring-boot-starter-web</artifactId>
59+
</dependency>
60+
61+
<dependency>
62+
<groupId>com.alibaba</groupId>
63+
<artifactId>fastjson</artifactId>
64+
<version>1.2.21</version>
65+
</dependency>
66+
</dependencies>
67+
68+
<build>
69+
<plugins>
70+
<plugin>
71+
<groupId>org.springframework.boot</groupId>
72+
<artifactId>spring-boot-maven-plugin</artifactId>
73+
</plugin>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-compiler-plugin</artifactId>
77+
<configuration>
78+
<source>1.8</source>
79+
<target>1.8</target>
80+
</configuration>
81+
</plugin>
82+
</plugins>
83+
</build>
84+
85+
<!-- Allow access to Spring milestones and snapshots -->
86+
<!-- (you don't need this if you are using anything after 0.5.0.RELEASE) -->
87+
<repositories>
88+
<repository>
89+
<id>spring-snapshots</id>
90+
<url>http://repo.spring.io/snapshot</url>
91+
<snapshots><enabled>true</enabled></snapshots>
92+
</repository>
93+
<repository>
94+
<id>spring-milestones</id>
95+
<url>http://repo.spring.io/milestone</url>
96+
<snapshots><enabled>true</enabled></snapshots>
97+
</repository>
98+
</repositories>
99+
<pluginRepositories>
100+
<pluginRepository>
101+
<id>spring-snapshots</id>
102+
<url>http://repo.spring.io/snapshot</url>
103+
</pluginRepository>
104+
<pluginRepository>
105+
<id>spring-milestones</id>
106+
<url>http://repo.spring.io/milestone</url>
107+
</pluginRepository>
108+
</pluginRepositories>
109+
110+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package apijson.demo.server;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.context.annotation.Bean;
6+
import org.springframework.web.cors.CorsConfiguration;
7+
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
8+
import org.springframework.web.filter.CorsFilter;
9+
10+
11+
/**application
12+
* @author Lemon
13+
*/
14+
@SpringBootApplication
15+
public class APIJSONApplication {
16+
17+
public static void main(String[] args) throws Exception {
18+
SpringApplication.run(APIJSONApplication.class, args);
19+
System.out.println("\n\n\n\n\n<<<<<<<<<<<<<<<<<<<<<<<<< APIJSON >>>>>>>>>>>>>>>>>>>>>>>>\n");
20+
System.out.println("开始测试:远程函数 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
21+
System.out.println("\n完成测试:远程函数 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
22+
System.out.println("\n\n\n开始测试:请求校验 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
23+
System.out.println("\n完成测试:请求校验 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
24+
System.out.println("\n\n<<<<<<<<<<<<<<<<<<<<<<<<< APIJSON已启动 >>>>>>>>>>>>>>>>>>>>>>>>\n");
25+
}
26+
27+
28+
29+
//支持JavaScript跨域请求<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
30+
/**
31+
* 跨域过滤器
32+
* @return
33+
*/
34+
@Bean
35+
public CorsFilter corsFilter() {
36+
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
37+
source.registerCorsConfiguration("/**", buildConfig());
38+
return new CorsFilter(source);
39+
}
40+
/**CORS跨域配置
41+
* @return
42+
*/
43+
private CorsConfiguration buildConfig() {
44+
CorsConfiguration corsConfiguration = new CorsConfiguration();
45+
corsConfiguration.addAllowedOrigin("*"); //允许的域名或IP地址
46+
corsConfiguration.addAllowedHeader("*"); //允许的请求头
47+
corsConfiguration.addAllowedMethod("*"); //允许的HTTP请求方法
48+
corsConfiguration.setAllowCredentials(true); //允许发送跨域凭据,前端Axios存取JSESSIONID必须要
49+
return corsConfiguration;
50+
}
51+
//支持JavaScript跨域请求 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
52+
53+
}

0 commit comments

Comments
 (0)