├── .gitattributes
├── LICENSE
├── README.md
├── RookieMeeting
├── .gitignore
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── rookie
│ │ │ └── rookiemeeting
│ │ │ ├── RookieMeetingApplication.java
│ │ │ ├── common
│ │ │ ├── execption
│ │ │ │ ├── GlobalExceptionHandler.java
│ │ │ │ └── ServiceException.java
│ │ │ └── lang
│ │ │ │ ├── Constants.java
│ │ │ │ └── Result.java
│ │ │ ├── config
│ │ │ ├── AuthAccess.java
│ │ │ ├── BaiduConfig.java
│ │ │ ├── CorsConfig.java
│ │ │ ├── DruidConfig.java
│ │ │ ├── InterceptionConfig.java
│ │ │ ├── MyApplicationRunner.java
│ │ │ ├── MybatisPlusConfig.java
│ │ │ ├── MybatisRedisCache.java
│ │ │ ├── RedisConfig.java
│ │ │ └── SwaggerConfig.java
│ │ │ ├── controller
│ │ │ ├── ApproveAccountController.java
│ │ │ ├── ChangeBookingController.java
│ │ │ ├── DepartmentController.java
│ │ │ ├── DictController.java
│ │ │ ├── EChartsController.java
│ │ │ ├── EmployeeController.java
│ │ │ ├── MeetingController.java
│ │ │ ├── MeetingParticipantsController.java
│ │ │ ├── MeetingRoomController.java
│ │ │ ├── MenuController.java
│ │ │ ├── NotificationsController.java
│ │ │ ├── PhotoController.java
│ │ │ ├── RoleController.java
│ │ │ └── RoleMenuController.java
│ │ │ ├── dto
│ │ │ ├── EmployeeDto.java
│ │ │ ├── LoginDto.java
│ │ │ ├── MeetingDto.java
│ │ │ ├── ParticipantsDto.java
│ │ │ ├── RoomDto.java
│ │ │ ├── SevenDayMeeting.java
│ │ │ └── UpdatePassDTO.java
│ │ │ ├── interceptor
│ │ │ └── JwtInterceptor.java
│ │ │ ├── mapper
│ │ │ ├── DepartmentMapper.java
│ │ │ ├── DictMapper.java
│ │ │ ├── EmployeeMapper.java
│ │ │ ├── MeetingMapper.java
│ │ │ ├── MeetingParticipantsMapper.java
│ │ │ ├── MeetingRoomMapper.java
│ │ │ ├── MenuMapper.java
│ │ │ ├── RoleMapper.java
│ │ │ └── RoleMenuMapper.java
│ │ │ ├── service
│ │ │ ├── IDepartmentService.java
│ │ │ ├── IDictService.java
│ │ │ ├── IEmployeeService.java
│ │ │ ├── IMeetingParticipantsService.java
│ │ │ ├── IMeetingRoomService.java
│ │ │ ├── IMeetingService.java
│ │ │ ├── IMenuService.java
│ │ │ ├── IRoleMenuService.java
│ │ │ ├── IRoleService.java
│ │ │ └── Impl
│ │ │ │ ├── DepartmentServiceImpl.java
│ │ │ │ ├── DictServiceImpl.java
│ │ │ │ ├── EmployeeServiceImpl.java
│ │ │ │ ├── MeetingParticipantsServiceImpl.java
│ │ │ │ ├── MeetingRoomServiceImpl.java
│ │ │ │ ├── MeetingServiceImpl.java
│ │ │ │ ├── MenuServiceImpl.java
│ │ │ │ ├── RoleMenuServiceImpl.java
│ │ │ │ └── RoleServiceImpl.java
│ │ │ └── util
│ │ │ ├── BASE64.java
│ │ │ ├── SpringUtil.java
│ │ │ └── TokenUtils.java
│ └── resources
│ │ ├── application.yaml
│ │ ├── banner.txt
│ │ └── mapper
│ │ ├── DepartmentMapper.xml
│ │ ├── DictMapper.xml
│ │ ├── EmployeeMapper.xml
│ │ ├── MeetingMapper.xml
│ │ ├── MeetingParticipantsMapper.xml
│ │ ├── MeetingRoomMapper.xml
│ │ ├── MenuMapper.xml
│ │ ├── RoleMapper.xml
│ │ └── RoleMenuMapper.xml
│ └── test
│ └── java
│ └── com
│ └── rookie
│ └── rookiemeeting
│ └── RookieMeetingApplicationTests.java
├── imgs
├── .keep
├── image1.png
├── image2.png
├── image3.png
├── image4.png
└── image5.png
└── meeting
├── .browserslistrc
├── .gitignore
├── README.md
├── babel.config.js
├── jsconfig.json
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── icon.png
└── index.html
├── src
├── App.vue
├── assets
│ ├── 404.png
│ ├── gloable.css
│ ├── logo.png
│ └── 错误.png
├── components
│ ├── Aside.vue
│ ├── Header.vue
│ └── Layout.vue
├── main.js
├── store
│ └── index.js
├── util
│ ├── calendar.js
│ └── request.js
└── views
│ ├── 404
│ └── NotFound.vue
│ ├── DataReport
│ └── DataReport.vue
│ ├── Home.vue
│ ├── Meeting booking
│ ├── BookScheduled.vue
│ ├── MeetingRoom.vue
│ └── SearchMeeting.vue
│ ├── Personal Center
│ ├── Cancel.vue
│ ├── Meeting.vue
│ ├── Person.vue
│ ├── Scheduled.vue
│ └── UpdatePwd.vue
│ ├── Personnel management
│ ├── Approval.vue
│ ├── Manage.vue
│ └── Search.vue
│ ├── login
│ ├── FaceLogin.vue
│ └── Login.vue
│ ├── register
│ └── Register.vue
│ └── sys
│ ├── Dict.vue
│ ├── Druid.vue
│ ├── Menu.vue
│ └── Role.vue
└── vue.config.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=Java
2 | *.css linguist-language=Java
3 | *.html linguist-language=Java
4 | *.vue linguist-language=Java
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
基于springboot + vue + 百度SDK 开发的前后端分离人脸识别会议签到系统
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 |
40 | 基于springboot + vue + 百度SDK 开发的前后端分离人脸识别会议签到系统,支持会议的基本功能,人脸签到,照片签到,人脸登录,地图坐标签到,后台管理功能等。第十一届中国软件杯B4赛题三等奖。
41 |
42 | 在线网址:http://121.40.41.122/Meeting
43 |
44 | #### 软件架构
45 |
46 | B/S架构,架构图如下
47 | 
48 |
49 |
50 | #### 目录结构
51 |
52 | SQL文件位于sql文件夹下的rookismeeting.sql,需要MySQL8以上版本。
53 |
54 | 可直接导入该项目的本地编辑器中,修改后端配置文件中的数据库等连接信息,项目中使用到的百度地图SDK和百度人脸识别SDK等需要自行开通。
55 |
56 |
57 | #### 技术介绍
58 |
59 | 前端技术:Vue2 + Vuex + Vue - Router + Axios + Element - ui + Bootstrap + Echarts + JavaScript
60 |
61 | 后端技术:SpringBoot + Jwt + MyBatisPlus + MySQL+ Redis + Swagger + Druid + 百度SDK
62 |
63 |
64 | #### 开发环境
65 |
66 | | 开发工具 |说明 |
67 | |---|---|
68 | | IDEA | Java开发工具 |
69 | |VSCode | Vue开发工具IDE|
70 |
71 | | 开发环境 |版本 |
72 | |---|---|
73 | |JDK |1.8 |
74 | |MYSQL | 8.0.12 |
75 | |Redis | 5.0.14 |
76 | |Node |14.19.0
77 |
78 |
79 | #### 项目效果
80 | * 首页
81 | 
82 |
83 | * 会议统计可视化
84 | 
85 |
86 | * 会议签到
87 | 
88 |
89 | * 人脸识别登录
90 | 
91 |
92 | #### 部署项目
93 |
94 | 1、后端项目使用IDEA打开,一键启动
95 |
96 | 2、前端下载依赖,npm install
97 |
98 | 3、前端启动,npm run serve
99 |
100 | 4、如需要部署上线,可参考系统部署说明书
101 |
102 | #### 注意事项
103 |
104 | 若部署失败或不成功可加作者QQ:2740860037来咨询
105 |
--------------------------------------------------------------------------------
/RookieMeeting/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
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 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/RookieMeeting/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/He0306/meeting/5ac8e0e36f13de07a558062c1120885a71f8ec3a/RookieMeeting/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/RookieMeeting/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 |
--------------------------------------------------------------------------------
/RookieMeeting/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM https://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM set title of command window
39 | title %0
40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42 |
43 | @REM set %HOME% to equivalent of $HOME
44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45 |
46 | @REM Execute a user defined script before this one
47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
51 | :skipRcPre
52 |
53 | @setlocal
54 |
55 | set ERROR_CODE=0
56 |
57 | @REM To isolate internal variables from possible post scripts, we use another setlocal
58 | @setlocal
59 |
60 | @REM ==== START VALIDATION ====
61 | if not "%JAVA_HOME%" == "" goto OkJHome
62 |
63 | echo.
64 | echo Error: JAVA_HOME not found in your environment. >&2
65 | echo Please set the JAVA_HOME variable in your environment to match the >&2
66 | echo location of your Java installation. >&2
67 | echo.
68 | goto error
69 |
70 | :OkJHome
71 | if exist "%JAVA_HOME%\bin\java.exe" goto init
72 |
73 | echo.
74 | echo Error: JAVA_HOME is set to an invalid directory. >&2
75 | echo JAVA_HOME = "%JAVA_HOME%" >&2
76 | echo Please set the JAVA_HOME variable in your environment to match the >&2
77 | echo location of your Java installation. >&2
78 | echo.
79 | goto error
80 |
81 | @REM ==== END VALIDATION ====
82 |
83 | :init
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122 |
123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
124 |
125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127 | )
128 |
129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131 | if exist %WRAPPER_JAR% (
132 | if "%MVNW_VERBOSE%" == "true" (
133 | echo Found %WRAPPER_JAR%
134 | )
135 | ) else (
136 | if not "%MVNW_REPOURL%" == "" (
137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
138 | )
139 | if "%MVNW_VERBOSE%" == "true" (
140 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
141 | echo Downloading from: %DOWNLOAD_URL%
142 | )
143 |
144 | powershell -Command "&{"^
145 | "$webclient = new-object System.Net.WebClient;"^
146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
148 | "}"^
149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
150 | "}"
151 | if "%MVNW_VERBOSE%" == "true" (
152 | echo Finished downloading %WRAPPER_JAR%
153 | )
154 | )
155 | @REM End of extension
156 |
157 | @REM Provide a "standardized" way to retrieve the CLI args that will
158 | @REM work with both Windows and non-Windows executions.
159 | set MAVEN_CMD_LINE_ARGS=%*
160 |
161 | %MAVEN_JAVA_EXE% ^
162 | %JVM_CONFIG_MAVEN_PROPS% ^
163 | %MAVEN_OPTS% ^
164 | %MAVEN_DEBUG_OPTS% ^
165 | -classpath %WRAPPER_JAR% ^
166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
168 | if ERRORLEVEL 1 goto error
169 | goto end
170 |
171 | :error
172 | set ERROR_CODE=1
173 |
174 | :end
175 | @endlocal & set ERROR_CODE=%ERROR_CODE%
176 |
177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
181 | :skipRcPost
182 |
183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause
185 |
186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
187 |
188 | cmd /C exit /B %ERROR_CODE%
189 |
--------------------------------------------------------------------------------
/RookieMeeting/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.5.6
9 |
10 |
11 | com.rookie
12 | RookieMeeting
13 | 0.0.1-SNAPSHOT
14 | RookieMeeting
15 | Demo project for Spring Boot
16 |
17 | 1.8
18 |
19 |
20 |
21 |
22 | org.springframework.boot
23 | spring-boot-starter-web
24 |
25 |
26 |
27 |
28 | cn.afterturn
29 | easypoi-spring-boot-starter
30 | 4.4.0
31 |
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-cache
36 |
37 |
38 |
39 |
40 | mysql
41 | mysql-connector-java
42 | runtime
43 |
44 |
45 |
46 |
47 | com.baomidou
48 | mybatis-plus-boot-starter
49 | 3.5.1
50 |
51 |
52 |
53 |
54 | com.baomidou
55 | mybatis-plus-generator
56 | 3.5.1
57 |
58 |
59 |
60 |
61 | org.apache.velocity
62 | velocity
63 | 1.7
64 |
65 |
66 |
67 |
68 | com.github.xiaoymin
69 | knife4j-spring-boot-starter
70 | 3.0.2
71 |
72 |
73 |
74 |
75 | com.auth0
76 | java-jwt
77 | 3.18.3
78 |
79 |
80 |
81 |
82 | cn.hutool
83 | hutool-all
84 | 5.7.22
85 |
86 |
87 |
88 |
89 | commons-codec
90 | commons-codec
91 |
92 |
93 | org.apache.commons
94 | commons-lang3
95 | 3.8.1
96 |
97 |
98 |
99 |
100 | com.alibaba
101 | druid
102 | 1.2.8
103 |
104 |
105 |
106 |
107 | log4j
108 | log4j
109 | 1.2.17
110 |
111 |
112 |
113 |
114 | org.springframework.boot
115 | spring-boot-starter-data-redis
116 |
117 |
118 |
119 |
120 | com.alibaba
121 | fastjson
122 | 1.2.76
123 |
124 |
125 |
126 |
127 | org.projectlombok
128 | lombok
129 | true
130 |
131 |
132 |
133 | com.baidu.aip
134 | java-sdk
135 | 4.16.7
136 |
137 |
138 | org.slf4j
139 | slf4j-simple
140 |
141 |
142 |
143 |
144 |
145 |
146 | org.springframework.boot
147 | spring-boot-starter-validation
148 |
149 |
150 |
151 | org.springframework.boot
152 | spring-boot-starter-test
153 | test
154 |
155 |
156 |
157 |
158 |
159 |
160 | org.springframework.boot
161 | spring-boot-maven-plugin
162 | 2.5.6
163 |
164 |
165 |
166 | org.projectlombok
167 | lombok
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/RookieMeetingApplication.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class RookieMeetingApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(RookieMeetingApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/common/execption/GlobalExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.common.execption;
2 |
3 | import com.rookie.rookiemeeting.common.lang.Result;
4 | import lombok.extern.slf4j.Slf4j;
5 | import org.springframework.web.bind.annotation.ExceptionHandler;
6 | import org.springframework.web.bind.annotation.ResponseBody;
7 | import org.springframework.web.bind.annotation.RestControllerAdvice;
8 |
9 | /**
10 | * 全局异常捕获
11 | */
12 | @RestControllerAdvice
13 | @Slf4j
14 | public class GlobalExceptionHandler {
15 |
16 |
17 | @ExceptionHandler(ServiceException.class)
18 | @ResponseBody
19 | public Result handle(ServiceException serviceException) {
20 | return Result.fail(serviceException.getCode(), serviceException.getMessage());
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/common/execption/ServiceException.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.common.execption;
2 |
3 | import lombok.Getter;
4 |
5 | @Getter
6 | public class ServiceException extends RuntimeException {
7 |
8 | private final int code;
9 |
10 | public ServiceException(int code, String msg) {
11 | super(msg);
12 | this.code = code;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/common/lang/Constants.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.common.lang;
2 |
3 | public interface Constants {
4 |
5 | int CODE_401 = 401; //权限不足
6 |
7 | int CODE_500 = 500; //系统错误
8 |
9 | String ROLE = "ROLE_NORMAL";
10 |
11 | int STATUS = 0;
12 |
13 | String DICT_ICON = "icon";
14 |
15 | String SALT = "hechao!#$%@";
16 | }
17 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/common/lang/Result.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.common.lang;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | @Data
8 | public class Result implements Serializable {
9 |
10 | private int code; //200是正常,非200表示异常
11 | private String msg;
12 | private Object data;
13 |
14 | //成功消息
15 | public static Result succ(Object data) {
16 | return succ(200, "操作成功", data);
17 | }
18 |
19 | //失败消息
20 | public static Result fail(String msg) {
21 | return fail(400, msg, null);
22 | }
23 |
24 | //失败消息
25 | public static Result fail(int code, String msg) {
26 | return fail(code, msg, null);
27 | }
28 |
29 | public static Result fail(String msg, Object data) {
30 | return fail(400, msg, data);
31 | }
32 |
33 | public static Result succ(int code, String msg, Object data) {
34 | Result rs = new Result();
35 | rs.setCode(code);
36 | rs.setMsg(msg);
37 | rs.setData(data);
38 | return rs;
39 | }
40 |
41 | public static Result fail(int code, String msg, Object data) {
42 | Result rs = new Result();
43 | rs.setCode(code);
44 | rs.setMsg(msg);
45 | rs.setData(data);
46 | return rs;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/AuthAccess.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import java.lang.annotation.*;
4 |
5 | @Target({ElementType.METHOD})
6 | @Retention(RetentionPolicy.RUNTIME)
7 | @Documented
8 | public @interface AuthAccess {
9 |
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/BaiduConfig.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import com.baidu.aip.face.AipFace;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | @Configuration
9 | public class BaiduConfig {
10 |
11 | @Value("${baidu.appId}")
12 | private String appId;
13 |
14 | @Value("${baidu.key}")
15 | private String key;
16 |
17 | @Value("${baidu.secret}")
18 | private String secret;
19 |
20 | @Bean
21 | public AipFace aipFace() {
22 | return new AipFace(appId, key, secret);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/CorsConfig.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.web.cors.CorsConfiguration;
6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7 | import org.springframework.web.filter.CorsFilter;
8 |
9 | @Configuration
10 | public class CorsConfig {
11 |
12 | // 当前跨域请求最大有效时长,默认1天
13 | private static final long MAX_AGE = 24 * 60 * 60;
14 |
15 | @Bean
16 | public CorsFilter corsFilter() {
17 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
18 | CorsConfiguration corsConfiguration = new CorsConfiguration();
19 | corsConfiguration.addAllowedOrigin("*"); // 1 设置访问源地址
20 | corsConfiguration.addAllowedHeader("*"); // 2 设置访问源请求头
21 | corsConfiguration.addAllowedMethod("*"); // 3 设置访问源请求方法
22 | corsConfiguration.setMaxAge(MAX_AGE);
23 | source.registerCorsConfiguration("/**", corsConfiguration); // 4 对接口配置跨域设置
24 | return new CorsFilter(source);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/DruidConfig.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import com.alibaba.druid.pool.DruidDataSource;
4 | import com.alibaba.druid.support.http.StatViewServlet;
5 | import com.alibaba.druid.support.http.WebStatFilter;
6 | import org.springframework.boot.context.properties.ConfigurationProperties;
7 | import org.springframework.boot.web.servlet.FilterRegistrationBean;
8 | import org.springframework.boot.web.servlet.ServletRegistrationBean;
9 | import org.springframework.context.annotation.Bean;
10 | import org.springframework.context.annotation.Configuration;
11 |
12 | import javax.sql.DataSource;
13 | import java.util.Arrays;
14 | import java.util.HashMap;
15 | import java.util.Map;
16 |
17 | /**
18 | * druid配置
19 | * http://localhost:8888/druid/login.html 访问
20 | */
21 | @Configuration
22 | public class DruidConfig {
23 |
24 | @ConfigurationProperties(prefix = "spring.datasource")
25 | @Bean
26 | public DataSource druidDataSource() {
27 | return new DruidDataSource();
28 | }
29 |
30 | @Bean
31 | public ServletRegistrationBean statViewServlet() {
32 | ServletRegistrationBean bean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
33 |
34 | Map initParams = new HashMap<>();
35 | //后台管理界面的登录账号、密码
36 | initParams.put("loginUsername", "admin");
37 | initParams.put("loginPassword", "123456");
38 |
39 | //后台访问、本机访问
40 | initParams.put("allow", "localhost");
41 |
42 | bean.setInitParameters(initParams);
43 |
44 | return bean;
45 | }
46 |
47 | @Bean
48 | public FilterRegistrationBean webStatFilter() {
49 | FilterRegistrationBean bean = new FilterRegistrationBean();
50 | bean.setFilter(new WebStatFilter());
51 |
52 | Map initParams = new HashMap<>();
53 | initParams.put("exclusions", "*.js,*.css,/druid/*,/jdbc/*");
54 | bean.setInitParameters(initParams);
55 |
56 | bean.setUrlPatterns(Arrays.asList("/*"));
57 | return bean;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/InterceptionConfig.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import com.rookie.rookiemeeting.interceptor.JwtInterceptor;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
8 |
9 | @Configuration
10 | public class InterceptionConfig implements WebMvcConfigurer {
11 |
12 | @Override
13 | public void addInterceptors(InterceptorRegistry registry) {
14 |
15 | registry.addInterceptor(jwtInterceptor())
16 | .addPathPatterns("/**") // 拦截所有请求,通过判断token是否合法来决定是否需要登录
17 | .excludePathPatterns("/employee/login", "/employee/register", "/department/all", "/faceLogin", "/download", "/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**", "/api", "/api-docs", "/api-docs/**")
18 | .excludePathPatterns("/**/*.html", "/**/*.js", "/**/*.css", "/**/*.woff", "/**/*.ttf"); // 放行静态文件
19 | }
20 |
21 |
22 | @Bean
23 | public JwtInterceptor jwtInterceptor() {
24 | return new JwtInterceptor();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/MyApplicationRunner.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import lombok.extern.slf4j.Slf4j;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.boot.ApplicationArguments;
6 | import org.springframework.boot.ApplicationRunner;
7 | import org.springframework.context.annotation.Configuration;
8 | import org.springframework.data.redis.core.RedisTemplate;
9 |
10 | import java.util.Set;
11 |
12 | /**
13 | * 启动清理缓存
14 | */
15 | @Configuration
16 | @Slf4j
17 | public class MyApplicationRunner implements ApplicationRunner {
18 |
19 | @Autowired
20 | RedisTemplate redisTemplate;
21 |
22 | @Autowired
23 | MybatisRedisCache mybatisRedisCache;
24 |
25 | @Override
26 | public void run(ApplicationArguments args) throws Exception {
27 | Set keys = redisTemplate.keys("*");
28 | mybatisRedisCache.removeObject(keys);
29 | redisTemplate.delete(keys);
30 | log.info("清理redis缓存");
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/MybatisPlusConfig.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import com.baomidou.mybatisplus.annotation.DbType;
4 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
5 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 | import org.springframework.transaction.annotation.EnableTransactionManagement;
9 |
10 | @Configuration
11 | @EnableTransactionManagement
12 | public class MybatisPlusConfig {
13 |
14 | @Bean
15 | public MybatisPlusInterceptor mybatisPlusInterceptor() {
16 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
17 | //分页
18 | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
19 | return interceptor;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/MybatisRedisCache.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
4 | import com.rookie.rookiemeeting.util.SpringUtil;
5 | import lombok.AllArgsConstructor;
6 | import lombok.Data;
7 | import lombok.NoArgsConstructor;
8 | import lombok.extern.slf4j.Slf4j;
9 | import org.apache.ibatis.cache.Cache;
10 | import org.springframework.context.annotation.Configuration;
11 | import org.springframework.data.redis.connection.RedisServerCommands;
12 | import org.springframework.data.redis.core.RedisTemplate;
13 |
14 | import java.util.Set;
15 | import java.util.concurrent.locks.ReadWriteLock;
16 | import java.util.concurrent.locks.ReentrantReadWriteLock;
17 |
18 | @Configuration
19 | @Slf4j
20 | @Data
21 | @AllArgsConstructor
22 | @NoArgsConstructor
23 | public class MybatisRedisCache implements Cache {
24 | // 读写锁
25 | private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(true);
26 |
27 | //这里使用了redis缓存,使用springboot自动注入
28 | private RedisTemplate redisTemplate;
29 |
30 | private String id;
31 |
32 | public MybatisRedisCache(final String id) {
33 | if (id == null) {
34 | throw new IllegalArgumentException("Cache instances require an ID");
35 | }
36 | this.id = id;
37 | }
38 |
39 | @Override
40 | public String getId() {
41 | return this.id;
42 | }
43 |
44 | @Override
45 | public void putObject(Object key, Object value) {
46 | if (redisTemplate == null) {
47 | //由于启动期间注入失败,只能运行期间注入,这段代码可以删除
48 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate");
49 | }
50 | if (value != null) {
51 | redisTemplate.opsForValue().set(key.toString(), value);
52 | }
53 | }
54 |
55 | @Override
56 | public Object getObject(Object key) {
57 | if (redisTemplate == null) {
58 | //由于启动期间注入失败,只能运行期间注入,这段代码可以删除
59 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate");
60 | }
61 | try {
62 | if (key != null) {
63 | return redisTemplate.opsForValue().get(key.toString());
64 | }
65 | } catch (Exception e) {
66 | e.printStackTrace();
67 | log.error("缓存出错 ");
68 | }
69 | return null;
70 | }
71 |
72 | @Override
73 | public Object removeObject(Object key) {
74 | if (redisTemplate == null) {
75 | //由于启动期间注入失败,只能运行期间注入,这段代码可以删除
76 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate");
77 | }
78 | if (key != null) {
79 | redisTemplate.delete(key.toString());
80 | }
81 | return null;
82 | }
83 |
84 | @Override
85 | public void clear() {
86 | log.debug("清空缓存");
87 | if (redisTemplate == null) {
88 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate");
89 | }
90 | Set keys = redisTemplate.keys("*:" + this.id + "*");
91 | if (!CollectionUtils.isEmpty(keys)) {
92 | redisTemplate.delete(keys);
93 | }
94 | }
95 |
96 | @Override
97 | public int getSize() {
98 | if (redisTemplate == null) {
99 | //由于启动期间注入失败,只能运行期间注入,这段代码可以删除
100 | redisTemplate = (RedisTemplate) SpringUtil.getBean("redisTemplate");
101 | }
102 | Long size = redisTemplate.execute(RedisServerCommands::dbSize);
103 | return size.intValue();
104 | }
105 |
106 | @Override
107 | public ReadWriteLock getReadWriteLock() {
108 | return this.readWriteLock;
109 | }
110 | }
111 |
112 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/RedisConfig.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import com.fasterxml.jackson.annotation.JsonAutoDetect;
4 | import com.fasterxml.jackson.annotation.PropertyAccessor;
5 | import com.fasterxml.jackson.databind.ObjectMapper;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 | import org.springframework.data.redis.connection.RedisConnectionFactory;
9 | import org.springframework.data.redis.core.RedisTemplate;
10 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
11 | import org.springframework.data.redis.serializer.StringRedisSerializer;
12 |
13 | /**
14 | * redis 配置类
15 | */
16 | @Configuration
17 | public class RedisConfig {
18 |
19 | @Bean
20 | @SuppressWarnings("all") //镇压所有警告
21 | public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) {
22 |
23 | RedisTemplate template = new RedisTemplate<>();
24 | template.setConnectionFactory(redisConnectionFactory);
25 |
26 | //Json序列化配置
27 | Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer(Object.class);
28 | ObjectMapper objectMapper = new ObjectMapper();
29 | objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
30 | objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
31 | serializer.setObjectMapper(objectMapper);
32 |
33 | //String类型的序列化
34 | StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
35 |
36 | //key采用String的序列化方式
37 | template.setKeySerializer(stringRedisSerializer);
38 |
39 | //hash的key也采用String序列化方式
40 | template.setHashKeySerializer(stringRedisSerializer);
41 |
42 | //value序列化采用jackJson
43 | template.setValueSerializer(serializer);
44 |
45 | //hash的key序列化方式也采用jackJson
46 | template.setHashValueSerializer(serializer);
47 |
48 | template.afterPropertiesSet();
49 |
50 |
51 | return template;
52 | }
53 | }
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/config/SwaggerConfig.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.config;
2 |
3 | import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import springfox.documentation.builders.ApiInfoBuilder;
7 | import springfox.documentation.builders.PathSelectors;
8 | import springfox.documentation.builders.RequestHandlerSelectors;
9 | import springfox.documentation.service.ApiInfo;
10 | import springfox.documentation.spi.DocumentationType;
11 | import springfox.documentation.spring.web.plugins.Docket;
12 | import springfox.documentation.swagger2.annotations.EnableSwagger2;
13 |
14 | @Configuration
15 | @EnableSwagger2
16 | @EnableKnife4j
17 | public class SwaggerConfig {
18 |
19 | /**
20 | * swagger配置
21 | *
22 | * @return
23 | */
24 | @Bean
25 | public Docket docket() {
26 | return new Docket(DocumentationType.SWAGGER_2)
27 | .apiInfo(apiInfo())
28 | .select()
29 | .apis(RequestHandlerSelectors.basePackage("com.rookie.rookiemeeting.controller"))
30 | .paths(PathSelectors.any())
31 | .build();
32 | }
33 |
34 | private ApiInfo apiInfo() {
35 | return new ApiInfoBuilder()
36 | .title("基于深度学习的人脸识别会议签到系统")
37 | .version("v1.0")
38 | .description("基于深度学习的人脸识别会议签到系统接口文档")
39 | .build();
40 | }
41 | }
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/ApproveAccountController.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.controller;
2 |
3 | import com.rookie.rookiemeeting.common.lang.Result;
4 | import com.rookie.rookiemeeting.service.IEmployeeService;
5 | import io.swagger.annotations.Api;
6 | import io.swagger.annotations.ApiOperation;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.web.bind.annotation.PathVariable;
9 | import org.springframework.web.bind.annotation.PostMapping;
10 | import org.springframework.web.bind.annotation.RequestMapping;
11 | import org.springframework.web.bind.annotation.RestController;
12 |
13 | @RestController
14 | @RequestMapping("/approve")
15 | @Api(tags = "管理员审批控制类")
16 | public class ApproveAccountController {
17 |
18 | //待批准状态码为0
19 | public static final Integer PENDING_APPROVE = 0;
20 | @Autowired
21 | IEmployeeService employeeService;
22 |
23 | /**
24 | * 查询所有未审批的用户
25 | *
26 | * @return
27 | */
28 | @ApiOperation("查询所有未审批的用户接口")
29 | @PostMapping("getStatus")
30 | public Result getStatus() {
31 | return Result.succ(employeeService.getByStatus(PENDING_APPROVE));
32 | }
33 |
34 | /**
35 | * 根据ID通过注册审批
36 | *
37 | * @param employeeid
38 | * @return
39 | */
40 | @ApiOperation("根据ID通过注册审批接口")
41 | @PostMapping("/updateStatusAdopt/{employeeid}")
42 | public Result updateStatusAdopt(@PathVariable(name = "employeeid") Long employeeid) {
43 | return Result.succ(employeeService.updateStatusAdopt(employeeid));
44 | }
45 |
46 | /**
47 | * 根据ID不通过注册审批
48 | *
49 | * @param employeeid
50 | * @return
51 | */
52 | @ApiOperation("根据ID不通过注册审批接口")
53 | @PostMapping("/updateStatusFail/{employeeid}")
54 | public Result updateStatusFail(@PathVariable(name = "employeeid") Long employeeid) {
55 | return Result.succ(employeeService.updateStatusFail(employeeid));
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/ChangeBookingController.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.controller;
2 |
3 | import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
4 | import cn.afterturn.easypoi.excel.entity.ExportParams;
5 | import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
6 | import cn.afterturn.easypoi.view.PoiBaseView;
7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8 | import com.rookie.rookiemeeting.common.lang.Result;
9 | import com.rookie.rookiemeeting.dto.ParticipantsDto;
10 | import com.rookie.rookiemeeting.service.IEmployeeService;
11 | import com.rookie.rookiemeeting.service.IMeetingParticipantsService;
12 | import com.rookie.rookiemeeting.service.IMeetingService;
13 | import io.swagger.annotations.Api;
14 | import io.swagger.annotations.ApiOperation;
15 | import org.springframework.beans.factory.annotation.Autowired;
16 | import org.springframework.ui.ModelMap;
17 | import org.springframework.web.bind.annotation.*;
18 |
19 | import javax.servlet.http.HttpServletRequest;
20 | import javax.servlet.http.HttpServletResponse;
21 | import java.util.List;
22 |
23 | @RestController
24 | @RequestMapping("/bookings")
25 | @Api(tags = "更改预订控制类")
26 | public class ChangeBookingController {
27 |
28 | @Autowired
29 | IMeetingService meetingService;
30 |
31 | @Autowired
32 | IEmployeeService employeeService;
33 |
34 | @Autowired
35 | IMeetingParticipantsService meetingParticipantsService;
36 |
37 | /**
38 | * 我的预定,并且会议状态为0
39 | *
40 | * @param employeeid
41 | * @return
42 | */
43 | @ApiOperation("根据已登录的员工ID查询自己的会议并且会议状态为0接口")
44 | @GetMapping("/mybookings/{employeeid}")
45 | public Result mybookings(@PathVariable(name = "employeeid") Long employeeid,
46 | @RequestParam Integer pageNum,
47 | @RequestParam Integer pageSize,
48 | @RequestParam(defaultValue = "") String meetingname) {
49 | return Result.succ(meetingService.getmeetingofmybookCanCancle(new Page<>(pageNum, pageSize), employeeid, meetingname));
50 | }
51 |
52 | /**
53 | * 取消会议的原因
54 | *
55 | * @param meetingid
56 | * @param canceledreason
57 | * @return
58 | */
59 | @ApiOperation("取消会议接口")
60 | @PostMapping("/cancelmeeting/{meetingid}")
61 | public Result cancelmeeting(@PathVariable(name = "meetingid") Integer meetingid, @RequestBody String canceledreason) {
62 | meetingService.cancelmeeting(meetingid, canceledreason);
63 | return Result.succ(null);
64 | }
65 |
66 | /**
67 | * 根据ID查询会议详情
68 | *
69 | * @param meetingid
70 | * @return
71 | */
72 | @ApiOperation("根据ID查询会议详情接口")
73 | @PostMapping("/meetingById/{meetingid}")
74 | public Result meetingById(@PathVariable(name = "meetingid") Integer meetingid) {
75 | return Result.succ(meetingService.getById(meetingid));
76 | }
77 |
78 | /**
79 | * 根据已登录的员工ID查询自己的会议
80 | *
81 | * @param employeeid
82 | * @param pageNum
83 | * @param pageSize
84 | * @param meetingname
85 | * @return
86 | */
87 | @ApiOperation("根据已登录的员工ID查询自己的会议接口")
88 | @GetMapping("/myMeeting/{employeeid}")
89 | public Result myMeeting(@PathVariable(name = "employeeid") Long employeeid,
90 | @RequestParam Integer pageNum,
91 | @RequestParam Integer pageSize,
92 | @RequestParam(defaultValue = "") String meetingname) {
93 | return Result.succ(meetingService.getMyMeeting(new Page<>(pageNum, pageSize), employeeid, meetingname));
94 | }
95 |
96 | /**
97 | * 查询参会人员
98 | *
99 | * @param meetingid
100 | * @return
101 | */
102 | @ApiOperation("查询参会人员接口")
103 | @PostMapping("/participants/{meetingid}")
104 | public Result participants(@PathVariable(name = "meetingid") Integer meetingid) {
105 | return Result.succ(employeeService.getEmpsById(meetingid));
106 | }
107 |
108 | /**
109 | * 导出考勤信息
110 | *
111 | * @param map
112 | * @param response
113 | * @param request
114 | * @param meetingid
115 | */
116 | @GetMapping("/exports/{meetingid}")
117 | public void export(ModelMap map, HttpServletResponse response, HttpServletRequest request, @PathVariable("meetingid") Integer meetingid) {
118 | List emps = employeeService.getEmpsById(meetingid);
119 | ExportParams exportParams = new ExportParams("考勤信息", "考勤信息", ExcelType.XSSF);
120 | map.put(NormalExcelConstants.DATA_LIST, emps);
121 | map.put(NormalExcelConstants.CLASS, ParticipantsDto.class);
122 | map.put(NormalExcelConstants.PARAMS, exportParams);
123 | map.put(NormalExcelConstants.FILE_NAME, "考勤信息表");
124 | PoiBaseView.render(map, request, response, NormalExcelConstants.EASYPOI_EXCEL_VIEW);
125 |
126 | }
127 |
128 | /**
129 | * 日历显示会议功能
130 | *
131 | * @param employeeid
132 | * @return
133 | */
134 | @ApiOperation("日历显示会议接口")
135 | @GetMapping("/calendar/{employeeid}")
136 | public Result calendar(@PathVariable(name = "employeeid") Long employeeid) {
137 | return Result.succ(meetingService.getCalendar(employeeid));
138 | }
139 |
140 | /**
141 | * 参加会议总人数
142 | *
143 | * @param meetingid
144 | * @return
145 | */
146 | @ApiOperation("参加会议总人数接口")
147 | @PostMapping("/queryNum/{meetingid}")
148 | public Result queryNum(@PathVariable(name = "meetingid") Integer meetingid) {
149 | return Result.succ(meetingParticipantsService.queryNum(meetingid));
150 | }
151 |
152 | /**
153 | * 未签到人数
154 | *
155 | * @param meetingid
156 | * @return
157 | */
158 | @ApiOperation("未签到人数接口")
159 | @PostMapping("/signed/{meetingid}")
160 | public Result signed(@PathVariable(name = "meetingid") Integer meetingid) {
161 | return Result.succ(meetingParticipantsService.signed(meetingid));
162 | }
163 | }
164 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/DepartmentController.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.controller;
2 |
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 | import com.rookie.rookiemeeting.common.lang.Result;
6 | import com.rookie.rookiemeeting.entity.Department;
7 | import com.rookie.rookiemeeting.service.IDepartmentService;
8 | import io.swagger.annotations.Api;
9 | import io.swagger.annotations.ApiOperation;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.web.bind.annotation.*;
12 |
13 | import java.util.List;
14 |
15 | @RestController
16 | @RequestMapping("/department")
17 | @Api(tags = "部门控制类")
18 | public class DepartmentController {
19 |
20 | @Autowired
21 | IDepartmentService departmentService;
22 |
23 | /**
24 | * 获取全部部门、分页查询
25 | *
26 | * @return
27 | */
28 | @ApiOperation("分页查询所有部门接口")
29 | @GetMapping("/page")
30 | public Result findPage(@RequestParam Integer pageNum,
31 | @RequestParam Integer pageSize,
32 | @RequestParam(defaultValue = "") String departmentname) {
33 | QueryWrapper queryWrapper = new QueryWrapper<>();
34 | queryWrapper.like("departmentname", departmentname);
35 | return Result.succ(departmentService.page(new Page<>(pageNum, pageSize), queryWrapper));
36 | }
37 |
38 | /**
39 | * 新增和编辑部门
40 | *
41 | * @param department
42 | * @return
43 | */
44 | @ApiOperation("新增和编辑部门接口")
45 | @PostMapping("/save")
46 | public Result save(@RequestBody Department department) {
47 | return Result.succ(departmentService.saveOrUpdate(department));
48 | }
49 |
50 | /**
51 | * 根据id删除单个部门
52 | *
53 | * @param departmentid
54 | * @return
55 | */
56 | @ApiOperation("根据ID删除单个部门接口")
57 | @DeleteMapping("/delete/{departmentid}")
58 | public Result delete(@PathVariable(name = "departmentid") Integer departmentid) {
59 | return Result.succ(departmentService.removeById(departmentid));
60 | }
61 |
62 | /**
63 | * 批量删除多个部门
64 | *
65 | * @param ids
66 | * @return
67 | */
68 | @ApiOperation("批量删除多个部门接口")
69 | @PostMapping("/delete/batch")
70 | public Result batch(@RequestBody List ids) {
71 | return Result.succ(departmentService.removeBatchByIds(ids));
72 | }
73 |
74 | /**
75 | * 查询所有部门
76 | *
77 | * @return
78 | */
79 | @ApiOperation("查询所有部门接口")
80 | @GetMapping("/all")
81 | public Result all() {
82 | return Result.succ(departmentService.list());
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/DictController.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.controller;
2 |
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 | import com.rookie.rookiemeeting.common.lang.Constants;
6 | import com.rookie.rookiemeeting.common.lang.Result;
7 | import com.rookie.rookiemeeting.entity.Dict;
8 | import com.rookie.rookiemeeting.service.IDictService;
9 | import io.swagger.annotations.Api;
10 | import io.swagger.annotations.ApiOperation;
11 | import org.springframework.beans.factory.annotation.Autowired;
12 | import org.springframework.web.bind.annotation.*;
13 |
14 | import java.util.List;
15 |
16 |
17 | /**
18 | *
19 | * 前端控制器
20 | *
21 | *
22 | * @author 何超
23 | * @since 2022-08-23
24 | */
25 | @RestController
26 | @RequestMapping("/dict")
27 | @Api(tags = "图标模块")
28 | public class DictController {
29 |
30 | @Autowired
31 | private IDictService dictService;
32 |
33 | //新增或修改
34 | @ApiOperation("新增或修改接口")
35 | @PostMapping("/save")
36 | public Result save(@RequestBody Dict dict) {
37 | return Result.succ(dictService.saveOrUpdate(dict));
38 | }
39 |
40 | //根据ID删除
41 | @ApiOperation("根据ID删除接口")
42 | @DeleteMapping("/delete/{id}")
43 | public Result delete(@PathVariable Integer id) {
44 |
45 | return Result.succ(dictService.removeById(id));
46 | }
47 |
48 | @ApiOperation("根据ID批量删除接口")
49 | @PostMapping("/delete/batch")
50 | public Result deleteBatch(@RequestBody List ids) {
51 |
52 | return Result.succ(dictService.removeByIds(ids));
53 | }
54 |
55 | //查询全部
56 | @ApiOperation("根据类型查询图标接口")
57 | @GetMapping("/getAll")
58 | public Result findAll() {
59 | QueryWrapper queryWrapper = new QueryWrapper<>();
60 | queryWrapper.eq("type", Constants.DICT_ICON);
61 | List list = dictService.list(queryWrapper);
62 | return Result.succ(list);
63 | }
64 |
65 | //根据ID查询
66 | @ApiOperation("根据ID查询接口")
67 | @GetMapping("/dict/{id}")
68 | public Result findOne(@PathVariable Integer id) {
69 | return Result.succ(dictService.getById(id));
70 | }
71 |
72 | @ApiOperation("分页查询全部接口")
73 | @GetMapping("/page")
74 | public Result findPage(@RequestParam Integer pageNum,
75 | @RequestParam Integer pageSize,
76 | @RequestParam String name) {
77 | QueryWrapper dictQueryWrapper = new QueryWrapper<>();
78 | dictQueryWrapper.like("name", name);
79 | return Result.succ(dictService.page(new Page<>(pageNum, pageSize), dictQueryWrapper));
80 | }
81 | }
82 |
83 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/EChartsController.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.controller;
2 |
3 | import cn.hutool.core.collection.CollUtil;
4 | import cn.hutool.core.date.DateUtil;
5 | import cn.hutool.core.date.Quarter;
6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
7 | import com.rookie.rookiemeeting.common.lang.Result;
8 | import com.rookie.rookiemeeting.entity.Employee;
9 | import com.rookie.rookiemeeting.entity.Meeting;
10 | import com.rookie.rookiemeeting.service.IEmployeeService;
11 | import com.rookie.rookiemeeting.service.IMeetingService;
12 | import io.swagger.annotations.Api;
13 | import io.swagger.annotations.ApiOperation;
14 | import org.springframework.beans.factory.annotation.Autowired;
15 | import org.springframework.web.bind.annotation.GetMapping;
16 | import org.springframework.web.bind.annotation.RequestMapping;
17 | import org.springframework.web.bind.annotation.RestController;
18 |
19 | import java.util.Date;
20 | import java.util.List;
21 |
22 | @RestController
23 | @RequestMapping("/ECharts")
24 | @Api(tags = "数据报表模块")
25 | public class EChartsController {
26 |
27 | @Autowired
28 | IMeetingService meetingService;
29 |
30 | @Autowired
31 | IEmployeeService employeeService;
32 |
33 | @ApiOperation("数据展示接口")
34 | @GetMapping("/members")
35 | public Result members() {
36 | List list = meetingService.list();
37 | int q1 = 0; //第一季度
38 | int q2 = 0; //第二季度
39 | int q3 = 0; //第三季度
40 | int q4 = 0; //第四季度
41 | for (Meeting meeting : list) {
42 | Date reservationtime = meeting.getReservationtime();
43 | Quarter quarter = DateUtil.quarterEnum(reservationtime);
44 | switch (quarter) {
45 | case Q1:
46 | q1 += 1;
47 | break;
48 | case Q2:
49 | q2 += 1;
50 | break;
51 | case Q3:
52 | q3 += 1;
53 | break;
54 | case Q4:
55 | q4 += 1;
56 | break;
57 | default:
58 | break;
59 | }
60 | }
61 | return Result.succ(CollUtil.newArrayList(q1, q2, q3, q4));
62 | }
63 |
64 | /**
65 | * 正常账号总数
66 | *
67 | * @return
68 | */
69 | @GetMapping("/normal")
70 | public Result normal() {
71 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
72 | queryWrapper.eq(Employee::getStatus, 1);
73 | return Result.succ(employeeService.count(queryWrapper));
74 | }
75 |
76 | /**
77 | * 未审批总数
78 | *
79 | * @return
80 | */
81 | @GetMapping("/notApproved")
82 | public Result notApproved() {
83 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
84 | queryWrapper.eq(Employee::getStatus, 0);
85 | return Result.succ(employeeService.count(queryWrapper));
86 | }
87 |
88 | /**
89 | * 审批未通过总数
90 | *
91 | * @return
92 | */
93 | @GetMapping("/approvalFailed")
94 | public Result approvalFailed() {
95 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
96 | queryWrapper.eq(Employee::getStatus, 2);
97 | return Result.succ(employeeService.count(queryWrapper));
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/MeetingController.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.controller;
2 |
3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 | import com.rookie.rookiemeeting.common.lang.Result;
5 | import com.rookie.rookiemeeting.dto.MeetingDto;
6 | import com.rookie.rookiemeeting.entity.Meeting;
7 | import com.rookie.rookiemeeting.service.IMeetingService;
8 | import io.swagger.annotations.Api;
9 | import io.swagger.annotations.ApiOperation;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.web.bind.annotation.*;
12 |
13 | @RestController
14 | @RequestMapping("/meeting")
15 | @Api(tags = "会议控制类")
16 | public class MeetingController {
17 |
18 | @Autowired
19 | IMeetingService meetingService;
20 |
21 |
22 | /**
23 | * 分页和查询全部
24 | *
25 | * @param meetingDto
26 | * @param pageNum
27 | * @param pageSize
28 | * @return
29 | */
30 | @ApiOperation("分页和查询全部接口")
31 | @GetMapping("/page")
32 | public Result page(MeetingDto meetingDto,
33 | @RequestParam Integer pageNum,
34 | @RequestParam Integer pageSize) {
35 |
36 |
37 | return Result.succ(meetingService.findMeeting(new Page<>(pageNum, pageSize), meetingDto));
38 |
39 | }
40 |
41 | /**
42 | * 根据ID删除会议
43 | *
44 | * @param meetingid
45 | * @return
46 | */
47 | @ApiOperation("根据会议ID删除会议接口")
48 | @DeleteMapping("/delete/{meetingid}")
49 | public Result delete(@PathVariable(name = "meetingid") Integer meetingid) {
50 | meetingService.delById(meetingid);
51 | return Result.succ(null);
52 | }
53 |
54 | /**
55 | * 根据ID查询会议详情
56 | *
57 | * @param meetingid
58 | * @return
59 | */
60 | @ApiOperation("根据会议ID查询会议详情")
61 | @PostMapping("/meetingById/{meetingid}")
62 | public Result meetingById(@PathVariable(name = "meetingid") Integer meetingid) {
63 | return Result.succ(meetingService.meetingById(meetingid));
64 | }
65 |
66 |
67 | /**
68 | * 修改会议信息
69 | *
70 | * @param meeting
71 | * @return
72 | */
73 | @ApiOperation("修改会议信息接口")
74 | @PostMapping("/save")
75 | public Result save(@RequestBody Meeting meeting) {
76 | meetingService.saveOrUpdate(meeting);
77 | return Result.succ(null);
78 | }
79 |
80 | /**
81 | * 预定会议
82 | *
83 | * @param meeting
84 | * @param employeeid
85 | * @return
86 | */
87 | @ApiOperation("预定会议接口")
88 | @PostMapping("/addMeeting/{employeeid}")
89 | public Result addMeeting(@RequestBody Meeting meeting,
90 | @PathVariable(name = "employeeid") Long employeeid) {
91 | return Result.succ(meetingService.addMeeting(meeting, employeeid));
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/MeetingParticipantsController.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.controller;
2 |
3 | import com.rookie.rookiemeeting.common.lang.Result;
4 | import com.rookie.rookiemeeting.entity.MeetingParticipants;
5 | import com.rookie.rookiemeeting.service.IMeetingParticipantsService;
6 | import io.swagger.annotations.Api;
7 | import io.swagger.annotations.ApiOperation;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.*;
10 |
11 | import java.util.List;
12 |
13 | @RestController
14 | @RequestMapping("/addMeeting")
15 | @Api(tags = "会议参与者控制类")
16 | public class MeetingParticipantsController {
17 |
18 |
19 | @Autowired
20 | IMeetingParticipantsService meetingParticipantsService;
21 |
22 | /**
23 | * 选择参会员工
24 | *
25 | * @param meetingid
26 | * @param emplyeeid
27 | * @return
28 | */
29 | @ApiOperation("添加参会员工接口")
30 | @PostMapping("/addEmployee/{meetingid}")
31 | public Result addEmployee(@PathVariable(name = "meetingid") Integer meetingid,
32 | @RequestBody List emplyeeid) {
33 | meetingParticipantsService.addParticipants(meetingid, emplyeeid);
34 | return Result.succ(null);
35 | }
36 |
37 | /**
38 | * 根据会议ID,员工ID删除该员工的会议
39 | *
40 | * @param meetingid
41 | * @param employeeid
42 | * @return
43 | */
44 | @ApiOperation("根据会议ID,员工ID删除该员工的会议接口")
45 | @GetMapping("/delEmployee/{meetingid}/{employeeid}")
46 | public Result delEmployee(@PathVariable(name = "meetingid") Integer meetingid,
47 | @PathVariable(name = "employeeid") Long employeeid) {
48 | meetingParticipantsService.delEmployee(meetingid, employeeid);
49 | return Result.succ(null);
50 | }
51 |
52 | /**
53 | * 补签
54 | *
55 | * @param meetingParticipants
56 | * @return
57 | */
58 | @ApiOperation("补签接口")
59 | @PostMapping("/signature")
60 | public Result signature(@RequestBody MeetingParticipants meetingParticipants) {
61 | meetingParticipantsService.signature(meetingParticipants);
62 | return Result.succ(null);
63 | }
64 |
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/MeetingRoomController.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.controller;
2 |
3 | import com.rookie.rookiemeeting.common.lang.Result;
4 | import com.rookie.rookiemeeting.entity.MeetingRoom;
5 | import com.rookie.rookiemeeting.service.IMeetingRoomService;
6 | import io.swagger.annotations.Api;
7 | import io.swagger.annotations.ApiOperation;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.*;
10 |
11 | import java.util.List;
12 |
13 | @RestController
14 | @RequestMapping("/meetingroom")
15 | @Api(tags = "会议室控制类")
16 | public class MeetingRoomController {
17 |
18 | @Autowired
19 | IMeetingRoomService meetingRoomService;
20 |
21 | /**
22 | * 分页查询全部会议室
23 | *
24 | * @param pageNum
25 | * @param pageSize
26 | * @param roomname
27 | * @param roomnum
28 | * @return
29 | */
30 | @ApiOperation("分页查询全部会议室接口")
31 | @GetMapping("/page")
32 | public Result page(@RequestParam Integer pageNum,
33 | @RequestParam Integer pageSize,
34 | @RequestParam(defaultValue = "") String roomname,
35 | @RequestParam(defaultValue = "") String roomnum) {
36 |
37 | return Result.succ(meetingRoomService.mrPage(pageNum, pageSize, roomname, roomnum));
38 | }
39 |
40 | /**
41 | * 新增和编辑
42 | *
43 | * @param meetingRoom
44 | * @return
45 | */
46 | @ApiOperation("新增和编辑接口")
47 | @PostMapping("/save")
48 | public Result save(@RequestBody MeetingRoom meetingRoom) {
49 | return Result.succ(meetingRoomService.saveOrUpdate(meetingRoom));
50 | }
51 |
52 | /**
53 | * 根据id删除单个会议室
54 | *
55 | * @param roomid
56 | * @return
57 | */
58 | @ApiOperation("根据会议室ID删除单个会议室接口")
59 | @DeleteMapping("/delete/{roomid}")
60 | public Result delete(@PathVariable(name = "roomid") Integer roomid) {
61 | return Result.succ(meetingRoomService.removeById(roomid));
62 | }
63 |
64 | /**
65 | * 批量删除
66 | *
67 | * @param ids
68 | * @return
69 | */
70 | @ApiOperation("批量删除会议室接口")
71 | @PostMapping("/delete/batch")
72 | public Result batch(@RequestBody List ids) {
73 | return Result.succ(meetingRoomService.removeBatchByIds(ids));
74 | }
75 |
76 | /**
77 | * 查询可用的会议室
78 | *
79 | * @return
80 | */
81 | @ApiOperation("查询可用的会议室接口")
82 | @PostMapping("/list")
83 | public Result list() {
84 | return Result.succ(meetingRoomService.queryAll());
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/RookieMeeting/src/main/java/com/rookie/rookiemeeting/controller/MenuController.java:
--------------------------------------------------------------------------------
1 | package com.rookie.rookiemeeting.controller;
2 |
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 | import com.rookie.rookiemeeting.common.lang.Result;
6 | import com.rookie.rookiemeeting.entity.Menu;
7 | import com.rookie.rookiemeeting.service.IMenuService;
8 | import io.swagger.annotations.Api;
9 | import io.swagger.annotations.ApiOperation;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.web.bind.annotation.*;
12 |
13 | import java.util.List;
14 |
15 |
16 | /**
17 | *
18 | * 前端控制器
19 | *
20 | *
21 | * @author 何超
22 | * @since 2022-08-22
23 | */
24 | @RestController
25 | @RequestMapping("/menu")
26 | @Api(tags = "菜单模块")
27 | public class MenuController {
28 |
29 | @Autowired
30 | private IMenuService menuService;
31 |
32 | //新增或修改
33 | @ApiOperation("新增或修改接口")
34 | @PostMapping("/save")
35 | public Result save(@RequestBody Menu menu) {
36 | menuService.saveOrUpdate(menu);
37 | return Result.succ(null);
38 | }
39 |
40 | //根据ID删除
41 | @ApiOperation("根据ID删除接口")
42 | @DeleteMapping("/delete/{id}")
43 | public Result delete(@PathVariable Integer id) {
44 | menuService.removeById(id);
45 | return Result.succ(null);
46 | }
47 |
48 | @ApiOperation("根据ID批量删除接口")
49 | @PostMapping("/delete/batch")
50 | public Result deleteBatch(@RequestBody List ids) {
51 | menuService.removeByIds(ids);
52 | return Result.succ(null);
53 | }
54 |
55 | @GetMapping("/ids")
56 | public Result findAllIds() {
57 | return Result.succ(menuService.list().stream().map(Menu::getId));
58 | }
59 |
60 | //查询全部
61 | @GetMapping
62 | @ApiOperation("查询全部接口")
63 | public Result findAll(@RequestParam(defaultValue = "") String name) {
64 | return Result.succ(menuService.findMenus(name));
65 | }
66 |
67 | //根据ID查询
68 | @ApiOperation("根据ID查询接口")
69 | @GetMapping("/{id}")
70 | public Result findOne(@PathVariable Integer id) {
71 | return Result.succ(menuService.getById(id));
72 | }
73 |
74 | @ApiOperation("分页查询接口")
75 | @GetMapping("/page")
76 | public Result findPage(@RequestParam String name,
77 | @RequestParam Integer pageNum,
78 | @RequestParam Integer pageSize) {
79 | QueryWrapper