Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
e9b5868d
Commit
e9b5868d
authored
Aug 21, 2017
by
冯硕楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化rest server项目
parent
f2799d42
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
3 deletions
+113
-3
guns-parent/pom.xml
+9
-3
guns-rest/pom.xml
+47
-0
guns-rest/src/main/java/com/stylefeng/guns/GunsRestApplication.java
+41
-0
guns-rest/src/main/resources/application.properties
+0
-0
guns-rest/src/test/java/com/stylefeng/guns/GunsRestApplicationTests.java
+16
-0
No files found.
guns-parent/pom.xml
View file @
e9b5868d
...
...
@@ -16,13 +16,13 @@
</modules>
<properties>
<guns.version>
1.0.0-SNAPSHOT
</guns.version>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
<guns.version>
1.0.0-SNAPSHOT
</guns.version>
<shiro.version>
1.4.0
</shiro.version>
<mybatisplus-spring-boot-starter.version>
1.0.4
</mybatisplus-spring-boot-starter.version>
<mybatis-plus.version>
2.1
-gamma
</mybatis-plus.version>
<mybatis-plus.version>
2.1
.0
</mybatis-plus.version>
<fastjson.version>
1.2.31
</fastjson.version>
<commons.io.version>
2.5
</commons.io.version>
<velocity.version>
1.7
</velocity.version>
...
...
@@ -35,6 +35,7 @@
<commons-lang3.version>
3.6
</commons-lang3.version>
<ehcache.core.version>
2.6.11
</ehcache.core.version>
<mysql-connector-java.version>
5.1.38
</mysql-connector-java.version>
<jwt.version>
0.7.0
</jwt.version>
</properties>
<dependencyManagement>
...
...
@@ -144,6 +145,11 @@
<artifactId>
ehcache-core
</artifactId>
<version>
${ehcache.core.version}
</version>
</dependency>
<dependency>
<groupId>
io.jsonwebtoken
</groupId>
<artifactId>
jjwt
</artifactId>
<version>
${jwt.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
guns-rest/pom.xml
0 → 100644
View file @
e9b5868d
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>
com.stylefeng.guns
</groupId>
<artifactId>
guns-rest
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
guns-rest
</name>
<description>
guns REST服务器
</description>
<parent>
<groupId>
com.stylefeng
</groupId>
<artifactId>
guns-parent
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
<relativePath>
../guns-parent/pom.xml
</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
io.jsonwebtoken
</groupId>
<artifactId>
jjwt
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
guns-rest/src/main/java/com/stylefeng/guns/GunsRestApplication.java
0 → 100644
View file @
e9b5868d
package
com
.
stylefeng
.
guns
;
import
io.jsonwebtoken.Jwts
;
import
io.jsonwebtoken.SignatureAlgorithm
;
import
io.jsonwebtoken.SignatureException
;
import
io.jsonwebtoken.impl.crypto.MacProvider
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
java.security.Key
;
@SpringBootApplication
public
class
GunsRestApplication
{
public
static
void
main
(
String
[]
args
)
{
//SpringApplication.run(GunsRestApplication.class, args);
Key
key
=
MacProvider
.
generateKey
();
String
compactJws
=
Jwts
.
builder
()
.
setSubject
(
"Joe"
)
.
signWith
(
SignatureAlgorithm
.
HS512
,
key
)
.
compact
();
System
.
out
.
println
(
compactJws
);
try
{
Jwts
.
parser
().
setSigningKey
(
key
).
parseClaimsJws
(
compactJws
);
//OK, we can trust this JWT
System
.
out
.
println
(
"trust"
);
}
catch
(
SignatureException
e
)
{
//don't trust the JWT!
System
.
out
.
println
(
"not trust"
);
}
}
}
guns-rest/src/main/resources/application.properties
0 → 100644
View file @
e9b5868d
guns-rest/src/test/java/com/stylefeng/guns/GunsRestApplicationTests.java
0 → 100644
View file @
e9b5868d
package
com
.
stylefeng
.
guns
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
GunsRestApplicationTests
{
@Test
public
void
contextLoads
()
{
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment