├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── LICENSE ├── README.md ├── pom.xml ├── sql └── meeting.sql └── src ├── main ├── java │ └── com │ │ └── xyongfeng │ │ ├── MeetingApplication.java │ │ ├── aop │ │ ├── OperationLogAnnotation.java │ │ └── OperationLogAspect.java │ │ ├── config │ │ ├── CaptchaConfig.java │ │ ├── CorsConfig.java │ │ ├── MybatisPlusConfig.java │ │ ├── RedisConfig.java │ │ ├── RestTemplateConfig.java │ │ ├── SocketIOConfig.java │ │ ├── Swagger2Config.java │ │ └── security │ │ │ ├── JwtAuthencationTokenFilter.java │ │ │ ├── SGExpressionRoot.java │ │ │ └── SecurityConfig.java │ │ ├── content │ │ └── ResCode.java │ │ ├── controller │ │ ├── AdminLogController.java │ │ ├── AdminsMeetingController.java │ │ ├── AdminsUsersController.java │ │ ├── CaptchaController.java │ │ ├── ChatFilterController.java │ │ ├── MeetingController.java │ │ ├── MeetingScreenshotController.java │ │ ├── MenuController.java │ │ ├── RoleController.java │ │ ├── UserAdviceController.java │ │ └── UsersController.java │ │ ├── exceptionHandler │ │ ├── GlobalExceptionHandler.java │ │ ├── RestAuthorizeationEntryPoint.java │ │ ├── RestfulAccessDeniedHandler.java │ │ └── exception │ │ │ └── NormalException.java │ │ ├── mapper │ │ ├── AdminLogMapper.java │ │ ├── ChatFilterMapper.java │ │ ├── MeetingApplicationMapper.java │ │ ├── MeetingChatMapper.java │ │ ├── MeetingMapper.java │ │ ├── MeetingNoticeMapper.java │ │ ├── MeetingNoticeUsersMapper.java │ │ ├── MeetingPasswordMapper.java │ │ ├── MeetingScreenshotMapper.java │ │ ├── MeetingUsersMapper.java │ │ ├── MenuMapper.java │ │ ├── RoleMapper.java │ │ ├── UserAdviceImgMapper.java │ │ ├── UserAdviceMapper.java │ │ ├── UsersFaceFeatureMapper.java │ │ ├── UsersFriendInformMapper.java │ │ ├── UsersFriendMapper.java │ │ ├── UsersMapper.java │ │ ├── UsersRoleMapper.java │ │ └── xml │ │ │ ├── AdminLogMapper.xml │ │ │ ├── ChatFilterMapper.xml │ │ │ ├── MeetingApplicationMapper.xml │ │ │ ├── MeetingChatMapper.xml │ │ │ ├── MeetingMapper.xml │ │ │ ├── MeetingNoticeMapper.xml │ │ │ ├── MeetingNoticeUsersMapper.xml │ │ │ ├── MeetingPasswordMapper.xml │ │ │ ├── MeetingScreenshotMapper.xml │ │ │ ├── MeetingUsersMapper.xml │ │ │ ├── MenuMapper.xml │ │ │ ├── RoleMapper.xml │ │ │ ├── UserAdviceImgMapper.xml │ │ │ ├── UserAdviceMapper.xml │ │ │ ├── UsersFaceFeatureMapper.xml │ │ │ ├── UsersFriendInformMapper.xml │ │ │ ├── UsersFriendMapper.xml │ │ │ ├── UsersMapper.xml │ │ │ └── UsersRoleMapper.xml │ │ ├── pojo │ │ ├── AdminLog.java │ │ ├── ChatFilter.java │ │ ├── FriendsAndChat.java │ │ ├── JsonResult.java │ │ ├── Meeting.java │ │ ├── MeetingApplication.java │ │ ├── MeetingChat.java │ │ ├── MeetingNotice.java │ │ ├── MeetingNoticeUsers.java │ │ ├── MeetingPassword.java │ │ ├── MeetingScreenshot.java │ │ ├── MeetingUsers.java │ │ ├── Menu.java │ │ ├── MenuRole.java │ │ ├── Param │ │ │ ├── AdminLogSearchParam.java │ │ │ ├── ChatFilterParam.java │ │ │ ├── IDParam.java │ │ │ ├── ImgBase64Param.java │ │ │ ├── MeetSetLicenceParam.java │ │ │ ├── MeetingAddParam.java │ │ │ ├── MeetingUpdateParam.java │ │ │ ├── PageParam.java │ │ │ ├── RoleParam.java │ │ │ ├── UsersAddParam.java │ │ │ ├── UsersLoginParam.java │ │ │ ├── UsersRegisterParam.java │ │ │ ├── UsersSetAdminParam.java │ │ │ ├── UsersSetImgParam.java │ │ │ ├── UsersUpdateParam.java │ │ │ ├── UsersUpdatePassParam.java │ │ │ └── UsersUpdateWithOwnerParam.java │ │ ├── Role.java │ │ ├── UserAdvice.java │ │ ├── UserAdviceImg.java │ │ ├── Users.java │ │ ├── UsersFaceFeature.java │ │ ├── UsersFriend.java │ │ ├── UsersFriendInform.java │ │ ├── UsersRole.java │ │ └── config │ │ │ ├── ImgPathPro.java │ │ │ └── SocketIOPro.java │ │ ├── serializer │ │ └── RedisKeySerializer.java │ │ ├── service │ │ ├── AdminLogService.java │ │ ├── ChatFilterService.java │ │ ├── Impl │ │ │ ├── AdminLogServiceImpl.java │ │ │ ├── ChatFilterServiceImpl.java │ │ │ ├── MeetingApplicationServiceImpl.java │ │ │ ├── MeetingChatServiceImpl.java │ │ │ ├── MeetingNoticeServiceImpl.java │ │ │ ├── MeetingNoticeUsersServiceImpl.java │ │ │ ├── MeetingPasswordServiceImpl.java │ │ │ ├── MeetingScreenshotServiceImpl.java │ │ │ ├── MeetingServiceImpl.java │ │ │ ├── MenuServiceImpl.java │ │ │ ├── RoleServiceImpl.java │ │ │ ├── UserAdviceImgServiceImpl.java │ │ │ ├── UserAdviceServiceImpl.java │ │ │ ├── UsersFriendInformServiceImpl.java │ │ │ ├── UsersFriendServiceImpl.java │ │ │ └── UsersServiceImpl.java │ │ ├── MeetingApplicationService.java │ │ ├── MeetingChatService.java │ │ ├── MeetingNoticeService.java │ │ ├── MeetingNoticeUsersService.java │ │ ├── MeetingPasswordService.java │ │ ├── MeetingScreenshotService.java │ │ ├── MeetingService.java │ │ ├── MenuService.java │ │ ├── RoleService.java │ │ ├── UserAdviceImgService.java │ │ ├── UserAdviceService.java │ │ ├── UsersFriendInformService.java │ │ ├── UsersFriendService.java │ │ └── UsersService.java │ │ ├── socketer │ │ ├── SockerSender.java │ │ ├── SocketHandler.java │ │ ├── SocketMapDao.java │ │ ├── SocketState.java │ │ └── SocketUser.java │ │ └── util │ │ ├── FileUtil.java │ │ ├── IpUtil.java │ │ ├── JwtTokenUtil.java │ │ ├── MeetingParamConverter.java │ │ ├── MyUtil.java │ │ ├── RedisUtil.java │ │ ├── UserParamConverter.java │ │ └── ValidGroups.java └── resources │ ├── application.yml │ └── static │ ├── img │ └── head │ │ └── default.jpg │ └── stopwords.txt └── test └── java └── com └── xyongfeng └── MeetingApplicationTests.java /.gitignore: -------------------------------------------------------------------------------- 1 | API文档.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 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyongfeng/meeting_system_backend/33b0d0f0cffc41a52415fe2febb98163d6bd2412/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 xyongfeng 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## meeting_system_backend 2 | 3 | 前端:https://github.com/xyongfeng/meeting_system_front 4 | 5 | AI端:https://github.com/xyongfeng/meeting_system_ai 6 | 7 | **功能介绍可以前往前端查看** 8 | 9 | ### 开发环境 10 | 11 | jdk11、mysql5.7 12 | 13 | ### 技术框架 14 | 15 | Springboot2.6 web框架 16 | 17 | SpringSecurity + JWT 用户鉴权 18 | 19 | Mybatisplus 持久化 20 | 21 | Redis 缓存 22 | 23 | netty-socketio 消息推送 24 | 25 | swagger 生成接口文档 26 | 27 | ### 接口文档 28 | 29 | 在**active profiles**为**dev**时访问 30 | 31 | http://localhost:8080/doc.html 32 | 33 | ### 配置文件 34 | 35 | **application.yaml** 设置静态文件位置、AI端flask请求地址等 36 | 37 | ### 数据库文件 38 | 39 | sql/meeting.sql 40 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/MeetingApplication.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng; 2 | 3 | import com.corundumstudio.socketio.SocketIOServer; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.CommandLineRunner; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | import org.springframework.data.redis.core.RedisTemplate; 10 | import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; 11 | 12 | import java.util.Set; 13 | import java.util.stream.Collectors; 14 | 15 | @SpringBootApplication 16 | @EnableRedisHttpSession 17 | @Slf4j 18 | public class MeetingApplication implements CommandLineRunner { 19 | 20 | @Autowired 21 | private SocketIOServer socketIOServer; 22 | @Autowired 23 | private RedisTemplate redisTemplate; 24 | 25 | 26 | public static void main(String[] args) { 27 | SpringApplication.run(MeetingApplication.class, args); 28 | } 29 | 30 | @Override 31 | public void run(String... args) { 32 | socketIOServer.start(); 33 | log.info("socket.io启动"); 34 | 35 | // 对每个key去除前缀 meeting_system 长度为15 36 | Set keys = redisTemplate.keys("*").stream().map(x -> x.substring(15)).collect(Collectors.toSet()); 37 | if (!keys.isEmpty()) { 38 | Long result = redisTemplate.delete(keys); 39 | log.info("redis缓存清空"); 40 | } 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/aop/OperationLogAnnotation.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.aop; 2 | 3 | import java.lang.annotation.*; 4 | 5 | 6 | /** 7 | * 管理日志记录注解 8 | * 9 | * @author xyongfeng 10 | * @since 2023-9-5 11 | */ 12 | 13 | @Target(ElementType.METHOD)// 注解放置的目标位置即方法级别 14 | @Retention(RetentionPolicy.RUNTIME)// 注解在哪个阶段执行 15 | @Documented 16 | public @interface OperationLogAnnotation { 17 | 18 | String actionModule(); // 操作模块 19 | 20 | String actionType(); // 操作类型 21 | 22 | String actionUrl(); // 操作路径 23 | 24 | String actionContent() default ""; // 操作内容 25 | } -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/CaptchaConfig.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config; 2 | 3 | import com.google.code.kaptcha.impl.DefaultKaptcha; 4 | import com.google.code.kaptcha.util.Config; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | import java.util.Properties; 9 | 10 | /** 11 | * 验证码配置类 12 | * 13 | * @author xyongfeng 14 | */ 15 | 16 | @Configuration 17 | public class CaptchaConfig { 18 | @Bean 19 | public DefaultKaptcha getDefaultKaptcha() { 20 | DefaultKaptcha captchaProducer = new DefaultKaptcha(); 21 | Properties properties = new Properties(); 22 | properties.setProperty("kaptcha.border", "yes"); 23 | properties.setProperty("kaptcha.border.color", "105,179,90"); 24 | properties.setProperty("kaptcha.textproducer.font.color", "blue"); 25 | properties.setProperty("kaptcha.image.width", "110"); 26 | properties.setProperty("kaptcha.image.height", "40"); 27 | properties.setProperty("kaptcha.textproducer.font.size", "30"); 28 | properties.setProperty("kaptcha.session.key", "code"); 29 | properties.setProperty("kaptcha.textproducer.char.length", "4"); 30 | properties.setProperty("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑"); 31 | Config config = new Config(properties); 32 | captchaProducer.setConfig(config); 33 | return captchaProducer; 34 | 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | /** 7 | * 跨域配置 8 | * @author xyongfeng 9 | */ 10 | @Configuration 11 | public class CorsConfig implements WebMvcConfigurer { 12 | @Override 13 | public void addCorsMappings(CorsRegistry registry) { 14 | //设置运行跨域的路径 15 | registry.addMapping("/**") 16 | // 设置允许跨域请求的域名 17 | .allowedOriginPatterns("*") 18 | // 是否允许Cookie 19 | .allowCredentials(true) 20 | // 设置允许的请求方式 21 | .allowedMethods("GET","POST","DELETE","PUT") 22 | // 设置允许的header属性 23 | .allowedHeaders("*") 24 | // 跨域允许时间 25 | .maxAge(3600); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | 9 | @Configuration 10 | @EnableTransactionManagement 11 | @MapperScan("com.xyongfeng.mapper") 12 | public class MybatisPlusConfig { 13 | //分页插件 14 | @Bean 15 | public PaginationInterceptor paginationInterceptor() { 16 | PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); 17 | // 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false 18 | paginationInterceptor.setOverflow(false); 19 | // 设置最大单页限制数量,默认 500 条,-1 不受限制 20 | // paginationInterceptor.setLimit(500); 21 | // 开启 count 的 join 优化,只针对部分 left join 22 | return paginationInterceptor; 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config; 2 | 3 | import com.xyongfeng.serializer.RedisKeySerializer; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.data.redis.connection.RedisConnectionFactory; 7 | import org.springframework.data.redis.core.RedisTemplate; 8 | import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; 9 | 10 | @Configuration 11 | public class RedisConfig { 12 | 13 | // @Bean 14 | // public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) { 15 | // RedisTemplate template = new RedisTemplate<>(); 16 | // template.setConnectionFactory(redisConnectionFactory); 17 | // //序列化为String 18 | // RedisSerializer stringSerializer = new StringRedisSerializer(); 19 | // //序列化为Json 20 | // GenericJackson2JsonRedisSerializer serializer = new GenericJackson2JsonRedisSerializer(); 21 | // 22 | // template.setKeySerializer(stringSerializer); 23 | // template.setValueSerializer(serializer); 24 | // template.setHashKeySerializer(stringSerializer); 25 | // template.setHashValueSerializer(serializer); 26 | // 27 | // return template; 28 | // } 29 | 30 | @Bean 31 | public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) { 32 | RedisTemplate redisTemplate = new RedisTemplate<>(); 33 | // 设置连接工厂 34 | redisTemplate.setConnectionFactory(redisConnectionFactory); 35 | // 创建 JSON 序列化工具 36 | GenericJackson2JsonRedisSerializer jsonRedisSerializer = new GenericJackson2JsonRedisSerializer(); 37 | // 设置 key 的序列化 38 | RedisKeySerializer redisKeySerializer = new RedisKeySerializer(); 39 | redisTemplate.setKeySerializer(redisKeySerializer); 40 | redisTemplate.setHashKeySerializer(redisKeySerializer); 41 | // 设置 value 的序列化 42 | redisTemplate.setValueSerializer(jsonRedisSerializer); 43 | redisTemplate.setHashValueSerializer(jsonRedisSerializer); 44 | // 返回 45 | return redisTemplate; 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/RestTemplateConfig.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | import org.springframework.http.client.ClientHttpRequestFactory; 7 | import org.springframework.http.client.SimpleClientHttpRequestFactory; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | /** 11 | * 连接flask的config 12 | */ 13 | @Configuration 14 | public class RestTemplateConfig { 15 | 16 | @Bean 17 | public ClientHttpRequestFactory simpleClientHttpRequestFactory(){ 18 | SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); 19 | // 建立连接所用的时间 20 | factory.setConnectTimeout(10000); 21 | // 建立连接后从服务器读取到可用资源所用的时间 22 | factory.setReadTimeout(6000); 23 | return factory; 24 | 25 | } 26 | 27 | // 请求外部API 28 | @Bean 29 | public RestTemplate restTemplate(ClientHttpRequestFactory factory){ 30 | return new RestTemplate(factory); 31 | } 32 | 33 | 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/SocketIOConfig.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config; 2 | 3 | import com.corundumstudio.socketio.SocketConfig; 4 | import com.corundumstudio.socketio.SocketIOServer; 5 | import com.corundumstudio.socketio.annotation.SpringAnnotationScanner; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | 10 | @Configuration 11 | class SocketIOConfig { 12 | 13 | @Value("${socketio.host}") 14 | private String host; 15 | 16 | @Value("${socketio.port}") 17 | private Integer port; 18 | 19 | @Value("${socketio.bossCount}") 20 | private int bossCount; 21 | 22 | @Value("${socketio.workCount}") 23 | private int workCount; 24 | 25 | @Value("${socketio.allowCustomRequests}") 26 | private boolean allowCustomRequests; 27 | 28 | @Value("${socketio.upgradeTimeout}") 29 | private int upgradeTimeout; 30 | 31 | @Value("${socketio.pingTimeout}") 32 | private int pingTimeout; 33 | 34 | @Value("${socketio.pingInterval}") 35 | private int pingInterval; 36 | 37 | /** 38 | * SocketIO配置 39 | * @return 40 | */ 41 | @Bean 42 | public SocketIOServer socketIoServer() { 43 | 44 | SocketConfig socketConfig = new SocketConfig(); 45 | socketConfig.setTcpNoDelay(true); 46 | socketConfig.setSoLinger(0); 47 | com.corundumstudio.socketio.Configuration config = new com.corundumstudio.socketio.Configuration(); 48 | config.setSocketConfig(socketConfig); 49 | config.setHostname(host); 50 | config.setPort(port); 51 | config.setBossThreads(bossCount); 52 | config.setWorkerThreads(workCount); 53 | config.setAllowCustomRequests(allowCustomRequests); 54 | config.setUpgradeTimeout(upgradeTimeout); 55 | config.setPingTimeout(pingTimeout); 56 | config.setPingInterval(pingInterval); 57 | return new SocketIOServer(config); 58 | } 59 | 60 | /** 61 | * 用于扫描netty-socketio的注解,比如 @OnConnect、@OnEvent 62 | */ 63 | 64 | @Bean 65 | public SpringAnnotationScanner springAnnotationScanner() { 66 | return new SpringAnnotationScanner(socketIoServer()); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/Swagger2Config.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config; 2 | 3 | 4 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.annotation.Profile; 8 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 9 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 10 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 11 | import springfox.documentation.builders.ApiInfoBuilder; 12 | import springfox.documentation.builders.PathSelectors; 13 | import springfox.documentation.builders.RequestHandlerSelectors; 14 | import springfox.documentation.service.*; 15 | import springfox.documentation.spi.DocumentationType; 16 | import springfox.documentation.spi.service.contexts.SecurityContext; 17 | import springfox.documentation.spring.web.plugins.Docket; 18 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | @Configuration 24 | @EnableSwagger2 25 | @Profile("dev") 26 | /* 27 | * 注意:这里不能使用 WebMvcConfigurationSupport 因为这这个类会倒置springboot的自动装配失效, 28 | * * 从而造成SPRINGBOOT 默认配置的 静态资源文件的路径无法访问的问题发生 29 | */ 30 | 31 | public class Swagger2Config extends WebMvcConfigurerAdapter { 32 | @Override 33 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 34 | super.addResourceHandlers(registry); 35 | // 映射swagger访问路径 36 | registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/"); 37 | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); 38 | } 39 | 40 | @Bean 41 | public Docket createRestApi() { 42 | return new Docket(DocumentationType.SWAGGER_2) 43 | .apiInfo(apiInfo()) 44 | .select() 45 | .apis(RequestHandlerSelectors.basePackage("com.xyongfeng.controller")) 46 | .paths(PathSelectors.any()) 47 | .build() 48 | .securityContexts(securityContexts()) 49 | .securitySchemes(securitySchemes()); 50 | 51 | 52 | } 53 | 54 | private ApiInfo apiInfo() { 55 | return new ApiInfoBuilder() 56 | .title("会议系统接口文档") 57 | .description("会议系统接口文档") 58 | .contact(new Contact("xyongfeng", "", "979204556@qq.com")) 59 | .version("1.0") 60 | .build(); 61 | 62 | } 63 | 64 | private List securitySchemes() { 65 | // 设置请求头信息 66 | List result = new ArrayList<>(); 67 | ApiKey apiKey = new ApiKey("Authorization", "Authorization", "Header"); 68 | result.add(apiKey); 69 | return result; 70 | } 71 | 72 | private List securityContexts() { 73 | // 设置需要登录认证的路径 74 | List result = new ArrayList<>(); 75 | result.add(getContextByPath("/admins/.*")); 76 | return result; 77 | } 78 | 79 | private SecurityContext getContextByPath(String path) { 80 | return SecurityContext.builder() 81 | .securityReferences(defaultAuth()) 82 | .forPaths(PathSelectors.regex(path)) 83 | .build(); 84 | } 85 | 86 | private List defaultAuth() { 87 | List result = new ArrayList<>(); 88 | 89 | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); 90 | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; 91 | authorizationScopes[0] = authorizationScope; 92 | result.add(new SecurityReference("Authorization", authorizationScopes)); 93 | return result; 94 | } 95 | 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/security/JwtAuthencationTokenFilter.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config.security; 2 | 3 | import com.xyongfeng.content.ResCode; 4 | import com.xyongfeng.exceptionHandler.exception.NormalException; 5 | import com.xyongfeng.util.JwtTokenUtil; 6 | import com.xyongfeng.util.MyUtil; 7 | import com.xyongfeng.util.RedisUtil; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.beans.factory.annotation.Qualifier; 10 | import org.springframework.beans.factory.annotation.Value; 11 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 12 | import org.springframework.security.core.context.SecurityContextHolder; 13 | import org.springframework.security.core.userdetails.UserDetails; 14 | import org.springframework.security.core.userdetails.UserDetailsService; 15 | import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; 16 | import org.springframework.util.StringUtils; 17 | import org.springframework.web.filter.OncePerRequestFilter; 18 | import org.springframework.web.servlet.HandlerExceptionResolver; 19 | 20 | import javax.servlet.FilterChain; 21 | import javax.servlet.ServletException; 22 | import javax.servlet.http.HttpServletRequest; 23 | import javax.servlet.http.HttpServletResponse; 24 | import java.io.IOException; 25 | 26 | /** 27 | * 为token执行登录的过滤器 28 | * 29 | * @author xyongfeng 30 | */ 31 | 32 | public class JwtAuthencationTokenFilter extends OncePerRequestFilter { 33 | @Value("${jwt.tokenHeader}") 34 | private String tokenHeader; 35 | 36 | @Value("${jwt.tokenHead}") 37 | private String tokenHead; 38 | 39 | @Autowired 40 | private JwtTokenUtil jwtTokenUtil; 41 | 42 | @Autowired 43 | private UserDetailsService userDetailsService; 44 | 45 | @Autowired 46 | private RedisUtil redisUtil; 47 | 48 | @Autowired 49 | @Qualifier("handlerExceptionResolver") 50 | private HandlerExceptionResolver resolver; 51 | 52 | 53 | @Override 54 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { 55 | String authHeader = request.getHeader(tokenHeader); 56 | 57 | if (null != authHeader && authHeader.startsWith(tokenHead)) { 58 | String authToken = authHeader.substring(tokenHead.length()).strip(); 59 | String username = jwtTokenUtil.getUserNameFromToken(authToken); 60 | // token存在但未登录 61 | if (null != username && null == SecurityContextHolder.getContext().getAuthentication()) { 62 | // 查库获取用户信息 63 | UserDetails userDetails = userDetailsService.loadUserByUsername(username); 64 | 65 | // 验证token是否有效,重新设置用户对象 66 | if (jwtTokenUtil.validateToken(authToken, userDetails)) { 67 | UsernamePasswordAuthenticationToken authenticationToken = 68 | new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities()); 69 | authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); 70 | SecurityContextHolder.getContext().setAuthentication(authenticationToken); 71 | 72 | // 如果当前id对应token不相等,则说明已经有人在线上了 73 | Integer userId = MyUtil.getUsers().getId(); 74 | String redisToken = redisUtil.getUserOnline(userId); 75 | // 当redisToken为null,则代表当前用户没人在线,可以直接登录 76 | if (redisToken != null && !authToken.equals(redisToken)) { 77 | resolver.resolveException(request, response, null, new NormalException(ResCode.ONLINE_ERROR, "该用户已在其他地方登录")); 78 | return; 79 | } 80 | // 记录当前token至redis 81 | redisUtil.putUserOnline(userId, authToken); 82 | } 83 | } 84 | 85 | } 86 | filterChain.doFilter(request, response); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/security/SGExpressionRoot.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config.security; 2 | 3 | import org.springframework.security.core.GrantedAuthority; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.Collection; 8 | 9 | /** 10 | * 自定义验证规则 11 | */ 12 | @Component 13 | public class SGExpressionRoot { 14 | public boolean hasAuthority(String auth){ 15 | // 获取当前登录用户权限 16 | Collection authorities = SecurityContextHolder.getContext().getAuthentication().getAuthorities(); 17 | // 查看是否有auth权限 18 | for(GrantedAuthority authority:authorities){ 19 | if(authority.getAuthority().equals(auth)){ 20 | return true; 21 | } 22 | } 23 | return false; 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/config/security/SecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.config.security; 2 | 3 | import com.xyongfeng.exceptionHandler.RestAuthorizeationEntryPoint; 4 | import com.xyongfeng.exceptionHandler.RestfulAccessDeniedHandler; 5 | import com.xyongfeng.service.UsersService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 10 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; 11 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 12 | import org.springframework.security.config.annotation.web.builders.WebSecurity; 13 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 14 | import org.springframework.security.config.http.SessionCreationPolicy; 15 | import org.springframework.security.core.userdetails.UserDetailsService; 16 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 17 | import org.springframework.security.crypto.password.PasswordEncoder; 18 | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; 19 | 20 | /** 21 | * Security配置 22 | * 23 | * @author xyongfeng 24 | */ 25 | @Configuration 26 | @EnableGlobalMethodSecurity(prePostEnabled = true) 27 | public class SecurityConfig extends WebSecurityConfigurerAdapter { 28 | @Autowired 29 | private UsersService usersService; 30 | 31 | @Autowired 32 | private RestAuthorizeationEntryPoint restAuthorizeationEntryPoint; 33 | 34 | @Autowired 35 | private RestfulAccessDeniedHandler restfulAccessDeniedHandler; 36 | 37 | @Override 38 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { 39 | auth.userDetailsService(userDetailsService()).passwordEncoder(passwordEncoder()); 40 | } 41 | 42 | @Bean 43 | public PasswordEncoder passwordEncoder() { 44 | return new BCryptPasswordEncoder(); 45 | } 46 | 47 | 48 | @Override 49 | @Bean 50 | public UserDetailsService userDetailsService() { 51 | 52 | return username -> usersService.getUserByUserName(username); 53 | } 54 | 55 | @Bean 56 | public JwtAuthencationTokenFilter jwtAuthencationTokenFilter() { 57 | return new JwtAuthencationTokenFilter(); 58 | } 59 | 60 | @Override 61 | protected void configure(HttpSecurity http) throws Exception { 62 | // 使用JWT,不需要csrf 63 | http.csrf() 64 | .disable() 65 | // 基于token,不需要session 66 | .sessionManagement() 67 | .sessionCreationPolicy(SessionCreationPolicy.STATELESS) 68 | .and() 69 | .authorizeRequests() 70 | //只有管理员才能访问/admins/** 71 | .antMatchers("/admins/**").hasAuthority("admin") 72 | // 除了上面所有请求都要认证 73 | .anyRequest() 74 | .authenticated() 75 | .and() 76 | // 关闭缓存 77 | .headers() 78 | .cacheControl(); 79 | // 添加jwt,登录授权过滤器 80 | http.addFilterBefore(jwtAuthencationTokenFilter(), UsernamePasswordAuthenticationFilter.class); 81 | // 添加自定义未授权和未登录结果返回 82 | http.exceptionHandling() 83 | .accessDeniedHandler(restfulAccessDeniedHandler) 84 | .authenticationEntryPoint(restAuthorizeationEntryPoint); 85 | // 允许跨域 86 | http.cors(); 87 | } 88 | 89 | @Override 90 | public void configure(WebSecurity web) throws Exception { 91 | web.ignoring().antMatchers( 92 | "/users/login", 93 | "/users/loginWithFace", 94 | "/users/logout", 95 | "/users/register", 96 | "index.html", 97 | "/doc.html", 98 | "/webjars/**", 99 | "/swagger-resources/**", 100 | "/v2/api-docs/**", 101 | "/captcha", 102 | "/static/**" 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/content/ResCode.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.content; 2 | 3 | /** 4 | * 返回状态码 5 | */ 6 | public enum ResCode { 7 | SUCCESS(200, "ok"), 8 | NOT_FOUND_ERROR(404, "请求数据不存在"), 9 | FORBIDDEN_ERROR(403, "权限不足"), 10 | ONLINE_ERROR(401, "未登录"), 11 | SYSTEM_ERROR(500, "运行错误"); 12 | 13 | 14 | /** 15 | * 状态码 16 | */ 17 | private final int code; 18 | 19 | /** 20 | * 信息 21 | */ 22 | private final String message; 23 | 24 | ResCode(int code, String message) { 25 | this.code = code; 26 | this.message = message; 27 | } 28 | 29 | public int getCode() { 30 | return code; 31 | } 32 | 33 | public String getMessage() { 34 | return message; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/controller/AdminLogController.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.controller; 2 | 3 | 4 | import com.xyongfeng.pojo.JsonResult; 5 | import com.xyongfeng.pojo.Param.AdminLogSearchParam; 6 | import com.xyongfeng.service.AdminLogService; 7 | import com.xyongfeng.service.ChatFilterService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import lombok.extern.slf4j.Slf4j; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.security.access.prepost.PreAuthorize; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | import java.util.Map; 16 | 17 | /** 18 | *

