├── sql ├── tool_picture.sql └── 脚本如何选择.md ├── .gitignore ├── eladmin-system └── src │ ├── main │ ├── resources │ │ ├── ip2region │ │ │ └── ip2region.db │ │ ├── log4jdbc.log4j2.properties │ │ ├── banner.txt │ │ ├── generator.properties │ │ ├── template │ │ │ ├── generator │ │ │ │ ├── front │ │ │ │ │ └── api.ftl │ │ │ │ └── admin │ │ │ │ │ ├── Mapper.ftl │ │ │ │ │ ├── Repository.ftl │ │ │ │ │ └── Dto.ftl │ │ │ └── email │ │ │ │ └── email.ftl │ │ ├── config │ │ │ └── application.yml │ │ └── logback.xml │ └── java │ │ └── me │ │ └── zhengjie │ │ ├── modules │ │ ├── mnt │ │ │ ├── websocket │ │ │ │ ├── MsgType.java │ │ │ │ └── SocketMsg.java │ │ │ ├── repository │ │ │ │ ├── AppRepository.java │ │ │ │ ├── DeployRepository.java │ │ │ │ ├── DatabaseRepository.java │ │ │ │ ├── DeployHistoryRepository.java │ │ │ │ └── ServerDeployRepository.java │ │ │ ├── service │ │ │ │ ├── dto │ │ │ │ │ ├── AppQueryCriteria.java │ │ │ │ │ ├── ServerDeployQueryCriteria.java │ │ │ │ │ ├── DeployQueryCriteria.java │ │ │ │ │ ├── DeployHistoryQueryCriteria.java │ │ │ │ │ ├── DatabaseQueryCriteria.java │ │ │ │ │ ├── DatabaseDto.java │ │ │ │ │ ├── DeployHistoryDto.java │ │ │ │ │ ├── AppDto.java │ │ │ │ │ └── ServerDeployDto.java │ │ │ │ └── mapstruct │ │ │ │ │ ├── AppMapper.java │ │ │ │ │ ├── DatabaseMapper.java │ │ │ │ │ ├── ServerDeployMapper.java │ │ │ │ │ ├── DeployMapper.java │ │ │ │ │ └── DeployHistoryMapper.java │ │ │ └── domain │ │ │ │ ├── Database.java │ │ │ │ └── DeployHistory.java │ │ ├── system │ │ │ ├── domain │ │ │ │ ├── vo │ │ │ │ │ ├── UserPassVo.java │ │ │ │ │ ├── MenuMetaVo.java │ │ │ │ │ └── MenuVo.java │ │ │ │ ├── Dict.java │ │ │ │ └── DictDetail.java │ │ │ ├── service │ │ │ │ ├── MonitorService.java │ │ │ │ ├── dto │ │ │ │ │ ├── DeptSmallDto.java │ │ │ │ │ ├── DictQueryCriteria.java │ │ │ │ │ ├── DictSmallDto.java │ │ │ │ │ ├── JobSmallDto.java │ │ │ │ │ ├── RoleSmallDto.java │ │ │ │ │ ├── DictDetailQueryCriteria.java │ │ │ │ │ ├── RoleQueryCriteria.java │ │ │ │ │ ├── DictDetailDto.java │ │ │ │ │ ├── DictDto.java │ │ │ │ │ ├── JobQueryCriteria.java │ │ │ │ │ ├── MenuQueryCriteria.java │ │ │ │ │ ├── JobDto.java │ │ │ │ │ ├── DeptQueryCriteria.java │ │ │ │ │ ├── UserQueryCriteria.java │ │ │ │ │ ├── RoleDto.java │ │ │ │ │ └── UserDto.java │ │ │ │ ├── DataService.java │ │ │ │ ├── mapstruct │ │ │ │ │ ├── DeptMapper.java │ │ │ │ │ ├── DictMapper.java │ │ │ │ │ ├── MenuMapper.java │ │ │ │ │ ├── JobMapper.java │ │ │ │ │ ├── JobSmallMapper.java │ │ │ │ │ ├── DeptSmallMapper.java │ │ │ │ │ ├── DictSmallMapper.java │ │ │ │ │ ├── RoleSmallMapper.java │ │ │ │ │ ├── RoleMapper.java │ │ │ │ │ ├── UserMapper.java │ │ │ │ │ └── DictDetailMapper.java │ │ │ │ ├── VerifyService.java │ │ │ │ └── DictDetailService.java │ │ │ ├── repository │ │ │ │ ├── DictDetailRepository.java │ │ │ │ ├── JobRepository.java │ │ │ │ └── DictRepository.java │ │ │ └── rest │ │ │ │ ├── MonitorController.java │ │ │ │ └── LimitController.java │ │ ├── quartz │ │ │ ├── repository │ │ │ │ ├── QuartzLogRepository.java │ │ │ │ └── QuartzJobRepository.java │ │ │ ├── task │ │ │ │ └── TestTask.java │ │ │ ├── service │ │ │ │ └── dto │ │ │ │ │ └── JobQueryCriteria.java │ │ │ └── utils │ │ │ │ └── QuartzRunnable.java │ │ └── security │ │ │ ├── config │ │ │ ├── bean │ │ │ │ ├── LoginCodeEnum.java │ │ │ │ ├── LoginCode.java │ │ │ │ └── SecurityProperties.java │ │ │ └── ConfigBeanConfiguration.java │ │ │ ├── service │ │ │ ├── dto │ │ │ │ ├── AuthUserDto.java │ │ │ │ └── OnlineUserDto.java │ │ │ └── UserCacheClean.java │ │ │ └── security │ │ │ ├── JwtAccessDeniedHandler.java │ │ │ └── JwtAuthenticationEntryPoint.java │ │ └── config │ │ ├── WebSocketConfig.java │ │ └── thread │ │ ├── AsyncTaskProperties.java │ │ └── ThreadPoolExecutorUtil.java │ └── test │ └── java │ └── me │ └── zhengjie │ ├── EladminSystemApplicationTests.java │ └── LoginCacheTest.java ├── .github └── FUNDING.yml ├── eladmin-logging ├── pom.xml └── src │ └── main │ └── java │ └── me │ └── zhengjie │ ├── annotation │ └── Log.java │ ├── service │ ├── mapstruct │ │ ├── LogErrorMapper.java │ │ └── LogSmallMapper.java │ └── dto │ │ ├── LogSmallDTO.java │ │ ├── LogQueryCriteria.java │ │ └── LogErrorDTO.java │ └── repository │ └── LogRepository.java ├── eladmin-common ├── src │ ├── test │ │ └── java │ │ │ └── me │ │ │ └── zhengjie │ │ │ └── utils │ │ │ ├── EncryptUtilsTest.java │ │ │ ├── DateUtilsTest.java │ │ │ ├── FileUtilTest.java │ │ │ └── StringUtilsTest.java │ └── main │ │ └── java │ │ └── me │ │ └── zhengjie │ │ ├── aspect │ │ └── LimitType.java │ │ ├── annotation │ │ ├── AnonymousAccess.java │ │ ├── Limit.java │ │ └── DataPermission.java │ │ ├── base │ │ ├── BaseDTO.java │ │ └── BaseMapper.java │ │ ├── utils │ │ ├── ThrowableUtil.java │ │ ├── RequestHolder.java │ │ ├── CallBack.java │ │ ├── ElAdminConstant.java │ │ ├── enums │ │ │ ├── CodeBiEnum.java │ │ │ ├── CodeEnum.java │ │ │ ├── DataScopeEnum.java │ │ │ └── RequestMethodEnum.java │ │ ├── ValidationUtil.java │ │ └── CacheKey.java │ │ ├── config │ │ ├── RsaProperties.java │ │ ├── ElPermissionConfig.java │ │ ├── AuditorConfig.java │ │ └── FileProperties.java │ │ └── exception │ │ ├── EntityExistException.java │ │ ├── BadRequestException.java │ │ ├── EntityNotFoundException.java │ │ └── handler │ │ └── ApiError.java └── pom.xml ├── eladmin-tools ├── src │ └── main │ │ └── java │ │ └── me │ │ └── zhengjie │ │ ├── repository │ │ ├── EmailRepository.java │ │ ├── AliPayRepository.java │ │ ├── LocalStorageRepository.java │ │ ├── QiniuContentRepository.java │ │ └── QiNiuConfigRepository.java │ │ ├── service │ │ ├── dto │ │ │ ├── QiniuQueryCriteria.java │ │ │ ├── LocalStorageQueryCriteria.java │ │ │ ├── LocalStorageDto.java │ │ │ └── PictureQueryCriteria.java │ │ ├── mapstruct │ │ │ └── LocalStorageMapper.java │ │ ├── EmailService.java │ │ └── AliPayService.java │ │ ├── utils │ │ └── AliPayStatusEnum.java │ │ ├── domain │ │ ├── vo │ │ │ ├── EmailVo.java │ │ │ └── TradeVo.java │ │ └── EmailConfig.java │ │ └── config │ │ └── MultipartConfig.java └── pom.xml └── eladmin-generator ├── src └── main │ └── java │ └── me │ └── zhengjie │ ├── repository │ ├── GenConfigRepository.java │ └── ColumnInfoRepository.java │ ├── service │ └── GenConfigService.java │ ├── domain │ └── vo │ │ └── TableInfo.java │ ├── utils │ └── ColUtil.java │ └── rest │ └── GenConfigController.java └── pom.xml /sql/tool_picture.sql: -------------------------------------------------------------------------------- 1 | -- 删除免费图床表 2 | DROP TABLE tool_picture; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### IDEA ### 2 | .idea/* 3 | *.iml 4 | */target/* 5 | */*.iml 6 | /.gradle/ 7 | -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/ip2region/ip2region.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcomplete/eladmin/master/eladmin-system/src/main/resources/ip2region/ip2region.db -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # [user1, user2] 4 | otechie: c9635b6fcfabfeed 5 | custom: https://aurora-1255840532.cos.ap-chengdu.myqcloud.com/donation.png 6 | -------------------------------------------------------------------------------- /sql/脚本如何选择.md: -------------------------------------------------------------------------------- 1 | ## 脚本指南 2 | 项目根目录的 sql 文件夹内提供了本次数据库变更的脚本,脚本如何选择,以及执行的顺序如下 3 | 4 | ::: tip 注意 5 | 操作数据库属于危险行为,请勿用于生产库,请事先做好备份!!! 6 | ::: 7 | 8 | ### 初次使用 9 | eladmin.sql 为 eladmin 项目完整的 sql 脚本,适合于初次使用的用户 10 | 11 | ### 更新迭代 12 | -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/log4jdbc.log4j2.properties: -------------------------------------------------------------------------------- 1 | # If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger 2 | log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator 3 | log4jdbc.auto.load.popular.drivers=false 4 | log4jdbc.drivers=com.mysql.cj.jdbc.Driver -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _ _ _ 2 | | | | | (_) 3 | ___| |______ __ _ __| |_ __ ___ _ _ __ 4 | / _ | |______/ _` |/ _` | '_ ` _ \| | '_ \ 5 | | __| | | (_| | (_| | | | | | | | | | | 6 | \___|_| \__,_|\__,_|_| |_| |_|_|_| |_| 7 | 8 | :: Spring Boot :: (v2.1.0.RELEASE) -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/generator.properties: -------------------------------------------------------------------------------- 1 | #数据库类型转Java类型 2 | tinyint=Integer 3 | smallint=Integer 4 | mediumint=Integer 5 | int=Integer 6 | integer=Integer 7 | 8 | bigint=Long 9 | 10 | float=Float 11 | 12 | double=Double 13 | 14 | decimal=BigDecimal 15 | 16 | bit=Boolean 17 | 18 | char=String 19 | varchar=String 20 | tinytext=String 21 | text=String 22 | mediumtext=String 23 | longtext=String 24 | 25 | date=Timestamp 26 | datetime=Timestamp 27 | timestamp=Timestamp -------------------------------------------------------------------------------- /eladmin-system/src/test/java/me/zhengjie/EladminSystemApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.zhengjie; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) 10 | public class EladminSystemApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | public static void main(String[] args) { 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/template/generator/front/api.ftl: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function add(data) { 4 | return request({ 5 | url: 'api/${changeClassName}', 6 | method: 'post', 7 | data 8 | }) 9 | } 10 | 11 | export function del(ids) { 12 | return request({ 13 | url: 'api/${changeClassName}/', 14 | method: 'delete', 15 | data: ids 16 | }) 17 | } 18 | 19 | export function edit(data) { 20 | return request({ 21 | url: 'api/${changeClassName}', 22 | method: 'put', 23 | data 24 | }) 25 | } 26 | 27 | export default { add, edit, del } 28 | -------------------------------------------------------------------------------- /eladmin-logging/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eladmin 7 | me.zhengjie 8 | 2.6 9 | 10 | 4.0.0 11 | 12 | eladmin-logging 13 | 日志模块 14 | 15 | 16 | 17 | me.zhengjie 18 | eladmin-common 19 | 2.6 20 | 21 | 22 | -------------------------------------------------------------------------------- /eladmin-common/src/test/java/me/zhengjie/utils/EncryptUtilsTest.java: -------------------------------------------------------------------------------- 1 | package me.zhengjie.utils; 2 | 3 | import org.junit.Test; 4 | import static org.junit.Assert.*; 5 | import static me.zhengjie.utils.EncryptUtils.*; 6 | 7 | public class EncryptUtilsTest { 8 | 9 | /** 10 | * 对称加密 11 | */ 12 | @Test 13 | public void testDesEncrypt() { 14 | try { 15 | assertEquals("7772841DC6099402", desEncrypt("123456")); 16 | } catch (Exception e) { 17 | e.printStackTrace(); 18 | } 19 | } 20 | 21 | /** 22 | * 对称解密 23 | */ 24 | @Test 25 | public void testDesDecrypt() { 26 | try { 27 | assertEquals("123456", desDecrypt("7772841DC6099402")); 28 | } catch (Exception e) { 29 | e.printStackTrace(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/aspect/LimitType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.aspect; 17 | 18 | /** 19 | * 限流枚举 20 | * @author / 21 | */ 22 | public enum LimitType { 23 | // 默认 24 | CUSTOMER, 25 | // by ip addr 26 | IP 27 | } 28 | -------------------------------------------------------------------------------- /eladmin-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eladmin 7 | me.zhengjie 8 | 2.6 9 | 10 | 4.0.0 11 | 12 | 5.3.4 13 | 14 | 15 | eladmin-common 16 | 公共模块 17 | 18 | 19 | 20 | 21 | cn.hutool 22 | hutool-all 23 | ${hutool.version} 24 | 25 | 26 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.websocket; 17 | 18 | /** 19 | * @author ZhangHouYing 20 | * @date 2019-08-10 9:56 21 | */ 22 | public enum MsgType { 23 | /** 连接 */ 24 | CONNECT, 25 | /** 关闭 */ 26 | CLOSE, 27 | /** 信息 */ 28 | INFO, 29 | /** 错误 */ 30 | ERROR 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/repository/EmailRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.repository; 17 | 18 | import me.zhengjie.domain.EmailConfig; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * @date 2018-12-26 24 | */ 25 | public interface EmailRepository extends JpaRepository { 26 | } 27 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/UserPassVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.domain.vo; 17 | 18 | import lombok.Data; 19 | 20 | /** 21 | * 修改密码的 Vo 类 22 | * @author Zheng Jie 23 | * @date 2019年7月11日13:59:49 24 | */ 25 | @Data 26 | public class UserPassVo { 27 | 28 | private String oldPass; 29 | 30 | private String newPass; 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/repository/AliPayRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.repository; 17 | 18 | import me.zhengjie.domain.AlipayConfig; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * @date 2018-12-31 24 | */ 25 | public interface AliPayRepository extends JpaRepository { 26 | } 27 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/annotation/AnonymousAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.annotation; 17 | 18 | import java.lang.annotation.*; 19 | 20 | /** 21 | * @author jacky 22 | * 用于标记匿名访问方法 23 | */ 24 | @Inherited 25 | @Documented 26 | @Target({ElementType.METHOD,ElementType.ANNOTATION_TYPE}) 27 | @Retention(RetentionPolicy.RUNTIME) 28 | public @interface AnonymousAccess { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /eladmin-common/src/test/java/me/zhengjie/utils/DateUtilsTest.java: -------------------------------------------------------------------------------- 1 | package me.zhengjie.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import java.time.LocalDateTime; 6 | import java.util.Date; 7 | 8 | public class DateUtilsTest { 9 | @Test 10 | public void test1() { 11 | long l = System.currentTimeMillis() / 1000; 12 | LocalDateTime localDateTime = DateUtil.fromTimeStamp(l); 13 | System.out.print(DateUtil.localDateTimeFormatyMdHms(localDateTime)); 14 | } 15 | 16 | @Test 17 | public void test2() { 18 | LocalDateTime now = LocalDateTime.now(); 19 | System.out.println(DateUtil.localDateTimeFormatyMdHms(now)); 20 | Date date = DateUtil.toDate(now); 21 | LocalDateTime localDateTime = DateUtil.toLocalDateTime(date); 22 | System.out.println(DateUtil.localDateTimeFormatyMdHms(localDateTime)); 23 | LocalDateTime localDateTime1 = DateUtil.fromTimeStamp(date.getTime() / 1000); 24 | System.out.println(DateUtil.localDateTimeFormatyMdHms(localDateTime1)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/MonitorService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service; 17 | 18 | import java.util.Map; 19 | 20 | /** 21 | * @author Zheng Jie 22 | * @date 2020-05-02 23 | */ 24 | public interface MonitorService { 25 | 26 | /** 27 | * 查询数据分页 28 | * @return Map 29 | */ 30 | Map getServers(); 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptSmallDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import java.io.Serializable; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * @date 2019-6-10 16:32:18 24 | */ 25 | @Data 26 | public class DeptSmallDto implements Serializable { 27 | 28 | private Long id; 29 | 30 | private String name; 31 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * 公共查询类 24 | */ 25 | @Data 26 | public class DictQueryCriteria { 27 | 28 | @Query(blurry = "name,description") 29 | private String blurry; 30 | } 31 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.Setter; 20 | import java.io.Serializable; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2019-04-10 25 | */ 26 | @Getter 27 | @Setter 28 | public class DictSmallDto implements Serializable { 29 | 30 | private Long id; 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.websocket; 17 | 18 | import lombok.Data; 19 | 20 | /** 21 | * @author ZhangHouYing 22 | * @date 2019-08-10 9:55 23 | */ 24 | @Data 25 | public class SocketMsg { 26 | private String msg; 27 | private MsgType msgType; 28 | 29 | public SocketMsg(String msg, MsgType msgType) { 30 | this.msg = msg; 31 | this.msgType = msgType; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import lombok.NoArgsConstructor; 20 | import java.io.Serializable; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2019-6-10 16:32:18 25 | */ 26 | @Data 27 | @NoArgsConstructor 28 | public class JobSmallDto implements Serializable { 29 | 30 | private Long id; 31 | 32 | private String name; 33 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/DataService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service; 17 | 18 | import me.zhengjie.modules.system.service.dto.UserDto; 19 | import java.util.List; 20 | 21 | /** 22 | * 数据权限服务类 23 | * @author Zheng Jie 24 | * @date 2020-05-07 25 | */ 26 | public interface DataService { 27 | 28 | /** 29 | * 获取数据权限 30 | * @param user / 31 | * @return / 32 | */ 33 | List getDeptIds(UserDto user); 34 | } 35 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleSmallDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import java.io.Serializable; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * @date 2018-11-23 24 | */ 25 | @Data 26 | public class RoleSmallDto implements Serializable { 27 | 28 | private Long id; 29 | 30 | private String name; 31 | 32 | private Integer level; 33 | 34 | private String dataScope; 35 | } 36 | -------------------------------------------------------------------------------- /eladmin-logging/src/main/java/me/zhengjie/annotation/Log.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.annotation; 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * @author Zheng Jie 25 | * @date 2018-11-24 26 | */ 27 | @Target(ElementType.METHOD) 28 | @Retention(RetentionPolicy.RUNTIME) 29 | public @interface Log { 30 | String value() default ""; 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.repository; 17 | 18 | import me.zhengjie.domain.LocalStorage; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2019-09-05 25 | */ 26 | public interface LocalStorageRepository extends JpaRepository, JpaSpecificationExecutor { 27 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.repository; 17 | 18 | import me.zhengjie.modules.mnt.domain.App; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | /** 23 | * @author zhanghouying 24 | * @date 2019-08-24 25 | */ 26 | public interface AppRepository extends JpaRepository, JpaSpecificationExecutor { 27 | } 28 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.domain.vo; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import java.io.Serializable; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2018-12-20 25 | */ 26 | @Data 27 | @AllArgsConstructor 28 | public class MenuMetaVo implements Serializable { 29 | 30 | private String title; 31 | 32 | private String icon; 33 | 34 | private Boolean noCache; 35 | } 36 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * @date 2019-04-10 24 | */ 25 | @Data 26 | public class DictDetailQueryCriteria { 27 | 28 | @Query(type = Query.Type.INNER_LIKE) 29 | private String label; 30 | 31 | @Query(propName = "name",joinName = "dict") 32 | private String dictName; 33 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.repository; 17 | 18 | import me.zhengjie.modules.mnt.domain.Deploy; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | /** 23 | * @author zhanghouying 24 | * @date 2019-08-24 25 | */ 26 | public interface DeployRepository extends JpaRepository, JpaSpecificationExecutor { 27 | } 28 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.repository; 17 | 18 | import me.zhengjie.modules.mnt.domain.Database; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | /** 23 | * @author zhanghouying 24 | * @date 2019-08-24 25 | */ 26 | public interface DatabaseRepository extends JpaRepository, JpaSpecificationExecutor { 27 | } 28 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/base/BaseDTO.java: -------------------------------------------------------------------------------- 1 | package me.zhengjie.base; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.apache.commons.lang3.builder.ToStringBuilder; 6 | import java.io.Serializable; 7 | import java.lang.reflect.Field; 8 | import java.sql.Timestamp; 9 | 10 | /** 11 | * @author Zheng Jie 12 | * @date 2019年10月24日20:48:53 13 | */ 14 | @Getter 15 | @Setter 16 | public class BaseDTO implements Serializable { 17 | 18 | private String createBy; 19 | 20 | private String updatedBy; 21 | 22 | private Timestamp createTime; 23 | 24 | private Timestamp updateTime; 25 | 26 | @Override 27 | public String toString() { 28 | ToStringBuilder builder = new ToStringBuilder(this); 29 | Field[] fields = this.getClass().getDeclaredFields(); 30 | try { 31 | for (Field f : fields) { 32 | f.setAccessible(true); 33 | builder.append(f.getName(), f.get(this)).append("\n"); 34 | } 35 | } catch (Exception e) { 36 | builder.append("toString builder encounter an error"); 37 | } 38 | return builder.toString(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /eladmin-generator/src/main/java/me/zhengjie/repository/GenConfigRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.repository; 17 | 18 | import me.zhengjie.domain.GenConfig; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * @date 2019-01-14 24 | */ 25 | public interface GenConfigRepository extends JpaRepository { 26 | 27 | /** 28 | * 查询表配置 29 | * @param tableName 表名 30 | * @return / 31 | */ 32 | GenConfig findByTableName(String tableName); 33 | } 34 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzLogRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.quartz.repository; 17 | 18 | import me.zhengjie.modules.quartz.domain.QuartzLog; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2019-01-07 25 | */ 26 | public interface QuartzLogRepository extends JpaRepository, JpaSpecificationExecutor { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /eladmin-common/src/test/java/me/zhengjie/utils/FileUtilTest.java: -------------------------------------------------------------------------------- 1 | package me.zhengjie.utils; 2 | 3 | import org.junit.Test; 4 | import org.springframework.mock.web.MockMultipartFile; 5 | 6 | import static org.junit.Assert.*; 7 | import static me.zhengjie.utils.FileUtil.*; 8 | 9 | public class FileUtilTest { 10 | 11 | @Test 12 | public void testToFile() { 13 | long retval = toFile(new MockMultipartFile("foo", (byte[]) null)).getTotalSpace(); 14 | assertEquals(500695072768L, retval); 15 | } 16 | 17 | @Test 18 | public void testGetExtensionName() { 19 | assertEquals("foo", getExtensionName("foo")); 20 | assertEquals("exe", getExtensionName("bar.exe")); 21 | } 22 | 23 | @Test 24 | public void testGetFileNameNoEx() { 25 | assertEquals("foo", getFileNameNoEx("foo")); 26 | assertEquals("bar", getFileNameNoEx("bar.txt")); 27 | } 28 | 29 | @Test 30 | public void testGetSize() { 31 | assertEquals("1000B ", getSize(1000)); 32 | assertEquals("1.00KB ", getSize(1024)); 33 | assertEquals("1.00MB ", getSize(1048576)); 34 | assertEquals("1.00GB ", getSize(1073741824)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.repository; 17 | 18 | import me.zhengjie.modules.mnt.domain.DeployHistory; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | /** 23 | * @author zhanghouying 24 | * @date 2019-08-24 25 | */ 26 | public interface DeployHistoryRepository extends JpaRepository, JpaSpecificationExecutor { 27 | } 28 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | 21 | import java.sql.Timestamp; 22 | import java.util.List; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-6-4 09:54:37 27 | */ 28 | @Data 29 | public class QiniuQueryCriteria{ 30 | 31 | @Query(type = Query.Type.INNER_LIKE) 32 | private String key; 33 | 34 | @Query(type = Query.Type.BETWEEN) 35 | private List createTime; 36 | } 37 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCodeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.security.config.bean; 17 | 18 | /** 19 | * 验证码配置枚举 20 | * 21 | * @author: liaojinlong 22 | * @date: 2020/6/10 17:40 23 | */ 24 | 25 | public enum LoginCodeEnum { 26 | /** 27 | * 算数 28 | */ 29 | arithmetic, 30 | /** 31 | * 中文 32 | */ 33 | chinese, 34 | /** 35 | * 中文闪图 36 | */ 37 | chinese_gif, 38 | /** 39 | * 闪图 40 | */ 41 | gif, 42 | spec 43 | } 44 | -------------------------------------------------------------------------------- /eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogErrorMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.domain.Log; 20 | import me.zhengjie.service.dto.LogErrorDTO; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-5-22 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface LogErrorMapper extends BaseMapper { 30 | 31 | } -------------------------------------------------------------------------------- /eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogSmallMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.domain.Log; 20 | import me.zhengjie.service.dto.LogSmallDTO; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-5-22 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface LogSmallMapper extends BaseMapper { 30 | 31 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | 21 | import java.sql.Timestamp; 22 | import java.util.List; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * 公共查询类 27 | */ 28 | @Data 29 | public class RoleQueryCriteria { 30 | 31 | @Query(blurry = "name,description") 32 | private String blurry; 33 | 34 | @Query(type = Query.Type.BETWEEN) 35 | private List createTime; 36 | } 37 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.dto; 17 | 18 | import lombok.Data; 19 | import java.sql.Timestamp; 20 | import java.util.List; 21 | 22 | import me.zhengjie.annotation.Query; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-09-05 27 | */ 28 | @Data 29 | public class LocalStorageQueryCriteria{ 30 | 31 | @Query(blurry = "name,suffix,type,createBy,size") 32 | private String blurry; 33 | 34 | @Query(type = Query.Type.BETWEEN) 35 | private List createTime; 36 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.security.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.Setter; 20 | import javax.validation.constraints.NotBlank; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2018-11-30 25 | */ 26 | @Getter 27 | @Setter 28 | public class AuthUserDto { 29 | 30 | @NotBlank 31 | private String username; 32 | 33 | @NotBlank 34 | private String password; 35 | 36 | private String code; 37 | 38 | private String uuid = ""; 39 | } 40 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/config/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.config; 17 | 18 | import org.springframework.context.annotation.Bean; 19 | import org.springframework.context.annotation.Configuration; 20 | import org.springframework.web.socket.server.standard.ServerEndpointExporter; 21 | 22 | /** 23 | * @author ZhangHouYing 24 | * @date 2019-08-24 15:44 25 | */ 26 | @Configuration 27 | public class WebSocketConfig { 28 | 29 | @Bean 30 | public ServerEndpointExporter serverEndpointExporter() { 31 | return new ServerEndpointExporter(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /eladmin-logging/src/main/java/me/zhengjie/service/dto/LogSmallDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.dto; 17 | 18 | import lombok.Data; 19 | import java.io.Serializable; 20 | import java.sql.Timestamp; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2019-5-22 25 | */ 26 | @Data 27 | public class LogSmallDTO implements Serializable { 28 | 29 | private String description; 30 | 31 | private String requestIp; 32 | 33 | private Long time; 34 | 35 | private String address; 36 | 37 | private String browser; 38 | 39 | private Timestamp createTime; 40 | } 41 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.sql.Timestamp; 21 | import java.util.List; 22 | 23 | /** 24 | * @author zhanghouying 25 | * @date 2019-08-24 26 | */ 27 | @Data 28 | public class AppQueryCriteria{ 29 | 30 | /** 31 | * 模糊 32 | */ 33 | @Query(type = Query.Type.INNER_LIKE) 34 | private String name; 35 | 36 | @Query(type = Query.Type.BETWEEN) 37 | private List createTime; 38 | } 39 | -------------------------------------------------------------------------------- /eladmin-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.repository; 17 | 18 | import me.zhengjie.domain.ColumnInfo; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import java.util.List; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2019-01-14 25 | */ 26 | public interface ColumnInfoRepository extends JpaRepository { 27 | 28 | /** 29 | * 查询表信息 30 | * @param tableName 表格名 31 | * @return 表信息 32 | */ 33 | List findByTableNameOrderByIdAsc(String tableName); 34 | } 35 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/service/mapstruct/LocalStorageMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.service.dto.LocalStorageDto; 20 | import me.zhengjie.domain.LocalStorage; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-09-05 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface LocalStorageMapper extends BaseMapper { 30 | 31 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.Dept; 20 | import me.zhengjie.modules.system.service.dto.DeptDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-03-25 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface DeptMapper extends BaseMapper { 30 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/template/generator/admin/Mapper.ftl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ${package}.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import ${package}.domain.${className}; 20 | import ${package}.service.dto.${className}Dto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @website https://el-admin.vip 26 | * @author ${author} 27 | * @date ${date} 28 | **/ 29 | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) 30 | public interface ${className}Mapper extends BaseMapper<${className}Dto, ${className}> { 31 | 32 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.sql.Timestamp; 21 | import java.util.List; 22 | 23 | /** 24 | * @author zhanghouying 25 | * @date 2019-08-24 26 | */ 27 | @Data 28 | public class ServerDeployQueryCriteria{ 29 | 30 | /** 31 | * 模糊 32 | */ 33 | @Query(blurry = "name,ip,account") 34 | private String blurry; 35 | 36 | @Query(type = Query.Type.BETWEEN) 37 | private List createTime; 38 | } 39 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.Dict; 20 | import me.zhengjie.modules.system.service.dto.DictDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-04-10 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface DictMapper extends BaseMapper { 30 | 31 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.mnt.domain.App; 20 | import me.zhengjie.modules.mnt.service.dto.AppDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author zhanghouying 26 | * @date 2019-08-24 27 | */ 28 | @Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface AppMapper extends BaseMapper { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/MenuMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.Menu; 20 | import me.zhengjie.modules.system.service.dto.MenuDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2018-12-17 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface MenuMapper extends BaseMapper { 30 | } 31 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/ThrowableUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils; 17 | 18 | import java.io.PrintWriter; 19 | import java.io.StringWriter; 20 | 21 | /** 22 | * 异常工具 2019-01-06 23 | * @author Zheng Jie 24 | */ 25 | public class ThrowableUtil { 26 | 27 | /** 28 | * 获取堆栈信息 29 | */ 30 | public static String getStackTrace(Throwable throwable){ 31 | StringWriter sw = new StringWriter(); 32 | try (PrintWriter pw = new PrintWriter(sw)) { 33 | throwable.printStackTrace(pw); 34 | return sw.toString(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /eladmin-generator/src/main/java/me/zhengjie/service/GenConfigService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service; 17 | 18 | import me.zhengjie.domain.GenConfig; 19 | 20 | /** 21 | * @author Zheng Jie 22 | * @date 2019-01-14 23 | */ 24 | public interface GenConfigService { 25 | 26 | /** 27 | * 查询表配置 28 | * @param tableName 表名 29 | * @return 表配置 30 | */ 31 | GenConfig find(String tableName); 32 | 33 | /** 34 | * 更新表配置 35 | * @param tableName 表名 36 | * @param genConfig 表配置 37 | * @return 表配置 38 | */ 39 | GenConfig update(String tableName, GenConfig genConfig); 40 | } 41 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/VerifyService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service; 17 | 18 | import me.zhengjie.domain.vo.EmailVo; 19 | 20 | /** 21 | * @author Zheng Jie 22 | * @date 2018-12-26 23 | */ 24 | public interface VerifyService { 25 | 26 | /** 27 | * 发送验证码 28 | * @param email / 29 | * @param key / 30 | * @return / 31 | */ 32 | EmailVo sendEmail(String email, String key); 33 | 34 | 35 | /** 36 | * 验证 37 | * @param code / 38 | * @param key / 39 | */ 40 | void validated(String key, String code); 41 | } 42 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.Setter; 20 | import me.zhengjie.base.BaseDTO; 21 | import java.io.Serializable; 22 | 23 | /** 24 | * @author Zheng Jie 25 | * @date 2019-04-10 26 | */ 27 | @Getter 28 | @Setter 29 | public class DictDetailDto extends BaseDTO implements Serializable { 30 | 31 | private Long id; 32 | 33 | private DictSmallDto dict; 34 | 35 | private String label; 36 | 37 | private String value; 38 | 39 | private Integer dictSort; 40 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.Setter; 20 | import me.zhengjie.base.BaseDTO; 21 | import java.io.Serializable; 22 | import java.util.List; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-04-10 27 | */ 28 | @Getter 29 | @Setter 30 | public class DictDto extends BaseDTO implements Serializable { 31 | 32 | private Long id; 33 | 34 | private List dictDetails; 35 | 36 | private String name; 37 | 38 | private String description; 39 | } 40 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.Job; 20 | import me.zhengjie.modules.system.service.dto.JobDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-03-29 27 | */ 28 | @Mapper(componentModel = "spring",uses = {DeptMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface JobMapper extends BaseMapper { 30 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.Job; 20 | import me.zhengjie.modules.system.service.dto.JobSmallDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-03-29 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface JobSmallMapper extends BaseMapper { 30 | 31 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/TestTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.quartz.task; 17 | 18 | import lombok.extern.slf4j.Slf4j; 19 | import org.springframework.stereotype.Component; 20 | 21 | /** 22 | * 测试用 23 | * @author Zheng Jie 24 | * @date 2019-01-08 25 | */ 26 | @Slf4j 27 | @Component 28 | public class TestTask { 29 | 30 | public void run(){ 31 | log.info("run 执行成功"); 32 | } 33 | 34 | public void run1(String str){ 35 | log.info("run1 执行成功,参数为: {}" + str); 36 | } 37 | 38 | public void run2(){ 39 | log.info("run2 执行成功"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptSmallMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.Dept; 20 | import me.zhengjie.modules.system.service.dto.DeptSmallDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-03-25 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface DeptSmallMapper extends BaseMapper { 30 | 31 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictSmallMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.Dict; 20 | import me.zhengjie.modules.system.service.dto.DictSmallDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-04-10 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface DictSmallMapper extends BaseMapper { 30 | 31 | } -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.Setter; 20 | import me.zhengjie.base.BaseDTO; 21 | import java.io.Serializable; 22 | 23 | /** 24 | * @author Zheng Jie 25 | * @date 2019-09-05 26 | */ 27 | @Getter 28 | @Setter 29 | public class LocalStorageDto extends BaseDTO implements Serializable { 30 | 31 | private Long id; 32 | 33 | private String realName; 34 | 35 | private String name; 36 | 37 | private String suffix; 38 | 39 | private String type; 40 | 41 | private String size; 42 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.mnt.domain.Database; 20 | import me.zhengjie.modules.mnt.service.dto.DatabaseDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author zhanghouying 26 | * @date 2019-08-24 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface DatabaseMapper extends BaseMapper { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleSmallMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.Role; 20 | import me.zhengjie.modules.system.service.dto.RoleSmallDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-5-23 27 | */ 28 | @Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface RoleSmallMapper extends BaseMapper { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.sql.Timestamp; 21 | import java.util.List; 22 | 23 | /** 24 | * @author zhanghouying 25 | * @date 2019-08-24 26 | */ 27 | @Data 28 | public class DeployQueryCriteria{ 29 | 30 | /** 31 | * 模糊 32 | */ 33 | @Query(type = Query.Type.INNER_LIKE, propName = "name", joinName = "app") 34 | private String appName; 35 | 36 | @Query(type = Query.Type.BETWEEN) 37 | private List createTime; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.quartz.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.sql.Timestamp; 21 | import java.util.List; 22 | 23 | /** 24 | * @author Zheng Jie 25 | * @date 2019-6-4 10:33:02 26 | */ 27 | @Data 28 | public class JobQueryCriteria { 29 | 30 | @Query(type = Query.Type.INNER_LIKE) 31 | private String jobName; 32 | 33 | @Query 34 | private Boolean isSuccess; 35 | 36 | @Query(type = Query.Type.BETWEEN) 37 | private List createTime; 38 | } 39 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/config/RsaProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.config; 17 | 18 | import lombok.Data; 19 | import org.springframework.beans.factory.annotation.Value; 20 | import org.springframework.stereotype.Component; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @website https://el-admin.vip 25 | * @description 26 | * @date 2020-05-18 27 | **/ 28 | @Data 29 | @Component 30 | public class RsaProperties { 31 | 32 | public static String privateKey; 33 | 34 | @Value("${rsa.private_key}") 35 | public void setPrivateKey(String privateKey) { 36 | RsaProperties.privateKey = privateKey; 37 | } 38 | } -------------------------------------------------------------------------------- /eladmin-logging/src/main/java/me/zhengjie/service/dto/LogQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.sql.Timestamp; 21 | import java.util.List; 22 | 23 | /** 24 | * 日志查询类 25 | * @author Zheng Jie 26 | * @date 2019-6-4 09:23:07 27 | */ 28 | @Data 29 | public class LogQueryCriteria { 30 | 31 | @Query(blurry = "username,description,address,requestIp,method,params") 32 | private String blurry; 33 | 34 | @Query 35 | private String logType; 36 | 37 | @Query(type = Query.Type.BETWEEN) 38 | private List createTime; 39 | } 40 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.sql.Timestamp; 21 | import java.util.List; 22 | 23 | /** 24 | * @author zhanghouying 25 | * @date 2019-08-24 26 | */ 27 | @Data 28 | public class DeployHistoryQueryCriteria{ 29 | 30 | /** 31 | * 精确 32 | */ 33 | @Query(blurry = "appName,ip,deployUser") 34 | private String blurry; 35 | 36 | @Query 37 | private Long deployId; 38 | 39 | @Query(type = Query.Type.BETWEEN) 40 | private List deployDate; 41 | } 42 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.mnt.domain.ServerDeploy; 20 | import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author zhanghouying 26 | * @date 2019-08-24 27 | */ 28 | @Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface ServerDeployMapper extends BaseMapper { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.Role; 20 | import me.zhengjie.modules.system.service.dto.RoleDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2018-11-23 27 | */ 28 | @Mapper(componentModel = "spring", uses = {MenuMapper.class, DeptMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface RoleMapper extends BaseMapper { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.mnt.domain.Deploy; 20 | import me.zhengjie.modules.mnt.service.dto.DeployDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author zhanghouying 26 | * @date 2019-08-24 27 | */ 28 | @Mapper(componentModel = "spring",uses = {AppMapper.class, ServerDeployMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface DeployMapper extends BaseMapper { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.repository; 17 | 18 | import me.zhengjie.domain.QiniuContent; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2018-12-31 25 | */ 26 | public interface QiniuContentRepository extends JpaRepository, JpaSpecificationExecutor { 27 | 28 | /** 29 | * 根据key查询 30 | * @param key 文件名 31 | * @return QiniuContent 32 | */ 33 | QiniuContent findByKey(String key); 34 | } 35 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.mnt.domain.DeployHistory; 20 | import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author zhanghouying 26 | * @date 2019-08-24 27 | */ 28 | @Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface DeployHistoryMapper extends BaseMapper { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.User; 20 | import me.zhengjie.modules.system.service.dto.UserDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2018-11-23 27 | */ 28 | @Mapper(componentModel = "spring",uses = {RoleMapper.class, DeptMapper.class, JobMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface UserMapper extends BaseMapper { 30 | } 31 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.sql.Timestamp; 21 | import java.util.List; 22 | 23 | /** 24 | * sm.ms图床 25 | * 26 | * @author Zheng Jie 27 | * @date 2019-6-4 09:52:09 28 | */ 29 | @Data 30 | public class PictureQueryCriteria{ 31 | 32 | @Query(type = Query.Type.INNER_LIKE) 33 | private String filename; 34 | 35 | @Query(type = Query.Type.INNER_LIKE) 36 | private String username; 37 | 38 | @Query(type = Query.Type.BETWEEN) 39 | private List createTime; 40 | } 41 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictDetailMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.mapstruct; 17 | 18 | import me.zhengjie.base.BaseMapper; 19 | import me.zhengjie.modules.system.domain.DictDetail; 20 | import me.zhengjie.modules.system.service.dto.DictDetailDto; 21 | import org.mapstruct.Mapper; 22 | import org.mapstruct.ReportingPolicy; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-04-10 27 | */ 28 | @Mapper(componentModel = "spring", uses = {DictSmallMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE) 29 | public interface DictDetailMapper extends BaseMapper { 30 | 31 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.sql.Timestamp; 21 | import java.util.List; 22 | 23 | /** 24 | * @author zhanghouying 25 | * @date 2019-08-24 26 | */ 27 | @Data 28 | public class DatabaseQueryCriteria{ 29 | 30 | /** 31 | * 模糊 32 | */ 33 | @Query(type = Query.Type.INNER_LIKE) 34 | private String name; 35 | 36 | /** 37 | * 精确 38 | */ 39 | @Query 40 | private String jdbcUrl; 41 | 42 | @Query(type = Query.Type.BETWEEN) 43 | private List createTime; 44 | } 45 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import lombok.NoArgsConstructor; 20 | import me.zhengjie.annotation.Query; 21 | import java.sql.Timestamp; 22 | import java.util.List; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-6-4 14:49:34 27 | */ 28 | @Data 29 | @NoArgsConstructor 30 | public class JobQueryCriteria { 31 | 32 | @Query(type = Query.Type.INNER_LIKE) 33 | private String name; 34 | 35 | @Query 36 | private Boolean enabled; 37 | 38 | @Query(type = Query.Type.BETWEEN) 39 | private List createTime; 40 | } -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/RequestHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils; 17 | 18 | import org.springframework.web.context.request.RequestContextHolder; 19 | import org.springframework.web.context.request.ServletRequestAttributes; 20 | import javax.servlet.http.HttpServletRequest; 21 | import java.util.Objects; 22 | 23 | /** 24 | * 获取 HttpServletRequest 25 | * @author Zheng Jie 26 | * @date 2018-11-24 27 | */ 28 | public class RequestHolder { 29 | 30 | public static HttpServletRequest getHttpServletRequest() { 31 | return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /eladmin-logging/src/main/java/me/zhengjie/service/dto/LogErrorDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service.dto; 17 | 18 | import lombok.Data; 19 | import java.io.Serializable; 20 | import java.sql.Timestamp; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2019-5-22 25 | */ 26 | @Data 27 | public class LogErrorDTO implements Serializable { 28 | 29 | private Long id; 30 | 31 | private String username; 32 | 33 | private String description; 34 | 35 | private String method; 36 | 37 | private String params; 38 | 39 | private String browser; 40 | 41 | private String requestIp; 42 | 43 | private String address; 44 | 45 | private Timestamp createTime; 46 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.repository; 17 | 18 | import me.zhengjie.modules.mnt.domain.ServerDeploy; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | /** 23 | * @author zhanghouying 24 | * @date 2019-08-24 25 | */ 26 | public interface ServerDeployRepository extends JpaRepository, JpaSpecificationExecutor { 27 | 28 | /** 29 | * 根据IP查询 30 | * @param ip / 31 | * @return / 32 | */ 33 | ServerDeploy findByIp(String ip); 34 | } 35 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzJobRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.quartz.repository; 17 | 18 | import me.zhengjie.modules.quartz.domain.QuartzJob; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | import java.util.List; 22 | 23 | /** 24 | * @author Zheng Jie 25 | * @date 2019-01-07 26 | */ 27 | public interface QuartzJobRepository extends JpaRepository, JpaSpecificationExecutor { 28 | 29 | /** 30 | * 查询启用的任务 31 | * @return List 32 | */ 33 | List findByIsPauseIsFalse(); 34 | } 35 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils; 17 | 18 | /** 19 | * 支付状态 20 | * @author zhengjie 21 | * @date 2018/08/01 16:45:43 22 | */ 23 | public enum AliPayStatusEnum { 24 | 25 | /** 交易成功 */ 26 | FINISHED("TRADE_FINISHED"), 27 | 28 | /** 支付成功 */ 29 | SUCCESS("TRADE_SUCCESS"), 30 | 31 | /** 交易创建 */ 32 | BUYER_PAY("WAIT_BUYER_PAY"), 33 | 34 | /** 交易关闭 */ 35 | CLOSED("TRADE_CLOSED"); 36 | 37 | private final String value; 38 | 39 | AliPayStatusEnum(String value) { 40 | this.value = value; 41 | } 42 | 43 | public String getValue() { 44 | return value; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /eladmin-generator/src/main/java/me/zhengjie/domain/vo/TableInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.domain.vo; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | 22 | /** 23 | * 表的数据信息 24 | * @author Zheng Jie 25 | * @date 2019-01-02 26 | */ 27 | @Data 28 | @AllArgsConstructor 29 | @NoArgsConstructor 30 | public class TableInfo { 31 | 32 | /** 表名称 */ 33 | private Object tableName; 34 | 35 | /** 创建日期 */ 36 | private Object createTime; 37 | 38 | /** 数据库引擎 */ 39 | private Object engine; 40 | 41 | /** 编码集 */ 42 | private Object coding; 43 | 44 | /** 备注 */ 45 | private Object remark; 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.repository; 17 | 18 | import me.zhengjie.domain.QiniuConfig; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.Modifying; 21 | import org.springframework.data.jpa.repository.Query; 22 | 23 | /** 24 | * @author Zheng Jie 25 | * @date 2018-12-31 26 | */ 27 | public interface QiNiuConfigRepository extends JpaRepository { 28 | 29 | /** 30 | * 编辑类型 31 | * @param type 32 | */ 33 | @Modifying 34 | @Query(value = "update QiniuConfig set type = ?1") 35 | void update(String type); 36 | } 37 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/CallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package me.zhengjie.utils; 18 | 19 | /** 20 | * @author: liaojinlong 21 | * @date: 2020/6/9 17:02 22 | * @since: 1.0 23 | * @see {@link SpringContextHolder} 24 | * 针对某些初始化方法,在SpringContextHolder 初始化前时,
25 | * 可提交一个 提交回调任务。
26 | * 在SpringContextHolder 初始化后,进行回调使用 27 | */ 28 | 29 | public interface CallBack { 30 | /** 31 | * 回调执行方法 32 | */ 33 | void executor(); 34 | 35 | /** 36 | * 本回调任务名称 37 | * @return / 38 | */ 39 | default String getCallBackName() { 40 | return Thread.currentThread().getId() + ":" + this.getClass().getName(); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/exception/EntityExistException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.exception; 17 | 18 | import org.springframework.util.StringUtils; 19 | 20 | /** 21 | * @author Zheng Jie 22 | * @date 2018-11-23 23 | */ 24 | public class EntityExistException extends RuntimeException { 25 | 26 | public EntityExistException(Class clazz, String field, String val) { 27 | super(EntityExistException.generateMessage(clazz.getSimpleName(), field, val)); 28 | } 29 | 30 | private static String generateMessage(String entity, String field, String val) { 31 | return StringUtils.capitalize(entity) 32 | + " with " + field + " "+ val + " existed"; 33 | } 34 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.config.thread; 17 | 18 | import lombok.Data; 19 | import org.springframework.boot.context.properties.ConfigurationProperties; 20 | import org.springframework.stereotype.Component; 21 | 22 | /** 23 | * 线程池配置属性类 24 | * @author https://juejin.im/entry/5abb8f6951882555677e9da2 25 | * @date 2019年10月31日14:58:18 26 | */ 27 | @Data 28 | @Component 29 | @ConfigurationProperties(prefix = "task.pool") 30 | public class AsyncTaskProperties { 31 | 32 | private int corePoolSize; 33 | 34 | private int maxPoolSize; 35 | 36 | private int keepAliveSeconds; 37 | 38 | private int queueCapacity; 39 | } 40 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.domain.vo; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | import javax.validation.constraints.NotBlank; 22 | import javax.validation.constraints.NotEmpty; 23 | import java.util.List; 24 | 25 | /** 26 | * 发送邮件时,接收参数的类 27 | * @author 郑杰 28 | * @date 2018/09/28 12:02:14 29 | */ 30 | @Data 31 | @AllArgsConstructor 32 | @NoArgsConstructor 33 | public class EmailVo { 34 | 35 | /** 收件人,支持多个收件人 */ 36 | @NotEmpty 37 | private List tos; 38 | 39 | @NotBlank 40 | private String subject; 41 | 42 | @NotBlank 43 | private String content; 44 | } 45 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.sql.Timestamp; 21 | import java.util.List; 22 | 23 | /** 24 | * @author Zheng Jie 25 | * 公共查询类 26 | */ 27 | @Data 28 | public class MenuQueryCriteria { 29 | 30 | @Query(blurry = "title,component,permission") 31 | private String blurry; 32 | 33 | @Query(type = Query.Type.BETWEEN) 34 | private List createTime; 35 | 36 | @Query(type = Query.Type.IS_NULL, propName = "pid") 37 | private Boolean pidIsNull; 38 | 39 | @Query 40 | private Long pid; 41 | } 42 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/exception/BadRequestException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.exception; 17 | 18 | import lombok.Getter; 19 | import org.springframework.http.HttpStatus; 20 | import static org.springframework.http.HttpStatus.BAD_REQUEST; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2018-11-23 25 | * 统一异常处理 26 | */ 27 | @Getter 28 | public class BadRequestException extends RuntimeException{ 29 | 30 | private Integer status = BAD_REQUEST.value(); 31 | 32 | public BadRequestException(String msg){ 33 | super(msg); 34 | } 35 | 36 | public BadRequestException(HttpStatus status,String msg){ 37 | super(msg); 38 | this.status = status.value(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.exception; 17 | 18 | import org.springframework.util.StringUtils; 19 | 20 | /** 21 | * @author Zheng Jie 22 | * @date 2018-11-23 23 | */ 24 | public class EntityNotFoundException extends RuntimeException { 25 | 26 | public EntityNotFoundException(Class clazz, String field, String val) { 27 | super(EntityNotFoundException.generateMessage(clazz.getSimpleName(), field, val)); 28 | } 29 | 30 | private static String generateMessage(String entity, String field, String val) { 31 | return StringUtils.capitalize(entity) 32 | + " with " + field + " "+ val + " does not exist"; 33 | } 34 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictDetailRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.repository; 17 | 18 | import me.zhengjie.modules.system.domain.DictDetail; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-04-10 27 | */ 28 | public interface DictDetailRepository extends JpaRepository, JpaSpecificationExecutor { 29 | 30 | /** 31 | * 根据字典名称查询 32 | * @param name / 33 | * @return / 34 | */ 35 | List findByDictName(String name); 36 | } -------------------------------------------------------------------------------- /eladmin-system/src/test/java/me/zhengjie/LoginCacheTest.java: -------------------------------------------------------------------------------- 1 | package me.zhengjie; 2 | 3 | import me.zhengjie.modules.security.service.UserDetailsServiceImpl; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.context.junit4.SpringRunner; 8 | import javax.annotation.Resource; 9 | 10 | @RunWith(SpringRunner.class) 11 | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) 12 | public class LoginCacheTest { 13 | 14 | @Resource(name = "userDetailsService") 15 | private UserDetailsServiceImpl userDetailsService; 16 | 17 | @Test 18 | public void testCache() { 19 | long start1 = System.currentTimeMillis(); 20 | int size = 10000; 21 | for (int i = 0; i < size; i++) { 22 | userDetailsService.loadUserByUsername("admin"); 23 | } 24 | long end1 = System.currentTimeMillis(); 25 | //关闭缓存 26 | userDetailsService.setEnableCache(false); 27 | long start2 = System.currentTimeMillis(); 28 | for (int i = 0; i < size; i++) { 29 | userDetailsService.loadUserByUsername("admin"); 30 | } 31 | long end2 = System.currentTimeMillis(); 32 | System.out.print("使用缓存:" + (end1 - start1) + "毫秒\n 不使用缓存:" + (end2 - start2) + "毫秒"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/ElAdminConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils; 17 | 18 | /** 19 | * 常用静态常量 20 | * 21 | * @author Zheng Jie 22 | * @date 2018-12-26 23 | */ 24 | public class ElAdminConstant { 25 | 26 | /** 27 | * 用于IP定位转换 28 | */ 29 | public static final String REGION = "内网IP|内网IP"; 30 | /** 31 | * win 系统 32 | */ 33 | public static final String WIN = "win"; 34 | 35 | /** 36 | * mac 系统 37 | */ 38 | public static final String MAC = "mac"; 39 | 40 | /** 41 | * 常用接口 42 | */ 43 | public static class Url { 44 | // IP归属地查询 45 | public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp?ip=%s&json=true"; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.NoArgsConstructor; 20 | import lombok.Setter; 21 | import me.zhengjie.base.BaseDTO; 22 | 23 | import java.io.Serializable; 24 | 25 | /** 26 | * @author Zheng Jie 27 | * @date 2019-03-29 28 | */ 29 | @Getter 30 | @Setter 31 | @NoArgsConstructor 32 | public class JobDto extends BaseDTO implements Serializable { 33 | 34 | private Long id; 35 | 36 | private Integer jobSort; 37 | 38 | private String name; 39 | 40 | private Boolean enabled; 41 | 42 | public JobDto(String name, Boolean enabled) { 43 | this.name = name; 44 | this.enabled = enabled; 45 | } 46 | } -------------------------------------------------------------------------------- /eladmin-common/src/test/java/me/zhengjie/utils/StringUtilsTest.java: -------------------------------------------------------------------------------- 1 | package me.zhengjie.utils; 2 | 3 | import org.junit.Test; 4 | import org.springframework.mock.web.MockHttpServletRequest; 5 | 6 | import java.text.SimpleDateFormat; 7 | import java.util.*; 8 | 9 | import static me.zhengjie.utils.StringUtils.*; 10 | import static org.junit.Assert.*; 11 | 12 | public class StringUtilsTest { 13 | 14 | @Test 15 | public void testToCamelCase() { 16 | assertNull(toCamelCase(null)); 17 | } 18 | 19 | @Test 20 | public void testToCapitalizeCamelCase() { 21 | assertNull(StringUtils.toCapitalizeCamelCase(null)); 22 | assertEquals("HelloWorld", toCapitalizeCamelCase("hello_world")); 23 | } 24 | 25 | @Test 26 | public void testToUnderScoreCase() { 27 | assertNull(StringUtils.toUnderScoreCase(null)); 28 | assertEquals("hello_world", toUnderScoreCase("helloWorld")); 29 | assertEquals("\u0000\u0000", toUnderScoreCase("\u0000\u0000")); 30 | assertEquals("\u0000_a", toUnderScoreCase("\u0000A")); 31 | } 32 | 33 | @Test 34 | public void testGetWeekDay() { 35 | SimpleDateFormat simpleDateformat = new SimpleDateFormat("E"); 36 | assertEquals(simpleDateformat.format(new Date()), getWeekDay()); 37 | } 38 | 39 | @Test 40 | public void testGetIP() { 41 | assertEquals("127.0.0.1", getIp(new MockHttpServletRequest())); 42 | } 43 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.Setter; 20 | import me.zhengjie.base.BaseDTO; 21 | import java.io.Serializable; 22 | 23 | /** 24 | * @author zhanghouying 25 | * @date 2019-08-24 26 | */ 27 | @Getter 28 | @Setter 29 | public class DatabaseDto extends BaseDTO implements Serializable { 30 | 31 | /** 32 | * id 33 | */ 34 | private String id; 35 | 36 | /** 37 | * 数据库名称 38 | */ 39 | private String name; 40 | 41 | /** 42 | * 数据库连接地址 43 | */ 44 | private String jdbcUrl; 45 | 46 | /** 47 | * 数据库密码 48 | */ 49 | private String pwd; 50 | 51 | /** 52 | * 用户名 53 | */ 54 | private String userName; 55 | } 56 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.repository; 17 | 18 | import me.zhengjie.modules.system.domain.Job; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | import java.util.Set; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-03-29 27 | */ 28 | public interface JobRepository extends JpaRepository, JpaSpecificationExecutor { 29 | 30 | /** 31 | * 根据名称查询 32 | * @param name 名称 33 | * @return / 34 | */ 35 | Job findByName(String name); 36 | 37 | /** 38 | * 根据Id删除 39 | * @param ids / 40 | */ 41 | void deleteAllByIdIn(Set ids); 42 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.dto; 17 | 18 | import lombok.Data; 19 | import java.io.Serializable; 20 | import java.sql.Timestamp; 21 | 22 | /** 23 | * @author zhanghouying 24 | * @date 2019-08-24 25 | */ 26 | @Data 27 | public class DeployHistoryDto implements Serializable { 28 | 29 | /** 30 | * 编号 31 | */ 32 | private String id; 33 | 34 | /** 35 | * 应用名称 36 | */ 37 | private String appName; 38 | 39 | /** 40 | * 部署IP 41 | */ 42 | private String ip; 43 | 44 | /** 45 | * 部署时间 46 | */ 47 | private Timestamp deployDate; 48 | 49 | /** 50 | * 部署人员 51 | */ 52 | private String deployUser; 53 | 54 | /** 55 | * 部署编号 56 | */ 57 | private Long deployId; 58 | } 59 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.domain.vo; 17 | 18 | import com.fasterxml.jackson.annotation.JsonInclude; 19 | import lombok.Data; 20 | 21 | import java.io.Serializable; 22 | import java.util.List; 23 | 24 | /** 25 | * 构建前端路由时用到 26 | * @author Zheng Jie 27 | * @date 2018-12-20 28 | */ 29 | @Data 30 | @JsonInclude(JsonInclude.Include.NON_EMPTY) 31 | public class MenuVo implements Serializable { 32 | 33 | private String name; 34 | 35 | private String path; 36 | 37 | private Boolean hidden; 38 | 39 | private String redirect; 40 | 41 | private String component; 42 | 43 | private Boolean alwaysShow; 44 | 45 | private MenuMetaVo meta; 46 | 47 | private List children; 48 | } 49 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/base/BaseMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.base; 17 | 18 | import java.util.List; 19 | 20 | /** 21 | * @author Zheng Jie 22 | * @date 2018-11-23 23 | */ 24 | public interface BaseMapper { 25 | 26 | /** 27 | * DTO转Entity 28 | * @param dto / 29 | * @return / 30 | */ 31 | E toEntity(D dto); 32 | 33 | /** 34 | * Entity转DTO 35 | * @param entity / 36 | * @return / 37 | */ 38 | D toDto(E entity); 39 | 40 | /** 41 | * DTO集合转Entity集合 42 | * @param dtoList / 43 | * @return / 44 | */ 45 | List toEntity(List dtoList); 46 | 47 | /** 48 | * Entity集合转DTO集合 49 | * @param entityList / 50 | * @return / 51 | */ 52 | List toDto(List entityList); 53 | } 54 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.repository; 17 | 18 | import me.zhengjie.modules.system.domain.Dict; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | import java.util.List; 23 | import java.util.Set; 24 | 25 | /** 26 | * @author Zheng Jie 27 | * @date 2019-04-10 28 | */ 29 | public interface DictRepository extends JpaRepository, JpaSpecificationExecutor { 30 | 31 | /** 32 | * 删除 33 | * @param ids / 34 | */ 35 | void deleteByIdIn(Set ids); 36 | 37 | /** 38 | * 查询 39 | * @param ids / 40 | * @return / 41 | */ 42 | List findByIdIn(Set ids); 43 | } -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeBiEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils.enums; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Getter; 20 | 21 | /** 22 | *

23 | * 验证码业务场景 24 | *

25 | * @author Zheng Jie 26 | * @date 2020-05-02 27 | */ 28 | @Getter 29 | @AllArgsConstructor 30 | public enum CodeBiEnum { 31 | 32 | /* 旧邮箱修改邮箱 */ 33 | ONE(1, "旧邮箱修改邮箱"), 34 | 35 | /* 通过邮箱修改密码 */ 36 | TWO(2, "通过邮箱修改密码"); 37 | 38 | private final Integer code; 39 | private final String description; 40 | 41 | public static CodeBiEnum find(Integer code) { 42 | for (CodeBiEnum value : CodeBiEnum.values()) { 43 | if (code.equals(value.getCode())) { 44 | return value; 45 | } 46 | } 47 | return null; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/annotation/Limit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.annotation; 17 | 18 | import me.zhengjie.aspect.LimitType; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author jacky 26 | */ 27 | @Target(ElementType.METHOD) 28 | @Retention(RetentionPolicy.RUNTIME) 29 | public @interface Limit { 30 | 31 | // 资源名称,用于描述接口功能 32 | String name() default ""; 33 | 34 | // 资源 key 35 | String key() default ""; 36 | 37 | // key prefix 38 | String prefix() default ""; 39 | 40 | // 时间的,单位秒 41 | int period(); 42 | 43 | // 限制访问次数 44 | int count(); 45 | 46 | // 限制类型 47 | LimitType limitType() default LimitType.CUSTOMER; 48 | 49 | } 50 | -------------------------------------------------------------------------------- /eladmin-generator/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eladmin 7 | me.zhengjie 8 | 2.6 9 | 10 | 4.0.0 11 | 12 | eladmin-generator 13 | 代码生成模块 14 | 15 | 16 | 1.9 17 | 18 | 19 | 20 | 21 | me.zhengjie 22 | eladmin-common 23 | 2.6 24 | 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-freemarker 30 | 31 | 32 | 33 | 34 | commons-configuration 35 | commons-configuration 36 | ${configuration.version} 37 | 38 | 39 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.DataPermission; 20 | import me.zhengjie.annotation.Query; 21 | import java.sql.Timestamp; 22 | import java.util.List; 23 | 24 | /** 25 | * @author Zheng Jie 26 | * @date 2019-03-25 27 | */ 28 | @Data 29 | @DataPermission(fieldName = "id") 30 | public class DeptQueryCriteria{ 31 | 32 | @Query(type = Query.Type.INNER_LIKE) 33 | private String name; 34 | 35 | @Query 36 | private Boolean enabled; 37 | 38 | @Query 39 | private Long pid; 40 | 41 | @Query(type = Query.Type.IS_NULL, propName = "pid") 42 | private Boolean pidIsNull; 43 | 44 | @Query(type = Query.Type.BETWEEN) 45 | private List createTime; 46 | } -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils.enums; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Getter; 20 | 21 | /** 22 | *

23 | * 验证码业务场景对应的 Redis 中的 key 24 | *

25 | * @author Zheng Jie 26 | * @date 2020-05-02 27 | */ 28 | @Getter 29 | @AllArgsConstructor 30 | public enum CodeEnum { 31 | 32 | /* 通过手机号码重置邮箱 */ 33 | PHONE_RESET_EMAIL_CODE("phone_reset_email_code_", "通过手机号码重置邮箱"), 34 | 35 | /* 通过旧邮箱重置邮箱 */ 36 | EMAIL_RESET_EMAIL_CODE("email_reset_email_code_", "通过旧邮箱重置邮箱"), 37 | 38 | /* 通过手机号码重置密码 */ 39 | PHONE_RESET_PWD_CODE("phone_reset_pwd_code_", "通过手机号码重置密码"), 40 | 41 | /* 通过邮箱重置密码 */ 42 | EMAIL_RESET_PWD_CODE("email_reset_pwd_code_", "通过邮箱重置密码"); 43 | 44 | private final String key; 45 | private final String description; 46 | } 47 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/service/EmailService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service; 17 | 18 | import me.zhengjie.domain.vo.EmailVo; 19 | import me.zhengjie.domain.EmailConfig; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * @date 2018-12-26 24 | */ 25 | public interface EmailService { 26 | 27 | /** 28 | * 更新邮件配置 29 | * @param emailConfig 邮箱配置 30 | * @param old / 31 | * @return / 32 | * @throws Exception / 33 | */ 34 | EmailConfig config(EmailConfig emailConfig, EmailConfig old) throws Exception; 35 | 36 | /** 37 | * 查询配置 38 | * @return EmailConfig 邮件配置 39 | */ 40 | EmailConfig find(); 41 | 42 | /** 43 | * 发送邮件 44 | * @param emailVo 邮件发送的内容 45 | * @param emailConfig 邮件配置 46 | * @throws Exception / 47 | */ 48 | void send(EmailVo emailVo, EmailConfig emailConfig); 49 | } 50 | -------------------------------------------------------------------------------- /eladmin-logging/src/main/java/me/zhengjie/repository/LogRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.repository; 17 | 18 | import me.zhengjie.domain.Log; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | import org.springframework.data.jpa.repository.Modifying; 22 | import org.springframework.data.jpa.repository.Query; 23 | import org.springframework.stereotype.Repository; 24 | 25 | /** 26 | * @author Zheng Jie 27 | * @date 2018-11-24 28 | */ 29 | @Repository 30 | public interface LogRepository extends JpaRepository, JpaSpecificationExecutor { 31 | 32 | /** 33 | * 根据日志类型删除信息 34 | * @param logType 日志类型 35 | */ 36 | @Modifying 37 | @Query(value = "delete from sys_log where log_type = ?1", nativeQuery = true) 38 | void deleteByLogType(String logType); 39 | } 40 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/config/ElPermissionConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.config; 17 | 18 | import me.zhengjie.utils.SecurityUtils; 19 | import org.springframework.security.core.GrantedAuthority; 20 | import org.springframework.stereotype.Service; 21 | import java.util.Arrays; 22 | import java.util.List; 23 | import java.util.stream.Collectors; 24 | 25 | /** 26 | * @author Zheng Jie 27 | */ 28 | @Service(value = "el") 29 | public class ElPermissionConfig { 30 | 31 | public Boolean check(String ...permissions){ 32 | // 获取当前用户的所有权限 33 | List elPermissions = SecurityUtils.getCurrentUser().getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.toList()); 34 | // 判断当前用户的所有权限是否包含接口上定义的权限 35 | return elPermissions.contains("admin") || Arrays.stream(permissions).anyMatch(elPermissions::contains); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8000 3 | 4 | spring: 5 | freemarker: 6 | check-template-location: false 7 | profiles: 8 | active: dev 9 | jackson: 10 | time-zone: GMT+8 11 | data: 12 | redis: 13 | repositories: 14 | enabled: false 15 | 16 | #配置 Jpa 17 | jpa: 18 | properties: 19 | hibernate: 20 | ddl-auto: none 21 | dialect: org.hibernate.dialect.MySQL5InnoDBDialect 22 | open-in-view: true 23 | 24 | redis: 25 | #数据库索引 26 | database: ${REDIS_DB:0} 27 | host: ${REDIS_HOST:127.0.0.1} 28 | port: ${REDIS_PORT:6379} 29 | password: ${REDIS_PWD:} 30 | #连接超时时间 31 | timeout: 5000 32 | 33 | task: 34 | pool: 35 | # 核心线程池大小 36 | core-pool-size: 10 37 | # 最大线程数 38 | max-pool-size: 30 39 | # 活跃时间 40 | keep-alive-seconds: 60 41 | # 队列容量 42 | queue-capacity: 50 43 | 44 | #七牛云 45 | qiniu: 46 | # 文件大小 /M 47 | max-size: 15 48 | 49 | #邮箱验证码有效时间/秒 50 | code: 51 | expiration: 300 52 | 53 | #密码加密传输,前端公钥加密,后端私钥解密 54 | rsa: 55 | private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A== 56 | -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/template/generator/admin/Repository.ftl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ${package}.repository; 17 | 18 | import ${package}.domain.${className}; 19 | import org.springframework.data.jpa.repository.JpaRepository; 20 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 21 | 22 | /** 23 | * @website https://el-admin.vip 24 | * @author ${author} 25 | * @date ${date} 26 | **/ 27 | public interface ${className}Repository extends JpaRepository<${className}, ${pkColumnType}>, JpaSpecificationExecutor<${className}> { 28 | <#if columns??> 29 | <#list columns as column> 30 | <#if column.columnKey = 'UNI'> 31 | /** 32 | * 根据 ${column.capitalColumnName} 查询 33 | * @param ${column.columnName} / 34 | * @return / 35 | */ 36 | ${className} findBy${column.capitalColumnName}(${column.columnType} ${column.columnName}); 37 | 38 | 39 | 40 | } -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/config/AuditorConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.config; 17 | 18 | import me.zhengjie.utils.SecurityUtils; 19 | import org.springframework.data.domain.AuditorAware; 20 | import org.springframework.stereotype.Component; 21 | import java.util.Optional; 22 | 23 | /** 24 | * @description : 设置审计 25 | * @author : Dong ZhaoYang 26 | * @date : 2019/10/28 27 | */ 28 | @Component("auditorAware") 29 | public class AuditorConfig implements AuditorAware { 30 | 31 | /** 32 | * 返回操作员标志信息 33 | * 34 | * @return / 35 | */ 36 | @Override 37 | public Optional getCurrentAuditor() { 38 | try { 39 | // 这里应根据实际业务情况获取具体信息 40 | return Optional.of(SecurityUtils.getCurrentUsername()); 41 | }catch (Exception ignored){} 42 | // 用户定时任务,或者无Token调用的情况 43 | return Optional.of("System"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/ValidationUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils; 17 | 18 | import cn.hutool.core.util.ObjectUtil; 19 | import me.zhengjie.exception.BadRequestException; 20 | import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator; 21 | 22 | /** 23 | * 验证工具 24 | * @author Zheng Jie 25 | * @date 2018-11-23 26 | */ 27 | public class ValidationUtil{ 28 | 29 | /** 30 | * 验证空 31 | */ 32 | public static void isNull(Object obj, String entity, String parameter , Object value){ 33 | if(ObjectUtil.isNull(obj)){ 34 | String msg = entity + " 不存在: "+ parameter +" is "+ value; 35 | throw new BadRequestException(msg); 36 | } 37 | } 38 | 39 | /** 40 | * 验证是否为邮箱 41 | */ 42 | public static boolean isEmail(String email) { 43 | return new EmailValidator().isValid(email, null); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/enums/DataScopeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils.enums; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Getter; 20 | 21 | /** 22 | *

23 | * 数据权限枚举 24 | *

25 | * @author Zheng Jie 26 | * @date 2020-05-07 27 | */ 28 | @Getter 29 | @AllArgsConstructor 30 | public enum DataScopeEnum { 31 | 32 | /* 全部的数据权限 */ 33 | ALL("全部", "全部的数据权限"), 34 | 35 | /* 自己部门的数据权限 */ 36 | THIS_LEVEL("本级", "自己部门的数据权限"), 37 | 38 | /* 自定义的数据权限 */ 39 | CUSTOMIZE("自定义", "自定义的数据权限"); 40 | 41 | private final String value; 42 | private final String description; 43 | 44 | public static DataScopeEnum find(String val) { 45 | for (DataScopeEnum dataScopeEnum : DataScopeEnum.values()) { 46 | if (val.equals(dataScopeEnum.getValue())) { 47 | return dataScopeEnum; 48 | } 49 | } 50 | return null; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.annotation.Query; 20 | import java.io.Serializable; 21 | import java.sql.Timestamp; 22 | import java.util.HashSet; 23 | import java.util.List; 24 | import java.util.Set; 25 | 26 | /** 27 | * @author Zheng Jie 28 | * @date 2018-11-23 29 | */ 30 | @Data 31 | public class UserQueryCriteria implements Serializable { 32 | 33 | @Query 34 | private Long id; 35 | 36 | @Query(propName = "id", type = Query.Type.IN, joinName = "dept") 37 | private Set deptIds = new HashSet<>(); 38 | 39 | @Query(blurry = "email,username,nickName") 40 | private String blurry; 41 | 42 | @Query 43 | private Boolean enabled; 44 | 45 | private Long deptId; 46 | 47 | @Query(type = Query.Type.BETWEEN) 48 | private List createTime; 49 | } 50 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAccessDeniedHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.security.security; 17 | 18 | import org.springframework.security.access.AccessDeniedException; 19 | import org.springframework.security.web.access.AccessDeniedHandler; 20 | import org.springframework.stereotype.Component; 21 | 22 | import javax.servlet.http.HttpServletRequest; 23 | import javax.servlet.http.HttpServletResponse; 24 | import java.io.IOException; 25 | 26 | /** 27 | * @author Zheng Jie 28 | */ 29 | @Component 30 | public class JwtAccessDeniedHandler implements AccessDeniedHandler { 31 | 32 | @Override 33 | public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException { 34 | //当用户在没有授权的情况下访问受保护的REST资源时,将调用此方法发送403 Forbidden响应 35 | response.sendError(HttpServletResponse.SC_FORBIDDEN, accessDeniedException.getMessage()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/security/service/UserCacheClean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package me.zhengjie.modules.security.service; 18 | 19 | import me.zhengjie.utils.StringUtils; 20 | import org.springframework.stereotype.Component; 21 | 22 | /** 23 | * @author: liaojinlong 24 | * @date: 2020/6/11 18:01 25 | * @apiNote: 用于清理 用户登录信息缓存,为防止Spring循环依赖与安全考虑 ,单独构成工具类 26 | */ 27 | @Component 28 | public class UserCacheClean { 29 | 30 | /** 31 | * 清理特定用户缓存信息
32 | * 用户信息变更时 33 | * 34 | * @param userName / 35 | */ 36 | public void cleanUserCache(String userName) { 37 | if (StringUtils.isNotEmpty(userName)) { 38 | UserDetailsServiceImpl.userDtoCache.remove(userName); 39 | } 40 | } 41 | 42 | /** 43 | * 清理所有用户的缓存信息
44 | * ,如发生角色授权信息变化,可以简便的全部失效缓存 45 | */ 46 | public void cleanAll() { 47 | UserDetailsServiceImpl.userDtoCache.clear(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/annotation/DataPermission.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.annotation; 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | *

25 | * 用于判断是否过滤数据权限 26 | * 1、如果没有用到 @OneToOne 这种关联关系,只需要填写 fieldName [参考:DeptQueryCriteria.class] 27 | * 2、如果用到了 @OneToOne ,fieldName 和 joinName 都需要填写,拿UserQueryCriteria.class举例: 28 | * 应该是 @DataPermission(joinName = "dept", fieldName = "id") 29 | *

30 | * @author Zheng Jie 31 | * @website https://el-admin.vip 32 | * @date 2020-05-07 33 | **/ 34 | @Target(ElementType.TYPE) 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface DataPermission { 37 | 38 | /** 39 | * Entity 中的字段名称 40 | */ 41 | String fieldName() default ""; 42 | 43 | /** 44 | * Entity 中与部门关联的字段名称 45 | */ 46 | String joinName() default ""; 47 | } 48 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.Setter; 20 | import me.zhengjie.base.BaseDTO; 21 | import java.io.Serializable; 22 | 23 | /** 24 | * @author zhanghouying 25 | * @date 2019-08-24 26 | */ 27 | @Getter 28 | @Setter 29 | public class AppDto extends BaseDTO implements Serializable { 30 | 31 | /** 32 | * 应用编号 33 | */ 34 | private Long id; 35 | 36 | /** 37 | * 应用名称 38 | */ 39 | private String name; 40 | 41 | /** 42 | * 端口 43 | */ 44 | private Integer port; 45 | 46 | /** 47 | * 上传目录 48 | */ 49 | private String uploadPath; 50 | 51 | /** 52 | * 部署目录 53 | */ 54 | private String deployPath; 55 | 56 | /** 57 | * 备份目录 58 | */ 59 | private String backupPath; 60 | 61 | /** 62 | * 启动脚本 63 | */ 64 | private String startScript; 65 | 66 | /** 67 | * 部署脚本 68 | */ 69 | private String deployScript; 70 | 71 | } 72 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.security.config.bean; 17 | 18 | import lombok.Data; 19 | 20 | /** 21 | * 登录验证码配置信息 22 | * 23 | * @author: liaojinlong 24 | * @date: 2020/6/10 18:53 25 | */ 26 | @Data 27 | public class LoginCode { 28 | 29 | /** 30 | * 验证码配置 31 | */ 32 | private LoginCodeEnum codeType; 33 | /** 34 | * 验证码有效期 分钟 35 | */ 36 | private Long expiration = 2L; 37 | /** 38 | * 验证码内容长度 39 | */ 40 | private int length = 2; 41 | /** 42 | * 验证码宽度 43 | */ 44 | private int width = 111; 45 | /** 46 | * 验证码高度 47 | */ 48 | private int height = 36; 49 | /** 50 | * 验证码字体 51 | */ 52 | private String fontName; 53 | /** 54 | * 字体大小 55 | */ 56 | private int fontSize = 25; 57 | 58 | public LoginCodeEnum getCodeType() { 59 | return codeType; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/config/thread/ThreadPoolExecutorUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.config.thread; 17 | 18 | import me.zhengjie.utils.SpringContextHolder; 19 | 20 | import java.util.concurrent.ArrayBlockingQueue; 21 | import java.util.concurrent.ThreadPoolExecutor; 22 | import java.util.concurrent.TimeUnit; 23 | 24 | /** 25 | * 用于获取自定义线程池 26 | * @author Zheng Jie 27 | * @date 2019年10月31日18:16:47 28 | */ 29 | public class ThreadPoolExecutorUtil { 30 | 31 | public static ThreadPoolExecutor getPoll(){ 32 | AsyncTaskProperties properties = SpringContextHolder.getBean(AsyncTaskProperties.class); 33 | return new ThreadPoolExecutor( 34 | properties.getCorePoolSize(), 35 | properties.getMaxPoolSize(), 36 | properties.getKeepAliveSeconds(), 37 | TimeUnit.SECONDS, 38 | new ArrayBlockingQueue<>(properties.getQueueCapacity()), 39 | new TheadFactoryName() 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/exception/handler/ApiError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.exception.handler; 17 | 18 | import com.fasterxml.jackson.annotation.JsonFormat; 19 | import lombok.Data; 20 | import java.time.LocalDateTime; 21 | 22 | /** 23 | * @author Zheng Jie 24 | * @date 2018-11-23 25 | */ 26 | @Data 27 | class ApiError { 28 | 29 | private Integer status = 400; 30 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") 31 | private LocalDateTime timestamp; 32 | private String message; 33 | 34 | private ApiError() { 35 | timestamp = LocalDateTime.now(); 36 | } 37 | 38 | public static ApiError error(String message){ 39 | ApiError apiError = new ApiError(); 40 | apiError.setMessage(message); 41 | return apiError; 42 | } 43 | 44 | public static ApiError error(Integer status, String message){ 45 | ApiError apiError = new ApiError(); 46 | apiError.setStatus(status); 47 | apiError.setMessage(message); 48 | return apiError; 49 | } 50 | } 51 | 52 | 53 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAuthenticationEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.security.security; 17 | 18 | import org.springframework.security.core.AuthenticationException; 19 | import org.springframework.security.web.AuthenticationEntryPoint; 20 | import org.springframework.stereotype.Component; 21 | 22 | import javax.servlet.http.HttpServletRequest; 23 | import javax.servlet.http.HttpServletResponse; 24 | import java.io.IOException; 25 | 26 | /** 27 | * @author Zheng Jie 28 | */ 29 | @Component 30 | public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint { 31 | 32 | @Override 33 | public void commence(HttpServletRequest request, 34 | HttpServletResponse response, 35 | AuthenticationException authException) throws IOException { 36 | // 当用户尝试访问安全的REST资源而不提供任何凭据时,将调用此方法发送401 响应 37 | response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException==null?"Unauthorized":authException.getMessage()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/OnlineUserDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.security.service.dto; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Data; 20 | import lombok.NoArgsConstructor; 21 | import java.util.Date; 22 | 23 | /** 24 | * 在线用户 25 | * @author Zheng Jie 26 | */ 27 | @Data 28 | @AllArgsConstructor 29 | @NoArgsConstructor 30 | public class OnlineUserDto { 31 | 32 | /** 33 | * 用户名 34 | */ 35 | private String userName; 36 | 37 | /** 38 | * 昵称 39 | */ 40 | private String nickName; 41 | 42 | /** 43 | * 岗位 44 | */ 45 | private String dept; 46 | 47 | /** 48 | * 浏览器 49 | */ 50 | private String browser; 51 | 52 | /** 53 | * IP 54 | */ 55 | private String ip; 56 | 57 | /** 58 | * 地址 59 | */ 60 | private String address; 61 | 62 | /** 63 | * token 64 | */ 65 | private String key; 66 | 67 | /** 68 | * 登录时间 69 | */ 70 | private Date loginTime; 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | elAdmin 4 | 5 | 6 | 7 | 8 | 9 | 10 | ${log.pattern} 11 | ${log.charset} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MonitorController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.rest; 17 | 18 | import io.swagger.annotations.Api; 19 | import io.swagger.annotations.ApiOperation; 20 | import lombok.RequiredArgsConstructor; 21 | import me.zhengjie.modules.system.service.MonitorService; 22 | import org.springframework.http.HttpStatus; 23 | import org.springframework.http.ResponseEntity; 24 | import org.springframework.security.access.prepost.PreAuthorize; 25 | import org.springframework.web.bind.annotation.*; 26 | 27 | /** 28 | * @author Zheng Jie 29 | * @date 2020-05-02 30 | */ 31 | @RestController 32 | @RequiredArgsConstructor 33 | @Api(tags = "系统-服务监控管理") 34 | @RequestMapping("/api/monitor") 35 | public class MonitorController { 36 | 37 | private final MonitorService serverService; 38 | 39 | @GetMapping 40 | @ApiOperation("查询服务监控") 41 | @PreAuthorize("@el.check('monitor:list')") 42 | public ResponseEntity query(){ 43 | return new ResponseEntity<>(serverService.getServers(),HttpStatus.OK); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/service/AliPayService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.service; 17 | 18 | import me.zhengjie.domain.vo.TradeVo; 19 | import me.zhengjie.domain.AlipayConfig; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * @date 2018-12-31 24 | */ 25 | public interface AliPayService { 26 | 27 | /** 28 | * 查询配置 29 | * @return AlipayConfig 30 | */ 31 | AlipayConfig find(); 32 | 33 | /** 34 | * 更新配置 35 | * @param alipayConfig 支付宝配置 36 | * @return AlipayConfig 37 | */ 38 | AlipayConfig config(AlipayConfig alipayConfig); 39 | 40 | /** 41 | * 处理来自PC的交易请求 42 | * @param alipay 支付宝配置 43 | * @param trade 交易详情 44 | * @return String 45 | * @throws Exception 异常 46 | */ 47 | String toPayAsPc(AlipayConfig alipay, TradeVo trade) throws Exception; 48 | 49 | /** 50 | * 处理来自手机网页的交易请求 51 | * @param alipay 支付宝配置 52 | * @param trade 交易详情 53 | * @return String 54 | * @throws Exception 异常 55 | */ 56 | String toPayAsWeb(AlipayConfig alipay, TradeVo trade) throws Exception; 57 | } 58 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/security/config/ConfigBeanConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.security.config; 17 | 18 | import me.zhengjie.modules.security.config.bean.LoginProperties; 19 | import me.zhengjie.modules.security.config.bean.SecurityProperties; 20 | import org.springframework.boot.context.properties.ConfigurationProperties; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | 24 | /** 25 | * @apiNote 配置文件转换Pojo类的 统一配置 类 26 | * @author: liaojinlong 27 | * @date: 2020/6/10 19:04 28 | */ 29 | @Configuration 30 | public class ConfigBeanConfiguration { 31 | 32 | @Bean 33 | @ConfigurationProperties(prefix = "login", ignoreUnknownFields = true) 34 | public LoginProperties loginProperties() { 35 | return new LoginProperties(); 36 | } 37 | 38 | @Bean 39 | @ConfigurationProperties(prefix = "jwt", ignoreUnknownFields = true) 40 | public SecurityProperties securityProperties() { 41 | return new SecurityProperties(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/template/generator/admin/Dto.ftl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package ${package}.service.dto; 17 | 18 | import lombok.Data; 19 | <#if hasTimestamp> 20 | import java.sql.Timestamp; 21 | 22 | <#if hasBigDecimal> 23 | import java.math.BigDecimal; 24 | 25 | import java.io.Serializable; 26 | <#if !auto && pkColumnType = 'Long'> 27 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 28 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 29 | 30 | 31 | /** 32 | * @website https://el-admin.vip 33 | * @description / 34 | * @author ${author} 35 | * @date ${date} 36 | **/ 37 | @Data 38 | public class ${className}Dto implements Serializable { 39 | <#if columns??> 40 | <#list columns as column> 41 | 42 | <#if column.remark != ''> 43 | /** ${column.remark} */ 44 | 45 | <#if column.columnKey = 'PRI'> 46 | <#if !auto && pkColumnType = 'Long'> 47 | /** 防止精度丢失 */ 48 | @JsonSerialize(using= ToStringSerializer.class) 49 | 50 | 51 | private ${column.columnType} ${column.changeColumnName}; 52 | 53 | 54 | } -------------------------------------------------------------------------------- /eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils; 17 | 18 | import org.apache.commons.configuration.*; 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | 22 | /** 23 | * sql字段转java 24 | * 25 | * @author Zheng Jie 26 | * @date 2019-01-03 27 | */ 28 | public class ColUtil { 29 | private static final Logger log = LoggerFactory.getLogger(ColUtil.class); 30 | 31 | /** 32 | * 转换mysql数据类型为java数据类型 33 | * 34 | * @param type 数据库字段类型 35 | * @return String 36 | */ 37 | static String cloToJava(String type) { 38 | Configuration config = getConfig(); 39 | assert config != null; 40 | return config.getString(type, "unknowType"); 41 | } 42 | 43 | /** 44 | * 获取配置信息 45 | */ 46 | public static PropertiesConfiguration getConfig() { 47 | try { 48 | return new PropertiesConfiguration("generator.properties"); 49 | } catch (ConfigurationException e) { 50 | log.error(e.getMessage(), e); 51 | } 52 | return null; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.Setter; 20 | import me.zhengjie.base.BaseDTO; 21 | import java.io.Serializable; 22 | import java.util.Objects; 23 | 24 | /** 25 | * @author zhanghouying 26 | * @date 2019-08-24 27 | */ 28 | @Getter 29 | @Setter 30 | public class ServerDeployDto extends BaseDTO implements Serializable { 31 | 32 | private Long id; 33 | 34 | private String name; 35 | 36 | private String ip; 37 | 38 | private Integer port; 39 | 40 | private String account; 41 | 42 | private String password; 43 | 44 | @Override 45 | public boolean equals(Object o) { 46 | if (this == o) { 47 | return true; 48 | } 49 | if (o == null || getClass() != o.getClass()) { 50 | return false; 51 | } 52 | ServerDeployDto that = (ServerDeployDto) o; 53 | return Objects.equals(id, that.id) && 54 | Objects.equals(name, that.name); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | return Objects.hash(id, name); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/rest/LimitController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.rest; 17 | 18 | import io.swagger.annotations.Api; 19 | import io.swagger.annotations.ApiOperation; 20 | import me.zhengjie.annotation.Limit; 21 | import me.zhengjie.annotation.rest.AnonymousGetMapping; 22 | import org.springframework.web.bind.annotation.RequestMapping; 23 | import org.springframework.web.bind.annotation.RestController; 24 | 25 | import java.util.concurrent.atomic.AtomicInteger; 26 | 27 | /** 28 | * @author / 29 | * 接口限流测试类 30 | */ 31 | @RestController 32 | @RequestMapping("/api/limit") 33 | @Api(tags = "系统:限流测试管理") 34 | public class LimitController { 35 | 36 | private static final AtomicInteger ATOMIC_INTEGER = new AtomicInteger(); 37 | 38 | /** 39 | * 测试限流注解,下面配置说明该接口 60秒内最多只能访问 10次,保存到redis的键名为 limit_test, 40 | */ 41 | @AnonymousGetMapping 42 | @ApiOperation("测试") 43 | @Limit(key = "test", period = 60, count = 10, name = "testLimit", prefix = "limit") 44 | public int test() { 45 | return ATOMIC_INTEGER.incrementAndGet(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/domain/EmailConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.domain; 17 | 18 | import io.swagger.annotations.ApiModelProperty; 19 | import lombok.Data; 20 | import javax.persistence.*; 21 | import javax.validation.constraints.NotBlank; 22 | import java.io.Serializable; 23 | 24 | /** 25 | * 邮件配置类,数据存覆盖式存入数据存 26 | * @author Zheng Jie 27 | * @date 2018-12-26 28 | */ 29 | @Entity 30 | @Data 31 | @Table(name = "tool_email_config") 32 | public class EmailConfig implements Serializable { 33 | 34 | @Id 35 | @Column(name = "config_id") 36 | @ApiModelProperty(value = "ID", hidden = true) 37 | private Long id; 38 | 39 | @NotBlank 40 | @ApiModelProperty(value = "邮件服务器SMTP地址") 41 | private String host; 42 | 43 | @NotBlank 44 | @ApiModelProperty(value = "邮件服务器 SMTP 端口") 45 | private String port; 46 | 47 | @NotBlank 48 | @ApiModelProperty(value = "发件者用户名") 49 | private String user; 50 | 51 | @NotBlank 52 | @ApiModelProperty(value = "密码") 53 | private String pass; 54 | 55 | @NotBlank 56 | @ApiModelProperty(value = "收件人") 57 | private String fromUser; 58 | } 59 | -------------------------------------------------------------------------------- /eladmin-tools/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eladmin 7 | me.zhengjie 8 | 2.6 9 | 10 | 4.0.0 11 | 12 | eladmin-tools 13 | 工具模块 14 | 15 | 16 | 1.5.0-b01 17 | [7.2.0, 7.2.99] 18 | 4.9.153.ALL 19 | 20 | 21 | 22 | 23 | 24 | me.zhengjie 25 | eladmin-logging 26 | 2.6 27 | 28 | 29 | 30 | 31 | javax.mail 32 | mail 33 | ${mail.version} 34 | 35 | 36 | 37 | 38 | com.qiniu 39 | qiniu-java-sdk 40 | ${qiniu.version} 41 | 42 | 43 | 44 | 45 | com.alipay.sdk 46 | alipay-sdk-java 47 | ${alipay.version} 48 | 49 | 50 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/CacheKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils; 17 | 18 | /** 19 | * @author: liaojinlong 20 | * @date: 2020/6/11 15:49 21 | * @apiNote: 关于缓存的Key集合 22 | */ 23 | public interface CacheKey { 24 | 25 | /** 26 | * 内置 用户、岗位、应用、菜单、角色 相关key 27 | */ 28 | String USER_MODIFY_TIME_KEY = "user:modify:time:key:"; 29 | String APP_MODIFY_TIME_KEY = "app:modify:time:key:"; 30 | String JOB_MODIFY_TIME_KEY = "job:modify:time:key:"; 31 | String MENU_MODIFY_TIME_KEY = "menu:modify:time:key:"; 32 | String ROLE_MODIFY_TIME_KEY = "role:modify:time:key:"; 33 | String DEPT_MODIFY_TIME_KEY = "dept:modify:time:key:"; 34 | 35 | /** 36 | * 用户 37 | */ 38 | String USER_ID = "user::id:"; 39 | String USER_NAME = "user::username:"; 40 | /** 41 | * 数据 42 | */ 43 | String DATE_USER = "data::user:"; 44 | /** 45 | * 菜单 46 | */ 47 | String MENU_USER = "menu::user:"; 48 | /** 49 | * 角色授权 50 | */ 51 | String ROLE_AUTH = "role::auth:"; 52 | /** 53 | * 角色信息 54 | */ 55 | String ROLE_ID = "role::id:"; 56 | } 57 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/config/MultipartConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.config; 17 | 18 | import org.springframework.boot.web.servlet.MultipartConfigFactory; 19 | import org.springframework.context.annotation.Bean; 20 | import org.springframework.context.annotation.Configuration; 21 | import javax.servlet.MultipartConfigElement; 22 | import java.io.File; 23 | 24 | /** 25 | * @date 2018-12-28 26 | * @author https://blog.csdn.net/llibin1024530411/article/details/79474953 27 | */ 28 | @Configuration 29 | public class MultipartConfig { 30 | 31 | /** 32 | * 文件上传临时路径 33 | */ 34 | @Bean 35 | MultipartConfigElement multipartConfigElement() { 36 | MultipartConfigFactory factory = new MultipartConfigFactory(); 37 | String location = System.getProperty("user.home") + "/.eladmin/file/tmp"; 38 | File tmpFile = new File(location); 39 | if (!tmpFile.exists()) { 40 | if (!tmpFile.mkdirs()) { 41 | System.out.println("create was not successful."); 42 | } 43 | } 44 | factory.setLocation(location); 45 | return factory.createMultipartConfig(); 46 | } 47 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/resources/template/email/email.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 15 |
21 |
22 |

尊敬的用户,您好:

23 |

您正在申请邮箱验证,您的验证码为:

24 |

${code}

32 |
37 |
38 |
42 | Copyright ©${.now?string("yyyy")} EL-ADMIN 后台管理系统 All Rights Reserved. 43 |
44 | 45 |
46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/SecurityProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.security.config.bean; 17 | 18 | import lombok.Data; 19 | 20 | /** 21 | * Jwt参数配置 22 | * 23 | * @author Zheng Jie 24 | * @date 2019年11月28日 25 | */ 26 | @Data 27 | public class SecurityProperties { 28 | 29 | /** 30 | * Request Headers : Authorization 31 | */ 32 | private String header; 33 | 34 | /** 35 | * 令牌前缀,最后留个空格 Bearer 36 | */ 37 | private String tokenStartWith; 38 | 39 | /** 40 | * 必须使用最少88位的Base64对该令牌进行编码 41 | */ 42 | private String base64Secret; 43 | 44 | /** 45 | * 令牌过期时间 此处单位/毫秒 46 | */ 47 | private Long tokenValidityInSeconds; 48 | 49 | /** 50 | * 在线用户 key,根据 key 查询 redis 中在线用户的数据 51 | */ 52 | private String onlineKey; 53 | 54 | /** 55 | * 验证码 key 56 | */ 57 | private String codeKey; 58 | 59 | /** 60 | * token 续期检查 61 | */ 62 | private Long detect; 63 | 64 | /** 65 | * 续期时间 66 | */ 67 | private Long renew; 68 | 69 | public String getTokenStartWith() { 70 | return tokenStartWith + " "; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/config/FileProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.config; 17 | 18 | import lombok.Data; 19 | import me.zhengjie.utils.ElAdminConstant; 20 | import org.springframework.boot.context.properties.ConfigurationProperties; 21 | import org.springframework.context.annotation.Configuration; 22 | 23 | /** 24 | * @author Zheng Jie 25 | */ 26 | @Data 27 | @Configuration 28 | @ConfigurationProperties(prefix = "file") 29 | public class FileProperties { 30 | 31 | /** 文件大小限制 */ 32 | private Long maxSize; 33 | 34 | /** 头像大小限制 */ 35 | private Long avatarMaxSize; 36 | 37 | private ElPath mac; 38 | 39 | private ElPath linux; 40 | 41 | private ElPath windows; 42 | 43 | public ElPath getPath(){ 44 | String os = System.getProperty("os.name"); 45 | if(os.toLowerCase().startsWith(ElAdminConstant.WIN)) { 46 | return windows; 47 | } else if(os.toLowerCase().startsWith(ElAdminConstant.MAC)){ 48 | return mac; 49 | } 50 | return linux; 51 | } 52 | 53 | @Data 54 | public static class ElPath{ 55 | 56 | private String path; 57 | 58 | private String avatar; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dict.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.domain; 17 | 18 | import io.swagger.annotations.ApiModelProperty; 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | import me.zhengjie.base.BaseEntity; 22 | import javax.persistence.*; 23 | import javax.validation.constraints.NotBlank; 24 | import javax.validation.constraints.NotNull; 25 | import java.io.Serializable; 26 | import java.util.List; 27 | 28 | /** 29 | * @author Zheng Jie 30 | * @date 2019-04-10 31 | */ 32 | @Entity 33 | @Getter 34 | @Setter 35 | @Table(name="sys_dict") 36 | public class Dict extends BaseEntity implements Serializable { 37 | 38 | @Id 39 | @Column(name = "dict_id") 40 | @NotNull(groups = Update.class) 41 | @ApiModelProperty(value = "ID", hidden = true) 42 | @GeneratedValue(strategy = GenerationType.IDENTITY) 43 | private Long id; 44 | 45 | @OneToMany(mappedBy = "dict",cascade={CascadeType.PERSIST,CascadeType.REMOVE}) 46 | private List dictDetails; 47 | 48 | @NotBlank 49 | @ApiModelProperty(value = "名称") 50 | private String name; 51 | 52 | @ApiModelProperty(value = "描述") 53 | private String description; 54 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import lombok.Getter; 19 | import lombok.Setter; 20 | import me.zhengjie.base.BaseDTO; 21 | import java.io.Serializable; 22 | import java.util.Objects; 23 | import java.util.Set; 24 | 25 | /** 26 | * @author Zheng Jie 27 | * @date 2018-11-23 28 | */ 29 | @Getter 30 | @Setter 31 | public class RoleDto extends BaseDTO implements Serializable { 32 | 33 | private Long id; 34 | 35 | private Set menus; 36 | 37 | private Set depts; 38 | 39 | private String name; 40 | 41 | private String dataScope; 42 | 43 | private Integer level; 44 | 45 | private String description; 46 | 47 | @Override 48 | public boolean equals(Object o) { 49 | if (this == o) { 50 | return true; 51 | } 52 | if (o == null || getClass() != o.getClass()) { 53 | return false; 54 | } 55 | RoleDto roleDto = (RoleDto) o; 56 | return Objects.equals(id, roleDto.id); 57 | } 58 | 59 | @Override 60 | public int hashCode() { 61 | return Objects.hash(id); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service.dto; 17 | 18 | import com.fasterxml.jackson.annotation.JsonIgnore; 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | import me.zhengjie.base.BaseDTO; 22 | import java.io.Serializable; 23 | import java.util.Date; 24 | import java.util.Set; 25 | 26 | /** 27 | * @author Zheng Jie 28 | * @date 2018-11-23 29 | */ 30 | @Getter 31 | @Setter 32 | public class UserDto extends BaseDTO implements Serializable { 33 | 34 | private Long id; 35 | 36 | private Set roles; 37 | 38 | private Set jobs; 39 | 40 | private DeptSmallDto dept; 41 | 42 | private Long deptId; 43 | 44 | private String username; 45 | 46 | private String nickName; 47 | 48 | private String email; 49 | 50 | private String phone; 51 | 52 | private String gender; 53 | 54 | private String avatarName; 55 | 56 | private String avatarPath; 57 | 58 | @JsonIgnore 59 | private String password; 60 | 61 | private Boolean enabled; 62 | 63 | @JsonIgnore 64 | private Boolean isAdmin = false; 65 | 66 | private Date pwdResetTime; 67 | } 68 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.domain; 17 | 18 | import io.swagger.annotations.ApiModelProperty; 19 | import cn.hutool.core.bean.BeanUtil; 20 | import cn.hutool.core.bean.copier.CopyOptions; 21 | import lombok.Getter; 22 | import lombok.Setter; 23 | import me.zhengjie.base.BaseEntity; 24 | import javax.persistence.*; 25 | import java.io.Serializable; 26 | 27 | /** 28 | * @author zhanghouying 29 | * @date 2019-08-24 30 | */ 31 | @Entity 32 | @Getter 33 | @Setter 34 | @Table(name="mnt_database") 35 | public class Database extends BaseEntity implements Serializable { 36 | 37 | @Id 38 | @Column(name = "db_id") 39 | @ApiModelProperty(value = "ID", hidden = true) 40 | private String id; 41 | 42 | @ApiModelProperty(value = "数据库名称") 43 | private String name; 44 | 45 | @ApiModelProperty(value = "数据库连接地址") 46 | private String jdbcUrl; 47 | 48 | @ApiModelProperty(value = "数据库密码") 49 | private String pwd; 50 | 51 | @ApiModelProperty(value = "用户名") 52 | private String userName; 53 | 54 | public void copy(Database source){ 55 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /eladmin-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.domain.vo; 17 | 18 | import io.swagger.annotations.ApiModelProperty; 19 | import lombok.Data; 20 | import javax.validation.constraints.NotBlank; 21 | import java.sql.Date; 22 | import java.sql.Timestamp; 23 | 24 | /** 25 | * 交易详情,按需应该存入数据库,这里存入数据库,仅供临时测试 26 | * @author Zheng Jie 27 | * @date 2018-12-31 28 | */ 29 | @Data 30 | public class TradeVo { 31 | 32 | /** (必填)商品描述 */ 33 | @NotBlank 34 | private String body; 35 | 36 | /** (必填)商品名称 */ 37 | @NotBlank 38 | private String subject; 39 | 40 | /** (必填)商户订单号,应该由后台生成 */ 41 | @ApiModelProperty(hidden = true) 42 | private String outTradeNo; 43 | 44 | /** (必填)第三方订单号 */ 45 | @ApiModelProperty(hidden = true) 46 | private String tradeNo; 47 | 48 | /** (必填)价格 */ 49 | @NotBlank 50 | private String totalAmount; 51 | 52 | /** 订单状态,已支付,未支付,作废 */ 53 | @ApiModelProperty(hidden = true) 54 | private String state; 55 | 56 | /** 创建时间,存入数据库时需要 */ 57 | @ApiModelProperty(hidden = true) 58 | private Timestamp createTime; 59 | 60 | /** 作废时间,存入数据库时需要 */ 61 | @ApiModelProperty(hidden = true) 62 | private Date cancelTime; 63 | } 64 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/domain/DictDetail.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.domain; 17 | 18 | import io.swagger.annotations.ApiModelProperty; 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | import me.zhengjie.base.BaseEntity; 22 | import javax.persistence.*; 23 | import javax.validation.constraints.NotNull; 24 | import java.io.Serializable; 25 | 26 | /** 27 | * @author Zheng Jie 28 | * @date 2019-04-10 29 | */ 30 | @Entity 31 | @Getter 32 | @Setter 33 | @Table(name="sys_dict_detail") 34 | public class DictDetail extends BaseEntity implements Serializable { 35 | 36 | @Id 37 | @Column(name = "detail_id") 38 | @NotNull(groups = Update.class) 39 | @ApiModelProperty(value = "ID", hidden = true) 40 | @GeneratedValue(strategy = GenerationType.IDENTITY) 41 | private Long id; 42 | 43 | @JoinColumn(name = "dict_id") 44 | @ManyToOne(fetch=FetchType.LAZY) 45 | @ApiModelProperty(value = "字典", hidden = true) 46 | private Dict dict; 47 | 48 | @ApiModelProperty(value = "字典标签") 49 | private String label; 50 | 51 | @ApiModelProperty(value = "字典值") 52 | private String value; 53 | 54 | @ApiModelProperty(value = "排序") 55 | private Integer dictSort = 999; 56 | } -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictDetailService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.system.service; 17 | 18 | import me.zhengjie.modules.system.domain.DictDetail; 19 | import me.zhengjie.modules.system.service.dto.DictDetailDto; 20 | import me.zhengjie.modules.system.service.dto.DictDetailQueryCriteria; 21 | import org.springframework.data.domain.Pageable; 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | /** 26 | * @author Zheng Jie 27 | * @date 2019-04-10 28 | */ 29 | public interface DictDetailService { 30 | 31 | /** 32 | * 创建 33 | * @param resources / 34 | */ 35 | void create(DictDetail resources); 36 | 37 | /** 38 | * 编辑 39 | * @param resources / 40 | */ 41 | void update(DictDetail resources); 42 | 43 | /** 44 | * 删除 45 | * @param id / 46 | */ 47 | void delete(Long id); 48 | 49 | /** 50 | * 分页查询 51 | * @param criteria 条件 52 | * @param pageable 分页参数 53 | * @return / 54 | */ 55 | Map queryAll(DictDetailQueryCriteria criteria, Pageable pageable); 56 | 57 | /** 58 | * 根据字典名称获取字典详情 59 | * @param name 字典名称 60 | * @return / 61 | */ 62 | List getDictByName(String name); 63 | } -------------------------------------------------------------------------------- /eladmin-common/src/main/java/me/zhengjie/utils/enums/RequestMethodEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.utils.enums; 17 | 18 | import lombok.AllArgsConstructor; 19 | import lombok.Getter; 20 | 21 | /** 22 | * @author Zheng Jie 23 | * @website https://el-admin.vip 24 | * @description 25 | * @date 2020-06-10 26 | **/ 27 | @Getter 28 | @AllArgsConstructor 29 | public enum RequestMethodEnum { 30 | 31 | /** 32 | * 搜寻 @AnonymousGetMapping 33 | */ 34 | GET("GET"), 35 | 36 | /** 37 | * 搜寻 @AnonymousPostMapping 38 | */ 39 | POST("POST"), 40 | 41 | /** 42 | * 搜寻 @AnonymousPutMapping 43 | */ 44 | PUT("PUT"), 45 | 46 | /** 47 | * 搜寻 @AnonymousPatchMapping 48 | */ 49 | PATCH("PATCH"), 50 | 51 | /** 52 | * 搜寻 @AnonymousDeleteMapping 53 | */ 54 | DELETE("DELETE"), 55 | 56 | /** 57 | * 否则就是所有 Request 接口都放行 58 | */ 59 | ALL("All"); 60 | 61 | /** 62 | * Request 类型 63 | */ 64 | private final String type; 65 | 66 | public static RequestMethodEnum find(String type) { 67 | for (RequestMethodEnum value : RequestMethodEnum.values()) { 68 | if (type.equals(value.getType())) { 69 | return value; 70 | } 71 | } 72 | return ALL; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /eladmin-generator/src/main/java/me/zhengjie/rest/GenConfigController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.rest; 17 | 18 | import io.swagger.annotations.Api; 19 | import io.swagger.annotations.ApiOperation; 20 | import lombok.RequiredArgsConstructor; 21 | import me.zhengjie.domain.GenConfig; 22 | import me.zhengjie.service.GenConfigService; 23 | import org.springframework.http.HttpStatus; 24 | import org.springframework.http.ResponseEntity; 25 | import org.springframework.validation.annotation.Validated; 26 | import org.springframework.web.bind.annotation.*; 27 | 28 | /** 29 | * @author Zheng Jie 30 | * @date 2019-01-14 31 | */ 32 | @RestController 33 | @RequiredArgsConstructor 34 | @RequestMapping("/api/genConfig") 35 | @Api(tags = "系统:代码生成器配置管理") 36 | public class GenConfigController { 37 | 38 | private final GenConfigService genConfigService; 39 | 40 | @ApiOperation("查询") 41 | @GetMapping(value = "/{tableName}") 42 | public ResponseEntity query(@PathVariable String tableName){ 43 | return new ResponseEntity<>(genConfigService.find(tableName), HttpStatus.OK); 44 | } 45 | 46 | @ApiOperation("修改") 47 | @PutMapping 48 | public ResponseEntity update(@Validated @RequestBody GenConfig genConfig){ 49 | return new ResponseEntity<>(genConfigService.update(genConfig.getTableName(), genConfig),HttpStatus.OK); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.quartz.utils; 17 | 18 | import lombok.extern.slf4j.Slf4j; 19 | import me.zhengjie.utils.SpringContextHolder; 20 | import org.apache.commons.lang3.StringUtils; 21 | import org.springframework.util.ReflectionUtils; 22 | import java.lang.reflect.Method; 23 | import java.util.concurrent.Callable; 24 | 25 | /** 26 | * 执行定时任务 27 | * @author / 28 | */ 29 | @Slf4j 30 | public class QuartzRunnable implements Callable { 31 | 32 | private final Object target; 33 | private final Method method; 34 | private final String params; 35 | 36 | QuartzRunnable(String beanName, String methodName, String params) 37 | throws NoSuchMethodException, SecurityException { 38 | this.target = SpringContextHolder.getBean(beanName); 39 | this.params = params; 40 | 41 | if (StringUtils.isNotBlank(params)) { 42 | this.method = target.getClass().getDeclaredMethod(methodName, String.class); 43 | } else { 44 | this.method = target.getClass().getDeclaredMethod(methodName); 45 | } 46 | } 47 | 48 | @Override 49 | public Object call() throws Exception { 50 | ReflectionUtils.makeAccessible(method); 51 | if (StringUtils.isNotBlank(params)) { 52 | method.invoke(target, params); 53 | } else { 54 | method.invoke(target); 55 | } 56 | return null; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2020 Zheng Jie 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package me.zhengjie.modules.mnt.domain; 17 | 18 | import io.swagger.annotations.ApiModelProperty; 19 | import cn.hutool.core.bean.BeanUtil; 20 | import cn.hutool.core.bean.copier.CopyOptions; 21 | import lombok.Getter; 22 | import lombok.Setter; 23 | import org.hibernate.annotations.CreationTimestamp; 24 | import javax.persistence.*; 25 | import java.io.Serializable; 26 | import java.sql.Timestamp; 27 | 28 | /** 29 | * @author zhanghouying 30 | * @date 2019-08-24 31 | */ 32 | @Entity 33 | @Getter 34 | @Setter 35 | @Table(name="mnt_deploy_history") 36 | public class DeployHistory implements Serializable { 37 | 38 | @Id 39 | @Column(name = "history_id") 40 | @ApiModelProperty(value = "ID", hidden = true) 41 | private String id; 42 | 43 | @ApiModelProperty(value = "应用名称") 44 | private String appName; 45 | 46 | @ApiModelProperty(value = "IP") 47 | private String ip; 48 | 49 | @CreationTimestamp 50 | @ApiModelProperty(value = "部署时间") 51 | private Timestamp deployDate; 52 | 53 | @ApiModelProperty(value = "部署者") 54 | private String deployUser; 55 | 56 | @ApiModelProperty(value = "部署ID") 57 | private Long deployId; 58 | 59 | public void copy(DeployHistory source){ 60 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); 61 | } 62 | } 63 | --------------------------------------------------------------------------------