├── .gitignore
├── README.md
├── image
├── 1.png
├── 10.png
├── 11.png
├── 12.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── 6.png
├── 7.png
├── 8.png
└── 9.png
├── limage
├── 1.png
├── 2.png
└── 3.png
├── mvnw
├── mvnw.cmd
├── pom-war.xml
├── pom.xml
└── src
├── main
├── java
│ └── com
│ │ ├── SpringbootSchemaApplication.java
│ │ ├── annotation
│ │ ├── APPLoginUser.java
│ │ ├── IgnoreAuth.java
│ │ └── LoginUser.java
│ │ ├── config
│ │ ├── AlipayConfig.java
│ │ ├── InterceptorConfig.java
│ │ └── MybatisPlusConfig.java
│ │ ├── controller
│ │ ├── CommonController.java
│ │ ├── ConfigController.java
│ │ ├── DiscussketixinxiController.java
│ │ ├── FileController.java
│ │ ├── JiaoshiController.java
│ │ ├── KetifenleiController.java
│ │ ├── KetixinxiController.java
│ │ ├── NewsController.java
│ │ ├── StoreupController.java
│ │ ├── UsersController.java
│ │ ├── XuantixinxiController.java
│ │ ├── XueshengController.java
│ │ └── ZiniketiController.java
│ │ ├── dao
│ │ ├── CommonDao.java
│ │ ├── ConfigDao.java
│ │ ├── DiscussketixinxiDao.java
│ │ ├── JiaoshiDao.java
│ │ ├── KetifenleiDao.java
│ │ ├── KetixinxiDao.java
│ │ ├── NewsDao.java
│ │ ├── StoreupDao.java
│ │ ├── TokenDao.java
│ │ ├── UsersDao.java
│ │ ├── XuantixinxiDao.java
│ │ ├── XueshengDao.java
│ │ └── ZiniketiDao.java
│ │ ├── entity
│ │ ├── ConfigEntity.java
│ │ ├── DiscussketixinxiEntity.java
│ │ ├── EIException.java
│ │ ├── JiaoshiEntity.java
│ │ ├── KetifenleiEntity.java
│ │ ├── KetixinxiEntity.java
│ │ ├── NewsEntity.java
│ │ ├── StoreupEntity.java
│ │ ├── TokenEntity.java
│ │ ├── UsersEntity.java
│ │ ├── XuantixinxiEntity.java
│ │ ├── XueshengEntity.java
│ │ ├── ZiniketiEntity.java
│ │ ├── model
│ │ │ ├── DiscussketixinxiModel.java
│ │ │ ├── JiaoshiModel.java
│ │ │ ├── KetifenleiModel.java
│ │ │ ├── KetixinxiModel.java
│ │ │ ├── NewsModel.java
│ │ │ ├── StoreupModel.java
│ │ │ ├── XuantixinxiModel.java
│ │ │ ├── XueshengModel.java
│ │ │ └── ZiniketiModel.java
│ │ ├── view
│ │ │ ├── DiscussketixinxiView.java
│ │ │ ├── JiaoshiView.java
│ │ │ ├── KetifenleiView.java
│ │ │ ├── KetixinxiView.java
│ │ │ ├── NewsView.java
│ │ │ ├── StoreupView.java
│ │ │ ├── XuantixinxiView.java
│ │ │ ├── XueshengView.java
│ │ │ └── ZiniketiView.java
│ │ └── vo
│ │ │ ├── DiscussketixinxiVO.java
│ │ │ ├── JiaoshiVO.java
│ │ │ ├── KetifenleiVO.java
│ │ │ ├── KetixinxiVO.java
│ │ │ ├── NewsVO.java
│ │ │ ├── StoreupVO.java
│ │ │ ├── XuantixinxiVO.java
│ │ │ ├── XueshengVO.java
│ │ │ └── ZiniketiVO.java
│ │ ├── interceptor
│ │ └── AuthorizationInterceptor.java
│ │ ├── service
│ │ ├── CommonService.java
│ │ ├── ConfigService.java
│ │ ├── DiscussketixinxiService.java
│ │ ├── JiaoshiService.java
│ │ ├── KetifenleiService.java
│ │ ├── KetixinxiService.java
│ │ ├── NewsService.java
│ │ ├── StoreupService.java
│ │ ├── TokenService.java
│ │ ├── UsersService.java
│ │ ├── XuantixinxiService.java
│ │ ├── XueshengService.java
│ │ ├── ZiniketiService.java
│ │ └── impl
│ │ │ ├── CommonServiceImpl.java
│ │ │ ├── ConfigServiceImpl.java
│ │ │ ├── DiscussketixinxiServiceImpl.java
│ │ │ ├── JiaoshiServiceImpl.java
│ │ │ ├── KetifenleiServiceImpl.java
│ │ │ ├── KetixinxiServiceImpl.java
│ │ │ ├── NewsServiceImpl.java
│ │ │ ├── StoreupServiceImpl.java
│ │ │ ├── TokenServiceImpl.java
│ │ │ ├── UsersServiceImpl.java
│ │ │ ├── XuantixinxiServiceImpl.java
│ │ │ ├── XueshengServiceImpl.java
│ │ │ └── ZiniketiServiceImpl.java
│ │ └── utils
│ │ ├── BaiduUtil.java
│ │ ├── CommonUtil.java
│ │ ├── FileUtil.java
│ │ ├── HttpClientUtils.java
│ │ ├── JQPageInfo.java
│ │ ├── MD5Util.java
│ │ ├── MPUtil.java
│ │ ├── PageUtils.java
│ │ ├── Query.java
│ │ ├── R.java
│ │ ├── SQLFilter.java
│ │ ├── SpringContextUtils.java
│ │ └── ValidatorUtils.java
└── resources
│ ├── application.yml
│ └── mapper
│ ├── CommonDao.xml
│ ├── ConfigDao.xml
│ ├── DiscussketixinxiDao.xml
│ ├── JiaoshiDao.xml
│ ├── KetifenleiDao.xml
│ ├── KetixinxiDao.xml
│ ├── NewsDao.xml
│ ├── StoreupDao.xml
│ ├── TokenDao.xml
│ ├── UsersDao.xml
│ ├── XuantixinxiDao.xml
│ ├── XueshengDao.xml
│ └── ZiniketiDao.xml
└── test
└── java
└── com
└── SpringbootSchemaApplicationTests.java
/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**
5 | !**/src/test/**
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 |
30 | ### VS Code ###
31 | .vscode/
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 基于Springboot的课程设计选题管理系统(程序+论文)
2 | =
3 | ### 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/))
4 | ### 作者微信:19941326836 QQ:952045282
5 | ### 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习
6 | ### 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务
7 | ### 所有选题地址https://github.com/nature924/allProject
8 |
9 | 一、项目介绍
10 | ---
11 | 基于Spring Boot框架实现的课程设计选题管理系统,系统包含三种角色:管理员、用户,教师主要功能如下。
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 | 选题信息管理:查看学生已选题目的情况。
40 | 自拟课题管理:提出和管理个人自拟的课题。
41 | 系统管理:校园资讯管理。
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | 二、项目技术
50 | ---
51 | - 编程语言:Java
52 | - 数据库:MySQL
53 | - 项目管理工具:Maven
54 | - 前端技术:VUE、HTML、Jquery、Bootstrap
55 | - 后端技术:Spring、SpringMVC、MyBatis
56 |
57 | 三、运行环境
58 | ---
59 | - 操作系统:Windows、macOS都可以
60 | - JDK版本:JDK1.8以上都可以
61 | - 开发工具:IDEA、Ecplise、Myecplise都可以
62 | - 数据库: MySQL5.7以上都可以
63 | - Tomcat:任意版本都可以
64 | - Maven:任意版本都可以
65 |
66 | 四、运行截图
67 | ---
68 | ### 论文截图:
69 | 
70 | 
71 |
72 | ### 程序截图:
73 | 
74 | 
75 | 
76 | 
77 | 
78 | 
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/image/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/1.png
--------------------------------------------------------------------------------
/image/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/10.png
--------------------------------------------------------------------------------
/image/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/11.png
--------------------------------------------------------------------------------
/image/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/12.png
--------------------------------------------------------------------------------
/image/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/2.png
--------------------------------------------------------------------------------
/image/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/3.png
--------------------------------------------------------------------------------
/image/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/4.png
--------------------------------------------------------------------------------
/image/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/5.png
--------------------------------------------------------------------------------
/image/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/6.png
--------------------------------------------------------------------------------
/image/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/7.png
--------------------------------------------------------------------------------
/image/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/8.png
--------------------------------------------------------------------------------
/image/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/image/9.png
--------------------------------------------------------------------------------
/limage/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/limage/1.png
--------------------------------------------------------------------------------
/limage/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/limage/2.png
--------------------------------------------------------------------------------
/limage/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nature924/No254Course-Design-Topic-Management-System/d2af5937501ef84230333d73c4d2ab38c46a0504/limage/3.png
--------------------------------------------------------------------------------
/pom-war.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.2.2.RELEASE
9 |
10 |
11 | com.jlwl
12 |
13 | springbootw9opl
14 | 0.0.1-SNAPSHOT
15 | springboot-schema
16 | springboot学习框架(war包对应的pom,打war包,执行【mvn clean package -f pom-war.xml】)
17 | war
18 |
19 |
20 | 1.8
21 | 1.2.8
22 | 3.1.1
23 |
24 |
25 |
26 |
27 | org.springframework.boot
28 | spring-boot-starter-web
29 |
30 |
31 | org.mybatis.spring.boot
32 | mybatis-spring-boot-starter
33 | 2.1.1
34 |
35 |
36 | org.springframework.boot
37 | spring-boot-starter-jdbc
38 |
39 |
40 |
41 | org.springframework.boot
42 | spring-boot-starter-tomcat
43 | provided
44 |
45 |
46 |
47 | mysql
48 | mysql-connector-java
49 |
50 |
51 | org.apache.shiro
52 | shiro-spring
53 | 1.3.2
54 |
55 |
56 |
57 | com.baomidou
58 | mybatis-plus
59 | 2.3
60 |
61 |
62 | com.baomidou
63 | mybatisplus-spring-boot-starter
64 | 1.0.5
65 |
66 |
67 | com.google.protobuf
68 | protobuf-java
69 | 3.10.0
70 |
71 |
72 |
73 | org.apache.commons
74 | commons-lang3
75 | 3.0
76 |
77 |
78 |
79 | javax.validation
80 | validation-api
81 | 2.0.1.Final
82 |
83 |
84 |
85 | commons-io
86 | commons-io
87 | 2.5
88 |
89 |
90 |
91 |
92 | cn.hutool
93 | hutool-all
94 | 4.0.12
95 |
96 |
97 |
98 |
99 | com.alibaba
100 | fastjson
101 | ${fastjson.version}
102 |
103 |
104 |
105 | com.baidu.aip
106 | java-sdk
107 | 4.4.1
108 |
109 |
110 |
111 | org.apache.poi
112 | poi
113 | 3.11
114 |
115 |
116 |
117 | org.apache.poi
118 | poi-ooxml
119 | 3.9
120 |
121 |
122 |
123 |
124 | org.springframework.boot
125 | spring-boot-starter-test
126 | test
127 |
128 |
129 | org.junit.vintage
130 | junit-vintage-engine
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | springbootw9opl
139 |
140 |
141 | org.springframework.boot
142 | spring-boot-maven-plugin
143 |
144 |
145 |
146 | org.apache.maven.plugins
147 | maven-surefire-plugin
148 |
149 | true
150 |
151 |
152 |
153 |
154 |
155 |
156 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.2.2.RELEASE
9 |
10 |
11 | com.jlwl
12 |
13 | springbootw9opl
14 | 0.0.1-SNAPSHOT
15 | springboot-schema
16 | springboot学习框架
17 |
18 |
19 | 1.8
20 | 1.2.8
21 | 3.1.1
22 |
23 |
24 |
25 |
26 | org.springframework.boot
27 | spring-boot-starter-web
28 |
29 |
30 | org.mybatis.spring.boot
31 | mybatis-spring-boot-starter
32 | 2.1.1
33 |
34 |
35 | org.springframework.boot
36 | spring-boot-starter-jdbc
37 |
38 |
39 |
40 | mysql
41 | mysql-connector-java
42 |
43 |
44 | org.apache.shiro
45 | shiro-spring
46 | 1.3.2
47 |
48 |
49 |
50 | com.baomidou
51 | mybatis-plus
52 | 2.3
53 |
54 |
55 | com.baomidou
56 | mybatisplus-spring-boot-starter
57 | 1.0.5
58 |
59 |
60 | com.google.protobuf
61 | protobuf-java
62 | 3.10.0
63 |
64 |
65 |
66 | org.apache.commons
67 | commons-lang3
68 | 3.0
69 |
70 |
71 |
72 | javax.validation
73 | validation-api
74 | 2.0.1.Final
75 |
76 |
77 |
78 | commons-io
79 | commons-io
80 | 2.5
81 |
82 |
83 |
84 |
85 | cn.hutool
86 | hutool-all
87 | 4.0.12
88 |
89 |
90 |
91 |
92 | com.alibaba
93 | fastjson
94 | ${fastjson.version}
95 |
96 |
97 | com.microsoft.sqlserver
98 | sqljdbc4
99 | 4.0
100 | 4.0
101 |
102 |
103 |
104 | com.microsoft.sqlserver
105 | mssql-jdbc
106 | 6.2.0.jre8
107 | runtime
108 |
109 |
110 |
111 | com.baidu.aip
112 | java-sdk
113 | 4.4.1
114 |
115 |
116 |
117 | org.apache.poi
118 | poi
119 | 3.11
120 |
121 |
122 |
123 | org.apache.poi
124 | poi-ooxml
125 | 3.9
126 |
127 |
128 |
129 |
130 | org.springframework.boot
131 | spring-boot-starter-test
132 | test
133 |
134 |
135 | org.junit.vintage
136 | junit-vintage-engine
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 | org.springframework.boot
146 | spring-boot-maven-plugin
147 |
148 |
149 | org.apache.maven.plugins
150 | maven-compiler-plugin
151 |
152 | 1.8
153 | 1.8
154 |
155 |
156 |
157 | org.apache.maven.plugins
158 | maven-surefire-plugin
159 |
160 | true
161 |
162 |
163 |
164 |
165 |
166 |
167 |
--------------------------------------------------------------------------------
/src/main/java/com/SpringbootSchemaApplication.java:
--------------------------------------------------------------------------------
1 | package com;
2 |
3 | import org.mybatis.spring.annotation.MapperScan;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.boot.builder.SpringApplicationBuilder;
7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
8 |
9 | @SpringBootApplication
10 | @MapperScan(basePackages = {"com.dao"})
11 | public class SpringbootSchemaApplication extends SpringBootServletInitializer{
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(SpringbootSchemaApplication.class, args);
15 | }
16 |
17 | @Override
18 | protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
19 | return applicationBuilder.sources(SpringbootSchemaApplication.class);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/com/annotation/APPLoginUser.java:
--------------------------------------------------------------------------------
1 | package com.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * 登录用户信息
10 | */
11 | @Target(ElementType.PARAMETER)
12 | @Retention(RetentionPolicy.RUNTIME)
13 | public @interface APPLoginUser {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/com/annotation/IgnoreAuth.java:
--------------------------------------------------------------------------------
1 | package com.annotation;
2 |
3 | import java.lang.annotation.*;
4 |
5 | /**
6 | * 忽略Token验证
7 | */
8 | @Target(ElementType.METHOD)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | @Documented
11 | public @interface IgnoreAuth {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/com/annotation/LoginUser.java:
--------------------------------------------------------------------------------
1 | package com.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * 登录用户信息
10 | */
11 | @Target(ElementType.PARAMETER)
12 | @Retention(RetentionPolicy.RUNTIME)
13 | public @interface LoginUser {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/com/config/AlipayConfig.java:
--------------------------------------------------------------------------------
1 | package com.config;
2 |
3 | import java.io.FileWriter;
4 | import java.io.IOException;
5 |
6 | /* *
7 | *类名:AlipayConfig
8 | *功能:基础配置类
9 | *详细:设置帐户有关信息及返回路径
10 | *修改日期:2017-04-05
11 | *说明:
12 | *以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
13 | *该代码仅供学习和研究支付宝接口使用,只是提供一个参考。
14 | */
15 |
16 | public class AlipayConfig {
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/src/main/java/com/config/InterceptorConfig.java:
--------------------------------------------------------------------------------
1 | package com.config;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
6 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
8 |
9 | import com.interceptor.AuthorizationInterceptor;
10 |
11 | @Configuration
12 | public class InterceptorConfig extends WebMvcConfigurationSupport{
13 |
14 | @Bean
15 | public AuthorizationInterceptor getAuthorizationInterceptor() {
16 | return new AuthorizationInterceptor();
17 | }
18 |
19 | @Override
20 | public void addInterceptors(InterceptorRegistry registry) {
21 | registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**");
22 | super.addInterceptors(registry);
23 | }
24 |
25 | /**
26 | * springboot 2.0配置WebMvcConfigurationSupport之后,会导致默认配置被覆盖,要访问静态资源需要重写addResourceHandlers方法
27 | */
28 | @Override
29 | public void addResourceHandlers(ResourceHandlerRegistry registry) {
30 | registry.addResourceHandler("/**")
31 | .addResourceLocations("classpath:/resources/")
32 | .addResourceLocations("classpath:/static/")
33 | .addResourceLocations("classpath:/admin/")
34 | .addResourceLocations("classpath:/front/")
35 | .addResourceLocations("classpath:/public/");
36 | super.addResourceHandlers(registry);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/config/MybatisPlusConfig.java:
--------------------------------------------------------------------------------
1 |
2 | package com.config;
3 |
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
8 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
9 |
10 | /**
11 | * mybatis-plus配置
12 | */
13 | @Configuration
14 | public class MybatisPlusConfig {
15 |
16 | /**
17 | * 分页插件
18 | */
19 | @Bean
20 | public PaginationInterceptor paginationInterceptor() {
21 | return new PaginationInterceptor();
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/controller/ConfigController.java:
--------------------------------------------------------------------------------
1 |
2 | package com.controller;
3 |
4 |
5 | import java.util.Arrays;
6 | import java.util.Map;
7 |
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.PathVariable;
10 | import org.springframework.web.bind.annotation.PostMapping;
11 | import org.springframework.web.bind.annotation.RequestBody;
12 | import org.springframework.web.bind.annotation.RequestMapping;
13 | import org.springframework.web.bind.annotation.RequestParam;
14 | import org.springframework.web.bind.annotation.RestController;
15 |
16 | import com.annotation.IgnoreAuth;
17 | import com.baomidou.mybatisplus.mapper.EntityWrapper;
18 | import com.entity.ConfigEntity;
19 | import com.service.ConfigService;
20 | import com.utils.MPUtil;
21 | import com.utils.PageUtils;
22 | import com.utils.R;
23 | import com.utils.ValidatorUtils;
24 |
25 | /**
26 | * 登录相关
27 | */
28 | @RequestMapping("config")
29 | @RestController
30 | public class ConfigController{
31 |
32 | @Autowired
33 | private ConfigService configService;
34 |
35 | /**
36 | * 列表
37 | */
38 | @RequestMapping("/page")
39 | public R page(@RequestParam Map params,ConfigEntity config){
40 | EntityWrapper ew = new EntityWrapper();
41 | PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
42 | return R.ok().put("data", page);
43 | }
44 |
45 | /**
46 | * 列表
47 | */
48 | @IgnoreAuth
49 | @RequestMapping("/list")
50 | public R list(@RequestParam Map params,ConfigEntity config){
51 | EntityWrapper ew = new EntityWrapper();
52 | PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
53 | return R.ok().put("data", page);
54 | }
55 |
56 | /**
57 | * 信息
58 | */
59 | @RequestMapping("/info/{id}")
60 | public R info(@PathVariable("id") String id){
61 | ConfigEntity config = configService.selectById(id);
62 | return R.ok().put("data", config);
63 | }
64 |
65 | /**
66 | * 详情
67 | */
68 | @IgnoreAuth
69 | @RequestMapping("/detail/{id}")
70 | public R detail(@PathVariable("id") String id){
71 | ConfigEntity config = configService.selectById(id);
72 | return R.ok().put("data", config);
73 | }
74 |
75 | /**
76 | * 根据name获取信息
77 | */
78 | @RequestMapping("/info")
79 | public R infoByName(@RequestParam String name){
80 | ConfigEntity config = configService.selectOne(new EntityWrapper().eq("name", "faceFile"));
81 | return R.ok().put("data", config);
82 | }
83 |
84 | /**
85 | * 保存
86 | */
87 | @PostMapping("/save")
88 | public R save(@RequestBody ConfigEntity config){
89 | // ValidatorUtils.validateEntity(config);
90 | configService.insert(config);
91 | return R.ok();
92 | }
93 |
94 | /**
95 | * 修改
96 | */
97 | @RequestMapping("/update")
98 | public R update(@RequestBody ConfigEntity config){
99 | // ValidatorUtils.validateEntity(config);
100 | configService.updateById(config);//全部更新
101 | return R.ok();
102 | }
103 |
104 | /**
105 | * 删除
106 | */
107 | @RequestMapping("/delete")
108 | public R delete(@RequestBody Long[] ids){
109 | configService.deleteBatchIds(Arrays.asList(ids));
110 | return R.ok();
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/src/main/java/com/controller/FileController.java:
--------------------------------------------------------------------------------
1 | package com.controller;
2 |
3 | import java.io.File;
4 | import java.io.FileNotFoundException;
5 | import java.io.IOException;
6 | import java.util.Arrays;
7 | import java.util.Date;
8 | import java.util.HashMap;
9 | import java.util.List;
10 | import java.util.Map;
11 | import java.util.Random;
12 | import java.util.UUID;
13 |
14 | import org.apache.commons.io.FileUtils;
15 | import org.apache.commons.lang3.StringUtils;
16 | import org.springframework.beans.factory.annotation.Autowired;
17 | import org.springframework.http.HttpHeaders;
18 | import org.springframework.http.HttpStatus;
19 | import org.springframework.http.MediaType;
20 | import org.springframework.http.ResponseEntity;
21 | import org.springframework.util.ResourceUtils;
22 | import org.springframework.web.bind.annotation.PathVariable;
23 | import org.springframework.web.bind.annotation.RequestBody;
24 | import org.springframework.web.bind.annotation.RequestMapping;
25 | import org.springframework.web.bind.annotation.RequestParam;
26 | import org.springframework.web.bind.annotation.RestController;
27 | import org.springframework.web.multipart.MultipartFile;
28 |
29 | import com.annotation.IgnoreAuth;
30 | import com.baomidou.mybatisplus.mapper.EntityWrapper;
31 | import com.entity.ConfigEntity;
32 | import com.entity.EIException;
33 | import com.service.ConfigService;
34 | import com.utils.R;
35 |
36 | /**
37 | * 上传文件映射表
38 | */
39 | @RestController
40 | @RequestMapping("file")
41 | @SuppressWarnings({"unchecked","rawtypes"})
42 | public class FileController{
43 | @Autowired
44 | private ConfigService configService;
45 | /**
46 | * 上传文件
47 | */
48 | @RequestMapping("/upload")
49 | @IgnoreAuth
50 | public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
51 | if (file.isEmpty()) {
52 | throw new EIException("上传文件不能为空");
53 | }
54 | String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
55 | File path = new File(ResourceUtils.getURL("classpath:static").getPath());
56 | if(!path.exists()) {
57 | path = new File("");
58 | }
59 | File upload = new File(path.getAbsolutePath(),"/upload/");
60 | if(!upload.exists()) {
61 | upload.mkdirs();
62 | }
63 | String fileName = new Date().getTime()+"."+fileExt;
64 | File dest = new File(upload.getAbsolutePath()+"/"+fileName);
65 | file.transferTo(dest);
66 | /**
67 | * 如果使用idea或者eclipse重启项目,发现之前上传的图片或者文件丢失,将下面一行代码注释打开
68 | * 请将以下的"D:\\springbootq33sd\\src\\main\\resources\\static\\upload"替换成你本地项目的upload路径,
69 | * 并且项目路径不能存在中文、空格等特殊字符
70 | */
71 | // FileUtils.copyFile(dest, new File("D:\\springbootq33sd\\src\\main\\resources\\static\\upload"+"/"+fileName)); /**修改了路径以后请将该行最前面的//注释去掉**/
72 | if(StringUtils.isNotBlank(type) && type.equals("1")) {
73 | ConfigEntity configEntity = configService.selectOne(new EntityWrapper().eq("name", "faceFile"));
74 | if(configEntity==null) {
75 | configEntity = new ConfigEntity();
76 | configEntity.setName("faceFile");
77 | configEntity.setValue(fileName);
78 | } else {
79 | configEntity.setValue(fileName);
80 | }
81 | configService.insertOrUpdate(configEntity);
82 | }
83 | return R.ok().put("file", fileName);
84 | }
85 |
86 | /**
87 | * 下载文件
88 | */
89 | @IgnoreAuth
90 | @RequestMapping("/download")
91 | public ResponseEntity download(@RequestParam String fileName) {
92 | try {
93 | File path = new File(ResourceUtils.getURL("classpath:static").getPath());
94 | if(!path.exists()) {
95 | path = new File("");
96 | }
97 | File upload = new File(path.getAbsolutePath(),"/upload/");
98 | if(!upload.exists()) {
99 | upload.mkdirs();
100 | }
101 | File file = new File(upload.getAbsolutePath()+"/"+fileName);
102 | if(file.exists()){
103 | /*if(!fileService.canRead(file, SessionManager.getSessionUser())){
104 | getResponse().sendError(403);
105 | }*/
106 | HttpHeaders headers = new HttpHeaders();
107 | headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
108 | headers.setContentDispositionFormData("attachment", fileName);
109 | return new ResponseEntity(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
110 | }
111 | } catch (IOException e) {
112 | e.printStackTrace();
113 | }
114 | return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
115 | }
116 |
117 | }
118 |
--------------------------------------------------------------------------------
/src/main/java/com/dao/CommonDao.java:
--------------------------------------------------------------------------------
1 |
2 | package com.dao;
3 |
4 | import java.util.List;
5 | import java.util.Map;
6 |
7 | /**
8 | * 通用接口
9 | */
10 | public interface CommonDao{
11 | List getOption(Map params);
12 |
13 | Map getFollowByOption(Map params);
14 |
15 | List getFollowByOption2(Map params);
16 |
17 | void sh(Map params);
18 |
19 | int remindCount(Map params);
20 |
21 | Map selectCal(Map params);
22 |
23 | List