19 | * 前端控制器 20 | *

21 | * 22 | * @author xyongfeng 23 | * @since 2022-12-29 24 | */ 25 | @Slf4j 26 | @Api(tags = "管理员操作日志") 27 | @RestController 28 | @RequestMapping("/adminLog") 29 | public class AdminLogController { 30 | @Autowired 31 | private AdminLogService adminLogService; 32 | 33 | @PreAuthorize("@SGExpressionRoot.hasAuthority('adminLog')") 34 | @ApiOperation("分页查看操作日志列表") 35 | @GetMapping("/{current}/{size}") 36 | public JsonResult select(@PathVariable Integer current, @PathVariable Integer size, @RequestParam Map params) { 37 | log.info(String.format("get:/adminLog 分页查看操作日志列表。%d , %d", current, size)); 38 | 39 | return adminLogService.select(current, size, params); 40 | 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/controller/CaptchaController.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.controller; 2 | 3 | import com.google.code.kaptcha.impl.DefaultKaptcha; 4 | import io.swagger.annotations.Api; 5 | import io.swagger.annotations.ApiOperation; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.CrossOrigin; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.annotation.Resource; 14 | import javax.imageio.ImageIO; 15 | import javax.servlet.ServletOutputStream; 16 | import javax.servlet.http.HttpServletRequest; 17 | import javax.servlet.http.HttpServletResponse; 18 | import javax.servlet.http.HttpSession; 19 | import java.awt.*; 20 | import java.awt.image.BufferedImage; 21 | import java.io.IOException; 22 | 23 | /** 24 | * 验证码 25 | * 26 | * @author xyongfeng 27 | */ 28 | @Api(tags = "验证码") 29 | @RestController 30 | @Slf4j 31 | public class CaptchaController { 32 | @Autowired 33 | private DefaultKaptcha defaultKaptcha; 34 | 35 | @ApiOperation("验证码") 36 | @GetMapping(value = "/captcha", produces = "image/jpeg") 37 | public void captcha(HttpServletRequest request, HttpServletResponse response) { 38 | response.setDateHeader("Expires", 0); 39 | response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); 40 | response.addHeader("Cache-Control", "post-check=0, pre-check=0"); 41 | response.setHeader("Pragma", "no-cache"); 42 | response.setContentType("image/jpeg"); 43 | 44 | // 生成验证码 45 | String text = defaultKaptcha.createText(); 46 | log.info(String.format("验证码:%s", text)); 47 | 48 | request.getSession().setAttribute("captcha", text); 49 | 50 | // 根据文本验证码内容创建图形验证码 51 | BufferedImage image = defaultKaptcha.createImage(text); 52 | ServletOutputStream outputStream = null; 53 | 54 | try { 55 | outputStream = response.getOutputStream(); 56 | // 输出流输出图片,格式为jpg 57 | ImageIO.write(image, "jpg", outputStream); 58 | outputStream.flush(); 59 | } catch (IOException e) { 60 | e.printStackTrace(); 61 | } finally { 62 | if (null != outputStream) { 63 | try { 64 | outputStream.close(); 65 | } catch (IOException e) { 66 | e.printStackTrace(); 67 | } 68 | } 69 | } 70 | 71 | 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/controller/ChatFilterController.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.controller; 2 | 3 | 4 | import com.alibaba.fastjson.JSONObject; 5 | import com.xyongfeng.pojo.ChatFilter; 6 | import com.xyongfeng.pojo.JsonResult; 7 | import com.xyongfeng.pojo.Param.*; 8 | import com.xyongfeng.service.AdminLogService; 9 | import com.xyongfeng.service.ChatFilterService; 10 | import io.swagger.annotations.Api; 11 | import io.swagger.annotations.ApiOperation; 12 | import lombok.extern.slf4j.Slf4j; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.security.access.prepost.PreAuthorize; 15 | import org.springframework.validation.annotation.Validated; 16 | import org.springframework.web.bind.annotation.*; 17 | 18 | /** 19 | *

20 | * 前端控制器 21 | *

22 | * 23 | * @author xyongfeng 24 | * @since 2022-12-29 25 | */ 26 | @Slf4j 27 | @Api(tags = "管理聊天过滤词") 28 | @RestController 29 | @RequestMapping("/chatFilter") 30 | public class ChatFilterController { 31 | @Autowired 32 | private ChatFilterService chatFilterService; 33 | @Autowired 34 | private AdminLogService adminLogService; 35 | 36 | @PreAuthorize("@SGExpressionRoot.hasAuthority('chatFilter')") 37 | @ApiOperation("分页查看过滤词列表") 38 | @GetMapping("/{current}/{size}") 39 | public JsonResult select(@PathVariable Integer current, @PathVariable Integer size) { 40 | log.info(String.format("get:/chatFilter 分页查看过滤词列表。%d , %d", current, size)); 41 | JsonResult jsonResult = chatFilterService.select(current, size); 42 | adminLogService.insert("chatFilter", "查看", "/chatFilter", jsonResult.getCode().equals(200)); 43 | return jsonResult; 44 | } 45 | 46 | @PreAuthorize("@SGExpressionRoot.hasAuthority('chatFilter')") 47 | @ApiOperation("添加过滤词") 48 | @PostMapping() 49 | public JsonResult insert(@RequestBody @Validated ChatFilter chatFilter) { 50 | log.info(String.format("post:/chatFilter 添加过滤词。%s", chatFilter)); 51 | JsonResult jsonResult = chatFilterService.insert(chatFilter); 52 | ChatFilterParam chatFilterParam = new ChatFilterParam(chatFilter.getId(), chatFilter.getFilterContent(), chatFilter.getFilterRule(), chatFilter.getReplaceContent()); 53 | adminLogService.insert("chatFilter", "新增", "/chatFilter", JSONObject.toJSONString(chatFilterParam), jsonResult.getCode().equals(200)); 54 | return jsonResult; 55 | } 56 | 57 | @PreAuthorize("@SGExpressionRoot.hasAuthority('chatFilter')") 58 | @ApiOperation("修改过滤词") 59 | @PutMapping("/{id}") 60 | public JsonResult update(@RequestBody @Validated ChatFilter chatFilter, @PathVariable Integer id) { 61 | chatFilter.setId(id); 62 | log.info(String.format("put:/chatFilter 修改过滤词。%s", chatFilter)); 63 | JsonResult jsonResult = chatFilterService.updateOne(chatFilter); 64 | ChatFilterParam chatFilterParam = new ChatFilterParam(chatFilter.getId(), chatFilter.getFilterContent(), chatFilter.getFilterRule(), chatFilter.getReplaceContent()); 65 | adminLogService.insert("chatFilter", "编辑", String.format("/chatFilter/%s", id), JSONObject.toJSONString(chatFilterParam), jsonResult.getCode().equals(200)); 66 | 67 | return jsonResult; 68 | } 69 | 70 | @PreAuthorize("@SGExpressionRoot.hasAuthority('chatFilter')") 71 | @ApiOperation("删除过滤词") 72 | @DeleteMapping("/{id}") 73 | public JsonResult delete(@PathVariable Integer id) { 74 | log.info(String.format("delete:/chatFilter 删除过滤词。%s", id)); 75 | JsonResult jsonResult = chatFilterService.delete(id); 76 | 77 | adminLogService.insert("chatFilter", "删除", String.format("/chatFilter/%s", id), jsonResult.getCode().equals(200)); 78 | return jsonResult; 79 | } 80 | 81 | @PreAuthorize("@SGExpressionRoot.hasAuthority('chatFilter')") 82 | @ApiOperation("设置过滤词是否启用") 83 | @PutMapping("/{id}/enable/{enable}") 84 | public JsonResult setAdmin(@PathVariable Integer id, @PathVariable Integer enable) { 85 | log.info(String.format("Put:/chatFilter/{id}/enable/{enable} 设置过滤词是否启用。%d,%d", id, enable)); 86 | JsonResult jsonResult = chatFilterService.setEnable(id, enable == 1); 87 | adminLogService.insert("chatFilter", "编辑", String.format("/chatFilter/%s/enable/%s", id, enable), jsonResult.getCode().equals(200)); 88 | return jsonResult; 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/controller/MeetingScreenshotController.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.controller; 2 | 3 | 4 | import com.xyongfeng.pojo.JsonResult; 5 | import com.xyongfeng.pojo.Param.ImgBase64Param; 6 | import com.xyongfeng.service.MeetingScreenshotService; 7 | import io.swagger.annotations.Api; 8 | import io.swagger.annotations.ApiOperation; 9 | import lombok.extern.slf4j.Slf4j; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.validation.annotation.Validated; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | /** 15 | *

16 | * 前端控制器 17 | *

18 | * 19 | * @author xyongfeng 20 | * @since 2022-12-31 21 | */ 22 | @Api(tags = "会议截屏") 23 | @Slf4j 24 | @RestController 25 | @RequestMapping("/meetingScreenshot") 26 | public class MeetingScreenshotController { 27 | @Autowired 28 | private MeetingScreenshotService meetingScreenshotService; 29 | @ApiOperation("接收base64,保存截屏图像") 30 | @PostMapping("/{mid}") 31 | public JsonResult setScreenshotWithBase64(@RequestBody @Validated ImgBase64Param param, @PathVariable String mid) { 32 | log.info(String.format("Post:/meetingScreenshot/%s 接收base64,保存截屏图像 %s", mid, param)); 33 | return meetingScreenshotService.setScreenshotWithBase64(mid, param); 34 | } 35 | @ApiOperation("根据会议id输出该用户的截屏路径") 36 | @GetMapping("/{mid}/path") 37 | public JsonResult selectPath( @PathVariable String mid) { 38 | log.info(String.format("Get:/meetingScreenshot/%s 接收base64,保存截屏图像", mid)); 39 | return meetingScreenshotService.selectPath(mid); 40 | } 41 | 42 | @ApiOperation("输出该用户所有会议截屏") 43 | @GetMapping() 44 | public JsonResult selectAll() { 45 | log.info("Get:/meetingScreenshot 输出该用户所有会议截屏"); 46 | return meetingScreenshotService.selectAll(); 47 | } 48 | 49 | @ApiOperation("根据id删除") 50 | @DeleteMapping("/{id}") 51 | public JsonResult deleteById(@PathVariable String id) { 52 | log.info(String.format("Delete:/meetingScreenshot/%s 根据id删除", id)); 53 | return meetingScreenshotService.deleteById(id); 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/controller/MenuController.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.controller; 2 | 3 | 4 | import com.xyongfeng.pojo.JsonResult; 5 | import com.xyongfeng.pojo.Menu; 6 | import com.xyongfeng.service.MenuService; 7 | import io.swagger.annotations.Api; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.GetMapping; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | import org.springframework.web.bind.annotation.RestController; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | *

20 | * 前端控制器 21 | *

22 | * 23 | * @author xyongfeng 24 | * @since 2022-06-25 25 | */ 26 | @Api(tags = "管理员操作meeting接口") 27 | @RestController 28 | @RequestMapping("/admins/menu") 29 | public class MenuController { 30 | @Autowired 31 | private MenuService menuService; 32 | 33 | @ApiOperation(value = "通过用户ID查询菜单列表") 34 | @GetMapping 35 | public JsonResult getMenusByAdminId(){ 36 | return menuService.getMenusByUserId(); 37 | } 38 | 39 | 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/controller/RoleController.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.controller; 2 | 3 | 4 | import com.xyongfeng.pojo.JsonResult; 5 | import com.xyongfeng.service.RoleService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import lombok.extern.log4j.Log4j; 9 | import lombok.extern.slf4j.Slf4j; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.security.access.prepost.PreAuthorize; 12 | import org.springframework.web.bind.annotation.GetMapping; 13 | import org.springframework.web.bind.annotation.PathVariable; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RestController; 16 | 17 | /** 18 | *

19 | * 前端控制器 20 | *

21 | * 22 | * @author xyongfeng 23 | * @since 2022-06-25 24 | */ 25 | @RestController 26 | @RequestMapping("/role") 27 | @Api(tags = "权限") 28 | @Slf4j 29 | public class RoleController { 30 | @Autowired 31 | private RoleService roleService; 32 | 33 | 34 | @PreAuthorize("@SGExpressionRoot.hasAuthority('role')") 35 | @ApiOperation("查看管理员权限列表(隐藏权限除外)") 36 | @GetMapping() 37 | public JsonResult getAllRole() { 38 | log.info("Get:/role 查看管理员权限列表。"); 39 | return roleService.selectAllRole(); 40 | } 41 | 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/controller/UserAdviceController.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.controller; 2 | 3 | 4 | import com.xyongfeng.pojo.JsonResult; 5 | import com.xyongfeng.pojo.UserAdvice; 6 | import com.xyongfeng.service.AdminLogService; 7 | import com.xyongfeng.service.UserAdviceService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import lombok.extern.slf4j.Slf4j; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.security.access.prepost.PreAuthorize; 13 | import org.springframework.web.bind.annotation.*; 14 | import org.springframework.web.multipart.MultipartFile; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | *

20 | * 前端控制器 21 | *

22 | * 23 | * @author xyongfeng 24 | * @since 2022-12-29 25 | */ 26 | @Slf4j 27 | @Api(tags = "管理用户意见") 28 | @RestController 29 | @RequestMapping("/userAdvice") 30 | public class UserAdviceController { 31 | 32 | @Autowired 33 | private UserAdviceService userAdviceService; 34 | 35 | @Autowired 36 | private AdminLogService adminLogService; 37 | 38 | @PreAuthorize("@SGExpressionRoot.hasAuthority('userAdvice')") 39 | @ApiOperation("分页查看意见列表") 40 | @GetMapping("/{current}/{size}") 41 | public JsonResult select(@PathVariable Integer current, @PathVariable Integer size) { 42 | log.info(String.format("get:/userAdvice 分页查看意见列表。%d , %d", current, size)); 43 | JsonResult jsonResult = userAdviceService.select(current, size); 44 | adminLogService.insert("userAdvice", "查看", "/userAdvice", jsonResult.getCode().equals(200)); 45 | return jsonResult; 46 | } 47 | 48 | 49 | @ApiOperation("添加意见") 50 | @PostMapping() 51 | public JsonResult insert(@RequestParam String type, @RequestParam String title, @RequestParam String content, @RequestParam List files) { 52 | log.info("post:/userAdvice 添加意见。"); 53 | 54 | return userAdviceService.insert(new UserAdvice().setType(type).setTitle(title).setContent(content),files); 55 | } 56 | 57 | 58 | @PreAuthorize("@SGExpressionRoot.hasAuthority('userAdvice')") 59 | @ApiOperation("删除意见") 60 | @DeleteMapping("/{id}") 61 | public JsonResult delete(@PathVariable Integer id) { 62 | log.info(String.format("delete:/userAdvice 删除意见。%s", id)); 63 | JsonResult jsonResult = userAdviceService.delete(id); 64 | 65 | adminLogService.insert("userAdvice", "删除", String.format("/userAdvice/%s", id), jsonResult.getCode().equals(200)); 66 | return jsonResult; 67 | } 68 | 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/exceptionHandler/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.exceptionHandler; 2 | 3 | import com.xyongfeng.exceptionHandler.exception.NormalException; 4 | import com.xyongfeng.pojo.JsonResult; 5 | import io.jsonwebtoken.ExpiredJwtException; 6 | import lombok.extern.slf4j.Slf4j; 7 | 8 | import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException; 9 | import org.springframework.validation.ObjectError; 10 | import org.springframework.web.bind.MethodArgumentNotValidException; 11 | import org.springframework.web.bind.annotation.ExceptionHandler; 12 | import org.springframework.web.bind.annotation.RestControllerAdvice; 13 | import org.springframework.web.client.HttpClientErrorException; 14 | import org.springframework.web.client.HttpServerErrorException; 15 | 16 | import java.net.ConnectException; 17 | import java.net.SocketTimeoutException; 18 | 19 | import java.time.format.DateTimeParseException; 20 | import java.util.List; 21 | 22 | /** 23 | * 全局错误抓取 24 | * 25 | * @author xyongfeng 26 | */ 27 | @RestControllerAdvice 28 | @Slf4j 29 | public class GlobalExceptionHandler { 30 | 31 | /** 32 | * 抓取字段错误 33 | * 34 | * @param e 35 | * @return 36 | */ 37 | @ExceptionHandler(MethodArgumentNotValidException.class) 38 | public JsonResult methodArgumentNotValidException(MethodArgumentNotValidException e) { 39 | 40 | List allErrors = e.getAllErrors(); 41 | ObjectError error = allErrors.get(0); 42 | log.info(error.getDefaultMessage()); 43 | return JsonResult.error(error.getDefaultMessage()); 44 | } 45 | // @ExceptionHandler(SQLException.class) 46 | // public JsonResult sqlException(SQLException e){ 47 | // return JsonResult.error("数据库异常,操作失败"); 48 | // } 49 | 50 | @ExceptionHandler(DateTimeParseException.class) 51 | public JsonResult dateTimeParseException(DateTimeParseException e) { 52 | 53 | return JsonResult.error(String.format("%s: 时间格式错误 格式为:yyyy-MM-dd HH:mm:ss", e.getParsedString())); 54 | } 55 | 56 | @ExceptionHandler(SocketTimeoutException.class) 57 | public JsonResult socketTimeoutException(SocketTimeoutException e) { 58 | return JsonResult.error("请求超时,请稍后再试"); 59 | } 60 | 61 | @ExceptionHandler({ConnectException.class, HttpServerErrorException.class, HttpClientErrorException.class}) 62 | public JsonResult connectException(Exception e) { 63 | return JsonResult.error("人脸识别服务未启动,请通知管理员"); 64 | } 65 | 66 | @ExceptionHandler(FileSizeLimitExceededException.class) 67 | public JsonResult fileSizeLimitExceededException(FileSizeLimitExceededException e) { 68 | return JsonResult.error("文件上传失败"); 69 | } 70 | 71 | @ExceptionHandler(NormalException.class) 72 | public JsonResult normalException(NormalException e) { 73 | return JsonResult.error(e.getCode(), e.getMessage()); 74 | } 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/exceptionHandler/RestAuthorizeationEntryPoint.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.exceptionHandler; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.xyongfeng.content.ResCode; 5 | import com.xyongfeng.pojo.JsonResult; 6 | import org.springframework.security.core.AuthenticationException; 7 | import org.springframework.security.web.AuthenticationEntryPoint; 8 | import org.springframework.stereotype.Component; 9 | 10 | import javax.servlet.ServletException; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.io.IOException; 14 | import java.io.PrintWriter; 15 | 16 | /** 17 | * 当未登录或者token失效时访问接口时,自定义的返回结果 18 | * 19 | * @author xyongfeng 20 | */ 21 | @Component 22 | public class RestAuthorizeationEntryPoint implements AuthenticationEntryPoint { 23 | @Override 24 | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { 25 | response.setCharacterEncoding("UTF-8"); 26 | response.setContentType("application/json"); 27 | PrintWriter out = response.getWriter(); 28 | JsonResult jsonResult = JsonResult.error(ResCode.ONLINE_ERROR.getCode(), "请登录再访问"); 29 | 30 | out.write(new ObjectMapper().writeValueAsString(jsonResult)); 31 | out.flush(); 32 | out.close(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/exceptionHandler/RestfulAccessDeniedHandler.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.exceptionHandler; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.xyongfeng.content.ResCode; 5 | import com.xyongfeng.pojo.JsonResult; 6 | import org.springframework.security.access.AccessDeniedException; 7 | import org.springframework.security.web.access.AccessDeniedHandler; 8 | import org.springframework.stereotype.Component; 9 | 10 | import javax.servlet.ServletException; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.io.IOException; 14 | import java.io.PrintWriter; 15 | 16 | /** 17 | * 当访问接口没有权限时,自定义返回结果 18 | */ 19 | @Component 20 | public class RestfulAccessDeniedHandler implements AccessDeniedHandler { 21 | @Override 22 | public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { 23 | response.setCharacterEncoding("UTF-8"); 24 | response.setContentType("application/json"); 25 | PrintWriter out = response.getWriter(); 26 | JsonResult jsonResult = JsonResult.error(ResCode.FORBIDDEN_ERROR.getCode(), "权限不足"); 27 | out.write(new ObjectMapper().writeValueAsString(jsonResult)); 28 | out.flush(); 29 | out.close(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/exceptionHandler/exception/NormalException.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.exceptionHandler.exception; 2 | 3 | import com.xyongfeng.content.ResCode; 4 | 5 | /** 6 | * @author xyongfeng 7 | */ 8 | 9 | 10 | public class NormalException extends RuntimeException { 11 | /** 12 | * 错误码 13 | */ 14 | private final int code; 15 | 16 | 17 | public NormalException(int code, String message) { 18 | super(message); 19 | this.code = code; 20 | } 21 | 22 | public NormalException(String message) { 23 | this(ResCode.SYSTEM_ERROR.getCode(), message); 24 | } 25 | 26 | public NormalException(ResCode errorCode) { 27 | super(errorCode.getMessage()); 28 | this.code = errorCode.getCode(); 29 | } 30 | 31 | public NormalException(ResCode errorCode, String message) { 32 | super(message); 33 | this.code = errorCode.getCode(); 34 | } 35 | 36 | public int getCode() { 37 | return code; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/AdminLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.conditions.Wrapper; 5 | import com.baomidou.mybatisplus.core.metadata.IPage; 6 | import com.baomidou.mybatisplus.core.toolkit.Constants; 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 8 | import com.xyongfeng.pojo.AdminLog; 9 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 10 | import com.xyongfeng.pojo.ChatFilter; 11 | import com.xyongfeng.pojo.Meeting; 12 | import org.apache.ibatis.annotations.Param; 13 | import org.springframework.stereotype.Component; 14 | 15 | /** 16 | *

17 | * Mapper 接口 18 | *

19 | * 20 | * @author xyongfeng 21 | * @since 2022-12-29 22 | */ 23 | @Component 24 | public interface AdminLogMapper extends BaseMapper { 25 | IPage selectWithUser(Page page, @Param("ew") Wrapper customSqlSegment); 26 | 27 | AdminLog selectWithUserById(@Param("userId") Integer userId); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/ChatFilterMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.xyongfeng.pojo.ChatFilter; 7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 8 | import com.xyongfeng.pojo.Meeting; 9 | import org.apache.ibatis.annotations.Param; 10 | import org.springframework.stereotype.Component; 11 | 12 | /** 13 | *

14 | * Mapper 接口 15 | *

16 | * 17 | * @author xyongfeng 18 | * @since 2022-12-29 19 | */ 20 | @Component 21 | public interface ChatFilterMapper extends BaseMapper { 22 | IPage selectWithUser(Page page); 23 | 24 | ChatFilter selectWithUserById(@Param("userId") Integer userId); 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/MeetingApplicationMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.xyongfeng.pojo.MeetingApplication; 6 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | *

11 | * Mapper 接口 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-09-12 16 | */ 17 | @Component 18 | public interface MeetingApplicationMapper extends BaseMapper { 19 | 20 | IPage selectMeetingApplications(Integer uid, Page objectPage); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/MeetingChatMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.xyongfeng.pojo.MeetingChat; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *

9 | * Mapper 接口 10 | *

11 | * 12 | * @author xyongfeng 13 | * @since 2022-12-30 14 | */ 15 | @Component 16 | public interface MeetingChatMapper extends BaseMapper { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/MeetingMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.xyongfeng.pojo.JsonResult; 7 | import com.xyongfeng.pojo.Meeting; 8 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 9 | import com.xyongfeng.pojo.MeetingUsers; 10 | import com.xyongfeng.pojo.Users; 11 | import org.apache.ibatis.annotations.Param; 12 | import org.springframework.stereotype.Component; 13 | 14 | import java.io.Serializable; 15 | import java.time.LocalDateTime; 16 | import java.util.List; 17 | 18 | /** 19 | *

20 | * Mapper 接口 21 | *

22 | * 23 | * @author xyongfeng 24 | * @since 2022-07-02 25 | */ 26 | @Component 27 | public interface MeetingMapper extends BaseMapper { 28 | 29 | 30 | @Override 31 | Meeting selectById(@Param("mid") Serializable id); 32 | 33 | /** 34 | * 会议与创建的用户一一对应 输出列表 35 | * 36 | * @param page 37 | * @param wrapper 38 | * @return 39 | */ 40 | IPage selectMeetingWithCreater(Page page, @Param("ew") QueryWrapper wrapper); 41 | 42 | /** 43 | * 输出id对应的会议携带创建者users 输出单个 44 | * 45 | * @param meetId 46 | * @return 47 | */ 48 | Meeting selectMeetingWithCreaterOne(@Param("meeting_id") String meetId); 49 | 50 | /** 51 | * 输出当前用户参与的会议列表 52 | * 53 | * @param page 54 | * @param userId 55 | * @return 56 | */ 57 | // IPage selectMeetingByParticipants(Page page, @Param("user_id") Integer userId); 58 | 59 | /** 60 | * 输出当前用户参与的会议列表有条件 61 | * 62 | * @param page 63 | * @param userId 64 | * @return 65 | */ 66 | IPage selectMeetingByParticipants(Page page, @Param("user_id") Integer userId, @Param("ew") QueryWrapper wrapper); 67 | 68 | /** 69 | * 获得用户参与表中是否存在此会议 70 | * 71 | * @param meetId 72 | * @param userId 73 | */ 74 | Meeting getExistMeetWithUser(@Param("meeting_id") String meetId, @Param("user_id") Integer userId); 75 | 76 | /** 77 | * 输出该会议的参与者列表 78 | * 79 | * @param meetId 80 | * @return 81 | */ 82 | List selectOneWithParticipantById(@Param("meeting_id") String meetId); 83 | 84 | /** 85 | * 输出用户参与的已结束的会议,也就是历史会议 86 | */ 87 | IPage selectMeetingByParticipantsWithEnd(Page objectPage, @Param("user_id") Integer id); 88 | 89 | /** 90 | * 为结束的会议,写上结束时间 91 | * 92 | * @param mid 93 | * @param now 94 | * @return 95 | */ 96 | Integer updateEndDate(@Param("mid") String mid, @Param("endDate") String now); 97 | 98 | /** 99 | * 根据id删除自己的历史会议 100 | * 101 | * @param mid 102 | * @param uid 103 | * @return 104 | */ 105 | Integer delHistoryMeeting(@Param("mid") String mid, @Param("uid") Integer uid); 106 | 107 | /** 108 | * 获取所有会议开始时间 109 | * 110 | * @return 111 | */ 112 | List selectAllStartDateTime(@Param("withoutEnd") Boolean withoutEnd); 113 | } 114 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/MeetingNoticeMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.xyongfeng.pojo.MeetingNotice; 5 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | *

11 | * Mapper 接口 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-09-12 16 | */ 17 | @Component 18 | public interface MeetingNoticeMapper extends BaseMapper { 19 | /** 20 | * 输出该用户未读的会议通知 21 | * @param uid 22 | * @param page 23 | * @return 24 | */ 25 | IPage selectMeetingNoticePushWithUid(@Param("uid") Integer uid, IPage page); 26 | 27 | /** 28 | * 输出该会议的公告 29 | * @param mid 30 | * @param page 31 | * @return 32 | */ 33 | IPage selectMeetingNotice(@Param("mid") String mid, IPage page); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/MeetingNoticeUsersMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.xyongfeng.pojo.MeetingNoticeUsers; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | *

11 | * Mapper 接口 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-09-12 16 | */ 17 | @Component 18 | public interface MeetingNoticeUsersMapper extends BaseMapper { 19 | /** 20 | * 将之前的推送公告加入到该用户通知中 21 | * @param mid 22 | * @param uid 23 | */ 24 | void insertMeetingNoticePushToUser(@Param("mid") String mid, @Param("uid") Integer uid); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/MeetingPasswordMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.xyongfeng.pojo.MeetingPassword; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *

9 | * Mapper 接口 10 | *

11 | * 12 | * @author xyongfeng 13 | * @since 2023-01-03 14 | */ 15 | @Component 16 | public interface MeetingPasswordMapper extends BaseMapper { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/MeetingScreenshotMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.xyongfeng.pojo.MeetingScreenshot; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * Mapper 接口 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-12-31 16 | */ 17 | @Component 18 | public interface MeetingScreenshotMapper extends BaseMapper { 19 | 20 | /** 21 | * 输出该用户所有 22 | * @return 23 | */ 24 | List selectAll(Integer uid); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/MeetingUsersMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.xyongfeng.pojo.JsonResult; 7 | import com.xyongfeng.pojo.Meeting; 8 | import com.xyongfeng.pojo.MeetingUsers; 9 | import com.xyongfeng.pojo.Users; 10 | import org.apache.ibatis.annotations.Param; 11 | import org.springframework.stereotype.Component; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | *

17 | * Mapper 接口 18 | *

19 | * 20 | * @author xyongfeng 21 | * @since 2022-07-20 22 | */ 23 | @Component 24 | public interface MeetingUsersMapper extends BaseMapper { 25 | 26 | IPage selectHadSignInList(Page page,@Param("mid") String mid ); 27 | 28 | IPage selectMeetingUsersList(Page page,@Param("mid") String mid ); 29 | 30 | Integer delHistoryMeeting(@Param("mid") String mid,@Param("uid") Integer uid); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/MenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.xyongfeng.pojo.Menu; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * Mapper 接口 13 | *

14 | * 15 | * @author xyongfeng 16 | * @since 2022-06-25 17 | */ 18 | @Component 19 | public interface MenuMapper extends BaseMapper { 20 | /** 21 | * 通过用户ID查询菜单列表 22 | * @param id 23 | * @return 24 | */ 25 | 26 | List getMenusByUserId(Integer id); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.xyongfeng.pojo.Role; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * Mapper 接口 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-06-25 16 | */ 17 | @Component 18 | public interface RoleMapper extends BaseMapper { 19 | /** 20 | * 根据用户id获得Role列表 21 | * 22 | * @return 23 | */ 24 | List selectRoleWithUserid(Integer uid); 25 | 26 | /** 27 | * 不会输出隐藏role 28 | * @param uid 29 | * @return 30 | */ 31 | List selectRoleWithoutHidden(Integer uid); 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/UserAdviceImgMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.xyongfeng.pojo.UserAdviceImg; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *

9 | * Mapper 接口 10 | *

11 | * 12 | * @author xyongfeng 13 | * @since 2023-01-03 14 | */ 15 | @Component 16 | public interface UserAdviceImgMapper extends BaseMapper { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/UserAdviceMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.xyongfeng.pojo.AdminLog; 6 | import com.xyongfeng.pojo.UserAdvice; 7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.springframework.stereotype.Component; 10 | 11 | /** 12 | *

13 | * Mapper 接口 14 | *

15 | * 16 | * @author xyongfeng 17 | * @since 2022-12-29 18 | */ 19 | @Component 20 | public interface UserAdviceMapper extends BaseMapper { 21 | 22 | IPage selectWithUserAndImg(Page page); 23 | 24 | UserAdvice selectWithUserAndImgById(@Param("userId") Integer userId); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/UsersFaceFeatureMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.xyongfeng.pojo.UsersFaceFeature; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * Mapper 接口 13 | *

14 | * 15 | * @author xyongfeng 16 | * @since 2022-11-28 17 | */ 18 | @Component 19 | public interface UsersFaceFeatureMapper extends BaseMapper { 20 | 21 | List selectAll(); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/UsersFriendInformMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.xyongfeng.pojo.UsersFriendInform; 7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.springframework.stereotype.Component; 10 | 11 | /** 12 | *

13 | * Mapper 接口 14 | *

15 | * 16 | * @author xyongfeng 17 | * @since 2022-08-22 18 | */ 19 | @Component 20 | public interface UsersFriendInformMapper extends BaseMapper { 21 | 22 | IPage selectPageWithFromerInfo(Page page, @Param("ew") QueryWrapper orderByDesc); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/UsersFriendMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.xyongfeng.pojo.Users; 6 | import com.xyongfeng.pojo.UsersFriend; 7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.springframework.stereotype.Component; 10 | 11 | /** 12 | *

13 | * Mapper 接口 14 | *

15 | * 16 | * @author xyongfeng 17 | * @since 2022-08-22 18 | */ 19 | @Component 20 | public interface UsersFriendMapper extends BaseMapper { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/UsersMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.xyongfeng.pojo.Users; 6 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 7 | 8 | import org.apache.ibatis.annotations.Param; 9 | import org.springframework.stereotype.Component; 10 | 11 | 12 | /** 13 | *

14 | * Mapper 接口 15 | *

16 | * 17 | * @author xyongfeng 18 | * @since 2022-06-09 19 | */ 20 | @Component 21 | public interface UsersMapper extends BaseMapper { 22 | 23 | IPage selectFriendsAndChatPage(Page page, @Param("ownerId") Integer ownerId); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/UsersRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.mapper; 2 | 3 | import com.xyongfeng.pojo.UsersRole; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | *

9 | * Mapper 接口 10 | *

11 | * 12 | * @author xyongfeng 13 | * @since 2022-10-27 14 | */ 15 | @Component 16 | public interface UsersRoleMapper extends BaseMapper { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/AdminLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 40 | 49 | 50 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/ChatFilterMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 43 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/MeetingApplicationMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/MeetingChatMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/MeetingNoticeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 53 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/MeetingNoticeUsersMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | INSERT INTO t_meeting_notice_users_xq(`user_id_xq`,`notice_id_xq`,`state_xq`) 14 | SELECT ${uid} as `user_id`,`id_xq` as `notice_id`,0 as `state` 15 | FROM t_meeting_notice_xq 16 | WHERE 17 | meeting_id_xq='${mid}' AND 18 | type_xq=2; 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/MeetingPasswordMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/MeetingScreenshotMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/MeetingUsersMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | update t_meeting_users_xq mu 33 | set mu.to_user_hidden_xq = 1 34 | where mu.meeting_id_xq = '${mid}' and 35 | mu.users_id_xq = ${uid} 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 64 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/MenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/RoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 25 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/UserAdviceImgMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/UserAdviceMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 35 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/UsersFaceFeatureMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/UsersFriendInformMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/UsersFriendMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/UsersMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/mapper/xml/UsersRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/AdminLog.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | 8 | import java.time.LocalDateTime; 9 | import java.io.Serializable; 10 | 11 | import com.fasterxml.jackson.annotation.JsonFormat; 12 | import io.swagger.annotations.ApiModel; 13 | import io.swagger.annotations.ApiModelProperty; 14 | import lombok.Data; 15 | import lombok.EqualsAndHashCode; 16 | import lombok.experimental.Accessors; 17 | 18 | /** 19 | *

20 | * 21 | *

22 | * 23 | * @author xyongfeng 24 | * @since 2022-12-29 25 | */ 26 | @Data 27 | @EqualsAndHashCode(callSuper = false) 28 | @Accessors(chain = true) 29 | @TableName("t_admin_log_xq") 30 | @ApiModel(value = "AdminLog对象", description = "") 31 | public class AdminLog implements Serializable { 32 | 33 | private static final long serialVersionUID = 1L; 34 | 35 | @TableId(value = "id_xq", type = IdType.AUTO) 36 | private Integer id; 37 | 38 | @ApiModelProperty(value = "操作模块") 39 | @TableField("action_module_xq") 40 | private String actionModule; 41 | 42 | @ApiModelProperty(value = "操作人id") 43 | @TableField("action_user_id_xq") 44 | private Integer actionUserId; 45 | 46 | @TableField("action_url_xq") 47 | @ApiModelProperty(value = "url") 48 | private String actionUrl; 49 | 50 | @TableField("action_content_xq") 51 | @ApiModelProperty(value = "请求参数") 52 | private String actionContent; 53 | 54 | @TableField("action_type_xq") 55 | @ApiModelProperty(value = "操作类型 查看 编辑 删除 新增") 56 | private String actionType; 57 | 58 | @TableField("action_ip_xq") 59 | @ApiModelProperty(value = "操作ip") 60 | private String actionIp; 61 | 62 | @TableField("action_time_xq") 63 | @ApiModelProperty(value = "操作时间") 64 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 65 | private LocalDateTime actionTime; 66 | 67 | 68 | @TableField("action_success_xq") 69 | @ApiModelProperty(value = "操作是否成功") 70 | private Boolean actionSuccess; 71 | 72 | @ApiModelProperty(value = "操作人") 73 | @TableField(exist = false) 74 | private Users actionUser; 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/ChatFilter.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | 8 | import java.time.LocalDateTime; 9 | import java.io.Serializable; 10 | 11 | import com.fasterxml.jackson.annotation.JsonFormat; 12 | import io.swagger.annotations.ApiModel; 13 | import io.swagger.annotations.ApiModelProperty; 14 | import lombok.Data; 15 | import lombok.EqualsAndHashCode; 16 | import lombok.experimental.Accessors; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import javax.validation.constraints.NotNull; 20 | 21 | /** 22 | *

23 | * 24 | *

25 | * 26 | * @author xyongfeng 27 | * @since 2022-12-29 28 | */ 29 | @Data 30 | @EqualsAndHashCode(callSuper = false) 31 | @Accessors(chain = true) 32 | @TableName("t_chat_filter_xq") 33 | @ApiModel(value = "ChatFilter对象", description = "") 34 | public class ChatFilter implements Serializable { 35 | 36 | private static final long serialVersionUID = 1L; 37 | 38 | @TableId(value = "id_xq", type = IdType.AUTO) 39 | private Integer id; 40 | 41 | @ApiModelProperty(value = "过滤内容", required = true) 42 | @NotBlank(message = "过滤内容不能为空") 43 | @TableField("filter_content_xq") 44 | private String filterContent; 45 | 46 | @TableField("filter_rule_xq") 47 | @ApiModelProperty(value = "过滤规则 1 直接替换,2 正则表达式替换", required = true) 48 | @NotNull(message = "过滤规则不能为空") 49 | private Integer filterRule; 50 | 51 | @TableField("replace_content_xq") 52 | @ApiModelProperty(value = "替换内容") 53 | private String replaceContent; 54 | 55 | @TableField("appender_id_xq") 56 | @ApiModelProperty(value = "添加人的id") 57 | private Integer appenderId; 58 | 59 | @TableField("append_time_xq") 60 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 61 | @ApiModelProperty(value = "添加时间") 62 | private LocalDateTime appendTime; 63 | 64 | @TableField("enable_xq") 65 | @ApiModelProperty(value = "是否启用") 66 | private Boolean enable; 67 | 68 | @ApiModelProperty(value = "添加用户") 69 | @TableField(exist = false) 70 | private Users appender; 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/FriendsAndChat.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import io.swagger.annotations.ApiModel; 6 | import lombok.Data; 7 | import lombok.experimental.Accessors; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author xyongfeng 13 | */ 14 | @Data 15 | @Accessors(chain = true) 16 | @ApiModel(value = "好友信息及好友聊天记录", description = "") 17 | public class FriendsAndChat { 18 | private Integer uid; 19 | private String name; 20 | private String headImage; 21 | private List chatMessage; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/JsonResult.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import com.xyongfeng.content.ResCode; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | 12 | /** 13 | * @author xyongfeng 14 | */ 15 | @ApiModel("返回json实体") 16 | @Data 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | @JsonInclude(JsonInclude.Include.NON_NULL) 20 | public class JsonResult { 21 | @ApiModelProperty("状态码") 22 | private Integer code; 23 | @ApiModelProperty("状态信息") 24 | private String message; 25 | @ApiModelProperty("json核心数据内容") 26 | private Object data; 27 | 28 | public JsonResult(int i) { 29 | this.code = i; 30 | 31 | } 32 | 33 | public JsonResult(int i, String message) { 34 | this.code = i; 35 | this.message = message; 36 | } 37 | 38 | public JsonResult(int i, Object data) { 39 | this.code = i; 40 | this.data = data; 41 | } 42 | 43 | /** 44 | * 成功返回结果 45 | * 46 | * @param message 47 | * @return 48 | */ 49 | public static JsonResult success(String message) { 50 | return new JsonResult(ResCode.SUCCESS.getCode(), message); 51 | } 52 | 53 | public static JsonResult success() { 54 | return new JsonResult(ResCode.SUCCESS.getCode()); 55 | } 56 | 57 | public static JsonResult success(Object data) { 58 | return new JsonResult(ResCode.SUCCESS.getCode(), data); 59 | } 60 | 61 | /** 62 | * 成功返回结果 63 | * 64 | * @param message 65 | * @param data 66 | * @return 67 | */ 68 | public static JsonResult success(String message, Object data) { 69 | return new JsonResult(ResCode.SUCCESS.getCode(), message, data); 70 | } 71 | 72 | /** 73 | * 成功返回结果 74 | * 75 | * @param code 76 | * @param message 77 | * @param data 78 | * @return 79 | */ 80 | public static JsonResult success(int code, String message, Object data) { 81 | return new JsonResult(code, message, data); 82 | } 83 | 84 | public static JsonResult success(int code, String message) { 85 | return new JsonResult(code, message); 86 | } 87 | 88 | /** 89 | * 失败返回结果 90 | * 91 | * @param message 92 | * @return 93 | */ 94 | public static JsonResult error(String message) { 95 | return new JsonResult(ResCode.SYSTEM_ERROR.getCode(), message); 96 | } 97 | 98 | /** 99 | * 失败返回结果 100 | * 101 | * @param message 102 | * @param data 103 | * @return 104 | */ 105 | public static JsonResult error(String message, Object data) { 106 | return new JsonResult(ResCode.SYSTEM_ERROR.getCode(), message, data); 107 | } 108 | 109 | /** 110 | * 失败返回结果 111 | * 112 | * @param code 113 | * @param message 114 | * @param data 115 | * @return 116 | */ 117 | public static JsonResult error(int code, String message, Object data) { 118 | return new JsonResult(code, message, data); 119 | } 120 | 121 | public static JsonResult error(int code, String message) { 122 | return new JsonResult(code, message); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Meeting.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.*; 4 | 5 | import java.time.LocalDateTime; 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | import lombok.EqualsAndHashCode; 14 | import lombok.experimental.Accessors; 15 | 16 | /** 17 | *

18 | * 19 | *

20 | * 21 | * @author xyongfeng 22 | * @since 2022-07-02 23 | */ 24 | @Data 25 | @EqualsAndHashCode(callSuper = false) 26 | @Accessors(chain = true) 27 | @TableName("t_meeting_xq") 28 | @ApiModel(value = "Meeting对象", description = "") 29 | public class Meeting implements Serializable { 30 | 31 | private static final long serialVersionUID = 1L; 32 | 33 | @ApiModelProperty(value = "id") 34 | @TableId(value = "id_xq", type = IdType.ASSIGN_ID) 35 | private String id; 36 | 37 | @TableField("name_xq") 38 | @ApiModelProperty(value = "会议名称") 39 | private String name; 40 | 41 | @TableField("user_id_xq") 42 | @ApiModelProperty(value = "创建会议的用户id") 43 | private Integer userId; 44 | 45 | @TableField("create_date_xq") 46 | @ApiModelProperty(value = "创建会议的时间") 47 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 48 | private LocalDateTime createDate; 49 | 50 | @TableField("start_date_xq") 51 | @ApiModelProperty(value = "会议开始时间") 52 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 53 | private LocalDateTime startDate; 54 | 55 | @TableField("end_date_xq") 56 | @ApiModelProperty(value = "会议结束时间") 57 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 58 | private LocalDateTime endDate; 59 | 60 | @ApiModelProperty(value = "进入会议是否需要创建者认可") 61 | @TableField("haveLicence_xq") 62 | private Boolean haveLicence; 63 | 64 | @ApiModelProperty(value = "会议是否已经结束") 65 | @TableField("end_xq") 66 | @TableLogic(value = "0", delval = "1") 67 | private Boolean end; 68 | 69 | @ApiModelProperty(value = "主持人删除了该会议的记录就对他隐藏") 70 | @TableField("to_owner_hidden_xq") 71 | private Boolean toOwnerHidden; 72 | 73 | 74 | @ApiModelProperty(value = "参会最大人数") 75 | @TableField("max_number_xq") 76 | private Integer maxNumber; 77 | 78 | @ApiModelProperty(value = "进入房间是否需要人脸验证") 79 | @TableField("need_face_xq") 80 | private Boolean needFace; 81 | 82 | @ApiModelProperty(value = "创建用户") 83 | @TableField(exist = false) 84 | private Users users; 85 | 86 | 87 | @ApiModelProperty(value = "参加用户列表") 88 | @TableField(exist = false) 89 | private List participants; 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/MeetingApplication.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | import java.io.Serializable; 14 | import java.time.LocalDateTime; 15 | 16 | /** 17 | *

18 | * 19 | *

20 | * 21 | * @author xyongfeng 22 | * @since 2022-09-13 23 | */ 24 | @Data 25 | @EqualsAndHashCode(callSuper = false) 26 | @Accessors(chain = true) 27 | @TableName("t_meeting_application_xq") 28 | @ApiModel(value="MeetingApplication对象", description="") 29 | public class MeetingApplication implements Serializable { 30 | 31 | private static final long serialVersionUID=1L; 32 | 33 | @TableId(value = "id_xq", type = IdType.AUTO) 34 | private Integer id; 35 | 36 | @TableField("applicant_id_xq") 37 | @ApiModelProperty(value = "申请人id") 38 | private Integer applicantId; 39 | 40 | @TableField("meeting_id_xq") 41 | @ApiModelProperty(value = "会议id") 42 | private String meetingId; 43 | 44 | @TableField("state_xq") 45 | @ApiModelProperty(value = "0 未读 1 已读") 46 | private Integer state; 47 | 48 | @TableField("send_time_xq") 49 | @ApiModelProperty(value = "发送时间") 50 | private LocalDateTime sendTime; 51 | 52 | @TableField(exist = false) 53 | private Meeting meeting; 54 | 55 | @TableField(exist = false) 56 | private Users users; 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/MeetingChat.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import java.time.LocalDateTime; 8 | import java.io.Serializable; 9 | import io.swagger.annotations.ApiModel; 10 | import lombok.Data; 11 | import lombok.EqualsAndHashCode; 12 | import lombok.experimental.Accessors; 13 | 14 | /** 15 | *

16 | * 17 | *

18 | * 19 | * @author xyongfeng 20 | * @since 2022-12-30 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @Accessors(chain = true) 25 | @TableName("t_meeting_chat_xq") 26 | @ApiModel(value="MeetingChat对象", description="") 27 | public class MeetingChat implements Serializable { 28 | 29 | private static final long serialVersionUID=1L; 30 | 31 | @TableId(value = "id_xq", type = IdType.AUTO) 32 | private Integer id; 33 | 34 | @TableField("meeting_id_xq") 35 | private String meetingId; 36 | 37 | @TableField("user_id_xq") 38 | private Integer userId; 39 | 40 | @TableField("msg_xq") 41 | private String msg; 42 | 43 | @TableField("send_time_xq") 44 | private LocalDateTime sendTime; 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/MeetingNotice.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.time.LocalDateTime; 8 | import java.io.Serializable; 9 | 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import io.swagger.annotations.ApiModel; 12 | import io.swagger.annotations.ApiModelProperty; 13 | import lombok.Data; 14 | import lombok.EqualsAndHashCode; 15 | import lombok.experimental.Accessors; 16 | import org.hibernate.validator.constraints.Length; 17 | 18 | import javax.validation.constraints.NotBlank; 19 | import javax.validation.constraints.NotNull; 20 | 21 | /** 22 | *

23 | * 24 | *

25 | * 26 | * @author xyongfeng 27 | * @since 2022-09-12 28 | */ 29 | @Data 30 | @EqualsAndHashCode(callSuper = false) 31 | @Accessors(chain = true) 32 | @TableName("t_meeting_notice_xq") 33 | @ApiModel(value="MeetingNotice对象", description="") 34 | public class MeetingNotice implements Serializable { 35 | 36 | private static final long serialVersionUID=1L; 37 | @TableId(value = "id_xq", type = IdType.AUTO) 38 | private Integer id; 39 | 40 | @TableField("meeting_id_xq") 41 | @ApiModelProperty(value = "会议id") 42 | private String meetingId; 43 | 44 | @TableField("sender_id_xq") 45 | @ApiModelProperty(value = "发送人id") 46 | private Integer senderId; 47 | 48 | @TableField("title_xq") 49 | @NotBlank(message = "标题不能为空") 50 | @Length(max = 10, message = "标题长度不能大于10") 51 | @ApiModelProperty(value = "通知标题") 52 | private String title; 53 | 54 | @TableField("content_xq") 55 | @NotBlank(message = "通知内容不能为空") 56 | @ApiModelProperty(value = "通知内容") 57 | private String content; 58 | 59 | @TableField("send_time_xq") 60 | @ApiModelProperty(value = "发送时间") 61 | @JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 62 | private LocalDateTime sendTime; 63 | 64 | @TableField("type_xq") 65 | @ApiModelProperty(value = "公告类型 1 普通公告 2 推送公告") 66 | @NotNull(message = "公告类型不能为空") 67 | private Integer type; 68 | 69 | @TableField("update_time_xq") 70 | @ApiModelProperty(value = "编辑时间") 71 | @JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 72 | private LocalDateTime updateTime; 73 | 74 | @TableField("hidden_xq") 75 | @ApiModelProperty(value = "隐藏,不会出现在公告列表里面,通常用来发送私有通知") 76 | private Boolean hidden; 77 | 78 | 79 | @TableField(exist = false) 80 | @ApiModelProperty(value = "通知id") 81 | private Integer informId; 82 | 83 | @TableField(exist = false) 84 | @ApiModelProperty(value = "发送通知的用户") 85 | private Users sender; 86 | 87 | @TableField(exist = false) 88 | @ApiModelProperty(value = "通知来源的会议") 89 | private Meeting meeting; 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/MeetingNoticeUsers.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import io.swagger.annotations.ApiModel; 9 | import io.swagger.annotations.ApiModelProperty; 10 | import lombok.Data; 11 | import lombok.EqualsAndHashCode; 12 | import lombok.experimental.Accessors; 13 | 14 | /** 15 | *

16 | * 17 | *

18 | * 19 | * @author xyongfeng 20 | * @since 2022-09-12 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @Accessors(chain = true) 25 | @TableName("t_meeting_notice_users_xq") 26 | @ApiModel(value="MeetingNoticeUsers对象", description="") 27 | public class MeetingNoticeUsers implements Serializable { 28 | 29 | private static final long serialVersionUID=1L; 30 | @TableId(value = "id_xq", type = IdType.AUTO) 31 | private Integer id; 32 | 33 | @TableField("user_id_xq") 34 | @ApiModelProperty(value = "接收人id") 35 | private Integer userId; 36 | 37 | @TableField("notice_id_xq") 38 | @ApiModelProperty(value = "通知id") 39 | private Integer noticeId; 40 | 41 | @TableField("state_xq") 42 | @ApiModelProperty(value = "0 未读 1已读") 43 | private Integer state; 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/MeetingPassword.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import java.io.Serializable; 8 | import io.swagger.annotations.ApiModel; 9 | import io.swagger.annotations.ApiModelProperty; 10 | import lombok.Data; 11 | import lombok.EqualsAndHashCode; 12 | import lombok.experimental.Accessors; 13 | 14 | /** 15 | *

16 | * 17 | *

18 | * 19 | * @author xyongfeng 20 | * @since 2023-01-03 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @Accessors(chain = true) 25 | @TableName("t_meeting_password_xq") 26 | @ApiModel(value="MeetingPassword对象", description="") 27 | public class MeetingPassword implements Serializable { 28 | 29 | private static final long serialVersionUID=1L; 30 | 31 | @TableId(value = "id_xq", type = IdType.AUTO) 32 | private Integer id; 33 | 34 | @TableField("meeting_id_xq") 35 | private String meetingId; 36 | 37 | @TableField("password_xq") 38 | @ApiModelProperty(value = "会议密码") 39 | private String password; 40 | 41 | @TableField("enabled_xq") 42 | @ApiModelProperty(value = "是否启用") 43 | private Boolean enabled; 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/MeetingScreenshot.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import java.io.Serializable; 8 | import io.swagger.annotations.ApiModel; 9 | import io.swagger.annotations.ApiModelProperty; 10 | import lombok.Data; 11 | import lombok.EqualsAndHashCode; 12 | import lombok.experimental.Accessors; 13 | 14 | /** 15 | *

16 | * 17 | *

18 | * 19 | * @author xyongfeng 20 | * @since 2022-12-31 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @Accessors(chain = true) 25 | @TableName("t_meeting_screenshot_xq") 26 | @ApiModel(value="MeetingScreenshot对象", description="") 27 | public class MeetingScreenshot implements Serializable { 28 | 29 | private static final long serialVersionUID=1L; 30 | @TableId(value = "id_xq", type = IdType.AUTO) 31 | private Integer id; 32 | 33 | @TableField("user_id_xq") 34 | private Integer userId; 35 | 36 | @TableField("meeting_id_xq") 37 | private String meetingId; 38 | 39 | @TableField("path_xq") 40 | private String path; 41 | 42 | @TableField(exist = false) 43 | private Meeting meeting; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/MeetingUsers.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.fasterxml.jackson.annotation.JsonFormat; 8 | import io.swagger.annotations.ApiModel; 9 | import io.swagger.annotations.ApiModelProperty; 10 | import lombok.Data; 11 | import lombok.EqualsAndHashCode; 12 | import lombok.experimental.Accessors; 13 | 14 | import java.io.Serializable; 15 | import java.time.LocalDateTime; 16 | 17 | /** 18 | *

19 | * 20 | *

21 | * 22 | * @author xyongfeng 23 | * @since 2022-12-16 24 | */ 25 | @Data 26 | @EqualsAndHashCode(callSuper = false) 27 | @Accessors(chain = true) 28 | @TableName("t_meeting_users_xq") 29 | @ApiModel(value = "MeetingUsers对象", description = "") 30 | public class MeetingUsers implements Serializable { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | @TableId(value = "id_xq", type = IdType.AUTO) 35 | private Integer id; 36 | 37 | @TableField("meeting_id_xq") 38 | private String meetingId; 39 | 40 | @TableField("users_id_xq") 41 | private Integer usersId; 42 | 43 | @TableField("had_sign_in_xq") 44 | @ApiModelProperty(value = "是否完成签到") 45 | private Boolean hadSignIn; 46 | 47 | @TableField("had_sign_in_time_xq") 48 | @ApiModelProperty(value = "签到时间") 49 | @JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 50 | private LocalDateTime hadSignInTime; 51 | 52 | @TableField("had_ban_xq") 53 | @ApiModelProperty(value = "是否被加入黑名单") 54 | private Boolean hadBan; 55 | 56 | @TableField("had_muted_xq") 57 | @ApiModelProperty(value = "是否被静言") 58 | private Boolean hadMuted; 59 | 60 | @TableField("had_banup_xq") 61 | @ApiModelProperty(value = "是否被禁止投屏") 62 | private Boolean hadBanup; 63 | 64 | @TableField("uping_xq") 65 | @ApiModelProperty(value = "投屏中") 66 | private Boolean uping; 67 | 68 | @TableField("speeching_xq") 69 | @ApiModelProperty(value = "语音中") 70 | private Boolean speeching; 71 | 72 | @TableField("exist_minute_xq") 73 | @ApiModelProperty(value = "参会累计时长(分钟)") 74 | private Integer existMinute; 75 | 76 | @TableField("to_user_hidden_xq") 77 | @ApiModelProperty(value = "删除了该会议的记录就对他隐藏") 78 | private Boolean toUserHidden; 79 | 80 | @TableField("is_founder_xq") 81 | @ApiModelProperty(value = "是否为会议主持人") 82 | private Boolean isFounder; 83 | 84 | @TableField(exist = false) 85 | private Users users; 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Menu.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableField; 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | import lombok.EqualsAndHashCode; 14 | import lombok.experimental.Accessors; 15 | 16 | /** 17 | *

18 | * 19 | *

20 | * 21 | * @author xyongfeng 22 | * @since 2022-06-25 23 | */ 24 | @Data 25 | @EqualsAndHashCode(callSuper = false) 26 | @Accessors(chain = true) 27 | @TableName("t_menu_xq") 28 | @ApiModel(value="Menu对象", description="") 29 | public class Menu implements Serializable { 30 | 31 | private static final long serialVersionUID=1L; 32 | 33 | @ApiModelProperty(value = "id") 34 | @TableId(value = "id_xq", type = IdType.AUTO) 35 | private Integer id; 36 | 37 | @TableField("url_xq") 38 | @ApiModelProperty(value = "url") 39 | private String url; 40 | 41 | @TableField("path_xq") 42 | @ApiModelProperty(value = "path") 43 | private String path; 44 | 45 | @TableField("component_xq") 46 | @ApiModelProperty(value = "组件") 47 | private String component; 48 | 49 | @TableField("name_xq") 50 | @ApiModelProperty(value = "菜单名") 51 | private String name; 52 | 53 | @ApiModelProperty(value = "图标") 54 | @TableField("iconCls_xq") 55 | private String iconCls; 56 | 57 | @ApiModelProperty(value = "是否要求权限") 58 | @TableField("requireAuth_xq") 59 | private Boolean requireAuth; 60 | 61 | @TableField("parentid_xq") 62 | @ApiModelProperty(value = "父ID") 63 | private Integer parentid; 64 | 65 | @TableField("enabled_xq") 66 | @ApiModelProperty(value = "是否启用") 67 | private Boolean enabled; 68 | 69 | @ApiModelProperty(value = "子菜单") 70 | @TableField(exist = false) 71 | private List children; 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/MenuRole.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | import java.io.Serializable; 14 | 15 | /** 16 | *

17 | * 18 | *

19 | * 20 | * @author xyongfeng 21 | * @since 2022-06-25 22 | */ 23 | @Data 24 | @EqualsAndHashCode(callSuper = false) 25 | @Accessors(chain = true) 26 | @TableName("t_menu_role_xq") 27 | @ApiModel(value="MenuRole对象", description="") 28 | public class MenuRole implements Serializable { 29 | 30 | private static final long serialVersionUID=1L; 31 | 32 | @TableId(value = "id_xq", type = IdType.AUTO) 33 | @ApiModelProperty(value = "id") 34 | private Integer id; 35 | 36 | @TableField("menu_id_xq") 37 | @ApiModelProperty(value = "menu_id") 38 | private Integer menuId; 39 | 40 | @TableField("role_id_xq") 41 | @ApiModelProperty(value = "role_id") 42 | private Integer roleId; 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/AdminLogSearchParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | import lombok.experimental.Accessors; 8 | 9 | import java.time.LocalDateTime; 10 | 11 | @Data 12 | @AllArgsConstructor 13 | @NoArgsConstructor 14 | @Accessors(chain = true) 15 | public class AdminLogSearchParam { 16 | private String searchType; 17 | 18 | private String key; 19 | 20 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 21 | private LocalDateTime startDate; 22 | 23 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 24 | private LocalDateTime endDate; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/ChatFilterParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | 9 | @Data 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class ChatFilterParam { 13 | 14 | private Integer id; 15 | 16 | private String filterContent; 17 | 18 | private Integer filterRule; 19 | 20 | private String replaceContent; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/IDParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.experimental.Accessors; 8 | 9 | import javax.validation.constraints.NotNull; 10 | 11 | /** 12 | * @author xyongfeng 13 | */ 14 | @Data 15 | @ApiModel(description = "ID实体类") 16 | public class IDParam { 17 | 18 | @ApiModelProperty(value = "id",required = true) 19 | @NotNull(message = "id不能为空") 20 | private Integer id; 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/ImgBase64Param.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | import javax.validation.constraints.NotBlank; 10 | import javax.validation.constraints.NotNull; 11 | 12 | /** 13 | * @author xyongfeng 14 | */ 15 | @ApiModel(description = "base64上传图片") 16 | @Data 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | public class ImgBase64Param { 20 | 21 | @ApiModelProperty(value = "base64编码后的图片",required = true) 22 | @NotBlank(message = "图片不能为空") 23 | private String imgBase64; 24 | 25 | private String meetingId; 26 | 27 | private Integer userId; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/MeetSetLicenceParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | import javax.validation.constraints.NotNull; 10 | 11 | @Data 12 | @AllArgsConstructor 13 | @NoArgsConstructor 14 | @ApiModel(description = "进入会议是否需要许可") 15 | public class MeetSetLicenceParam { 16 | @ApiModelProperty(value = "id",required = true) 17 | @NotNull(message = "id不能为空") 18 | private String id; 19 | 20 | @ApiModelProperty(value = "是否需要许可",required = true) 21 | @NotNull(message = "许可不能为空") 22 | private Boolean haveLicence; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/MeetingAddParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableLogic; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.AllArgsConstructor; 10 | import lombok.Data; 11 | import lombok.NoArgsConstructor; 12 | import org.hibernate.validator.constraints.Length; 13 | 14 | import javax.validation.constraints.Max; 15 | import javax.validation.constraints.Min; 16 | import javax.validation.constraints.NotBlank; 17 | import javax.validation.constraints.NotNull; 18 | import java.time.LocalDateTime; 19 | 20 | /** 21 | * @author xyongfeng 22 | */ 23 | @Data 24 | @AllArgsConstructor 25 | @NoArgsConstructor 26 | @ApiModel(description = "Meeting添加实体类") 27 | public class MeetingAddParam { 28 | private String id; 29 | @ApiModelProperty(value = "会议名称", required = true) 30 | @NotBlank(message = "会议名不能为空") 31 | private String name; 32 | 33 | @ApiModelProperty(value = "会议开始时间", required = true) 34 | @NotNull(message = "开始时间不能为空") 35 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 36 | private LocalDateTime startDate; 37 | 38 | @ApiModelProperty(value = "进入会议是否需要创建者认可") 39 | @TableField("haveLicence") 40 | private Boolean haveLicence; 41 | 42 | @ApiModelProperty(value = "参会最大人数") 43 | @Max(value = 100, message = "人数最多不能超过100") 44 | @Min(value = 1, message = "人数不能少于1") 45 | private Integer maxNumber; 46 | 47 | @ApiModelProperty(value = "进入房间是否需要人脸验证") 48 | private Boolean needFace; 49 | 50 | @ApiModelProperty(value = "入会密码") 51 | @Length(max = 20, message = "密码长度不能大于20") 52 | private String password; 53 | 54 | @ApiModelProperty(value = "密码验证开启") 55 | private Boolean passEnabled; 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/MeetingUpdateParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.fasterxml.jackson.annotation.JsonFormat; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.AllArgsConstructor; 9 | import lombok.Data; 10 | import lombok.NoArgsConstructor; 11 | import lombok.experimental.Accessors; 12 | import org.hibernate.validator.constraints.Length; 13 | 14 | import javax.validation.constraints.Max; 15 | import javax.validation.constraints.Min; 16 | import javax.validation.constraints.NotBlank; 17 | import javax.validation.constraints.NotNull; 18 | import java.time.LocalDateTime; 19 | 20 | /** 21 | * @author xyongfeng 22 | */ 23 | @Data 24 | @AllArgsConstructor 25 | @NoArgsConstructor 26 | @ApiModel(description = "Meeting修改实体类") 27 | @Accessors(chain = true) 28 | public class MeetingUpdateParam { 29 | @ApiModelProperty(value = "会议id",required = true) 30 | // @NotNull(message = "会议id不能为空") 31 | private String id; 32 | 33 | @ApiModelProperty(value = "会议名称") 34 | @NotBlank(message = "会议名不能为空") 35 | private String name; 36 | 37 | @ApiModelProperty(value = "会议开始时间") 38 | @NotNull(message = "开始时间不能为空") 39 | @JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 40 | private LocalDateTime startDate; 41 | 42 | @ApiModelProperty(value = "进入会议是否需要创建者认可") 43 | @TableField("haveLicence") 44 | private Boolean haveLicence; 45 | 46 | @ApiModelProperty(value = "参会最大人数") 47 | @Max(value = 100, message = "人数最多不能超过100") 48 | @Min(value = 1, message = "人数不能少于1") 49 | private Integer maxNumber; 50 | 51 | @ApiModelProperty(value = "进入房间是否需要人脸验证") 52 | private Boolean needFace; 53 | 54 | @ApiModelProperty(value = "入会密码") 55 | @Length(max = 20, message = "密码长度不能大于20") 56 | private String password; 57 | 58 | @ApiModelProperty(value = "密码验证开启") 59 | private Boolean passEnabled; 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/PageParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | import javax.validation.constraints.NotNull; 11 | 12 | /** 13 | * @author xyongfeng 14 | */ 15 | @ApiModel(description = "分页类实体") 16 | @Data 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | public class PageParam { 20 | @ApiModelProperty(value = "当前页码",required = true) 21 | @NotNull(message = "页码不能为空") 22 | private Integer current; 23 | 24 | @ApiModelProperty(value = "页面大小",required = true) 25 | @NotNull(message = "页面大小不能为空") 26 | private Integer size; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/RoleParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | 9 | /** 10 | * @author xyongfeng 11 | */ 12 | @Data 13 | @ApiModel(description = "权限提交表单") 14 | public class RoleParam { 15 | 16 | @ApiModelProperty(value = "用户管理权限",required = true) 17 | @NotNull(message = "用户管理权限不能为空") 18 | private Boolean user; 19 | 20 | @ApiModelProperty(value = "会议管理权限",required = true) 21 | @NotNull(message = "会议管理权限不能为空") 22 | private Boolean meeting; 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/UsersAddParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | import org.hibernate.validator.constraints.Length; 11 | 12 | import javax.validation.constraints.Email; 13 | import javax.validation.constraints.NotBlank; 14 | import javax.validation.constraints.NotNull; 15 | import javax.validation.constraints.Pattern; 16 | 17 | 18 | /** 19 | * @author xyongfeng 20 | */ 21 | @Data 22 | @AllArgsConstructor 23 | @NoArgsConstructor 24 | @ApiModel(description = "User添加实体类") 25 | public class UsersAddParam { 26 | 27 | @ApiModelProperty(value = "名称",required = true) 28 | @NotBlank(message = "名称不能为空") 29 | @Length(max = 10, message = "名称长度不能大于10") 30 | private String name; 31 | 32 | 33 | @ApiModelProperty(value = "用户名",required = true) 34 | @NotBlank(message = "用户名不能为空") 35 | @Length(max = 20, message = "用户名长度不能大于20") 36 | private String username; 37 | 38 | @ApiModelProperty(value = "密码",required = true) 39 | @NotBlank(message = "密码不能为空") 40 | @Length(max = 20, message = "密码长度不能大于20") 41 | private String password; 42 | 43 | @ApiModelProperty(value = "手机号码") 44 | @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误") 45 | private String telephone; 46 | 47 | @ApiModelProperty(value = "邮箱地址") 48 | @Email(message = "邮箱地址格式有误") 49 | private String email; 50 | 51 | @ApiModelProperty(value = "头像路径") 52 | private String headImage; 53 | 54 | @ApiModelProperty(value = "是否拥有后台权限") 55 | private Boolean isAdmin; 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/UsersLoginParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | import com.xyongfeng.util.ValidGroups; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.experimental.Accessors; 9 | import org.hibernate.validator.constraints.Length; 10 | 11 | import javax.validation.constraints.NotBlank; 12 | import java.io.Serializable; 13 | 14 | 15 | /** 16 | * @author xyongfeng 17 | */ 18 | @Data 19 | @EqualsAndHashCode 20 | @ApiModel(description = "管理员实体") 21 | public class UsersLoginParam implements Serializable { 22 | @ApiModelProperty(value = "用户名", required = true) 23 | @NotBlank(message = "用户名不能为空") 24 | @Length(max = 20, message = "用户名长度不能大于20") 25 | private String username; 26 | 27 | 28 | @ApiModelProperty(value = "密码", required = true) 29 | @NotBlank(message = "密码不能为空") 30 | @Length(max = 20, message = "密码长度不能大于20") 31 | private String password; 32 | 33 | 34 | @ApiModelProperty(value = "验证码", required = true) 35 | @NotBlank(message = "验证码不能为空", groups = ValidGroups.Default.class) 36 | private String code; 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/UsersRegisterParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import com.xyongfeng.util.ValidGroups; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | import org.hibernate.validator.constraints.Length; 11 | 12 | import javax.validation.constraints.Email; 13 | import javax.validation.constraints.NotBlank; 14 | import javax.validation.constraints.Pattern; 15 | 16 | 17 | /** 18 | * @author xyongfeng 19 | */ 20 | @Data 21 | @AllArgsConstructor 22 | @NoArgsConstructor 23 | @ApiModel(description = "User添加实体类") 24 | public class UsersRegisterParam { 25 | 26 | @ApiModelProperty(value = "名称",required = true) 27 | @NotBlank(message = "名称不能为空") 28 | @Length(max = 10, message = "名称长度不能大于10") 29 | private String name; 30 | 31 | @ApiModelProperty(value = "用户名",required = true) 32 | @NotBlank(message = "用户名不能为空") 33 | @Length(max = 20, message = "用户名长度不能大于20") 34 | private String username; 35 | 36 | @ApiModelProperty(value = "密码",required = true) 37 | @NotBlank(message = "密码不能为空") 38 | @Length(max = 20, message = "密码长度不能大于20") 39 | private String password; 40 | 41 | @ApiModelProperty(value = "验证码", required = true) 42 | @NotBlank(message = "验证码不能为空") 43 | private String code; 44 | 45 | @ApiModelProperty(value = "手机号码") 46 | @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误") 47 | private String telephone; 48 | 49 | @ApiModelProperty(value = "邮箱地址") 50 | @Email(message = "邮箱地址格式有误") 51 | private String email; 52 | 53 | // @ApiModelProperty(value = "头像路径") 54 | // private String headImage; 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/UsersSetAdminParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import org.hibernate.validator.constraints.Length; 9 | 10 | import javax.validation.constraints.NotBlank; 11 | import javax.validation.constraints.NotNull; 12 | 13 | /** 14 | * User设置管理员 15 | * @author xyongfeng 16 | */ 17 | @Data 18 | @AllArgsConstructor 19 | @NoArgsConstructor 20 | @ApiModel(description = "User设置管理员") 21 | public class UsersSetAdminParam { 22 | @ApiModelProperty(value = "id",required = true) 23 | @NotNull(message = "id不能为空") 24 | private Integer id; 25 | 26 | @ApiModelProperty(value = "是否为管理员",required = true) 27 | @NotNull(message = "管理员状态不能为空") 28 | private Boolean isAdmin; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/UsersSetImgParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | import org.springframework.web.multipart.MultipartFile; 10 | 11 | import javax.validation.constraints.NotNull; 12 | 13 | @Data 14 | @AllArgsConstructor 15 | @NoArgsConstructor 16 | @ApiModel(description = "User设置头像") 17 | public class UsersSetImgParam { 18 | @ApiModelProperty(value = "id") 19 | private Integer id; 20 | 21 | @ApiModelProperty(value = "图片",required = true) 22 | @NotNull(message = "图片不能为空") 23 | private MultipartFile file; 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/UsersUpdateParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | import org.hibernate.validator.constraints.Length; 11 | 12 | import javax.validation.constraints.Email; 13 | import javax.validation.constraints.NotBlank; 14 | import javax.validation.constraints.NotNull; 15 | import javax.validation.constraints.Pattern; 16 | 17 | 18 | /** 19 | * @author xyongfeng 20 | */ 21 | @Data 22 | @AllArgsConstructor 23 | @NoArgsConstructor 24 | @ApiModel(description = "User更新实体类") 25 | public class UsersUpdateParam { 26 | 27 | @ApiModelProperty(value = "id",required = true) 28 | // @NotNull(message = "id不能为空") 29 | private Integer id; 30 | 31 | @ApiModelProperty(value = "名称") 32 | @NotBlank(message = "名称不能为空") 33 | @Length(max = 10, message = "名称长度不能大于10") 34 | private String name; 35 | 36 | @ApiModelProperty("用户名") 37 | @NotBlank(message = "用户名不能为空") 38 | @Length(max = 20, message = "用户名长度不能大于20") 39 | private String username; 40 | 41 | @ApiModelProperty("密码") 42 | @Length(max = 20, message = "密码长度不能大于20") 43 | private String password; 44 | 45 | @ApiModelProperty(value = "手机号码") 46 | @Pattern(regexp = "^$|^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误") 47 | private String telephone; 48 | 49 | @ApiModelProperty(value = "邮箱地址") 50 | @Email(message = "邮箱地址格式有误") 51 | private String email; 52 | 53 | @ApiModelProperty(value = "头像路径") 54 | private String headImage; 55 | 56 | @ApiModelProperty(value = "是否拥有后台权限") 57 | private Boolean isAdmin; 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/UsersUpdatePassParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import com.xyongfeng.util.ValidGroups; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | import org.hibernate.validator.constraints.Length; 11 | 12 | import javax.validation.constraints.Email; 13 | import javax.validation.constraints.NotBlank; 14 | import javax.validation.constraints.NotNull; 15 | import javax.validation.constraints.Pattern; 16 | 17 | 18 | /** 19 | * @author xyongfeng 20 | */ 21 | @Data 22 | @AllArgsConstructor 23 | @NoArgsConstructor 24 | @ApiModel(description = "User本人修改密码实体类") 25 | public class UsersUpdatePassParam { 26 | 27 | @ApiModelProperty(value = "id", required = true) 28 | @NotNull(message = "id不能为空") 29 | private Integer id; 30 | 31 | @ApiModelProperty(value = "当前密码", required = true) 32 | @NotBlank(message = "当前密码不能为空") 33 | @Length(max = 20, message = "当前密码长度不能大于20") 34 | private String oldpass; 35 | 36 | @ApiModelProperty(value = "新密码", required = true) 37 | @NotBlank(message = "新密码不能为空") 38 | @Length(max = 20, message = "新密码长度不能大于20") 39 | private String newpass; 40 | 41 | @ApiModelProperty(value = "验证码", required = true) 42 | @NotBlank(message = "验证码不能为空") 43 | private String code; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Param/UsersUpdateWithOwnerParam.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.Param; 2 | 3 | 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | import org.hibernate.validator.constraints.Length; 10 | 11 | import javax.validation.constraints.Email; 12 | import javax.validation.constraints.NotBlank; 13 | import javax.validation.constraints.NotNull; 14 | import javax.validation.constraints.Pattern; 15 | 16 | 17 | /** 18 | * @author xyongfeng 19 | */ 20 | @Data 21 | @AllArgsConstructor 22 | @NoArgsConstructor 23 | @ApiModel(description = "User本人更新实体类") 24 | public class UsersUpdateWithOwnerParam { 25 | 26 | @ApiModelProperty(value = "id", required = true) 27 | @NotNull(message = "id不能为空") 28 | private Integer id; 29 | 30 | 31 | @ApiModelProperty(value = "名称") 32 | @NotBlank(message = "名称不能为空") 33 | @Length(max = 10, message = "名称长度不能大于10") 34 | private String name; 35 | 36 | 37 | @ApiModelProperty(value = "手机号码") 38 | @Pattern(regexp = "^$|^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误") 39 | private String telephone; 40 | 41 | @ApiModelProperty(value = "邮箱地址") 42 | @Email(message = "邮箱地址格式有误") 43 | private String email; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Role.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | import java.io.Serializable; 14 | 15 | /** 16 | *

17 | * 18 | *

19 | * 20 | * @author xyongfeng 21 | * @since 2022-06-25 22 | */ 23 | @Data 24 | @EqualsAndHashCode(callSuper = false) 25 | @Accessors(chain = true) 26 | @TableName("t_role_xq") 27 | @ApiModel(value = "Role对象", description = "权限实体对象") 28 | public class Role implements Serializable { 29 | 30 | private static final long serialVersionUID = 1L; 31 | 32 | @TableId(value = "id_xq", type = IdType.AUTO) 33 | @ApiModelProperty(value = "id") 34 | private Integer id; 35 | 36 | @TableField("perms_xq") 37 | @ApiModelProperty(value = "权限识别") 38 | private String perms; 39 | 40 | @TableField("name_xq") 41 | @ApiModelProperty(value = "权限名") 42 | private String name; 43 | 44 | @TableField("remark_xq") 45 | @ApiModelProperty(value = "备注") 46 | private String remark; 47 | 48 | // @ApiModelProperty(value = "是否隐藏") 49 | // private Boolean hidden; 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/UserAdvice.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | 8 | import java.time.LocalDateTime; 9 | import java.io.Serializable; 10 | import java.util.List; 11 | 12 | import com.fasterxml.jackson.annotation.JsonFormat; 13 | import io.swagger.annotations.ApiModel; 14 | import io.swagger.annotations.ApiModelProperty; 15 | import lombok.Data; 16 | import lombok.EqualsAndHashCode; 17 | import lombok.experimental.Accessors; 18 | 19 | import javax.validation.constraints.NotBlank; 20 | 21 | /** 22 | *

23 | * 24 | *

25 | * 26 | * @author xyongfeng 27 | * @since 2022-12-29 28 | */ 29 | @Data 30 | @EqualsAndHashCode(callSuper = false) 31 | @Accessors(chain = true) 32 | @TableName("t_user_advice_xq") 33 | @ApiModel(value = "UserAdvice对象", description = "") 34 | public class UserAdvice implements Serializable { 35 | 36 | private static final long serialVersionUID = 1L; 37 | 38 | @TableId(value = "id_xq", type = IdType.AUTO) 39 | private Integer id; 40 | 41 | @TableField("user_id_xq") 42 | @ApiModelProperty(value = "用户id") 43 | private Integer userId; 44 | 45 | @TableField("type_xq") 46 | @ApiModelProperty(value = "意见种类",required = true) 47 | @NotBlank(message = "意见种类不能为空") 48 | private String type; 49 | 50 | @TableField("title_xq") 51 | @ApiModelProperty(value = "描述标题",required = true) 52 | @NotBlank(message = "描述标题不能为空") 53 | private String title; 54 | 55 | @TableField("content_xq") 56 | @ApiModelProperty(value = "描述内容",required = true) 57 | @NotBlank(message = "描述内容不能为空") 58 | private String content; 59 | 60 | @TableField("time_xq") 61 | @ApiModelProperty(value = "发起时间") 62 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 63 | private LocalDateTime time; 64 | 65 | @ApiModelProperty(value = "用户") 66 | @TableField(exist = false) 67 | private Users users; 68 | 69 | @ApiModelProperty(value = "上传的图片") 70 | @TableField(exist = false) 71 | private List imgs; 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/UserAdviceImg.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | import java.io.Serializable; 14 | 15 | /** 16 | *

17 | * 18 | *

19 | * 20 | * @author xyongfeng 21 | * @since 2023-01-03 22 | */ 23 | @Data 24 | @EqualsAndHashCode(callSuper = false) 25 | @Accessors(chain = true) 26 | @TableName("t_user_advice_img_xq") 27 | @ApiModel(value="UserAdviceImg对象", description="") 28 | public class UserAdviceImg implements Serializable { 29 | 30 | private static final long serialVersionUID=1L; 31 | 32 | @TableId(value = "id_xq", type = IdType.AUTO) 33 | private Integer id; 34 | 35 | @TableField("advice_id_xq") 36 | @ApiModelProperty(value = "意见id") 37 | private Integer adviceId; 38 | 39 | @TableField("img_path_xq") 40 | @ApiModelProperty(value = "图片路径") 41 | private String imgPath; 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/Users.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.fasterxml.jackson.annotation.JsonIgnore; 8 | 9 | import io.swagger.annotations.ApiModel; 10 | import io.swagger.annotations.ApiModelProperty; 11 | import lombok.*; 12 | import lombok.experimental.Accessors; 13 | import org.hibernate.validator.constraints.Length; 14 | import org.springframework.security.core.GrantedAuthority; 15 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 16 | import org.springframework.security.core.userdetails.UserDetails; 17 | 18 | 19 | import javax.validation.constraints.Email; 20 | import javax.validation.constraints.NotBlank; 21 | import javax.validation.constraints.NotNull; 22 | import javax.validation.constraints.Pattern; 23 | import java.io.Serializable; 24 | 25 | import java.time.LocalDateTime; 26 | import java.time.LocalTime; 27 | import java.util.Collection; 28 | import java.util.List; 29 | import java.util.stream.Collectors; 30 | 31 | /** 32 | *

33 | * 34 | *

35 | * 36 | * @author xyongfeng 37 | * @since 2022-06-30 38 | */ 39 | @ApiModel(description = "用户实体") 40 | @Data 41 | @AllArgsConstructor 42 | @NoArgsConstructor 43 | @EqualsAndHashCode 44 | @Accessors(chain = true) 45 | @TableName("t_users_xq") 46 | public class Users implements Serializable, UserDetails { 47 | 48 | private static final long serialVersionUID = 1L; 49 | 50 | 51 | @ApiModelProperty("id") 52 | @NotNull(message = "id不能为空") 53 | @TableId(value = "id_xq", type = IdType.AUTO) 54 | private Integer id; 55 | 56 | @ApiModelProperty(value = "名称") 57 | @NotBlank(message = "名称不能为空") 58 | @Length(max = 10, message = "名称长度不能大于10") 59 | @TableField("name_xq") 60 | private String name; 61 | 62 | 63 | @ApiModelProperty("用户名") 64 | @NotBlank(message = "用户名不能为空") 65 | @Length(max = 20, message = "用户名长度不能大于20") 66 | @TableField("username_xq") 67 | private String username; 68 | 69 | 70 | @ApiModelProperty("密码") 71 | @NotBlank(message = "密码不能为空") 72 | @Length(max = 20, message = "密码长度不能大于20") 73 | @TableField("password_xq") 74 | private String password; 75 | 76 | @ApiModelProperty(value = "手机号码") 77 | @Pattern(regexp = "^$|^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误") 78 | @TableField("telephone_xq") 79 | private String telephone; 80 | 81 | @ApiModelProperty(value = "邮箱地址") 82 | @Email(message = "邮箱地址格式有误") 83 | @TableField("email_xq") 84 | private String email; 85 | 86 | @ApiModelProperty(value = "头像路径") 87 | @TableField("headImage_xq") 88 | private String headImage; 89 | 90 | 91 | @ApiModelProperty(value = "面部照片路径") 92 | @TableField("faceImage_xq") 93 | private String faceImage; 94 | 95 | @ApiModelProperty(value = "是否拥有后台权限") 96 | @TableField("isAdmin_xq") 97 | private Boolean isAdmin; 98 | 99 | @ApiModelProperty("权限列表") 100 | @TableField(exist = false) 101 | private List perms; 102 | 103 | @ApiModelProperty("签到时间") 104 | @TableField(exist = false) 105 | private LocalDateTime hadSignInTime; 106 | 107 | 108 | @JsonIgnore 109 | @TableField(exist = false) 110 | private List authorities; 111 | 112 | 113 | @Override 114 | public Collection getAuthorities() { 115 | if (authorities == null && perms != null) { 116 | authorities = perms.stream().map(SimpleGrantedAuthority::new).collect(Collectors.toList()); 117 | } 118 | return authorities; 119 | } 120 | 121 | @Override 122 | public boolean isAccountNonExpired() { 123 | return false; 124 | } 125 | 126 | @Override 127 | public boolean isAccountNonLocked() { 128 | return false; 129 | } 130 | 131 | @Override 132 | public boolean isCredentialsNonExpired() { 133 | return false; 134 | } 135 | 136 | @Override 137 | public boolean isEnabled() { 138 | return true; 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/UsersFaceFeature.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import java.io.Serializable; 8 | import io.swagger.annotations.ApiModel; 9 | import io.swagger.annotations.ApiModelProperty; 10 | import lombok.Data; 11 | import lombok.EqualsAndHashCode; 12 | import lombok.experimental.Accessors; 13 | 14 | /** 15 | *

16 | * 17 | *

18 | * 19 | * @author xyongfeng 20 | * @since 2022-11-28 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @Accessors(chain = true) 25 | @TableName("t_users_face_feature_xq") 26 | @ApiModel(value="UsersFaceFeature对象", description="") 27 | public class UsersFaceFeature implements Serializable { 28 | 29 | private static final long serialVersionUID=1L; 30 | 31 | @TableId(value = "id_xq", type = IdType.AUTO) 32 | private Integer id; 33 | 34 | @TableField("user_id_xq") 35 | private Integer userId; 36 | 37 | @ApiModelProperty(value = "面部特征信息") 38 | @TableField("face_feature_xq") 39 | private String faceFeature; 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/UsersFriend.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import java.io.Serializable; 8 | import io.swagger.annotations.ApiModel; 9 | import io.swagger.annotations.ApiModelProperty; 10 | import lombok.Data; 11 | import lombok.EqualsAndHashCode; 12 | import lombok.experimental.Accessors; 13 | 14 | /** 15 | *

16 | * 17 | *

18 | * 19 | * @author xyongfeng 20 | * @since 2022-08-22 21 | */ 22 | @Data 23 | @EqualsAndHashCode(callSuper = false) 24 | @Accessors(chain = true) 25 | @TableName("t_users_friend_xq") 26 | @ApiModel(value="UsersFriend对象", description="") 27 | public class UsersFriend implements Serializable { 28 | 29 | private static final long serialVersionUID=1L; 30 | 31 | @TableId(value = "id_xq", type = IdType.AUTO) 32 | private Integer id; 33 | 34 | @TableField("user_id1_xq") 35 | private Integer userId1; 36 | 37 | @TableField("user_id2_xq") 38 | private Integer userId2; 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/UsersFriendInform.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.annotation.IdType; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import java.time.LocalDateTime; 8 | import java.io.Serializable; 9 | 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import io.swagger.annotations.ApiModel; 12 | import io.swagger.annotations.ApiModelProperty; 13 | import lombok.Data; 14 | import lombok.EqualsAndHashCode; 15 | import lombok.experimental.Accessors; 16 | 17 | /** 18 | *

19 | * 20 | *

21 | * 22 | * @author xyongfeng 23 | * @since 2022-08-22 24 | */ 25 | @Data 26 | @EqualsAndHashCode(callSuper = false) 27 | @Accessors(chain = true) 28 | @TableName("t_users_friend_inform_xq") 29 | @ApiModel(value="UsersFriendInform对象", description="") 30 | public class UsersFriendInform implements Serializable { 31 | 32 | private static final long serialVersionUID=1L; 33 | 34 | @TableId(value = "id_xq", type = IdType.AUTO) 35 | private Integer id; 36 | 37 | @TableField("type_xq") 38 | @ApiModelProperty(value = "通知消息类型 0 好友申请 1 好友消息") 39 | private Integer type; 40 | 41 | @TableField("from_id_xq") 42 | @ApiModelProperty(value = "发送消息的userid") 43 | private Integer fromId; 44 | 45 | @TableField("to_id_xq") 46 | @ApiModelProperty(value = "接收消息的userid") 47 | private Integer toId; 48 | 49 | @TableField("content_xq") 50 | @ApiModelProperty(value = "消息内容") 51 | private String content; 52 | 53 | @TableField("state_xq") 54 | @ApiModelProperty(value = "0 未读 1 已读") 55 | private Integer state; 56 | 57 | @TableField("send_time_xq") 58 | @ApiModelProperty(value = "发送时间") 59 | @JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 60 | private LocalDateTime sendTime; 61 | 62 | @ApiModelProperty(value = "发送消息的用户") 63 | @TableField(exist = false) 64 | private Users fromer; 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/UsersRole.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import io.swagger.annotations.ApiModel; 8 | import io.swagger.annotations.ApiModelProperty; 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import lombok.experimental.Accessors; 12 | 13 | import java.io.Serializable; 14 | 15 | /** 16 | *

17 | * 18 | *

19 | * 20 | * @author xyongfeng 21 | * @since 2022-10-27 22 | */ 23 | @Data 24 | @EqualsAndHashCode(callSuper = false) 25 | @Accessors(chain = true) 26 | @TableName("t_users_role_xq") 27 | @ApiModel(value="UsersRole对象", description="") 28 | public class UsersRole implements Serializable { 29 | 30 | private static final long serialVersionUID=1L; 31 | 32 | @ApiModelProperty(value = "id") 33 | @TableId(value = "id_xq", type = IdType.AUTO) 34 | private Integer id; 35 | 36 | @TableField("user_id_xq") 37 | private Integer userId; 38 | 39 | @TableField("role_id_xq") 40 | private Integer roleId; 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/config/ImgPathPro.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.stereotype.Component; 6 | 7 | 8 | /** 9 | * @author xyongfeng 10 | */ 11 | @Component 12 | @ConfigurationProperties(prefix = "img") 13 | @Data 14 | public class ImgPathPro { 15 | private String head; 16 | private String face; 17 | private String screenshot; 18 | private String adviceImg; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/pojo/config/SocketIOPro.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.pojo.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | @ConfigurationProperties(prefix = "socketio") 10 | @Data 11 | public class SocketIOPro { 12 | public String host; 13 | 14 | public Integer port; 15 | 16 | public int bossCount; 17 | 18 | public int workCount; 19 | 20 | public boolean allowCustomRequests; 21 | 22 | public int upgradeTimeout; 23 | 24 | public int pingTimeout; 25 | 26 | public int pingInterval; 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/serializer/RedisKeySerializer.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.serializer; 2 | 3 | import org.springframework.data.redis.serializer.RedisSerializer; 4 | import org.springframework.data.redis.serializer.SerializationException; 5 | 6 | import java.nio.charset.Charset; 7 | import java.nio.charset.StandardCharsets; 8 | 9 | //设置Redis 缓存Key前缀 10 | 11 | public class RedisKeySerializer implements RedisSerializer { 12 | /** 13 | * 编码格式 14 | */ 15 | private final Charset charset; 16 | 17 | /** 18 | * 前缀 19 | */ 20 | private final String PREFIX_KEY = "meeting_system:"; 21 | 22 | public RedisKeySerializer() { 23 | this(StandardCharsets.UTF_8); 24 | } 25 | 26 | public RedisKeySerializer(Charset charset) { 27 | this.charset = charset; 28 | } 29 | 30 | /** 31 | * Serialize the given object to binary data. 32 | * 33 | * @return the equivalent binary data. Can be {@literal null}. 34 | */ 35 | @Override 36 | public byte[] serialize(String cacheKey) throws SerializationException { 37 | String key = PREFIX_KEY + cacheKey; 38 | return key.getBytes(charset); 39 | } 40 | 41 | /** 42 | * Deserialize an object from the given binary data. 43 | * 44 | * @param bytes object binary representation. Can be {@literal null}. 45 | * @return the equivalent object instance. Can be {@literal null}. 46 | */ 47 | @Override 48 | public String deserialize(byte[] bytes) throws SerializationException { 49 | String cacheKey = new String(bytes, charset); 50 | int indexOf = cacheKey.indexOf(PREFIX_KEY); 51 | if (indexOf == -1) { 52 | cacheKey = PREFIX_KEY + cacheKey; 53 | } 54 | return (cacheKey.getBytes() == null ? null : cacheKey); 55 | } 56 | } -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/AdminLogService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xyongfeng.pojo.AdminLog; 5 | import com.xyongfeng.pojo.JsonResult; 6 | import com.xyongfeng.pojo.Param.AdminLogSearchParam; 7 | 8 | import java.util.Map; 9 | 10 | /** 11 | *

12 | * 服务类 13 | *

14 | * 15 | * @author xyongfeng 16 | * @since 2022-12-29 17 | */ 18 | public interface AdminLogService extends IService { 19 | 20 | void insert(String actionModule, String actionType, String actionUrl, String actionContent,Boolean actionSuccess); 21 | 22 | JsonResult select(Integer current, Integer size, Map params); 23 | 24 | void insert(String actionModule, String actionType, String actionUrl, Boolean actionSuccess); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/ChatFilterService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xyongfeng.pojo.ChatFilter; 5 | import com.xyongfeng.pojo.JsonResult; 6 | 7 | /** 8 | *

9 | * 服务类 10 | *

11 | * 12 | * @author xyongfeng 13 | * @since 2022-12-29 14 | */ 15 | public interface ChatFilterService extends IService { 16 | /** 17 | * 分页查看过滤词列表 18 | * 19 | * @param current 20 | * @param size 21 | * @return 22 | */ 23 | JsonResult select(Integer current, Integer size); 24 | 25 | /** 26 | * 修改过滤词 27 | * 28 | * @param chatFilter 29 | * @return 30 | */ 31 | JsonResult updateOne(ChatFilter chatFilter); 32 | 33 | /** 34 | * 添加过滤词 35 | * 36 | * @param chatFilter 37 | * @return 38 | */ 39 | JsonResult insert(ChatFilter chatFilter); 40 | 41 | /** 42 | * 删除过滤词 43 | * 44 | * @param id 45 | * @return 46 | */ 47 | JsonResult delete(Integer id); 48 | 49 | /** 50 | * 设置过滤词是否启用 51 | * 52 | * @param id 53 | * @param b 54 | * @return 55 | */ 56 | JsonResult setEnable(Integer id, boolean b); 57 | 58 | /** 59 | * 过滤msg并返回 60 | * 61 | * @param msg 62 | * @return 63 | */ 64 | String filter(String msg); 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/AdminLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 6 | import com.baomidou.mybatisplus.core.metadata.IPage; 7 | import com.baomidou.mybatisplus.core.metadata.OrderItem; 8 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; 9 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 11 | import com.xyongfeng.mapper.AdminLogMapper; 12 | import com.xyongfeng.pojo.AdminLog; 13 | import com.xyongfeng.pojo.JsonResult; 14 | import com.xyongfeng.pojo.Param.AdminLogSearchParam; 15 | import com.xyongfeng.service.AdminLogService; 16 | import com.xyongfeng.util.MyUtil; 17 | import org.springframework.beans.factory.annotation.Autowired; 18 | import org.springframework.stereotype.Service; 19 | 20 | import java.time.LocalDateTime; 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | /** 25 | *

26 | * 服务实现类 27 | *

28 | * 29 | * @author xyongfeng 30 | * @since 2022-12-29 31 | */ 32 | @Service 33 | public class AdminLogServiceImpl extends ServiceImpl implements AdminLogService { 34 | @Autowired 35 | private AdminLogMapper adminLogMapper; 36 | 37 | @Override 38 | public void insert(String actionModule, String actionType, String actionUrl, String actionContent, Boolean actionSuccess) { 39 | AdminLog adminLog = new AdminLog() 40 | .setActionTime(LocalDateTime.now()) 41 | .setActionUserId(MyUtil.getUsers().getId()) 42 | .setActionContent(actionContent) 43 | .setActionType(actionType) 44 | .setActionUrl(actionUrl) 45 | .setActionModule(actionModule) 46 | .setActionSuccess(actionSuccess); 47 | 48 | adminLogMapper.insert(adminLog); 49 | } 50 | 51 | @Override 52 | public void insert(String actionModule, String actionType, String actionUrl, Boolean actionSuccess) { 53 | insert(actionModule, actionType, actionUrl, "", actionSuccess); 54 | } 55 | 56 | @Override 57 | public JsonResult select(Integer current, Integer size, Map params) { 58 | QueryWrapper query = new QueryWrapper<>(); 59 | String type = params.get("searchType"); 60 | String key = params.get("key"); 61 | 62 | if ("actionUserName".equals(type)) { 63 | query.like("u.name_xq", key); 64 | } else if ("actionModule".equals(type)) { 65 | query.eq("action_module_xq", key); 66 | } else if ("actionType".equals(type)) { 67 | query.like("action_type_xq", key); 68 | } else if ("actionUrl".equals(type)) { 69 | query.like("action_url_xq", key); 70 | } else if ("actionSuccess".equals(type)) { 71 | query.eq("action_success_xq", key); 72 | } else if ("actionTime".equals(type)) { 73 | query.ge("action_time_xq", params.get("startDate")) 74 | .le("action_time_xq", params.get("endDate")); 75 | } 76 | 77 | return JsonResult.success(adminLogMapper.selectWithUser(new Page<>(current, size), query)); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/ChatFilterServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.xyongfeng.mapper.ChatFilterMapper; 7 | import com.xyongfeng.pojo.ChatFilter; 8 | import com.xyongfeng.pojo.JsonResult; 9 | import com.xyongfeng.service.ChatFilterService; 10 | import com.xyongfeng.util.MyUtil; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.time.LocalDateTime; 15 | import java.util.List; 16 | 17 | /** 18 | *

19 | * 服务实现类 20 | *

21 | * 22 | * @author xyongfeng 23 | * @since 2022-12-29 24 | */ 25 | @Service 26 | public class ChatFilterServiceImpl extends ServiceImpl implements ChatFilterService { 27 | @Autowired 28 | private ChatFilterMapper chatFilterMapper; 29 | 30 | @Override 31 | public JsonResult select(Integer current, Integer size) { 32 | 33 | return JsonResult.success(chatFilterMapper.selectWithUser(new Page<>(current, size))); 34 | } 35 | 36 | @Override 37 | public JsonResult updateOne(ChatFilter chatFilter) { 38 | 39 | int i = chatFilterMapper.updateById(chatFilter); 40 | if (i > 0) { 41 | return JsonResult.success("修改成功", chatFilter); 42 | } 43 | return JsonResult.error("修改失败"); 44 | } 45 | 46 | @Override 47 | public JsonResult insert(ChatFilter chatFilter) { 48 | chatFilter.setAppenderId(MyUtil.getUsers().getId()); 49 | chatFilter.setAppendTime(LocalDateTime.now()); 50 | int i = chatFilterMapper.insert(chatFilter); 51 | if (i > 0) { 52 | return JsonResult.success("添加成功"); 53 | } 54 | return JsonResult.error("添加失败"); 55 | } 56 | 57 | @Override 58 | public JsonResult delete(Integer id) { 59 | 60 | int i = chatFilterMapper.deleteById(id); 61 | if (i > 0) { 62 | return JsonResult.success("删除成功"); 63 | } 64 | return JsonResult.error("删除失败"); 65 | } 66 | 67 | @Override 68 | public JsonResult setEnable(Integer id, boolean b) { 69 | 70 | int i = chatFilterMapper.updateById(new ChatFilter().setId(id).setEnable(b)); 71 | 72 | if (i > 0) { 73 | return JsonResult.success("修改成功"); 74 | } 75 | return JsonResult.error("修改失败"); 76 | } 77 | 78 | @Override 79 | public String filter(String msg) { 80 | List filterItems = chatFilterMapper.selectList(new QueryWrapper().eq("enable_xq", 1)); 81 | for (ChatFilter filterItem : filterItems) { 82 | if (filterItem.getFilterRule() == 1) { 83 | msg = msg.replace(filterItem.getFilterContent(), filterItem.getReplaceContent()); 84 | } else { 85 | msg = msg.replaceAll(filterItem.getFilterContent(), filterItem.getReplaceContent()); 86 | } 87 | } 88 | return msg; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/MeetingApplicationServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.xyongfeng.pojo.MeetingApplication; 4 | import com.xyongfeng.mapper.MeetingApplicationMapper; 5 | import com.xyongfeng.service.MeetingApplicationService; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 服务实现类 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-09-12 16 | */ 17 | @Service 18 | public class MeetingApplicationServiceImpl extends ServiceImpl implements MeetingApplicationService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/MeetingNoticeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.xyongfeng.pojo.MeetingNotice; 4 | import com.xyongfeng.mapper.MeetingNoticeMapper; 5 | import com.xyongfeng.service.MeetingNoticeService; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 服务实现类 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-09-12 16 | */ 17 | @Service 18 | public class MeetingNoticeServiceImpl extends ServiceImpl implements MeetingNoticeService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/MeetingNoticeUsersServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.xyongfeng.pojo.MeetingNoticeUsers; 4 | import com.xyongfeng.mapper.MeetingNoticeUsersMapper; 5 | import com.xyongfeng.service.MeetingNoticeUsersService; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 服务实现类 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-09-12 16 | */ 17 | @Service 18 | public class MeetingNoticeUsersServiceImpl extends ServiceImpl implements MeetingNoticeUsersService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/MeetingPasswordServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 5 | import com.xyongfeng.pojo.MeetingPassword; 6 | import com.xyongfeng.mapper.MeetingPasswordMapper; 7 | import com.xyongfeng.service.MeetingPasswordService; 8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | /** 13 | *

14 | * 服务实现类 15 | *

16 | * 17 | * @author xyongfeng 18 | * @since 2023-01-03 19 | */ 20 | @Service 21 | public class MeetingPasswordServiceImpl extends ServiceImpl implements MeetingPasswordService { 22 | @Autowired 23 | private MeetingPasswordMapper meetingPasswordMapper; 24 | 25 | @Override 26 | public int insert(String mid, String password, Boolean passEnabled) { 27 | return meetingPasswordMapper.insert(new MeetingPassword().setMeetingId(mid).setPassword(password).setEnabled(passEnabled)); 28 | } 29 | 30 | @Override 31 | public MeetingPassword getMeetingPasswordOne(String mid) { 32 | 33 | return meetingPasswordMapper.selectOne(new QueryWrapper().eq("meeting_id_xq", mid)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/MeetingScreenshotServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.xyongfeng.pojo.JsonResult; 5 | import com.xyongfeng.pojo.MeetingScreenshot; 6 | import com.xyongfeng.mapper.MeetingScreenshotMapper; 7 | import com.xyongfeng.pojo.Param.ImgBase64Param; 8 | import com.xyongfeng.pojo.config.ImgPathPro; 9 | import com.xyongfeng.service.MeetingScreenshotService; 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 11 | import com.xyongfeng.util.FileUtil; 12 | import com.xyongfeng.util.MyUtil; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Service; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | *

20 | * 服务实现类 21 | *

22 | * 23 | * @author xyongfeng 24 | * @since 2022-12-31 25 | */ 26 | @Service 27 | public class MeetingScreenshotServiceImpl extends ServiceImpl implements MeetingScreenshotService { 28 | @Autowired 29 | private MeetingScreenshotMapper meetingScreenshotMapper; 30 | @Autowired 31 | private ImgPathPro imgPathPro; 32 | @Autowired 33 | private FileUtil fileUtil; 34 | 35 | private int insert(String mid, Integer uid, String filename) { 36 | return meetingScreenshotMapper.insert(new MeetingScreenshot().setUserId(uid).setMeetingId(mid).setPath(imgPathPro.getScreenshot().concat("/").concat(filename))); 37 | } 38 | 39 | @Override 40 | public JsonResult setScreenshotWithBase64(String mid, ImgBase64Param param) { 41 | String filename = fileUtil.uploadImgWithBase64(param.getImgBase64(), imgPathPro.getScreenshot()); 42 | if (filename != null) { 43 | int insert = insert(mid, MyUtil.getUsers().getId(), filename); 44 | if (insert > 0) { 45 | return JsonResult.success(); 46 | } 47 | } 48 | return JsonResult.error("保存失败"); 49 | } 50 | 51 | @Override 52 | public JsonResult selectPath(String mid) { 53 | List objects = meetingScreenshotMapper.selectObjs(new QueryWrapper().select("path_xq").eq("meeting_id_xq", mid).eq("user_id_xq", MyUtil.getUsers().getId())); 54 | return JsonResult.success(objects); 55 | } 56 | 57 | @Override 58 | public JsonResult selectAll() { 59 | return JsonResult.success(meetingScreenshotMapper.selectAll(MyUtil.getUsers().getId())); 60 | } 61 | 62 | @Override 63 | public JsonResult deleteById(String id) { 64 | int i = meetingScreenshotMapper.deleteById(id); 65 | if (i > 0) { 66 | return JsonResult.success("删除成功"); 67 | }else{ 68 | return JsonResult.error("删除失败"); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/MenuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.xyongfeng.mapper.MenuMapper; 5 | import com.xyongfeng.pojo.JsonResult; 6 | import com.xyongfeng.pojo.Users; 7 | import com.xyongfeng.service.MenuService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.security.core.context.SecurityContextHolder; 10 | import org.springframework.stereotype.Service; 11 | import com.xyongfeng.pojo.Menu; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | *

17 | * 服务实现类 18 | *

19 | * 20 | * @author xyongfeng 21 | * @since 2022-06-25 22 | */ 23 | @Service 24 | public class MenuServiceImpl extends ServiceImpl implements MenuService { 25 | @Autowired 26 | private MenuMapper menuMapper; 27 | 28 | 29 | @Override 30 | public JsonResult getMenusByUserId() { 31 | List menus = menuMapper.getMenusByUserId(((Users) SecurityContextHolder 32 | .getContext().getAuthentication().getPrincipal()).getId()); 33 | return JsonResult.success(menus); 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/RoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import com.xyongfeng.mapper.RoleMapper; 6 | import com.xyongfeng.mapper.UsersRoleMapper; 7 | import com.xyongfeng.pojo.JsonResult; 8 | import com.xyongfeng.pojo.Param.RoleParam; 9 | import com.xyongfeng.pojo.Role; 10 | import com.xyongfeng.pojo.UsersRole; 11 | import com.xyongfeng.service.RoleService; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Service; 14 | 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | /** 19 | *

20 | * 服务实现类 21 | *

22 | * 23 | * @author xyongfeng 24 | * @since 2022-06-25 25 | */ 26 | @Service 27 | public class RoleServiceImpl extends ServiceImpl implements RoleService { 28 | @Autowired 29 | private RoleMapper roleMapper; 30 | @Autowired 31 | private UsersRoleMapper usersRoleMapper; 32 | 33 | /** 34 | * 根据用户id获得Role列表 35 | * 36 | * @return 37 | */ 38 | @Override 39 | public List selectRoleWithUserid(Integer uid) { 40 | return roleMapper.selectRoleWithUserid(uid); 41 | } 42 | 43 | @Override 44 | public JsonResult selectRoleWithoutHidden(Integer uid) { 45 | 46 | return JsonResult.success(roleMapper.selectRoleWithoutHidden(uid)); 47 | } 48 | 49 | @Override 50 | public JsonResult selectAllRole() { 51 | return JsonResult.success(roleMapper.selectList(new QueryWrapper().eq("hidden_xq", 0))); 52 | } 53 | 54 | @Override 55 | public JsonResult updateRole(Integer uid, Map roleParam) { 56 | 57 | roleParam.forEach((k, v) -> { 58 | // System.out.println(k == 1); 59 | // System.out.println(v.equals(true)); 60 | usersRoleMapper.delete(new QueryWrapper() 61 | .eq("user_id_xq", uid) 62 | .eq("role_id_xq", k)); 63 | if (v) { 64 | UsersRole usersRole = new UsersRole().setUserId(uid).setRoleId(k); 65 | usersRoleMapper.insert(usersRole); 66 | 67 | } 68 | }); 69 | 70 | 71 | return JsonResult.success("权限修改成功"); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/UserAdviceImgServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.xyongfeng.pojo.UserAdviceImg; 4 | import com.xyongfeng.mapper.UserAdviceImgMapper; 5 | import com.xyongfeng.service.UserAdviceImgService; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 服务实现类 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2023-01-03 16 | */ 17 | @Service 18 | public class UserAdviceImgServiceImpl extends ServiceImpl implements UserAdviceImgService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/UserAdviceServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import com.xyongfeng.mapper.UserAdviceImgMapper; 8 | import com.xyongfeng.mapper.UserAdviceMapper; 9 | import com.xyongfeng.pojo.JsonResult; 10 | import com.xyongfeng.pojo.UserAdvice; 11 | import com.xyongfeng.pojo.UserAdviceImg; 12 | import com.xyongfeng.pojo.config.ImgPathPro; 13 | import com.xyongfeng.service.UserAdviceService; 14 | import com.xyongfeng.util.FileUtil; 15 | import com.xyongfeng.util.MyUtil; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.stereotype.Service; 18 | import org.springframework.web.multipart.MultipartFile; 19 | 20 | import java.nio.file.Paths; 21 | import java.time.LocalDateTime; 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | /** 26 | *

27 | * 服务实现类 28 | *

29 | * 30 | * @author xyongfeng 31 | * @since 2022-12-29 32 | */ 33 | @Service 34 | public class UserAdviceServiceImpl extends ServiceImpl implements UserAdviceService { 35 | @Autowired 36 | private UserAdviceMapper userAdviceMapper; 37 | @Autowired 38 | private UserAdviceImgMapper userAdviceImgMapper; 39 | 40 | @Autowired 41 | private ImgPathPro imgPathPro; 42 | 43 | @Autowired 44 | private FileUtil fileUtil; 45 | 46 | private List getAdviceImgs(UserAdvice userAdvice) { 47 | List objects = userAdviceImgMapper.selectObjs(new QueryWrapper() 48 | .eq("advice_id_xq", userAdvice.getId()).select("img_path_xq")); 49 | List strings = new ArrayList<>(); 50 | objects.forEach(x -> strings.add(x.toString())); 51 | 52 | return strings.size() > 0 ? strings : null; 53 | } 54 | 55 | @Override 56 | public JsonResult select(Integer current, Integer size) { 57 | IPage userAdviceIPage = userAdviceMapper.selectWithUserAndImg(new Page<>(current, size)); 58 | 59 | userAdviceIPage.getRecords().forEach(x -> x.setImgs(getAdviceImgs(x))); 60 | 61 | return JsonResult.success(userAdviceIPage); 62 | } 63 | 64 | @Override 65 | public JsonResult insert(UserAdvice userAdvice, List files) { 66 | 67 | userAdvice.setUserId(MyUtil.getUsers().getId()); 68 | userAdvice.setTime(LocalDateTime.now()); 69 | int i = userAdviceMapper.insert(userAdvice); 70 | 71 | for (MultipartFile file : files) { 72 | try { 73 | // 判断文件大小是否为0,则表示该文件为占用空文件,不能上传 74 | if(file.getSize() == 0){ 75 | continue; 76 | } 77 | // 上传图片 78 | String filename = fileUtil.uploadImg(file, imgPathPro.getAdviceImg()); 79 | 80 | assert filename != null; 81 | String filePath = Paths.get(imgPathPro.getAdviceImg()).resolve(filename).toString(); 82 | // 加入数据库 83 | userAdviceImgMapper.insert(new UserAdviceImg().setAdviceId(userAdvice.getId()).setImgPath(filePath)); 84 | } catch (Exception e) { 85 | e.printStackTrace(); 86 | return JsonResult.error("反馈失败 ".concat(e.getMessage())); 87 | } 88 | } 89 | 90 | if (i > 0) { 91 | return JsonResult.success("感谢您的反馈"); 92 | } 93 | return JsonResult.error("反馈失败"); 94 | 95 | } 96 | 97 | @Override 98 | public JsonResult delete(Integer id) { 99 | 100 | int i = userAdviceMapper.deleteById(id); 101 | if (i > 0) { 102 | return JsonResult.success("感谢您的反馈"); 103 | } 104 | return JsonResult.error("反馈失败"); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/UsersFriendInformServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.xyongfeng.pojo.UsersFriendInform; 5 | import com.xyongfeng.mapper.UsersFriendInformMapper; 6 | import com.xyongfeng.service.UsersFriendInformService; 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | *

15 | * 服务实现类 16 | *

17 | * 18 | * @author xyongfeng 19 | * @since 2022-08-22 20 | */ 21 | @Service 22 | public class UsersFriendInformServiceImpl extends ServiceImpl implements UsersFriendInformService { 23 | @Autowired 24 | private UsersFriendInformMapper usersFriendInformMapper; 25 | 26 | @Override 27 | public List getAllContent() { 28 | return usersFriendInformMapper.selectObjs(new QueryWrapper() 29 | .select("content_xq").eq("type_xq", 1)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/Impl/UsersFriendServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service.Impl; 2 | 3 | import com.xyongfeng.pojo.UsersFriend; 4 | import com.xyongfeng.mapper.UsersFriendMapper; 5 | import com.xyongfeng.service.UsersFriendService; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 服务实现类 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-08-22 16 | */ 17 | @Service 18 | public class UsersFriendServiceImpl extends ServiceImpl implements UsersFriendService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/MeetingApplicationService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.xyongfeng.pojo.MeetingApplication; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author xyongfeng 12 | * @since 2022-09-12 13 | */ 14 | public interface MeetingApplicationService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/MeetingChatService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.xyongfeng.pojo.JsonResult; 4 | import com.xyongfeng.pojo.MeetingChat; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 服务类 12 | *

13 | * 14 | * @author xyongfeng 15 | * @since 2022-12-30 16 | */ 17 | public interface MeetingChatService extends IService { 18 | /** 19 | * 插入聊天内容 20 | * @param meetingId 21 | * @param userId 22 | * @param msg 23 | */ 24 | void insert(String meetingId, Integer userId, String msg); 25 | 26 | /** 27 | * 查看所有聊天内容的分词结果 28 | * @return 29 | */ 30 | JsonResult selectChatJieba(); 31 | 32 | /** 33 | * 查看分词的停用词 34 | * @return 35 | */ 36 | JsonResult selectStopword(); 37 | 38 | /** 39 | * 修改分词的停用词 40 | * @return 41 | */ 42 | JsonResult updateStopword(List words); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/MeetingNoticeService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.xyongfeng.pojo.MeetingNotice; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author xyongfeng 12 | * @since 2022-09-12 13 | */ 14 | public interface MeetingNoticeService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/MeetingNoticeUsersService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.xyongfeng.pojo.MeetingNoticeUsers; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author xyongfeng 12 | * @since 2022-09-12 13 | */ 14 | public interface MeetingNoticeUsersService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/MeetingPasswordService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.xyongfeng.pojo.MeetingPassword; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author xyongfeng 12 | * @since 2023-01-03 13 | */ 14 | public interface MeetingPasswordService extends IService { 15 | 16 | int insert(String id, String password, Boolean passEnabled); 17 | 18 | /** 19 | * 返回会议密码,如果没有就返回空 20 | * 21 | * @param mid 22 | * @return 23 | */ 24 | MeetingPassword getMeetingPasswordOne(String mid); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/MeetingScreenshotService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.xyongfeng.pojo.JsonResult; 4 | import com.xyongfeng.pojo.MeetingScreenshot; 5 | import com.baomidou.mybatisplus.extension.service.IService; 6 | import com.xyongfeng.pojo.Param.ImgBase64Param; 7 | 8 | /** 9 | *

10 | * 服务类 11 | *

12 | * 13 | * @author xyongfeng 14 | * @since 2022-12-31 15 | */ 16 | public interface MeetingScreenshotService extends IService { 17 | 18 | /** 19 | * 接收base64,保存截屏图像 20 | * @param mid 21 | * @param param 22 | * @return 23 | */ 24 | JsonResult setScreenshotWithBase64(String mid, ImgBase64Param param); 25 | 26 | /** 27 | * 根据会议id输出该用户的截屏 28 | * @param mid 29 | * @return 30 | */ 31 | JsonResult selectPath(String mid); 32 | 33 | /** 34 | * 输出该用户所有会议截屏 35 | * @return 36 | */ 37 | JsonResult selectAll(); 38 | 39 | /** 40 | * 根据id删除 41 | * @param id 42 | * @return 43 | */ 44 | JsonResult deleteById(String id); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/MenuService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xyongfeng.pojo.JsonResult; 5 | import com.xyongfeng.pojo.Menu; 6 | 7 | /** 8 | *

9 | * 服务类 10 | *

11 | * 12 | * @author xyongfeng 13 | * @since 2022-06-25 14 | */ 15 | public interface MenuService extends IService { 16 | /** 17 | * 通过用户ID查询菜单列表 18 | * @return 19 | */ 20 | 21 | JsonResult getMenusByUserId(); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/RoleService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xyongfeng.pojo.JsonResult; 5 | import com.xyongfeng.pojo.Param.RoleParam; 6 | import com.xyongfeng.pojo.Role; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | *

13 | * 服务类 14 | *

15 | * 16 | * @author xyongfeng 17 | * @since 2022-06-25 18 | */ 19 | public interface RoleService extends IService { 20 | /** 21 | * 根据用户id获得Role列表 22 | * 后端系统权限认证调用 23 | * @return 24 | */ 25 | List selectRoleWithUserid(Integer uid); 26 | /** 27 | * 查看管理员权限 28 | * 开放的接口调用 29 | * 区别:不会输出隐藏权限 30 | * @param uid 31 | * @return 32 | */ 33 | JsonResult selectRoleWithoutHidden(Integer uid); 34 | 35 | /** 36 | * 修改管理员权限 37 | * @param uid 38 | * @param roleParam 39 | * @return 40 | */ 41 | JsonResult updateRole(Integer uid, Map roleParam); 42 | 43 | /** 44 | * 查看管理员权限列表 45 | * @return 46 | */ 47 | JsonResult selectAllRole(); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/UserAdviceImgService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.xyongfeng.pojo.UserAdviceImg; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author xyongfeng 12 | * @since 2023-01-03 13 | */ 14 | public interface UserAdviceImgService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/UserAdviceService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.xyongfeng.pojo.JsonResult; 5 | import com.xyongfeng.pojo.UserAdvice; 6 | import org.springframework.web.multipart.MultipartFile; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 服务类 13 | *

14 | * 15 | * @author xyongfeng 16 | * @since 2022-12-29 17 | */ 18 | public interface UserAdviceService extends IService { 19 | 20 | JsonResult select(Integer current, Integer size); 21 | 22 | JsonResult insert(UserAdvice userAdvice, List files); 23 | 24 | JsonResult delete(Integer id); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/UsersFriendInformService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.xyongfeng.pojo.UsersFriendInform; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 服务类 11 | *

12 | * 13 | * @author xyongfeng 14 | * @since 2022-08-22 15 | */ 16 | public interface UsersFriendInformService extends IService { 17 | 18 | List getAllContent(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/service/UsersFriendService.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.service; 2 | 3 | import com.xyongfeng.pojo.UsersFriend; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author xyongfeng 12 | * @since 2022-08-22 13 | */ 14 | public interface UsersFriendService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/socketer/SocketMapDao.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.socketer; 2 | 3 | import com.xyongfeng.util.RedisUtil; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.UUID; 8 | 9 | @Component 10 | public class SocketMapDao { 11 | 12 | @Autowired 13 | private RedisUtil redisUtil; 14 | 15 | public void putByUUID(UUID uuid, SocketUser value) { 16 | SocketState.CONNECT_USERS_MAP_UUID.put(uuid, value); 17 | } 18 | 19 | public void deleteByUUID(UUID uuid) { 20 | SocketState.CONNECT_USERS_MAP_UUID.remove(uuid); 21 | } 22 | 23 | public SocketUser getByUUID(UUID uuid) { 24 | return SocketState.CONNECT_USERS_MAP_UUID.get(uuid); 25 | } 26 | 27 | public void putByUserId(Integer userId, SocketUser value) { 28 | // redisTemplate.opsForHash().put(SOCKET_BY_USERID, userId.toString(), value); 29 | SocketState.CONNECT_USERS_MAP_USERID.put(userId, value); 30 | } 31 | 32 | public void deleteByUserId(Integer userId) { 33 | // redisTemplate.opsForHash().delete(SOCKET_BY_USERID, userId.toString()); 34 | SocketState.CONNECT_USERS_MAP_USERID.remove(userId); 35 | } 36 | 37 | public SocketUser getByUserId(Integer userId) { 38 | // return redisTemplate.opsForHash().get(SOCKET_BY_USERID, userId.toString()); 39 | return SocketState.CONNECT_USERS_MAP_USERID.get(userId); 40 | } 41 | 42 | public void putSocketUser(UUID uuid, Integer userId, SocketUser socketUser) { 43 | putByUUID(uuid, socketUser); 44 | putByUserId(userId, socketUser); 45 | } 46 | 47 | public SocketUser getSocketUserByUUID(UUID uuid) { 48 | return getByUUID(uuid); 49 | } 50 | 51 | public SocketUser getSocketUserByUserId(Integer userId) { 52 | return getByUserId(userId); 53 | 54 | } 55 | 56 | private void deleteSocketCommon(UUID uuid, Integer userId) { 57 | deleteByUUID(uuid); 58 | deleteByUserId(userId); 59 | 60 | // 从redis登录移除 61 | redisUtil.deleteUserOnline(userId); 62 | } 63 | 64 | public void deleteSocketByUUID(UUID uuid) { 65 | Integer userId = getSocketUserByUUID(uuid).getUsers().getId(); 66 | deleteSocketCommon(uuid, userId); 67 | } 68 | 69 | public void deleteSocketByUserId(Integer userId) { 70 | UUID uuid = getSocketUserByUserId(userId).getClient().getSessionId(); 71 | deleteSocketCommon(uuid, userId); 72 | } 73 | 74 | public int getSize() { 75 | int sizeByUUID = SocketState.CONNECT_USERS_MAP_UUID.size(); 76 | int sizeByUserId = SocketState.CONNECT_USERS_MAP_USERID.size(); 77 | 78 | return Math.max(sizeByUUID, sizeByUserId); 79 | 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/socketer/SocketState.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.socketer; 2 | 3 | 4 | import java.util.UUID; 5 | import java.util.concurrent.ConcurrentHashMap; 6 | import java.util.concurrent.ConcurrentMap; 7 | 8 | 9 | public class SocketState { 10 | 11 | /** 12 | * 用户sessionId对应用户信息的map 13 | */ 14 | public static final ConcurrentMap CONNECT_USERS_MAP_UUID = new ConcurrentHashMap<>(); 15 | 16 | public static final ConcurrentMap CONNECT_USERS_MAP_USERID = new ConcurrentHashMap<>(); 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/socketer/SocketUser.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.socketer; 2 | 3 | import com.corundumstudio.socketio.SocketIOClient; 4 | import com.xyongfeng.pojo.Users; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | 8 | import java.util.List; 9 | 10 | @AllArgsConstructor 11 | @Data 12 | 13 | public class SocketUser{ 14 | SocketIOClient client; 15 | Users users; 16 | List meetings; 17 | 18 | } -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/util/IpUtil.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.util; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import java.net.InetAddress; 5 | import java.net.UnknownHostException; 6 | 7 | public class IpUtil { 8 | public static String getIpAddr(HttpServletRequest request) { 9 | String ipAddress = null; 10 | try { 11 | ipAddress = request.getHeader("x-forwarded-for"); 12 | if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { 13 | ipAddress = request.getHeader("Proxy-Client-IP"); 14 | } 15 | if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { 16 | ipAddress = request.getHeader("WL-Proxy-Client-IP"); 17 | } 18 | if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { 19 | ipAddress = request.getRemoteAddr(); 20 | if ("127.0.0.1".equals(ipAddress)) { 21 | // 根据网卡取本机配置的IP 22 | InetAddress inet = null; 23 | try { 24 | inet = InetAddress.getLocalHost(); 25 | } catch (UnknownHostException e) { 26 | e.printStackTrace(); 27 | } 28 | ipAddress = inet.getHostAddress(); 29 | } 30 | } 31 | // 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割 32 | if (ipAddress != null && ipAddress.length() > 15) { // "***.***.***.***".length() 33 | // = 15 34 | if (ipAddress.indexOf(",") > 0) { 35 | ipAddress = ipAddress.substring(0, ipAddress.indexOf(",")); 36 | } 37 | } 38 | } catch (Exception e) { 39 | ipAddress = ""; 40 | } 41 | // ipAddress = this.getRequest().getRemoteAddr(); 42 | 43 | return ipAddress; 44 | } 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/util/JwtTokenUtil.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.util; 2 | 3 | import io.jsonwebtoken.*; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.security.core.userdetails.UserDetails; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.Date; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | @Component 13 | public class JwtTokenUtil { 14 | private static final String CLAIM_KEY_USERNAME = "sub"; 15 | private static final String CLAIM_KEY_CREATED = "created"; 16 | @Value("${jwt.secret}") 17 | private String secret; 18 | @Value("${jwt.expiration}") 19 | private Long expiration; 20 | 21 | /** 22 | * 根据用户信息生成token 23 | * 24 | * @param userDetails 25 | * @return 26 | */ 27 | public String generateToken(UserDetails userDetails) { 28 | Map claims = new HashMap<>(); 29 | claims.put(CLAIM_KEY_USERNAME, userDetails.getUsername()); 30 | claims.put(CLAIM_KEY_CREATED, new Date()); 31 | return generateToken(claims); 32 | } 33 | 34 | /** 35 | * 从token中获取登录用户名 36 | * 37 | * @param token 38 | * @return 39 | */ 40 | public String getUserNameFromToken(String token) { 41 | String username; 42 | 43 | try { 44 | Claims claims = getClaimsFormToken(token); 45 | username = claims.getSubject(); 46 | } catch (Exception e) { 47 | username = null; 48 | } 49 | return username; 50 | } 51 | 52 | /** 53 | * 验证token是否有效 54 | * 55 | * @param token 56 | * @param userDetails 57 | * @return 58 | */ 59 | public boolean validateToken(String token, UserDetails userDetails) { 60 | String username = getUserNameFromToken(token); 61 | return username.equals(userDetails.getUsername()) && !isTokenExpired(token); 62 | } 63 | 64 | /** 65 | * 判断token是否失效 66 | * 67 | * @return 68 | */ 69 | private boolean isTokenExpired(String token) { 70 | Date expireDate = getExpriredDateFromToken(token); 71 | return expireDate.before(new Date()); 72 | } 73 | 74 | /** 75 | * 判断token是否可以被刷新 76 | * 77 | * @param token 78 | * @return 79 | */ 80 | public boolean canRefresh(String token) { 81 | return !isTokenExpired(token); 82 | } 83 | 84 | /** 85 | * 刷新token 86 | * 87 | * @param token 88 | * @return 89 | */ 90 | public String refreshToken(String token) { 91 | Claims claims = getClaimsFormToken(token); 92 | claims.put(CLAIM_KEY_CREATED, new Date()); 93 | return generateToken(claims); 94 | } 95 | 96 | 97 | /** 98 | * 从token中获取失效时间 99 | * 100 | * @param token 101 | * @return 102 | */ 103 | private Date getExpriredDateFromToken(String token) { 104 | Claims claims = getClaimsFormToken(token); 105 | return claims.getExpiration(); 106 | } 107 | 108 | /** 109 | * 从token获取负载 110 | * 111 | * @param token 112 | * @return 113 | */ 114 | private Claims getClaimsFormToken(String token) { 115 | Claims claims = null; 116 | claims = Jwts.parser() 117 | .setSigningKey(secret) 118 | .parseClaimsJws(token) 119 | .getBody(); 120 | return claims; 121 | } 122 | 123 | /** 124 | * 根据负载生成 JWT token 125 | * 126 | * @param claims 127 | * @return 128 | */ 129 | private String generateToken(Map claims) { 130 | return Jwts.builder() 131 | .setClaims(claims) 132 | .setExpiration(generateExpirationDate()) 133 | .signWith(SignatureAlgorithm.HS512, secret) 134 | .compact(); 135 | } 136 | 137 | /** 138 | * 生成token失效时间 139 | * 140 | * @return 141 | */ 142 | private Date generateExpirationDate() { 143 | return new Date(System.currentTimeMillis() + expiration * 1000); 144 | } 145 | } 146 | 147 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/util/MeetingParamConverter.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.util; 2 | 3 | import com.xyongfeng.pojo.Meeting; 4 | import com.xyongfeng.pojo.Param.MeetingAddParam; 5 | import com.xyongfeng.pojo.Param.MeetingUpdateParam; 6 | 7 | 8 | /** 9 | * Meeting字段转换器 10 | * 11 | * @author xyongfeng 12 | */ 13 | 14 | public class MeetingParamConverter { 15 | 16 | public static Meeting getMeeting(MeetingAddParam meet) { 17 | return new Meeting() 18 | .setStartDate(meet.getStartDate()) 19 | .setHaveLicence(meet.getHaveLicence()) 20 | .setName(meet.getName()) 21 | .setMaxNumber(meet.getMaxNumber()) 22 | .setNeedFace(meet.getNeedFace()); 23 | 24 | } 25 | 26 | 27 | public static Meeting getMeeting(MeetingUpdateParam meet) { 28 | return new Meeting() 29 | .setId(meet.getId()) 30 | .setStartDate(meet.getStartDate()) 31 | .setHaveLicence(meet.getHaveLicence()) 32 | .setName(meet.getName()) 33 | .setMaxNumber(meet.getMaxNumber()) 34 | .setNeedFace(meet.getNeedFace()); 35 | 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/util/MyUtil.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.util; 2 | 3 | 4 | import com.xyongfeng.pojo.Users; 5 | import org.springframework.security.core.Authentication; 6 | import org.springframework.security.core.context.SecurityContextHolder; 7 | 8 | 9 | 10 | public class MyUtil { 11 | 12 | public static Users getUsers() { 13 | Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); 14 | 15 | if (authentication == null) { 16 | return null; 17 | } 18 | return (Users) authentication.getPrincipal(); 19 | } 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/util/RedisUtil.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.util; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.data.redis.core.RedisTemplate; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class RedisUtil { 9 | public final static String KEY_ONLINE = "keyOnline"; 10 | 11 | @Autowired 12 | private RedisTemplate redisTemplate; 13 | 14 | public void put(String key, String hashKey, Object value) { 15 | redisTemplate.opsForHash().put(key, hashKey, value); 16 | } 17 | 18 | public Object get(String key, String hashKey) { 19 | return redisTemplate.opsForHash().get(key, hashKey); 20 | } 21 | 22 | public void delete(String key, String hashKey) { 23 | redisTemplate.opsForHash().delete(key, hashKey); 24 | 25 | } 26 | 27 | 28 | public void putUserOnline(Integer userId, String token) { 29 | put(KEY_ONLINE, userId.toString(), token); 30 | } 31 | 32 | public void deleteUserOnline(Integer userId) { 33 | delete(KEY_ONLINE, String.valueOf(userId)); 34 | } 35 | 36 | public String getUserOnline(Integer userId) { 37 | return (String) get(KEY_ONLINE, userId.toString()); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/util/UserParamConverter.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.util; 2 | 3 | import com.xyongfeng.pojo.Users; 4 | import com.xyongfeng.pojo.Param.UsersAddParam; 5 | import com.xyongfeng.pojo.Param.UsersUpdateParam; 6 | 7 | /** 8 | * Users字段转换器 9 | * @author xyongfeng 10 | */ 11 | 12 | public class UserParamConverter { 13 | 14 | public static Users getUsers(UsersUpdateParam usersUpdateParam){ 15 | return new Users() 16 | .setId(usersUpdateParam.getId()) 17 | .setPassword(usersUpdateParam.getPassword()) 18 | .setName(usersUpdateParam.getName()) 19 | .setEmail(usersUpdateParam.getEmail()) 20 | .setHeadImage(usersUpdateParam.getHeadImage()) 21 | .setIsAdmin(usersUpdateParam.getIsAdmin()) 22 | .setUsername(usersUpdateParam.getUsername()) 23 | .setTelephone(usersUpdateParam.getTelephone()); 24 | } 25 | 26 | public static Users getUsers(UsersAddParam usersAddParam){ 27 | return new Users() 28 | .setName(usersAddParam.getName()) 29 | .setPassword(usersAddParam.getPassword()) 30 | .setEmail(usersAddParam.getEmail()) 31 | .setHeadImage(usersAddParam.getHeadImage()) 32 | .setIsAdmin(usersAddParam.getIsAdmin()) 33 | .setUsername(usersAddParam.getUsername()) 34 | .setTelephone(usersAddParam.getTelephone()); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/xyongfeng/util/ValidGroups.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng.util; 2 | 3 | public class ValidGroups { 4 | public interface Update { 5 | } 6 | 7 | public interface Default { 8 | } 9 | 10 | public interface Id { 11 | } 12 | 13 | public interface Face { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://localhost:3306/meeting 6 | username: root 7 | password: 8 | driver-class-name: com.mysql.cj.jdbc.Driver 9 | mvc: 10 | format: 11 | date-time: yyyy-MM-dd HH:mm:ss 12 | pathmatch: 13 | matching-strategy: ant_path_matcher 14 | # 设置匹配静态资源url 15 | static-path-pattern: /static/** 16 | servlet: 17 | multipart: 18 | max-file-size: 5MB 19 | max-request-size: 10MB 20 | web: 21 | resources: 22 | # 映射静态资源路径 一个是本地测试路径,一个是jar包外部资源路径 23 | static-locations: classpath:/static/,file:/www/wwwroot/meeting-system/static/ 24 | redis: 25 | port: 6379 26 | host: localhost 27 | password: 28 | database: 1 29 | 30 | mybatis-plus: 31 | mapper-locations: classpath:com/xyongfeng/mapper/xml/*.xml 32 | # 开启控制台输出语句 33 | configuration: 34 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 35 | 36 | # host表示允许接收请求的客户端IP,"0.0.0.0" 表示该服务端将接受来自任何网络接口的连接。 37 | socketio: 38 | host: 0.0.0.0 #监听的ip 39 | port: 9092 #监听端口 40 | # 设置最大每帧处理数据的长度,防止他人利用大数据来攻击服务器 41 | maxFramePayloadLength: 1048576 42 | # 设置http交互最大内容长度 43 | maxHttpContentLength: 1048576 44 | # socket连接数大小(如只监听一个端口boss线程组为1即可) 45 | bossCount: 1 46 | workCount: 100 47 | allowCustomRequests: true 48 | # 协议升级超时时间(毫秒),默认10秒。HTTP握手升级为ws协议超时时间 49 | upgradeTimeout: 1000000 50 | # Ping消息超时时间(毫秒),默认60秒,这个时间间隔内没有接收到心跳消息就会发送超时事件 51 | pingTimeout: 6000000 52 | # Ping消息间隔(毫秒),默认25秒。客户端向服务器发送一条心跳消息间隔 53 | pingInterval: 25000 54 | 55 | 56 | jwt: 57 | # JWT 存储的请求头 58 | tokenHeader: Authorization 59 | # JWT 加解密使用的密钥 60 | secret: meeting-xyf-secret 61 | # JWT的超期限时间(60*60*24) 62 | expiration: 604800 63 | # JWT 负载中拿到开头 64 | tokenHead: Bearer 65 | 66 | img: 67 | # 头像图片储存位置 68 | head: img/head 69 | # 面部图片存储位置 70 | face: img/face 71 | # 会议截屏位置 72 | screenshot: img/screenshot 73 | # 用户意见图片 74 | adviceImg: img/adviceImg 75 | 76 | 77 | flask: 78 | # AI端的访问url 79 | headerUrl: http://127.0.0.1:5000/ 80 | -------------------------------------------------------------------------------- /src/main/resources/static/img/head/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyongfeng/meeting_system_backend/33b0d0f0cffc41a52415fe2febb98163d6bd2412/src/main/resources/static/img/head/default.jpg -------------------------------------------------------------------------------- /src/test/java/com/xyongfeng/MeetingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.xyongfeng; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | 7 | @Slf4j 8 | @SpringBootTest 9 | class MeetingApplicationTests { 10 | 11 | } 12 | --------------------------------------------------------------------------------