├── .DS_Store
├── .gitignore
├── Insurance
├── .DS_Store
├── .classpath
├── .gitignore
├── .project
├── .settings
│ ├── .jsdtscope
│ ├── org.eclipse.core.resources.prefs
│ ├── org.eclipse.jdt.core.prefs
│ ├── org.eclipse.m2e.core.prefs
│ ├── org.eclipse.wst.common.component
│ ├── org.eclipse.wst.common.project.facet.core.xml
│ ├── org.eclipse.wst.jsdt.ui.superType.container
│ └── org.eclipse.wst.jsdt.ui.superType.name
├── ToorJar
│ ├── .gitignore
│ └── mysql-connector-java-5.1.44.jar
├── WebContent
│ ├── .DS_Store
│ ├── META-INF
│ │ └── MANIFEST.MF
│ └── WEB-INF
│ │ └── .DS_Store
├── pom.xml
└── src
│ ├── .DS_Store
│ ├── DBScript
│ ├── .DS_Store
│ ├── Insurance_Data_Script.sql
│ ├── Insurance_Mate_Script.sql
│ └── Insurance_Str_Script.sql
│ └── main
│ ├── .DS_Store
│ ├── java
│ ├── .DS_Store
│ └── com
│ │ ├── .DS_Store
│ │ └── Insurance
│ │ ├── ADemo
│ │ ├── AccessToken.java
│ │ ├── CaptchaModule.java
│ │ ├── DbController.java
│ │ ├── DemoController.java
│ │ ├── JsonWebToken.java
│ │ ├── LoginPara.java
│ │ ├── RedisConfig.java
│ │ ├── UserController.java
│ │ ├── UserInfo.java
│ │ └── UserInfoRepository.java
│ │ ├── Business
│ │ ├── LoginController.java
│ │ └── UserController.java
│ │ ├── Filter
│ │ ├── Audience.java
│ │ ├── HTTPBasicAuthorizeAttribute.java
│ │ ├── HTTPBearerAuthorizeAttribute.java
│ │ ├── JWTLoginFilter.java
│ │ ├── JwtAuthenticationFilter.java
│ │ ├── ResultMsg.java
│ │ └── ResultStatusCode.java
│ │ ├── InsuranceApplication.java
│ │ ├── Model
│ │ └── InsuranceUser.java
│ │ ├── Utils
│ │ ├── JwtHelper.java
│ │ └── SecurityHelper.java
│ │ └── repository
│ │ └── InsuranceUserRepository.java
│ └── resources
│ ├── .DS_Store
│ ├── application.properties
│ ├── jwt.properties
│ └── mapper
│ └── config
│ └── sqlMapConfig.xml
└── Servers
├── .DS_Store
├── .project
├── .settings
└── org.eclipse.wst.server.core.prefs
└── Tomcat v9.0 Server at localhost-config
├── catalina.policy
├── catalina.properties
├── context.xml
├── server.xml
├── tomcat-users.xml
└── web.xml
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/.DS_Store
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.metadata/
2 | RemoteSystemsTempFiles/.project
3 | Insurance/.DS_Store
4 | Insurance/.DS_Store
5 | Insurance/.metadata/.lock
6 | Insurance/.metadata/.log
7 | Insurance/.metadata/.mylyn/repositories.xml.zip
8 | Insurance/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version
9 | *.index
10 | Insurance/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
11 | Insurance/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree
12 | Insurance/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
13 | *.prefs
14 | *.xmi
15 | Insurance/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/http-cache.lucene60/segments_1
16 | Insurance/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/http-cache.lucene60/write.lock
17 | Insurance/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/_0.cfe
18 | *.cfs
19 | *.si
20 | Insurance/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/local-history.lucene60/segments_1
21 | *.lock
22 | Insurance/.metadata/.plugins/org.eclipse.epp.logging.aeri.ide/org.eclipse.epp.logging.aeri.ide.server/server-config.json
23 | Insurance/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache
24 | Insurance/.metadata/.plugins/org.eclipse.jdt.core/index.db
25 | Insurance/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache
26 | Insurance/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache
27 | Insurance/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat
28 | Insurance/.metadata/version.ini
29 | Insurance/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml
30 | Insurance/.metadata/.plugins/org.eclipse.ui.intro/introstate
31 | Insurance/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties
32 | Insurance/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.8.2.20171007-0217.xml
33 | Insurance/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log
34 | Insurance/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml
35 | Insurance/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml
36 |
--------------------------------------------------------------------------------
/Insurance/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/Insurance/.DS_Store
--------------------------------------------------------------------------------
/Insurance/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Insurance/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 |
--------------------------------------------------------------------------------
/Insurance/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Insurance
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.wst.common.project.facet.core.builder
10 |
11 |
12 |
13 |
14 | org.eclipse.jdt.core.javabuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.wst.validation.validationbuilder
20 |
21 |
22 |
23 |
24 | org.eclipse.m2e.core.maven2Builder
25 |
26 |
27 |
28 |
29 |
30 | org.eclipse.jem.workbench.JavaEMFNature
31 | org.eclipse.wst.common.modulecore.ModuleCoreNature
32 | org.eclipse.jdt.core.javanature
33 | org.eclipse.m2e.core.maven2Nature
34 | org.eclipse.wst.common.project.facet.core.nature
35 | org.eclipse.wst.jsdt.core.jsNature
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Insurance/.settings/.jsdtscope:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Insurance/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//src/main/java=UTF-8
3 | encoding//src/main/resources=UTF-8
4 | encoding//src/test/java=UTF-8
5 | encoding//src/test/resources=UTF-8
6 | encoding/=UTF-8
7 |
--------------------------------------------------------------------------------
/Insurance/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.compliance=1.8
7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
13 | org.eclipse.jdt.core.compiler.source=1.8
14 |
--------------------------------------------------------------------------------
/Insurance/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/Insurance/.settings/org.eclipse.wst.common.component:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Insurance/.settings/org.eclipse.wst.common.project.facet.core.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Insurance/.settings/org.eclipse.wst.jsdt.ui.superType.container:
--------------------------------------------------------------------------------
1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary
--------------------------------------------------------------------------------
/Insurance/.settings/org.eclipse.wst.jsdt.ui.superType.name:
--------------------------------------------------------------------------------
1 | Window
--------------------------------------------------------------------------------
/Insurance/ToorJar/.gitignore:
--------------------------------------------------------------------------------
1 | /mysql-connector-java-5.1.44.jar
2 |
--------------------------------------------------------------------------------
/Insurance/ToorJar/mysql-connector-java-5.1.44.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/Insurance/ToorJar/mysql-connector-java-5.1.44.jar
--------------------------------------------------------------------------------
/Insurance/WebContent/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/Insurance/WebContent/.DS_Store
--------------------------------------------------------------------------------
/Insurance/WebContent/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/Insurance/WebContent/WEB-INF/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/Insurance/WebContent/WEB-INF/.DS_Store
--------------------------------------------------------------------------------
/Insurance/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | com.Insurance
7 | Insurance
8 | 0.0.1-SNAPSHOT
9 | jar
10 |
11 | insurance
12 | recommend insurance project for Spring Boot
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter-parent
17 | 1.5.7.RELEASE
18 |
19 |
20 |
21 |
22 | UTF-8
23 | UTF-8
24 | 1.8
25 |
26 |
27 |
28 |
29 |
30 | org.springframework
31 | spring-webmvc
32 |
33 |
34 |
35 | org.springframework.boot
36 | spring-boot-starter
37 |
38 |
39 |
40 | org.springframework.boot
41 | spring-boot-starter-test
42 | test
43 |
44 |
45 | org.springframework.boot
46 | spring-boot-starter-web
47 |
48 |
49 | mysql
50 | mysql-connector-java
51 |
52 |
53 | org.springframework.boot
54 | spring-boot-starter-jdbc
55 |
56 |
57 | org.springframework.boot
58 | spring-boot-starter-security
59 |
60 |
61 | org.springframework.boot
62 | spring-boot-starter-data-jpa
63 |
64 |
65 | io.jsonwebtoken
66 | jjwt
67 | 0.7.0
68 |
69 |
70 | org.mybatis.spring.boot
71 | mybatis-spring-boot-starter
72 | 1.1.1
73 |
74 |
75 | org.springframework.boot
76 | spring-boot-starter-redis
77 | 1.4.7.RELEASE
78 |
79 |
80 | cn.apiclub.tool
81 | simplecaptcha
82 | 1.2.2
83 |
84 |
85 |
86 |
87 |
88 |
89 | org.apache.maven.plugins
90 | maven-compiler-plugin
91 |
92 | 1.7
93 | 1.7
94 | UTF-8
95 |
96 |
97 |
98 | org.springframework.boot
99 | spring-boot-maven-plugin
100 |
101 |
102 |
103 |
104 |
105 |
106 | org.apache.tomcat.maven
107 | tomcat7-maven-plugin
108 | 9.0
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/Insurance/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/Insurance/src/.DS_Store
--------------------------------------------------------------------------------
/Insurance/src/DBScript/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/Insurance/src/DBScript/.DS_Store
--------------------------------------------------------------------------------
/Insurance/src/DBScript/Insurance_Data_Script.sql:
--------------------------------------------------------------------------------
1 | insert insuranceuser (id,username,userpwd,phonenumb,email,nickname) values (1,'admin','admin','18701442226','abysmkami@163.com','创世大魔王');
2 |
3 |
--------------------------------------------------------------------------------
/Insurance/src/DBScript/Insurance_Mate_Script.sql:
--------------------------------------------------------------------------------
1 | insert insurancerole (id,rolename,roledisplayname) values (1,'sysadmin','系统管理员');
2 | insert insurancerole (id,rolename,roledisplayname) values (2,'sysmanager','系统业务员');
3 | insert insurancerole (id,rolename,roledisplayname) values (4,'companyadmin','公司管理员');
4 | insert insurancerole (id,rolename,roledisplayname) values (8,'companymanager','公司业务员');
5 | insert insurancerole (id,rolename,roledisplayname) values (16,'companyuser','公司用户');
6 | insert insurancerole (id,rolename,roledisplayname, values (32,'user','普通用户');
7 |
--------------------------------------------------------------------------------
/Insurance/src/DBScript/Insurance_Str_Script.sql:
--------------------------------------------------------------------------------
1 | use insurance
2 | CREATE TABLE insuranceuser (
3 | id INTEGER UNSIGNED NOT NULL,
4 | username VARCHAR(100),
5 | userpwd VARCHAR(100),
6 | phonenumb varchar(30),
7 | email varchar(100),
8 | nickname varchar (100),
9 | PRIMARY KEY (id)
10 | ) ENGINE=InnoDB
11 | create table insurancerole
12 | (
13 | id INTEGER UNSIGNED NOT NULL,
14 | rolename VARCHAR(30),
15 | roledisplayname varchar(30),
16 | PRIMARY KEY (id)
17 | )
18 |
--------------------------------------------------------------------------------
/Insurance/src/main/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/Insurance/src/main/.DS_Store
--------------------------------------------------------------------------------
/Insurance/src/main/java/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/Insurance/src/main/java/.DS_Store
--------------------------------------------------------------------------------
/Insurance/src/main/java/com/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abysmkami/java-springboot-Insurance/88e9d2974b6d9a01b5459cb6f0a05e977c97c572/Insurance/src/main/java/com/.DS_Store
--------------------------------------------------------------------------------
/Insurance/src/main/java/com/Insurance/ADemo/AccessToken.java:
--------------------------------------------------------------------------------
1 | package com.Insurance.ADemo;
2 |
3 | public class AccessToken {
4 | private String access_token;
5 | private String token_type;
6 | private long expires_in;
7 | public String getAccess_token() {
8 | return access_token;
9 | }
10 | public void setAccess_token(String access_token) {
11 | this.access_token = access_token;
12 | }
13 | public String getToken_type() {
14 | return token_type;
15 | }
16 | public void setToken_type(String token_type) {
17 | this.token_type = token_type;
18 | }
19 | public long getExpires_in() {
20 | return expires_in;
21 | }
22 | public void setExpires_in(long expires_in) {
23 | this.expires_in = expires_in;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Insurance/src/main/java/com/Insurance/ADemo/CaptchaModule.java:
--------------------------------------------------------------------------------
1 | package com.Insurance.ADemo;
2 |
3 | import java.io.ByteArrayOutputStream;
4 | import java.io.IOException;
5 | import java.util.UUID;
6 | import java.util.concurrent.TimeUnit;
7 |
8 | import javax.imageio.ImageIO;
9 | import javax.servlet.http.Cookie;
10 | import javax.servlet.http.HttpServletResponse;
11 |
12 | import org.springframework.beans.factory.annotation.Autowired;
13 | import org.springframework.data.redis.core.RedisTemplate;
14 | import org.springframework.http.MediaType;
15 | import org.springframework.web.bind.annotation.RequestMapping;
16 | import org.springframework.web.bind.annotation.RequestMethod;
17 | import org.springframework.web.bind.annotation.ResponseBody;
18 | import org.springframework.web.bind.annotation.RestController;
19 |
20 | import cn.apiclub.captcha.Captcha;
21 | import cn.apiclub.captcha.backgrounds.GradiatedBackgroundProducer;
22 | import cn.apiclub.captcha.gimpy.FishEyeGimpyRenderer;
23 |
24 | @RestController
25 | @RequestMapping("captcha")
26 | public class CaptchaModule {
27 |
28 | @Autowired
29 | private RedisTemplate redisTemplate;
30 |
31 | private static int captchaExpires = 3*60; //超时时间3min
32 | private static int captchaW = 200;
33 | private static int captchaH = 60;
34 |
35 | @RequestMapping(value = "getcaptcha", method = RequestMethod.GET, produces = MediaType.IMAGE_PNG_VALUE)
36 |
37 | public @ResponseBody byte[] getCaptcha(HttpServletResponse response)
38 | {
39 | //生成验证码
40 | String uuid = UUID.randomUUID().toString();
41 | Captcha captcha = new Captcha.Builder(captchaW, captchaH)
42 | .addText().addBackground(new GradiatedBackgroundProducer())
43 | .gimp(new FishEyeGimpyRenderer())
44 | .build();
45 |
46 | //将验证码以形式缓存到redis
47 | redisTemplate.opsForValue().set(uuid, captcha.getAnswer(), captchaExpires, TimeUnit.SECONDS);
48 |
49 | //将验证码key,及验证码的图片返回
50 | Cookie cookie = new Cookie("CaptchaCode",uuid);
51 | response.addCookie(cookie);
52 | ByteArrayOutputStream bao = new ByteArrayOutputStream();
53 | try {
54 | ImageIO.write(captcha.getImage(), "png", bao);
55 | return bao.toByteArray();
56 | } catch (IOException e) {
57 | return null;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Insurance/src/main/java/com/Insurance/ADemo/DbController.java:
--------------------------------------------------------------------------------
1 | package com.Insurance.ADemo;
2 |
3 | import java.util.Iterator;
4 | import java.util.List;
5 | import java.util.Map;
6 | import java.util.Map.Entry;
7 | import java.util.Set;
8 |
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.jdbc.core.JdbcTemplate;
11 | import org.springframework.web.bind.annotation.PathVariable;
12 | import org.springframework.web.bind.annotation.RequestMapping;
13 | import org.springframework.web.bind.annotation.RestController;
14 |
15 | @RestController
16 | @RequestMapping("/mydb")
17 | public class DbController {
18 |
19 | @Autowired
20 | private JdbcTemplate jdbcTemplate;
21 |
22 | @RequestMapping("/getUsers")
23 | public List