├── images ├── 0.png ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png ├── 9.png ├── 10.png ├── 11.png ├── 12.png ├── 13.png ├── 14.png ├── 15.png ├── 16.png ├── 17.png ├── 18.png ├── 19.png ├── 20.png ├── 21.png ├── 22.png └── qrcode.png ├── maku-boot-new ├── src │ └── main │ │ ├── resources │ │ └── auth.yml │ │ └── java │ │ └── net │ │ └── maku │ │ └── module │ │ └── controller │ │ └── TestController.java └── pom.xml ├── maku-boot-module ├── maku-module-generator │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── auth.yml │ │ │ └── template │ │ │ ├── java │ │ │ ├── Dao.java.ftl │ │ │ ├── Convert.java.ftl │ │ │ ├── Service.java.ftl │ │ │ ├── VO.java.ftl │ │ │ └── Query.java.ftl │ │ │ ├── vue │ │ │ └── api.ts.ftl │ │ │ └── xml │ │ │ └── Dao.xml.ftl │ └── pom.xml ├── maku-module-iot │ └── src │ │ └── main │ │ ├── resources │ │ └── mapper │ │ │ └── iot │ │ │ ├── IotDeviceDao.xml │ │ │ ├── IotDeviceEventLogDao.xml │ │ │ └── IotDeviceServiceLogDao.xml │ │ └── java │ │ └── net │ │ └── maku │ │ └── iot │ │ ├── enums │ │ ├── DeviceServiceEnum.java │ │ ├── IOTProtocolEnum.java │ │ └── DevicePropertyEnum.java │ │ ├── dao │ │ ├── IotDeviceDao.java │ │ ├── IotDeviceEventLogDao.java │ │ └── IotDeviceServiceLogDao.java │ │ ├── communication │ │ ├── dto │ │ │ ├── TcpMsgDTO.java │ │ │ ├── BaseDeviceID.java │ │ │ ├── BaseCommandResponseDTO.java │ │ │ ├── DevicePropertyDTO.java │ │ │ └── DeviceCommandDTO.java │ │ ├── mqtt │ │ │ └── handler │ │ │ │ ├── DevicePropertyChangeHandler.java │ │ │ │ ├── DeviceCommandResponseHandler.java │ │ │ │ └── MqttMessageHandler.java │ │ ├── tcp │ │ │ └── handler │ │ │ │ └── TCPMessageHandler.java │ │ └── service │ │ │ ├── CommunicationServiceFactory.java │ │ │ └── BaseCommunication.java │ │ ├── query │ │ ├── IotDeviceEventLogQuery.java │ │ ├── IotDeviceServiceLogQuery.java │ │ └── IotDeviceQuery.java │ │ ├── vo │ │ ├── DeviceCommandVO.java │ │ ├── DeviceReportAttributeDataVO.java │ │ └── IotDeviceEventLogVO.java │ │ ├── convert │ │ ├── IotDeviceConvert.java │ │ ├── IotDeviceEventLogConvert.java │ │ └── IotDeviceServiceLogConvert.java │ │ ├── entity │ │ ├── IotDeviceEventLogEntity.java │ │ └── IotDeviceServiceLogEntity.java │ │ └── utils │ │ └── MqttUtils.java ├── maku-module-quartz │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── net │ │ │ └── maku │ │ │ └── quartz │ │ │ ├── utils │ │ │ ├── ScheduleConcurrentExecution.java │ │ │ ├── ScheduleDisallowConcurrentExecution.java │ │ │ └── CronUtils.java │ │ │ ├── dao │ │ │ ├── ScheduleJobDao.java │ │ │ └── ScheduleJobLogDao.java │ │ │ ├── enums │ │ │ ├── ScheduleConcurrentEnum.java │ │ │ └── ScheduleStatusEnum.java │ │ │ ├── task │ │ │ └── TestTask.java │ │ │ ├── service │ │ │ ├── ScheduleJobLogService.java │ │ │ └── ScheduleJobService.java │ │ │ ├── query │ │ │ ├── ScheduleJobQuery.java │ │ │ └── ScheduleJobLogQuery.java │ │ │ └── convert │ │ │ ├── ScheduleJobConvert.java │ │ │ └── ScheduleJobLogConvert.java │ └── pom.xml ├── maku-module-member │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── net │ │ │ └── maku │ │ │ └── member │ │ │ ├── dao │ │ │ └── MemberUserDao.java │ │ │ ├── convert │ │ │ └── MemberUserConvert.java │ │ │ ├── service │ │ │ └── MemberUserService.java │ │ │ └── query │ │ │ └── MemberUserQuery.java │ └── pom.xml ├── maku-module-monitor │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── net │ │ │ └── maku │ │ │ └── monitor │ │ │ ├── vo │ │ │ ├── Cache.java │ │ │ └── UserOnlineVO.java │ │ │ └── model │ │ │ ├── Disk.java │ │ │ ├── Sys.java │ │ │ └── Mem.java │ └── pom.xml ├── maku-module-websocket │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── net │ │ │ └── maku │ │ │ └── websocket │ │ │ ├── message │ │ │ └── JsonDataMessage.java │ │ │ ├── util │ │ │ └── SessionUserUtil.java │ │ │ ├── vo │ │ │ └── MessageVO.java │ │ │ └── config │ │ │ └── WebSocketConfig.java │ └── pom.xml ├── README.md └── pom.xml ├── maku-framework └── src │ └── main │ ├── resources │ ├── ip2region.xdb │ └── auth.yml │ └── java │ └── net │ └── maku │ └── framework │ ├── mybatis │ ├── dao │ │ └── BaseDao.java │ ├── service │ │ └── BaseService.java │ └── interceptor │ │ └── DataScope.java │ ├── security │ ├── mobile │ │ ├── MobileVerifyCodeService.java │ │ └── MobileUserDetailsService.java │ ├── third │ │ ├── ThirdOpenIdService.java │ │ ├── ThirdLogin.java │ │ └── ThirdUserDetailsService.java │ ├── config │ │ └── PasswordConfig.java │ ├── properties │ │ └── SecurityProperties.java │ └── crypto │ │ └── Sm3PasswordEncoder.java │ ├── common │ ├── excel │ │ └── ExcelFinishCallBack.java │ ├── exception │ │ └── ErrorCode.java │ ├── xss │ │ ├── XssProperties.java │ │ └── XssUtils.java │ ├── cache │ │ └── RedisKeys.java │ ├── utils │ │ ├── ExceptionUtils.java │ │ ├── TreeNode.java │ │ ├── PageResult.java │ │ └── AssertUtils.java │ ├── query │ │ └── Query.java │ ├── constant │ │ └── Constant.java │ └── config │ │ └── CorsConfig.java │ └── operatelog │ ├── enums │ └── OperateTypeEnum.java │ ├── annotations │ └── OperateLog.java │ └── service │ └── OperateLogService.java ├── maku-boot-system └── src │ └── main │ ├── resources │ ├── mapper │ │ ├── SysPostDao.xml │ │ ├── SysDictDataDao.xml │ │ ├── SysDictTypeDao.xml │ │ ├── SysLogLoginDao.xml │ │ ├── SysLogOperateDao.xml │ │ ├── SysParamsDao.xml │ │ ├── SysAttachmentDao.xml │ │ ├── SysRoleMenuDao.xml │ │ ├── SysUserPostDao.xml │ │ ├── SysUserRoleDao.xml │ │ ├── SysOrgDao.xml │ │ ├── SysRoleDataScopeDao.xml │ │ ├── SysRoleDao.xml │ │ └── SysUseTokenDao.xml │ ├── auth.yml │ └── templates │ │ └── third_login.ftlh │ └── java │ └── net │ └── maku │ ├── system │ ├── enums │ │ ├── SysParamsEnum.java │ │ ├── DictSourceEnum.java │ │ ├── MailPlatformEnum.java │ │ ├── MailFormatEnum.java │ │ ├── MenuTypeEnum.java │ │ ├── SmsPlatformEnum.java │ │ ├── LoginOperationEnum.java │ │ ├── DataScopeEnum.java │ │ ├── ThirdLoginEnum.java │ │ ├── SuperAdminEnum.java │ │ └── UserStatusEnum.java │ ├── dao │ │ ├── SysPostDao.java │ │ ├── SysSmsLogDao.java │ │ ├── SysMailLogDao.java │ │ ├── SysMailConfigDao.java │ │ ├── SysSmsConfigDao.java │ │ ├── SysLogLoginDao.java │ │ ├── SysAttachmentDao.java │ │ ├── SysDictTypeDao.java │ │ ├── SysLogOperateDao.java │ │ ├── SysThirdLoginDao.java │ │ ├── SysThirdLoginConfigDao.java │ │ ├── SysUserPostDao.java │ │ ├── SysRoleMenuDao.java │ │ ├── SysOrgDao.java │ │ ├── SysDictDataDao.java │ │ ├── SysRoleDao.java │ │ ├── SysRoleDataScopeDao.java │ │ ├── SysParamsDao.java │ │ ├── SysUserRoleDao.java │ │ ├── SysMenuDao.java │ │ ├── SysUserTokenDao.java │ │ └── SysUserDao.java │ ├── service │ │ ├── SysUserDetailsService.java │ │ ├── SysLogOperateService.java │ │ ├── SysMailLogService.java │ │ ├── SysSmsLogService.java │ │ ├── SysCaptchaService.java │ │ ├── SysDictDataService.java │ │ ├── SysAttachmentService.java │ │ ├── SysPostService.java │ │ ├── SysRoleDataScopeService.java │ │ ├── SysMailConfigService.java │ │ ├── SysOrgService.java │ │ ├── SysRoleMenuService.java │ │ ├── SysThirdLoginService.java │ │ ├── SysSmsConfigService.java │ │ ├── SysThirdLoginConfigService.java │ │ ├── SysLogLoginService.java │ │ ├── SysUserPostService.java │ │ ├── SysRoleService.java │ │ ├── SysMenuService.java │ │ ├── SysDictTypeService.java │ │ └── SysAuthService.java │ ├── query │ │ ├── SysRoleUserQuery.java │ │ ├── SysMailConfigQuery.java │ │ ├── SysRoleQuery.java │ │ ├── SysMailLogQuery.java │ │ ├── SysSmsLogQuery.java │ │ ├── SysSmsConfigQuery.java │ │ ├── SysAttachmentQuery.java │ │ ├── SysDictTypeQuery.java │ │ ├── SysDictDataQuery.java │ │ ├── SysParamsQuery.java │ │ ├── SysPostQuery.java │ │ ├── SysLogLoginQuery.java │ │ ├── SysLogOperateQuery.java │ │ └── SysUserQuery.java │ ├── controller │ │ └── IndexController.java │ ├── convert │ │ ├── SysOrgConvert.java │ │ ├── SysMenuConvert.java │ │ ├── SysPostConvert.java │ │ ├── SysRoleConvert.java │ │ ├── SysUserTokenConvert.java │ │ ├── SysSmsLogConvert.java │ │ ├── SysDictDataConvert.java │ │ ├── SysDictTypeConvert.java │ │ ├── SysMailLogConvert.java │ │ ├── SysParamsConvert.java │ │ ├── SysLogLoginConvert.java │ │ ├── SysAttachmentConvert.java │ │ ├── SysLogOperateConvert.java │ │ ├── SysThirdLoginConvert.java │ │ ├── SysThirdLoginConfigConvert.java │ │ ├── SysSmsConfigConvert.java │ │ ├── SysMailConfigConvert.java │ │ └── SysUserConvert.java │ ├── vo │ │ ├── SysCaptchaVO.java │ │ ├── SysMobileLoginVO.java │ │ ├── SysUserAvatarVO.java │ │ ├── SysUserSignatureVO.java │ │ ├── SysThirdCallbackVO.java │ │ ├── SysSmsSendVO.java │ │ ├── SysFileUploadVO.java │ │ ├── SysAccountLoginVO.java │ │ ├── SysUserPasswordVO.java │ │ ├── SysRoleDataScopeVO.java │ │ ├── AccessTokenVO.java │ │ ├── SysAttachmentVO.java │ │ └── SysDictVO.java │ ├── entity │ │ ├── SysUserPostEntity.java │ │ ├── SysRoleMenuEntity.java │ │ ├── SysRoleDataScopeEntity.java │ │ ├── SysUserRoleEntity.java │ │ ├── SysPostEntity.java │ │ ├── SysAttachmentEntity.java │ │ ├── SysParamsEntity.java │ │ ├── SysDictDataEntity.java │ │ ├── SysRoleEntity.java │ │ └── SysOrgEntity.java │ └── cache │ │ └── SmsSendCache.java │ ├── storage │ ├── properties │ │ ├── QiniuStorageProperties.java │ │ ├── HuaweiStorageProperties.java │ │ ├── MinioStorageProperties.java │ │ ├── TencentStorageProperties.java │ │ ├── AliyunStorageProperties.java │ │ └── LocalStorageProperties.java │ └── enums │ │ └── StorageTypeEnum.java │ ├── sms │ ├── SmsStrategy.java │ └── config │ │ └── SmsConfig.java │ ├── email │ ├── param │ │ ├── EmailAliyunBatchSendParam.java │ │ ├── EmailAliyunSendParam.java │ │ └── EmailLocalSendParam.java │ └── config │ │ └── EmailConfig.java │ └── security │ └── service │ └── MobileVerifyCodeServiceImpl.java ├── deploy ├── docker-compose.yml └── Dockerfile ├── maku-server └── src │ ├── main │ ├── resources │ │ ├── banner.txt │ │ ├── application-dev.yml │ │ ├── application-prod.yml │ │ └── application-test.yml │ └── java │ │ └── net │ │ └── maku │ │ └── ServerApplication.java │ └── test │ └── java │ └── net │ └── maku │ └── FileUploadTest.java ├── .gitignore ├── maku-boot-api ├── pom.xml └── src │ └── main │ └── java │ └── net │ └── maku │ └── api │ └── module │ └── system │ └── StorageApi.java └── db └── mysql └── module ├── maku-module-member.sql └── maku-module-monitor.sql /images/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/0.png -------------------------------------------------------------------------------- /images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/1.png -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/3.png -------------------------------------------------------------------------------- /images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/4.png -------------------------------------------------------------------------------- /images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/5.png -------------------------------------------------------------------------------- /images/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/6.png -------------------------------------------------------------------------------- /images/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/7.png -------------------------------------------------------------------------------- /images/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/8.png -------------------------------------------------------------------------------- /images/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/9.png -------------------------------------------------------------------------------- /images/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/10.png -------------------------------------------------------------------------------- /images/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/11.png -------------------------------------------------------------------------------- /images/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/12.png -------------------------------------------------------------------------------- /images/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/13.png -------------------------------------------------------------------------------- /images/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/14.png -------------------------------------------------------------------------------- /images/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/15.png -------------------------------------------------------------------------------- /images/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/16.png -------------------------------------------------------------------------------- /images/17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/17.png -------------------------------------------------------------------------------- /images/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/18.png -------------------------------------------------------------------------------- /images/19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/19.png -------------------------------------------------------------------------------- /images/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/20.png -------------------------------------------------------------------------------- /images/21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/21.png -------------------------------------------------------------------------------- /images/22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/22.png -------------------------------------------------------------------------------- /images/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/images/qrcode.png -------------------------------------------------------------------------------- /maku-boot-new/src/main/resources/auth.yml: -------------------------------------------------------------------------------- 1 | # 配置忽略认证的URL地址 2 | auth: 3 | ignore_urls: 4 | - /new/** -------------------------------------------------------------------------------- /maku-boot-module/maku-module-generator/src/main/resources/auth.yml: -------------------------------------------------------------------------------- 1 | auth: 2 | ignore_urls: 3 | - /maku-generator/** -------------------------------------------------------------------------------- /maku-framework/src/main/resources/ip2region.xdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makunet/maku-boot/HEAD/maku-framework/src/main/resources/ip2region.xdb -------------------------------------------------------------------------------- /maku-framework/src/main/resources/auth.yml: -------------------------------------------------------------------------------- 1 | auth: 2 | ignore_urls: 3 | - /actuator/** 4 | - /v3/api-docs/** 5 | - /webjars/** 6 | - /swagger/** 7 | - /swagger-resources/** 8 | - /swagger-ui.html 9 | - /swagger-ui/** 10 | - /doc.html 11 | - / -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysPostDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysDictDataDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysDictTypeDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysLogLoginDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysLogOperateDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysParamsDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/resources/mapper/iot/IotDeviceDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysAttachmentDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /deploy/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | services: 3 | maku-boot: 4 | image: makunet:1.0 5 | container_name: maku-boot 6 | ports: 7 | - 8080:8080 8 | environment: 9 | - spring.profiles.active=prod 10 | volumes: 11 | - /work/www/maku-boot/maku-server.jar:/app/app.jar -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/resources/mapper/iot/IotDeviceEventLogDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/resources/mapper/iot/IotDeviceServiceLogDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/SysParamsEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | /** 4 | * 系统参数 枚举 5 | * 6 | * @author 阿沐 babamu@126.com 7 | * MAKU 8 | */ 9 | public enum SysParamsEnum { 10 | /** 11 | * 登录验证码 12 | */ 13 | LOGIN_CAPTCHA 14 | } 15 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/auth.yml: -------------------------------------------------------------------------------- 1 | auth: 2 | ignore_urls: 3 | - /sys/auth/captcha 4 | - /sys/auth/captcha/enabled 5 | - /sys/auth/login 6 | - /sys/auth/token 7 | - /sys/auth/send/code 8 | - /sys/auth/mobile 9 | - /sys/auth/third 10 | - /sys/third/callback/** 11 | - /sys/third/render/** 12 | - /upload/** 13 | - / -------------------------------------------------------------------------------- /maku-server/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ======================================================================================================================== 2 | 3 | 欢迎使用maku-boot,是一款开源的企业级低代码开发平台,让开发更简单! - Powered By https://maku.net 4 | 5 | ======================================================================================================================== -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/utils/ScheduleConcurrentExecution.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.utils; 2 | 3 | /** 4 | * 允许并发(不会等待上一次任务执行完毕,只要时间到就会执行) 5 | * 6 | * @author 阿沐 babamu@126.com 7 | * MAKU 8 | * 9 | */ 10 | public class ScheduleConcurrentExecution extends AbstractScheduleJob { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/mybatis/dao/BaseDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.mybatis.dao; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | * 基础Dao 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | public interface BaseDao extends BaseMapper { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/security/mobile/MobileVerifyCodeService.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.security.mobile; 2 | 3 | /** 4 | * 手机短信登录,验证码效验 5 | * 6 | * @author 阿沐 babamu@126.com 7 | * MAKU 8 | */ 9 | public interface MobileVerifyCodeService { 10 | 11 | boolean verifyCode(String mobile, String code); 12 | } 13 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/mybatis/service/BaseService.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.mybatis.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | 5 | /** 6 | * 基础服务接口,所有Service接口都要继承 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | public interface BaseService extends IService { 12 | 13 | 14 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysPostDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysPostEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 岗位管理 9 | * 10 | * @author 阿沐 babamu@126.com 11 | */ 12 | @Mapper 13 | public interface SysPostDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/enums/DeviceServiceEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.enums; 2 | 3 | import lombok.Getter; 4 | import lombok.RequiredArgsConstructor; 5 | 6 | @Getter 7 | @RequiredArgsConstructor 8 | public enum DeviceServiceEnum { 9 | 10 | COMMAND_ID("命令ID"); 11 | 12 | /** 13 | * 类型值 14 | */ 15 | private final String value; 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysSmsLogDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysSmsLogEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 短信日志 9 | * 10 | * @author 阿沐 babamu@126.com 11 | */ 12 | @Mapper 13 | public interface SysSmsLogDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysMailLogDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysMailLogEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 邮件日志 9 | * 10 | * @author 阿沐 babamu@126.com 11 | */ 12 | @Mapper 13 | public interface SysMailLogDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/mybatis/interceptor/DataScope.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.mybatis.interceptor; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | /** 7 | * 数据范围 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Data 13 | @AllArgsConstructor 14 | public class DataScope { 15 | private String sqlFilter; 16 | 17 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/dao/IotDeviceDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.iot.entity.IotDeviceEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 设备表 9 | * 10 | * @author LSF maku_lsf@163.com 11 | */ 12 | @Mapper 13 | public interface IotDeviceDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysMailConfigDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysMailConfigEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 邮件配置 9 | * 10 | * @author 阿沐 babamu@126.com 11 | */ 12 | @Mapper 13 | public interface SysMailConfigDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysSmsConfigDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysSmsConfigEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 短信配置 9 | * 10 | * @author 阿沐 babamu@126.com 11 | */ 12 | @Mapper 13 | public interface SysSmsConfigDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysUserDetailsService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.security.user.UserDetail; 4 | import org.springframework.security.core.userdetails.UserDetails; 5 | 6 | public interface SysUserDetailsService { 7 | 8 | /** 9 | * 获取 UserDetails 对象,设置用户权限信息 10 | */ 11 | UserDetails getUserDetails(UserDetail userDetail); 12 | } 13 | -------------------------------------------------------------------------------- /deploy/Dockerfile: -------------------------------------------------------------------------------- 1 | # 构建镜像,执行命令:【docker build -t makunet:1.0 .】 2 | FROM eclipse-temurin:17-jre 3 | MAINTAINER 阿沐 4 | 5 | # 设置时区 6 | RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 7 | RUN echo 'Asia/Shanghai' >/etc/timezone 8 | 9 | ENTRYPOINT ["java", "-server", "-Xms1024M", "-Xmx1024M", "-Djava.security.egd=file:/dev/./urandom", "-Dfile.encoding=UTF-8", "-XX:+HeapDumpOnOutOfMemoryError", "-jar", "/app/app.jar" ] 10 | 11 | 12 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-member/src/main/java/net/maku/member/dao/MemberUserDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.member.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.member.entity.MemberUserEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 会员管理 9 | * 10 | * @author 阿沐 babamu@126.com 11 | */ 12 | @Mapper 13 | public interface MemberUserDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/dao/ScheduleJobDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.quartz.entity.ScheduleJobEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 定时任务 9 | * 10 | * @author 阿沐 babamu@126.com 11 | */ 12 | @Mapper 13 | public interface ScheduleJobDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/storage/properties/QiniuStorageProperties.java: -------------------------------------------------------------------------------- 1 | package net.maku.storage.properties; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 七牛云存储配置项 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class QiniuStorageProperties { 13 | private String accessKey; 14 | private String secretKey; 15 | private String bucketName; 16 | } 17 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysRoleMenuDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | logs/ 6 | *.log 7 | 8 | # BlueJ files 9 | *.ctxt 10 | 11 | # Mobile Tools for Java (J2ME) 12 | .mtj.tmp/ 13 | 14 | # Package Files # 15 | .idea 16 | *.iml 17 | *.jar 18 | *.war 19 | *.nar 20 | *.ear 21 | *.zip 22 | *.tar.gz 23 | *.rar 24 | target/ 25 | upload/ 26 | 27 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 28 | hs_err_pid* 29 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/dto/TcpMsgDTO.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.dto; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | /** 7 | * tcp通讯数据包 8 | * 9 | * @author LSF maku_lsf@163.com 10 | */ 11 | @Data 12 | @Schema(description = "tcp通讯数据包装类") 13 | public class TcpMsgDTO { 14 | private String topic; 15 | private Object msg; 16 | } 17 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/sms/SmsStrategy.java: -------------------------------------------------------------------------------- 1 | package net.maku.sms; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * 短信 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | public interface SmsStrategy { 12 | 13 | /** 14 | * 发送短信 15 | * 16 | * @param mobile 手机号 17 | * @param params 参数 18 | */ 19 | void send(String mobile, Map params); 20 | } 21 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/dao/ScheduleJobLogDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.quartz.entity.ScheduleJobLogEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 定时任务日志 9 | * 10 | * @author 阿沐 babamu@126.com 11 | */ 12 | @Mapper 13 | public interface ScheduleJobLogDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/utils/ScheduleDisallowConcurrentExecution.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.utils; 2 | 3 | import org.quartz.DisallowConcurrentExecution; 4 | 5 | /** 6 | * 禁止并发 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | * 11 | */ 12 | @DisallowConcurrentExecution 13 | public class ScheduleDisallowConcurrentExecution extends AbstractScheduleJob { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysUserPostDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/dto/BaseDeviceID.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.dto; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | /** 7 | * 设备ID 8 | * 9 | * @author LSF maku_lsf@163.com 10 | */ 11 | @Data 12 | @Schema(description = "设备ID") 13 | public class BaseDeviceID { 14 | 15 | @Schema(description = "设备ID") 16 | protected String deviceId; 17 | } 18 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/dao/IotDeviceEventLogDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.iot.entity.IotDeviceEventLogEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 设备事件日志 9 | * 10 | * @author LSF maku_lsf@163.com 11 | */ 12 | @Mapper 13 | public interface IotDeviceEventLogDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-monitor/src/main/java/net/maku/monitor/vo/Cache.java: -------------------------------------------------------------------------------- 1 | package net.maku.monitor.vo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * Redis Info 9 | * 10 | * @author Pure tea 11 | */ 12 | @Data 13 | @NoArgsConstructor 14 | @AllArgsConstructor 15 | public class Cache { 16 | 17 | private String cacheKey; 18 | 19 | private Object cacheValue; 20 | } 21 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/dao/IotDeviceServiceLogDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.iot.entity.IotDeviceServiceLogEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 设备服务日志 9 | * 10 | * @author LSF maku_lsf@163.com 11 | */ 12 | @Mapper 13 | public interface IotDeviceServiceLogDao extends BaseDao { 14 | 15 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysLogLoginDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysLogLoginEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 登录日志 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Mapper 14 | public interface SysLogLoginDao extends BaseDao { 15 | 16 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/storage/properties/HuaweiStorageProperties.java: -------------------------------------------------------------------------------- 1 | package net.maku.storage.properties; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 华为云存储配置项 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class HuaweiStorageProperties { 13 | private String endPoint; 14 | private String accessKey; 15 | private String secretKey; 16 | private String bucketName; 17 | } 18 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/storage/properties/MinioStorageProperties.java: -------------------------------------------------------------------------------- 1 | package net.maku.storage.properties; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * Minio存储配置项 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class MinioStorageProperties { 13 | private String endPoint; 14 | private String accessKey; 15 | private String secretKey; 16 | private String bucketName; 17 | } 18 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/storage/properties/TencentStorageProperties.java: -------------------------------------------------------------------------------- 1 | package net.maku.storage.properties; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 腾讯云存储配置项 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class TencentStorageProperties { 13 | private String accessKey; 14 | private String secretKey; 15 | private String region; 16 | private String bucketName; 17 | } 18 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysAttachmentDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysAttachmentEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 附件管理 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Mapper 14 | public interface SysAttachmentDao extends BaseDao { 15 | 16 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysDictTypeDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysDictTypeEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 字典类型 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Mapper 14 | public interface SysDictTypeDao extends BaseDao { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysLogOperateDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysLogOperateEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 操作日志 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Mapper 14 | public interface SysLogOperateDao extends BaseDao { 15 | 16 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysThirdLoginDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysThirdLoginEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 第三方登录 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Mapper 14 | public interface SysThirdLoginDao extends BaseDao { 15 | 16 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/storage/properties/AliyunStorageProperties.java: -------------------------------------------------------------------------------- 1 | package net.maku.storage.properties; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 阿里云存储配置项 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class AliyunStorageProperties { 13 | private String endPoint; 14 | private String accessKeyId; 15 | private String accessKeySecret; 16 | private String bucketName; 17 | } 18 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/storage/properties/LocalStorageProperties.java: -------------------------------------------------------------------------------- 1 | package net.maku.storage.properties; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 本地存储配置项 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class LocalStorageProperties { 13 | /** 14 | * 本地存储路径 15 | */ 16 | private String path; 17 | /** 18 | * 资源起始路径 19 | */ 20 | private String url = "upload"; 21 | } 22 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/excel/ExcelFinishCallBack.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.excel; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * excel读取数据完成 7 | * 8 | * @param the type parameter 9 | * @author eden 10 | */ 11 | public interface ExcelFinishCallBack { 12 | 13 | /** 14 | * Do save batch. 15 | * 16 | * @param result the result 17 | */ 18 | default void doSaveBatch(List result) { 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/security/third/ThirdOpenIdService.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.security.third; 2 | 3 | /** 4 | * 第三方登录,通过code,获取开放平台用户唯一标识 5 | * 6 | * @author 阿沐 babamu@126.com 7 | * MAKU 8 | */ 9 | public interface ThirdOpenIdService { 10 | 11 | /** 12 | * 通过code,获取开放平台用户唯一标识 13 | * 14 | * @param login 第三方登录信息 15 | * @return 开放平台用户唯一标识 16 | */ 17 | String getOpenId(ThirdLogin login); 18 | } 19 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-generator/src/main/resources/template/java/Dao.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package}.${moduleName}.dao; 2 | 3 | import ${package}.framework.mybatis.dao.BaseDao; 4 | import ${package}.${moduleName}.entity.${ClassName}Entity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * ${tableComment} 9 | * 10 | * @author ${author} ${email} 11 | * @since ${version} ${date} 12 | */ 13 | @Mapper 14 | public interface ${ClassName}Dao extends BaseDao<${ClassName}Entity> { 15 | 16 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysThirdLoginConfigDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysThirdLoginConfigEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /** 8 | * 第三方登录配置 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Mapper 14 | public interface SysThirdLoginConfigDao extends BaseDao { 15 | 16 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-generator/src/main/resources/template/vue/api.ts.ftl: -------------------------------------------------------------------------------- 1 | import service from '@/utils/request' 2 | 3 | export const use${FunctionName}Api = (id: number) => { 4 | return service.get('/${moduleName}/${functionName}/' + id) 5 | } 6 | 7 | export const use${FunctionName}SubmitApi = (dataForm: any) => { 8 | if (dataForm.id) { 9 | return service.put('/${moduleName}/${functionName}', dataForm) 10 | } else { 11 | return service.post('/${moduleName}/${functionName}', dataForm) 12 | } 13 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-websocket/src/main/java/net/maku/websocket/message/JsonDataMessage.java: -------------------------------------------------------------------------------- 1 | package net.maku.websocket.message; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * websocket json 消息 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class JsonDataMessage { 13 | /** 14 | * 消息类型 预留 15 | */ 16 | private String type = "default"; 17 | /** 18 | * 消息数据 19 | */ 20 | private T data; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/dto/BaseCommandResponseDTO.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.dto; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | /** 7 | * 响应消息基础类 8 | * 9 | * @author eden on 2024/6/17 10 | */ 11 | @Data 12 | public class BaseCommandResponseDTO extends BaseDeviceID { 13 | /** 14 | * 命令ID 15 | */ 16 | @Schema(description = "命令ID", required = true) 17 | protected String commandId; 18 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/DictSourceEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 字典数据来源 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum DictSourceEnum { 15 | /** 16 | * 字典数据 17 | */ 18 | DICT(0), 19 | /** 20 | * 动态SQL 21 | */ 22 | SQL(1); 23 | 24 | private final int value; 25 | } 26 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/MailPlatformEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 邮件平台枚举 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum MailPlatformEnum { 15 | /** 16 | * 本地 17 | */ 18 | LOCAL(-1), 19 | /** 20 | * 阿里云 21 | */ 22 | ALIYUN(0); 23 | 24 | private final int value; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/MailFormatEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 邮件格式枚举 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum MailFormatEnum { 15 | /** 16 | * 纯文本 17 | */ 18 | TEXT, 19 | /** 20 | * HTML 21 | */ 22 | HTML, 23 | /** 24 | * 模板 25 | */ 26 | TEMPLATE; 27 | } 28 | -------------------------------------------------------------------------------- /maku-boot-module/README.md: -------------------------------------------------------------------------------- 1 | ## 说明 2 | maku-boot 是采用组件模式,扩展不同的业务功能,可以很方便的实现各种业务需求,且不会导致系统臃肿,若想使用某个组件,按需引入即可,反之亦然。 3 | 4 | ## 引入 5 | 如果需要使用对应的组件,如:`maku-boot-quartz`,则需要在`maku-boot/maku-server/pom.xml`里面引入,如下所示: 6 | 7 | ```xml 8 | 9 | net.maku 10 | maku-boot-quartz 11 | ${revision} 12 | 13 | ``` 14 | 15 | ## SQL语句 16 | 引入组件时,还需要执行对应的SQL文件,初始化表结构和菜单等。 17 | 如果使用的是MySQL数据库,则需要执行以下SQL文件: 18 | 19 | ``` 20 | maku-boot/db/mysql/module/maku-module-quartz.sql 21 | ``` -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/enums/ScheduleConcurrentEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 定时任务并发枚举 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum ScheduleConcurrentEnum { 15 | /** 16 | * 禁止 17 | */ 18 | NO(0), 19 | /** 20 | * 允许 21 | */ 22 | YES(1); 23 | 24 | private final int value; 25 | } 26 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/enums/ScheduleStatusEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 定时任务状态枚举 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum ScheduleStatusEnum { 15 | /** 16 | * 暂停 17 | */ 18 | PAUSE(0), 19 | /** 20 | * 正常 21 | */ 22 | NORMAL(1); 23 | 24 | private final int value; 25 | } 26 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/mqtt/handler/DevicePropertyChangeHandler.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.mqtt.handler; 2 | 3 | 4 | import net.maku.iot.communication.dto.DevicePropertyDTO; 5 | 6 | /** 7 | * 设备属性变化处理器 8 | * 9 | * @author LSF maku_lsf@163.com 10 | */ 11 | public interface DevicePropertyChangeHandler { 12 | /** 13 | * 设备属性状态变化处理 14 | * 15 | * @param topic 16 | * @param deviceStatus 17 | */ 18 | void handle(String topic, DevicePropertyDTO deviceStatus); 19 | } 20 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/task/TestTask.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.task; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.stereotype.Service; 5 | 6 | /** 7 | * 测试定时任务 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Slf4j 13 | @Service 14 | public class TestTask { 15 | 16 | public void run(String params) throws InterruptedException { 17 | log.info("我是testTask.run(),参数:{},正在被执行。", params); 18 | Thread.sleep(1000); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysRoleUserQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | /** 8 | * 分配角色查询 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "分配角色查询") 16 | public class SysRoleUserQuery extends SysUserQuery { 17 | @Schema(description = "角色ID") 18 | private Long roleId; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysMailConfigQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 邮件配置查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "邮件配置查询") 16 | public class SysMailConfigQuery extends Query { 17 | @Schema(description = "平台类型") 18 | private Integer platform; 19 | 20 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-generator/src/main/resources/template/xml/Dao.xml.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <#list fieldList as field> 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/mqtt/handler/DeviceCommandResponseHandler.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.mqtt.handler; 2 | 3 | 4 | import net.maku.iot.communication.dto.DeviceCommandResponseDTO; 5 | 6 | /** 7 | * 设备命令响应处理器 8 | * 9 | * @author LSF maku_lsf@163.com 10 | */ 11 | public interface DeviceCommandResponseHandler { 12 | /** 13 | * 设备命令响应处理 14 | * 15 | * @param topic 16 | * @param commandResponse 17 | */ 18 | void handle(String topic, DeviceCommandResponseDTO commandResponse); 19 | } 20 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/MenuTypeEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 菜单类型枚举 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum MenuTypeEnum { 15 | /** 16 | * 菜单 17 | */ 18 | MENU(0), 19 | /** 20 | * 按钮 21 | */ 22 | BUTTON(1), 23 | /** 24 | * 接口 25 | */ 26 | INTERFACE(2); 27 | 28 | private final int value; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/mqtt/handler/MqttMessageHandler.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.mqtt.handler; 2 | 3 | /** 4 | * MQTT订阅消息处理接口 5 | * 6 | * @author LSF maku_lsf@163.com 7 | */ 8 | public interface MqttMessageHandler { 9 | /** 10 | * 是否支持处理指定的topic 11 | * 12 | * @param topic 13 | * @return 14 | */ 15 | boolean supports(String topic); 16 | 17 | /** 18 | * mqtt消息处理接口 19 | * 20 | * @param topic 21 | * @param message 22 | */ 23 | void handle(String topic, String message); 24 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysRoleQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 角色管理 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @Schema(description = "角色查询") 17 | public class SysRoleQuery extends Query { 18 | @Schema(description = "角色名称") 19 | private String name; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/tcp/handler/TCPMessageHandler.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.tcp.handler; 2 | 3 | 4 | /** 5 | * TCP消息处理接口 6 | * 7 | * @author LSF maku_lsf@163.com 8 | */ 9 | public interface TCPMessageHandler { 10 | 11 | /** 12 | * 是否支持处理指定的topic 13 | * 14 | * @param topic 15 | * @return 16 | */ 17 | boolean supports(String topic); 18 | 19 | /** 20 | * TCP消息处理接口 21 | * 22 | * @param topic 23 | * @param message 24 | */ 25 | void handle(String topic, Object message); 26 | } 27 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/storage/enums/StorageTypeEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.storage.enums; 2 | 3 | /** 4 | * 存储类型枚举 5 | * 6 | * @author 阿沐 babamu@126.com 7 | * MAKU 8 | */ 9 | public enum StorageTypeEnum { 10 | /** 11 | * 本地 12 | */ 13 | LOCAL, 14 | /** 15 | * 阿里云 16 | */ 17 | ALIYUN, 18 | /** 19 | * 腾讯云 20 | */ 21 | TENCENT, 22 | /** 23 | * 七牛云 24 | */ 25 | QINIU, 26 | /** 27 | * 华为云 28 | */ 29 | HUAWEI, 30 | /** 31 | * Minio 32 | */ 33 | MINIO; 34 | } 35 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.controller; 2 | 3 | import io.swagger.v3.oas.annotations.tags.Tag; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | /** 8 | * 首页 欢迎信息 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Tag(name = "首页") 14 | @RestController 15 | public class IndexController { 16 | 17 | @GetMapping("/") 18 | public String index() { 19 | return "您好,项目已启动,祝您使用愉快!"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysOrgConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysOrgEntity; 4 | import net.maku.system.vo.SysOrgVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | 11 | @Mapper 12 | public interface SysOrgConvert { 13 | SysOrgConvert INSTANCE = Mappers.getMapper(SysOrgConvert.class); 14 | 15 | SysOrgEntity convert(SysOrgVO vo); 16 | 17 | SysOrgVO convert(SysOrgEntity entity); 18 | 19 | List convertList(List list); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysUserRoleDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 13 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/security/third/ThirdLogin.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.security.third; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 第三方登录 表单数据 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Data 14 | public class ThirdLogin implements Serializable { 15 | /** 16 | * 开放平台类型 17 | */ 18 | private String openType; 19 | 20 | /** 21 | * 开放平台Code 22 | */ 23 | private String code; 24 | 25 | /** 26 | * state 27 | */ 28 | private String state; 29 | } 30 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysMenuConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysMenuEntity; 4 | import net.maku.system.vo.SysMenuVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | 11 | @Mapper 12 | public interface SysMenuConvert { 13 | SysMenuConvert INSTANCE = Mappers.getMapper(SysMenuConvert.class); 14 | 15 | SysMenuEntity convert(SysMenuVO vo); 16 | 17 | SysMenuVO convert(SysMenuEntity entity); 18 | 19 | List convertList(List list); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysPostConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysPostEntity; 4 | import net.maku.system.vo.SysPostVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | 11 | @Mapper 12 | public interface SysPostConvert { 13 | SysPostConvert INSTANCE = Mappers.getMapper(SysPostConvert.class); 14 | 15 | SysPostVO convert(SysPostEntity entity); 16 | 17 | SysPostEntity convert(SysPostVO vo); 18 | 19 | List convertList(List list); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysRoleConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysRoleEntity; 4 | import net.maku.system.vo.SysRoleVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface SysRoleConvert { 12 | SysRoleConvert INSTANCE = Mappers.getMapper(SysRoleConvert.class); 13 | 14 | SysRoleVO convert(SysRoleEntity entity); 15 | 16 | SysRoleEntity convert(SysRoleVO vo); 17 | 18 | List convertList(List list); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/enums/IOTProtocolEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.enums; 2 | 3 | import cn.hutool.core.util.StrUtil; 4 | import lombok.Getter; 5 | import lombok.RequiredArgsConstructor; 6 | 7 | import java.util.Arrays; 8 | 9 | /** 10 | * IOT常用的通信协议 11 | * 12 | * @author LSF maku_lsf@163.com 13 | */ 14 | @Getter 15 | @RequiredArgsConstructor 16 | public enum IOTProtocolEnum { 17 | 18 | MQTT("MQTT"), 19 | TCP("TCP"), 20 | UDP("UDP"), 21 | BLE("BLE"), 22 | CoAP("CoAP"), 23 | LwM2M("LwM2M"), 24 | Modbus("Modbus"); 25 | 26 | private final String value; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysUserTokenConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysUserTokenEntity; 4 | import net.maku.system.vo.SysUserTokenVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | /** 9 | * 用户Token 10 | * 11 | * @author 阿沐 babamu@126.com 12 | */ 13 | @Mapper 14 | public interface SysUserTokenConvert { 15 | SysUserTokenConvert INSTANCE = Mappers.getMapper(SysUserTokenConvert.class); 16 | 17 | SysUserTokenEntity convert(SysUserTokenVO vo); 18 | 19 | SysUserTokenVO convert(SysUserTokenEntity entity); 20 | 21 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysUserPostDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysUserPostEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 用户岗位关系 12 | * 13 | * @author 阿沐 babamu@126.com 14 | */ 15 | @Mapper 16 | public interface SysUserPostDao extends BaseDao { 17 | 18 | /** 19 | * 岗位ID列表 20 | * @param userId 用户ID 21 | */ 22 | List getPostIdList(@Param("userId") Long userId); 23 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysMailLogQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 邮件日志查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "邮件日志查询") 16 | public class SysMailLogQuery extends Query { 17 | @Schema(description = "发送人邮箱") 18 | private String mailFrom; 19 | 20 | @Schema(description = "平台类型") 21 | private Integer platform; 22 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysSmsLogQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 短信日志查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "短信日志查询") 16 | public class SysSmsLogQuery extends Query { 17 | @Schema(description = "手机号") 18 | private String mobile; 19 | 20 | @Schema(description = "平台类型") 21 | private Integer platform; 22 | 23 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/exception/ErrorCode.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.exception; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 错误编码 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum ErrorCode { 15 | UNAUTHORIZED(401, "还未授权,不能访问"), 16 | FORBIDDEN(403, "没有权限,禁止访问"), 17 | REFRESH_TOKEN_INVALID(400, "refresh_token 已失效"), 18 | INTERNAL_SERVER_ERROR(500, "服务器异常,请稍后再试"); 19 | 20 | private final int code; 21 | private final String msg; 22 | } 23 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysSmsConfigQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 短信配置查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "短信配置查询") 16 | public class SysSmsConfigQuery extends Query { 17 | @Schema(description = "平台类型") 18 | private Integer platform; 19 | 20 | @Schema(description = "分组名称") 21 | private String groupName; 22 | 23 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysCaptchaVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 图片验证码 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @Schema(description = "图片验证码") 16 | public class SysCaptchaVO implements Serializable { 17 | private static final long serialVersionUID = 1L; 18 | 19 | @Schema(description = "key") 20 | private String key; 21 | 22 | @Schema(description = "image base64") 23 | private String image; 24 | } 25 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysSmsLogConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysSmsLogEntity; 4 | import net.maku.system.vo.SysSmsLogVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 短信日志 12 | * 13 | * @author 阿沐 babamu@126.com 14 | */ 15 | @Mapper 16 | public interface SysSmsLogConvert { 17 | SysSmsLogConvert INSTANCE = Mappers.getMapper(SysSmsLogConvert.class); 18 | 19 | SysSmsLogVO convert(SysSmsLogEntity entity); 20 | 21 | List convertList(List list); 22 | 23 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/SmsPlatformEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 短信平台枚举 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum SmsPlatformEnum { 15 | /** 16 | * 阿里云 17 | */ 18 | ALIYUN(0), 19 | /** 20 | * 腾讯云 21 | */ 22 | TENCENT(1), 23 | /** 24 | * 七牛云 25 | */ 26 | QINIU(2), 27 | /** 28 | * 华为云 29 | */ 30 | HUAWEI(3); 31 | 32 | private final int value; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysMobileLoginVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 手机号登录 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @Schema(description = "手机号登录") 16 | public class SysMobileLoginVO implements Serializable { 17 | private static final long serialVersionUID = 1L; 18 | 19 | @Schema(description = "手机号") 20 | private String mobile; 21 | 22 | @Schema(description = "验证码") 23 | private String code; 24 | } 25 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysRoleMenuDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysRoleMenuEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 角色与菜单对应关系 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysRoleMenuDao extends BaseDao { 18 | 19 | /** 20 | * 根据角色ID,获取菜单ID列表 21 | */ 22 | List getMenuIdList(@Param("roleId") Long roleId); 23 | } 24 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysUserPostEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.mybatis.entity.BaseEntity; 7 | 8 | /** 9 | * 用户岗位关系 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper=false) 16 | @TableName("sys_user_post") 17 | public class SysUserPostEntity extends BaseEntity { 18 | /** 19 | * 用户ID 20 | */ 21 | private Long userId; 22 | /** 23 | * 岗位ID 24 | */ 25 | private Long postId; 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysLogOperateService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysLogOperateEntity; 6 | import net.maku.system.query.SysLogOperateQuery; 7 | import net.maku.system.vo.SysLogOperateVO; 8 | 9 | /** 10 | * 操作日志 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | public interface SysLogOperateService extends BaseService { 16 | 17 | PageResult page(SysLogOperateQuery query); 18 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysMailLogService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysMailLogEntity; 6 | import net.maku.system.query.SysMailLogQuery; 7 | import net.maku.system.vo.SysMailLogVO; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 邮件日志 13 | * 14 | * @author 阿沐 babamu@126.com 15 | */ 16 | public interface SysMailLogService extends BaseService { 17 | 18 | PageResult page(SysMailLogQuery query); 19 | 20 | void delete(List idList); 21 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysUserAvatarVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import jakarta.validation.constraints.NotBlank; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 用户头像 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | @Data 16 | @Schema(description = "用户头像") 17 | public class SysUserAvatarVO implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @NotBlank(message = "头像不能为空") 21 | @Schema(description = "头像") 22 | private String avatar; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/query/IotDeviceEventLogQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 设备事件日志查询 10 | * 11 | * @author LSF maku_lsf@163.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "设备事件日志查询") 16 | public class IotDeviceEventLogQuery extends Query { 17 | 18 | @Schema(description = "指令") 19 | private String eventTypeEnum; 20 | 21 | @Schema(description = "设备id") 22 | private Long deviceId; 23 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/query/IotDeviceServiceLogQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 设备服务日志查询 10 | * 11 | * @author LSF maku_lsf@163.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "设备服务日志查询") 16 | public class IotDeviceServiceLogQuery extends Query { 17 | @Schema(description = "指令") 18 | private String deviceCommandEnum; 19 | 20 | @Schema(description = "设备id") 21 | private Long deviceId; 22 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysDictDataConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysDictDataEntity; 4 | import net.maku.system.vo.SysDictDataVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface SysDictDataConvert { 12 | SysDictDataConvert INSTANCE = Mappers.getMapper(SysDictDataConvert.class); 13 | 14 | SysDictDataVO convert(SysDictDataEntity entity); 15 | 16 | SysDictDataEntity convert(SysDictDataVO vo); 17 | 18 | List convertList(List list); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysDictTypeConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysDictTypeEntity; 4 | import net.maku.system.vo.SysDictTypeVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface SysDictTypeConvert { 12 | SysDictTypeConvert INSTANCE = Mappers.getMapper(SysDictTypeConvert.class); 13 | 14 | SysDictTypeVO convert(SysDictTypeEntity entity); 15 | 16 | SysDictTypeEntity convert(SysDictTypeVO vo); 17 | 18 | List convertList(List list); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysRoleMenuEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.mybatis.entity.BaseEntity; 7 | 8 | /** 9 | * 角色菜单关系 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper=false) 16 | @TableName("sys_role_menu") 17 | public class SysRoleMenuEntity extends BaseEntity { 18 | /** 19 | * 角色ID 20 | */ 21 | private Long roleId; 22 | /** 23 | * 菜单ID 24 | */ 25 | private Long menuId; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysOrgDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysOrgEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | * 机构管理 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysOrgDao extends BaseDao { 18 | 19 | List getList(Map params); 20 | 21 | /** 22 | * 获取所有机构的id、pid列表 23 | */ 24 | List getIdAndPidList(); 25 | 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysUserSignatureVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import jakarta.validation.constraints.NotBlank; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 用户签名 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | @Data 16 | @Schema(description = "用户签名") 17 | public class SysUserSignatureVO implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @NotBlank(message = "签名不能为空") 21 | @Schema(description = "签名") 22 | private String signature; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /maku-boot-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.maku 4 | maku-boot 5 | ${revision} 6 | 7 | 4.0.0 8 | maku-boot-api 9 | jar 10 | 11 | 12 | 13 | org.springframework.boot 14 | spring-boot-starter-web 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysRoleDataScopeEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.mybatis.entity.BaseEntity; 7 | 8 | /** 9 | * 角色数据权限 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper=false) 16 | @TableName("sys_role_data_scope") 17 | public class SysRoleDataScopeEntity extends BaseEntity { 18 | /** 19 | * 角色ID 20 | */ 21 | private Long roleId; 22 | /** 23 | * 机构ID 24 | */ 25 | private Long orgId; 26 | 27 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/LoginOperationEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 登录信息 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum LoginOperationEnum { 15 | /** 16 | * 登录成功 17 | */ 18 | LOGIN_SUCCESS(0), 19 | /** 20 | * 退出成功 21 | */ 22 | LOGOUT_SUCCESS(1), 23 | /** 24 | * 验证码错误 25 | */ 26 | CAPTCHA_FAIL(2), 27 | /** 28 | * 账号密码错误 29 | */ 30 | ACCOUNT_FAIL(3); 31 | 32 | private final int value; 33 | } 34 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysAttachmentQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 附件管理查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @Schema(description = "附件管理查询") 17 | public class SysAttachmentQuery extends Query { 18 | @Schema(description = "附件名称") 19 | private String name; 20 | 21 | @Schema(description = "存储平台") 22 | private String platform; 23 | 24 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysOrgDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 14 | 15 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysDictTypeQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 字典类型 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @Schema(description = "字典类型查询") 17 | public class SysDictTypeQuery extends Query { 18 | @Schema(description = "字典类型") 19 | private String dictType; 20 | 21 | @Schema(description = "字典名称") 22 | private String dictName; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/service/ScheduleJobLogService.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.quartz.entity.ScheduleJobLogEntity; 6 | import net.maku.quartz.query.ScheduleJobLogQuery; 7 | import net.maku.quartz.vo.ScheduleJobLogVO; 8 | 9 | /** 10 | * 定时任务日志 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | public interface ScheduleJobLogService extends BaseService { 16 | 17 | PageResult page(ScheduleJobLogQuery query); 18 | 19 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/templates/third_login.ftlh: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 第三方登录 8 | 9 | 10 | 登陆中... 11 | 23 | 24 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/vo/DeviceCommandVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 设备指令 10 | * 11 | * @author LSF maku_lsf@163.com 12 | */ 13 | @Data 14 | @Schema(description = "设备指令VO") 15 | public class DeviceCommandVO implements Serializable { 16 | private static final long serialVersionUID = 1L; 17 | 18 | @Schema(description = "设备ID") 19 | private Long deviceId; 20 | 21 | @Schema(description = "指令") 22 | private String command; 23 | 24 | @Schema(description = "指令内容") 25 | private String payload; 26 | } 27 | -------------------------------------------------------------------------------- /maku-boot-new/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.maku 4 | maku-boot 5 | ${revision} 6 | 7 | 4.0.0 8 | maku-boot-new 9 | jar 10 | 11 | 12 | 13 | net.maku 14 | maku-framework 15 | ${revision} 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysSmsLogService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysSmsLogEntity; 6 | import net.maku.system.query.SysSmsLogQuery; 7 | import net.maku.system.vo.SysSmsLogVO; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 短信日志 13 | * 14 | * @author 阿沐 babamu@126.com 15 | * MAKU 16 | */ 17 | public interface SysSmsLogService extends BaseService { 18 | 19 | PageResult page(SysSmsLogQuery query); 20 | 21 | void delete(List idList); 22 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/xss/XssProperties.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.xss; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | 6 | import java.util.Collections; 7 | import java.util.List; 8 | 9 | /** 10 | * XSS 配置项 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | @Data 16 | @ConfigurationProperties(prefix = "maku.xss") 17 | public class XssProperties { 18 | /** 19 | * 是否开启 XSS 20 | */ 21 | private boolean enabled; 22 | /** 23 | * 排除的URL列表 24 | */ 25 | private List excludeUrls = Collections.emptyList(); 26 | } 27 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/cache/RedisKeys.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.cache; 2 | 3 | /** 4 | * Redis Key管理 5 | * 6 | * @author 阿沐 babamu@126.com 7 | * MAKU 8 | */ 9 | public class RedisKeys { 10 | 11 | /** 12 | * 验证码Key 13 | */ 14 | public static String getCaptchaKey(String key) { 15 | return "sys:captcha:" + key; 16 | } 17 | 18 | /** 19 | * accessToken Key 20 | */ 21 | public static String getAccessTokenKey(String accessToken) { 22 | return "sys:token:" + accessToken; 23 | } 24 | 25 | public static String getLogKey() { 26 | return "sys:log"; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/convert/IotDeviceConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.convert; 2 | 3 | import net.maku.iot.entity.IotDeviceEntity; 4 | import net.maku.iot.vo.IotDeviceVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 设备表 12 | * 13 | * @author LSF maku_lsf@163.com 14 | */ 15 | @Mapper 16 | public interface IotDeviceConvert { 17 | IotDeviceConvert INSTANCE = Mappers.getMapper(IotDeviceConvert.class); 18 | 19 | IotDeviceEntity convert(IotDeviceVO vo); 20 | 21 | IotDeviceVO convert(IotDeviceEntity entity); 22 | 23 | List convertList(List list); 24 | 25 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/email/param/EmailAliyunBatchSendParam.java: -------------------------------------------------------------------------------- 1 | package net.maku.email.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 阿里云 批量发送邮件参数 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class EmailAliyunBatchSendParam { 13 | /** 14 | * 分组名称,非必填 15 | */ 16 | private String groupName; 17 | /** 18 | * 发件人邮箱 19 | */ 20 | private String from; 21 | /** 22 | * 收件人列表名称 23 | */ 24 | private String receiversName; 25 | /** 26 | * 邮件模板名称 27 | */ 28 | private String templateName; 29 | /** 30 | * 邮件标签 31 | */ 32 | private String tagName; 33 | } 34 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysMailLogConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysMailLogEntity; 4 | import net.maku.system.vo.SysMailLogVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 邮件日志 12 | * 13 | * @author 阿沐 babamu@126.com 14 | */ 15 | @Mapper 16 | public interface SysMailLogConvert { 17 | SysMailLogConvert INSTANCE = Mappers.getMapper(SysMailLogConvert.class); 18 | 19 | SysMailLogEntity convert(SysMailLogVO vo); 20 | 21 | SysMailLogVO convert(SysMailLogEntity entity); 22 | 23 | List convertList(List list); 24 | 25 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/DataScopeEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 数据范围枚举 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum DataScopeEnum { 15 | /** 16 | * 全部数据 17 | */ 18 | ALL(0), 19 | /** 20 | * 本机构及子机构数据 21 | */ 22 | ORG_AND_CHILD(1), 23 | /** 24 | * 本机构数据 25 | */ 26 | ORG_ONLY(2), 27 | /** 28 | * 本人数据 29 | */ 30 | SELF(3), 31 | /** 32 | * 自定义数据 33 | */ 34 | CUSTOM(4); 35 | 36 | private final Integer value; 37 | 38 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysDictDataQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import jakarta.validation.constraints.NotNull; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import net.maku.framework.common.query.Query; 8 | 9 | /** 10 | * 字典数据 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | @Data 16 | @EqualsAndHashCode(callSuper = false) 17 | @Schema(description = "字典数据查询") 18 | public class SysDictDataQuery extends Query { 19 | @Schema(description = "字典类型ID", required = true) 20 | @NotNull(message = "字典类型ID不能为空") 21 | private Long dictTypeId; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysRoleDataScopeDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/query/ScheduleJobQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 定时任务查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "定时任务查询") 16 | public class ScheduleJobQuery extends Query { 17 | @Schema(description = "任务名称") 18 | private String jobName; 19 | 20 | @Schema(description = "任务组名") 21 | private String jobGroup; 22 | 23 | @Schema(description = "状态") 24 | private Integer status; 25 | 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysUserRoleEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.mybatis.entity.BaseEntity; 7 | 8 | /** 9 | * 用户角色关系 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper=false) 16 | @TableName("sys_user_role") 17 | public class SysUserRoleEntity extends BaseEntity { 18 | private static final long serialVersionUID = 1L; 19 | 20 | /** 21 | * 角色ID 22 | */ 23 | private Long roleId; 24 | /** 25 | * 用户ID 26 | */ 27 | private Long userId; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/query/ScheduleJobLogQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 定时任务日志查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "定时任务日志查询") 16 | public class ScheduleJobLogQuery extends Query { 17 | @Schema(description = "任务id") 18 | private Long jobId; 19 | 20 | @Schema(description = "任务名称") 21 | private String jobName; 22 | 23 | @Schema(description = "任务组名") 24 | private String jobGroup; 25 | 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysDictDataDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysDictDataEntity; 5 | import net.maku.system.vo.SysDictVO; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | import org.apache.ibatis.annotations.Select; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 字典数据 14 | * 15 | * @author 阿沐 babamu@126.com 16 | * MAKU 17 | */ 18 | @Mapper 19 | public interface SysDictDataDao extends BaseDao { 20 | 21 | @Select("${sql}") 22 | List getListForSql(@Param("sql") String sql); 23 | } 24 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysCaptchaService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.system.vo.SysCaptchaVO; 4 | 5 | /** 6 | * 验证码 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | public interface SysCaptchaService { 12 | /** 13 | * 生成验证码 14 | */ 15 | SysCaptchaVO generate(); 16 | 17 | /** 18 | * 验证码效验 19 | * 20 | * @param key key 21 | * @param code 验证码 22 | * @return true:成功 false:失败 23 | */ 24 | boolean validate(String key, String code); 25 | 26 | /** 27 | * 是否开启登录验证码 28 | * 29 | * @return true:开启 false:关闭 30 | */ 31 | boolean isCaptchaEnabled(); 32 | } 33 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/security/mobile/MobileUserDetailsService.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.security.mobile; 2 | 3 | import org.springframework.security.core.userdetails.UserDetails; 4 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 5 | 6 | /** 7 | * 手机短信登录,UserDetailsService 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | public interface MobileUserDetailsService { 13 | 14 | /** 15 | * 通过手机号加载用户信息 16 | * 17 | * @param mobile 手机号 18 | * @return 用户信息 19 | * @throws UsernameNotFoundException 不存在异常 20 | */ 21 | UserDetails loadUserByMobile(String mobile) throws UsernameNotFoundException; 22 | } 23 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/dto/DevicePropertyDTO.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.dto; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import net.maku.iot.enums.DevicePropertyEnum; 6 | 7 | /** 8 | * 设备属性对象 9 | * 10 | * @author LSF maku_lsf@163.com 11 | */ 12 | @Data 13 | @Schema(description = "设备属性对象") 14 | public class DevicePropertyDTO extends BaseDeviceID { 15 | /** 16 | * 设备属性类型 17 | */ 18 | @Schema(description = "设备属性类型") 19 | private DevicePropertyEnum propertyType; 20 | 21 | /** 22 | * 属性数据 23 | */ 24 | @Schema(description = "状态数据,不同状态类型需传入相应的状态数据", required = true) 25 | private String payload; 26 | } 27 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/enums/DevicePropertyEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.enums; 2 | 3 | 4 | import lombok.Getter; 5 | import lombok.RequiredArgsConstructor; 6 | 7 | /** 8 | * 设备属性枚举 9 | * 10 | * @author LSF maku_lsf@163.com 11 | */ 12 | @Getter 13 | @RequiredArgsConstructor 14 | public enum DevicePropertyEnum { 15 | /** 16 | * 运行状态 17 | */ 18 | RUNNING_STATUS(1), 19 | 20 | /** 21 | * APP版本 22 | */ 23 | APP_VERSION(2), 24 | 25 | /** 26 | * 电池电量百分比 27 | */ 28 | BATTERY_PERCENT(3), 29 | 30 | /** 31 | * 温度 32 | */ 33 | TEMPERATURE(4); 34 | 35 | /** 36 | * 类型值 37 | */ 38 | private final Integer value; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-member/src/main/java/net/maku/member/convert/MemberUserConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.member.convert; 2 | 3 | import net.maku.member.entity.MemberUserEntity; 4 | import net.maku.member.vo.MemberUserVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 会员管理 12 | * 13 | * @author 阿沐 babamu@126.com 14 | */ 15 | @Mapper 16 | public interface MemberUserConvert { 17 | MemberUserConvert INSTANCE = Mappers.getMapper(MemberUserConvert.class); 18 | 19 | MemberUserEntity convert(MemberUserVO vo); 20 | 21 | MemberUserVO convert(MemberUserEntity entity); 22 | 23 | List convertList(List list); 24 | 25 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/vo/DeviceReportAttributeDataVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 设备上报属性数据 10 | * 11 | * @author LSF maku_lsf@163.com 12 | */ 13 | @Data 14 | @Schema(description = "设备上报属性数据VO") 15 | public class DeviceReportAttributeDataVO implements Serializable { 16 | private static final long serialVersionUID = 1L; 17 | 18 | @Schema(description = "设备ID") 19 | private Long deviceId; 20 | 21 | @Schema(description = "设备属性类型") 22 | private String propertyType; 23 | 24 | @Schema(description = "属性数据") 25 | private String payload; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/convert/ScheduleJobConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.convert; 2 | 3 | import net.maku.quartz.entity.ScheduleJobEntity; 4 | import net.maku.quartz.vo.ScheduleJobVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 定时任务 12 | * 13 | * @author 阿沐 babamu@126.com 14 | */ 15 | @Mapper 16 | public interface ScheduleJobConvert { 17 | ScheduleJobConvert INSTANCE = Mappers.getMapper(ScheduleJobConvert.class); 18 | 19 | ScheduleJobEntity convert(ScheduleJobVO vo); 20 | 21 | ScheduleJobVO convert(ScheduleJobEntity entity); 22 | 23 | List convertList(List list); 24 | 25 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysParamsConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysParamsEntity; 4 | import net.maku.system.vo.SysParamsVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 参数管理 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysParamsConvert { 18 | SysParamsConvert INSTANCE = Mappers.getMapper(SysParamsConvert.class); 19 | 20 | SysParamsEntity convert(SysParamsVO vo); 21 | 22 | SysParamsVO convert(SysParamsEntity entity); 23 | 24 | List convertList(List list); 25 | 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysThirdCallbackVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 第三方登录 回调参数 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @Schema(description = "第三方登录 回调参数") 16 | public class SysThirdCallbackVO implements Serializable { 17 | private static final long serialVersionUID = 1L; 18 | 19 | @Schema(description = "开放平台类型") 20 | private String openType; 21 | 22 | @Schema(description = "开放平台Code") 23 | private String code; 24 | 25 | @Schema(description = "state") 26 | private String state; 27 | } 28 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysSmsSendVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 短信发送 10 | * 11 | * @author 阿沐 babamu@126.com 12 | */ 13 | @Data 14 | @Schema(description = "短信发送") 15 | public class SysSmsSendVO implements Serializable { 16 | private static final long serialVersionUID = 1L; 17 | 18 | @Schema(description = "id") 19 | private Long id; 20 | 21 | @Schema(description = "手机号") 22 | private String mobile; 23 | 24 | @Schema(description = "参数Key") 25 | private String paramKey; 26 | 27 | @Schema(description = "参数Value") 28 | private String paramValue; 29 | 30 | } -------------------------------------------------------------------------------- /maku-server/src/main/java/net/maku/ServerApplication.java: -------------------------------------------------------------------------------- 1 | package net.maku; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.builder.SpringApplicationBuilder; 6 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 7 | 8 | @SpringBootApplication 9 | public class ServerApplication extends SpringBootServletInitializer { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(ServerApplication.class, args); 13 | } 14 | 15 | @Override 16 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 17 | return application.sources(ServerApplication.class); 18 | } 19 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/security/service/MobileVerifyCodeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package net.maku.security.service; 2 | 3 | import lombok.AllArgsConstructor; 4 | import net.maku.api.module.system.SmsApi; 5 | import net.maku.framework.security.mobile.MobileVerifyCodeService; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | * 短信验证码效验 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Service 15 | @AllArgsConstructor 16 | public class MobileVerifyCodeServiceImpl implements MobileVerifyCodeService { 17 | private final SmsApi smsApi; 18 | 19 | @Override 20 | public boolean verifyCode(String mobile, String code) { 21 | return smsApi.verifyCode(mobile, code); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysParamsQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 参数管理查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @Schema(description = "参数管理查询") 17 | public class SysParamsQuery extends Query { 18 | @Schema(description = "系统参数") 19 | private Integer paramType; 20 | 21 | @Schema(description = "参数键") 22 | private String paramKey; 23 | 24 | @Schema(description = "参数值") 25 | private String paramValue; 26 | 27 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysPostQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 岗位管理 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @Schema(description = "岗位管理查询") 17 | public class SysPostQuery extends Query { 18 | @Schema(description = "岗位编码") 19 | private String postCode; 20 | 21 | @Schema(description = "岗位名称") 22 | private String postName; 23 | 24 | @Schema(description = "状态 0:停用 1:正常") 25 | private Integer status; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysLogLoginQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 登录日志查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @Schema(description = "登录日志查询") 17 | public class SysLogLoginQuery extends Query { 18 | @Schema(description = "用户名") 19 | private String username; 20 | 21 | @Schema(description = "登录地点") 22 | private String address; 23 | 24 | @Schema(description = "登录状态 0:失败 1:成功") 25 | private Integer status; 26 | 27 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-member/src/main/java/net/maku/member/service/MemberUserService.java: -------------------------------------------------------------------------------- 1 | package net.maku.member.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.member.entity.MemberUserEntity; 6 | import net.maku.member.query.MemberUserQuery; 7 | import net.maku.member.vo.MemberUserVO; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 会员管理 13 | * 14 | * @author 阿沐 babamu@126.com 15 | */ 16 | public interface MemberUserService extends BaseService { 17 | 18 | PageResult page(MemberUserQuery query); 19 | 20 | void save(MemberUserVO vo); 21 | 22 | void update(MemberUserVO vo); 23 | 24 | void delete(List idList); 25 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysLogLoginConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysLogLoginEntity; 4 | import net.maku.system.vo.SysLogLoginVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 登录日志 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysLogLoginConvert { 18 | SysLogLoginConvert INSTANCE = Mappers.getMapper(SysLogLoginConvert.class); 19 | 20 | SysLogLoginEntity convert(SysLogLoginVO vo); 21 | 22 | SysLogLoginVO convert(SysLogLoginEntity entity); 23 | 24 | List convertList(List list); 25 | 26 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/convert/ScheduleJobLogConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.convert; 2 | 3 | import net.maku.quartz.entity.ScheduleJobLogEntity; 4 | import net.maku.quartz.vo.ScheduleJobLogVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 定时任务日志 12 | * 13 | * @author 阿沐 babamu@126.com 14 | */ 15 | @Mapper 16 | public interface ScheduleJobLogConvert { 17 | ScheduleJobLogConvert INSTANCE = Mappers.getMapper(ScheduleJobLogConvert.class); 18 | 19 | ScheduleJobLogEntity convert(ScheduleJobLogVO vo); 20 | 21 | ScheduleJobLogVO convert(ScheduleJobLogEntity entity); 22 | 23 | List convertList(List list); 24 | 25 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/query/IotDeviceQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 设备表查询 10 | * 11 | * @author LSF maku_lsf@163.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "设备表查询") 16 | public class IotDeviceQuery extends Query { 17 | 18 | @Schema(description = "状态,0禁用,1正常") 19 | private Integer status; 20 | 21 | @Schema(description = "运行状态,0.离线状态 1.在线状态 2.正常待机 3.用户使用中 4.OTA升级中") 22 | private Integer runningStatus; 23 | 24 | @Schema(description = "设备类型,1.手持设备,2.柜体,3传感设备") 25 | private Integer type; 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysRoleDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysRoleEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 角色管理 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysRoleDao extends BaseDao { 18 | 19 | /** 20 | * 根据用户ID,获取用户最大的数据范围 21 | */ 22 | Integer getDataScopeByUserId(@Param("userId") Long userId); 23 | 24 | /** 25 | * 根据用户ID,获取用户角色编码 26 | */ 27 | List geRoleCodeByUserId(@Param("userId") Long userId); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysRoleDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysFileUploadVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 文件上传 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @Schema(description = "文件上传") 16 | public class SysFileUploadVO implements Serializable { 17 | private static final long serialVersionUID = 1L; 18 | 19 | @Schema(description = "文件名称") 20 | private String name; 21 | 22 | @Schema(description = "文件地址") 23 | private String url; 24 | 25 | @Schema(description = "文件大小") 26 | private Long size; 27 | 28 | @Schema(description = "存储平台") 29 | private String platform; 30 | } 31 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-member/src/main/java/net/maku/member/query/MemberUserQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.member.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 会员管理查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | */ 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | @Schema(description = "会员管理查询") 16 | public class MemberUserQuery extends Query { 17 | @Schema(description = "昵称") 18 | private String nickName; 19 | 20 | @Schema(description = "手机号") 21 | private String mobile; 22 | 23 | @Schema(description = "性别") 24 | private Integer gender; 25 | 26 | @Schema(description = "状态") 27 | private Integer status; 28 | 29 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysAttachmentConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysAttachmentEntity; 4 | import net.maku.system.vo.SysAttachmentVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 附件管理 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysAttachmentConvert { 18 | SysAttachmentConvert INSTANCE = Mappers.getMapper(SysAttachmentConvert.class); 19 | 20 | SysAttachmentEntity convert(SysAttachmentVO vo); 21 | 22 | SysAttachmentVO convert(SysAttachmentEntity entity); 23 | 24 | List convertList(List list); 25 | 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysLogOperateConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysLogOperateEntity; 4 | import net.maku.system.vo.SysLogOperateVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 操作日志 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysLogOperateConvert { 18 | SysLogOperateConvert INSTANCE = Mappers.getMapper(SysLogOperateConvert.class); 19 | 20 | SysLogOperateEntity convert(SysLogOperateVO vo); 21 | 22 | SysLogOperateVO convert(SysLogOperateEntity entity); 23 | 24 | List convertList(List list); 25 | 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysThirdLoginConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysThirdLoginEntity; 4 | import net.maku.system.vo.SysThirdLoginVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 第三方登录 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysThirdLoginConvert { 18 | SysThirdLoginConvert INSTANCE = Mappers.getMapper(SysThirdLoginConvert.class); 19 | 20 | SysThirdLoginEntity convert(SysThirdLoginVO vo); 21 | 22 | SysThirdLoginVO convert(SysThirdLoginEntity entity); 23 | 24 | List convertList(List list); 25 | 26 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/xss/XssUtils.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.xss; 2 | 3 | import org.jsoup.Jsoup; 4 | import org.jsoup.nodes.Document; 5 | import org.jsoup.safety.Safelist; 6 | 7 | /** 8 | * XSS 过滤工具类 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | public class XssUtils { 14 | /** 15 | * 不格式化 16 | */ 17 | private final static Document.OutputSettings outputSettings = new Document.OutputSettings().prettyPrint(false); 18 | 19 | /** 20 | * XSS过滤 21 | * 22 | * @param content 需要过滤的内容 23 | * @return 返回过滤后的内容 24 | */ 25 | public static String filter(String content) { 26 | return Jsoup.clean(content, "", Safelist.relaxed(), outputSettings); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/security/config/PasswordConfig.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.security.config; 2 | 3 | import net.maku.framework.security.crypto.Sm3PasswordEncoder; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.security.crypto.password.PasswordEncoder; 7 | 8 | /** 9 | * 加密配置 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Configuration 15 | public class PasswordConfig { 16 | 17 | @Bean 18 | public PasswordEncoder passwordEncoder() { 19 | // 使用国密SM3加密 20 | return new Sm3PasswordEncoder(); 21 | 22 | // return PasswordEncoderFactories.createDelegatingPasswordEncoder(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/security/properties/SecurityProperties.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.security.properties; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * 安全配置项 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Data 14 | @Configuration 15 | @ConfigurationProperties(prefix = "maku.security") 16 | public class SecurityProperties { 17 | /** 18 | * accessToken 过期时间(单位:秒),默认2小时 19 | */ 20 | private int accessTokenExpire = 60 * 60 * 2; 21 | /** 22 | * refreshToken 过期时间(单位:秒),默认14天 23 | */ 24 | private int refreshTokenExpire = 60 * 60 * 24 * 14; 25 | } 26 | -------------------------------------------------------------------------------- /maku-boot-module/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.maku 4 | maku-boot 5 | ${revision} 6 | 7 | 4.0.0 8 | maku-boot-module 9 | pom 10 | 11 | 12 | maku-module-quartz 13 | maku-module-generator 14 | maku-module-monitor 15 | maku-module-member 16 | maku-module-iot 17 | maku-module-websocket 18 | 19 | 20 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysRoleDataScopeDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysRoleDataScopeEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 角色数据权限 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysRoleDataScopeDao extends BaseDao { 18 | 19 | /** 20 | * 根据角色ID,获取机构ID列表 21 | */ 22 | List getOrgIdList(@Param("roleId") Long roleId); 23 | 24 | /** 25 | * 获取用户的数据权限列表 26 | */ 27 | List getDataScopeList(@Param("userId") Long userId); 28 | 29 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysAccountLoginVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 账号登录 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @Schema(description = "账号登录") 16 | public class SysAccountLoginVO implements Serializable { 17 | private static final long serialVersionUID = 1L; 18 | 19 | @Schema(description = "用户名") 20 | private String username; 21 | 22 | @Schema(description = "密码") 23 | private String password; 24 | 25 | @Schema(description = "唯一key") 26 | private String key; 27 | 28 | @Schema(description = "验证码") 29 | private String captcha; 30 | } 31 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/convert/IotDeviceEventLogConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.convert; 2 | 3 | import net.maku.iot.entity.IotDeviceEventLogEntity; 4 | import net.maku.iot.vo.IotDeviceEventLogVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 设备事件日志 12 | * 13 | * @author LSF maku_lsf@163.com 14 | */ 15 | @Mapper 16 | public interface IotDeviceEventLogConvert { 17 | IotDeviceEventLogConvert INSTANCE = Mappers.getMapper(IotDeviceEventLogConvert.class); 18 | 19 | IotDeviceEventLogEntity convert(IotDeviceEventLogVO vo); 20 | 21 | IotDeviceEventLogVO convert(IotDeviceEventLogEntity entity); 22 | 23 | List convertList(List list); 24 | 25 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-monitor/src/main/java/net/maku/monitor/model/Disk.java: -------------------------------------------------------------------------------- 1 | package net.maku.monitor.model; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * Disk 7 | * 8 | * @author Pure tea 9 | */ 10 | @Data 11 | public class Disk { 12 | 13 | /** 14 | * 磁盘名称 15 | */ 16 | private String diskName; 17 | 18 | /** 19 | * 磁盘类型 20 | */ 21 | private String diskType; 22 | 23 | /** 24 | * 磁盘路径 25 | */ 26 | private String dirName; 27 | 28 | /** 29 | * 总大小 30 | */ 31 | private String total; 32 | 33 | /** 34 | * 剩余大小 35 | */ 36 | private String free; 37 | 38 | /** 39 | * 已经使用量 40 | */ 41 | private String used; 42 | 43 | /** 44 | * 资源的使用率 45 | */ 46 | private double usage; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysDictDataService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysDictDataEntity; 6 | import net.maku.system.query.SysDictDataQuery; 7 | import net.maku.system.vo.SysDictDataVO; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 数据字典 13 | * 14 | * @author 阿沐 babamu@126.com 15 | * MAKU 16 | */ 17 | public interface SysDictDataService extends BaseService { 18 | 19 | PageResult page(SysDictDataQuery query); 20 | 21 | void save(SysDictDataVO vo); 22 | 23 | void update(SysDictDataVO vo); 24 | 25 | void delete(List idList); 26 | 27 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/security/third/ThirdUserDetailsService.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.security.third; 2 | 3 | import org.springframework.security.core.userdetails.UserDetails; 4 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 5 | 6 | /** 7 | * 第三方登录,ThirdUserDetailsService 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | public interface ThirdUserDetailsService { 13 | 14 | /** 15 | * 通过开放平台类型和唯一标识,加载用户信息 16 | * 17 | * @param openType 开放平台类型 18 | * @param openId 开放平台唯一标识 19 | * @return 用户信息 20 | * @throws UsernameNotFoundException 不存在异常 21 | */ 22 | UserDetails loadUserByOpenTypeAndOpenId(String openType, String openId) throws UsernameNotFoundException; 23 | } 24 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-generator/src/main/resources/template/java/Convert.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package}.${moduleName}.convert; 2 | 3 | import ${package}.${moduleName}.entity.${ClassName}Entity; 4 | import ${package}.${moduleName}.vo.${ClassName}VO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * ${tableComment} 12 | * 13 | * @author ${author} ${email} 14 | * @since ${version} ${date} 15 | */ 16 | @Mapper 17 | public interface ${ClassName}Convert { 18 | ${ClassName}Convert INSTANCE = Mappers.getMapper(${ClassName}Convert.class); 19 | 20 | ${ClassName}Entity convert(${ClassName}VO vo); 21 | 22 | ${ClassName}VO convert(${ClassName}Entity entity); 23 | 24 | List<${ClassName}VO> convertList(List<${ClassName}Entity> list); 25 | 26 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-member/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | net.maku 5 | maku-boot-module 6 | ${revision} 7 | 8 | 4.0.0 9 | maku-module-member 10 | jar 11 | 12 | 13 | 14 | net.maku 15 | maku-framework 16 | ${revision} 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysAttachmentService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysAttachmentEntity; 6 | import net.maku.system.query.SysAttachmentQuery; 7 | import net.maku.system.vo.SysAttachmentVO; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 附件管理 13 | * 14 | * @author 阿沐 babamu@126.com 15 | * MAKU 16 | */ 17 | public interface SysAttachmentService extends BaseService { 18 | 19 | PageResult page(SysAttachmentQuery query); 20 | 21 | void save(SysAttachmentVO vo); 22 | 23 | void update(SysAttachmentVO vo); 24 | 25 | void delete(List idList); 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/resources/mapper/SysUseTokenDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/security/crypto/Sm3PasswordEncoder.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.security.crypto; 2 | 3 | import cn.hutool.core.util.StrUtil; 4 | import cn.hutool.crypto.SmUtil; 5 | import org.springframework.security.crypto.password.PasswordEncoder; 6 | 7 | /** 8 | * 采用国密SM3加密算法,对系统密码进行加密 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | public class Sm3PasswordEncoder implements PasswordEncoder { 14 | @Override 15 | public String encode(CharSequence rawPassword) { 16 | return SmUtil.sm3(rawPassword.toString()); 17 | } 18 | 19 | @Override 20 | public boolean matches(CharSequence rawPassword, String encodedPassword) { 21 | return StrUtil.equals(SmUtil.sm3(rawPassword.toString()), encodedPassword); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-generator/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | net.maku 5 | maku-boot-module 6 | ${revision} 7 | 8 | 4.0.0 9 | maku-module-generator 10 | jar 11 | 12 | 13 | 14 | net.maku 15 | maku-generator-boot-starter 16 | 3.2.0 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/convert/IotDeviceServiceLogConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.convert; 2 | 3 | import net.maku.iot.entity.IotDeviceServiceLogEntity; 4 | import net.maku.iot.vo.IotDeviceServiceLogVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 设备服务日志 12 | * 13 | * @author LSF maku_lsf@163.com 14 | */ 15 | @Mapper 16 | public interface IotDeviceServiceLogConvert { 17 | IotDeviceServiceLogConvert INSTANCE = Mappers.getMapper(IotDeviceServiceLogConvert.class); 18 | 19 | IotDeviceServiceLogEntity convert(IotDeviceServiceLogVO vo); 20 | 21 | IotDeviceServiceLogVO convert(IotDeviceServiceLogEntity entity); 22 | 23 | List convertList(List list); 24 | 25 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysLogOperateQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | /** 9 | * 操作日志查询 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @Schema(description = "操作日志查询") 17 | public class SysLogOperateQuery extends Query { 18 | @Schema(description = "用户") 19 | private String realName; 20 | 21 | @Schema(description = "模块名") 22 | private String module; 23 | 24 | @Schema(description = "请求URI") 25 | private String reqUri; 26 | 27 | @Schema(description = "操作状态") 28 | private Integer status; 29 | 30 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/utils/ExceptionUtils.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.utils; 2 | 3 | import cn.hutool.core.io.IoUtil; 4 | 5 | import java.io.PrintWriter; 6 | import java.io.StringWriter; 7 | 8 | /** 9 | * Exception工具类 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | public class ExceptionUtils { 15 | 16 | /** 17 | * 获取异常信息 18 | * @param e 异常 19 | * @return 返回异常信息 20 | */ 21 | public static String getExceptionMessage(Exception e) { 22 | StringWriter sw = new StringWriter(); 23 | PrintWriter pw = new PrintWriter(sw, true); 24 | e.printStackTrace(pw); 25 | 26 | // 关闭IO流 27 | IoUtil.close(pw); 28 | IoUtil.close(sw); 29 | 30 | return sw.toString(); 31 | } 32 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/dto/DeviceCommandDTO.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.dto; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import net.maku.iot.enums.DeviceCommandEnum; 6 | 7 | /** 8 | * 设备命令对象 9 | * 10 | * @author LSF maku_lsf@163.com 11 | */ 12 | @Data 13 | @Schema(description = "设备命令对象") 14 | public class DeviceCommandDTO extends BaseDeviceID { 15 | /** 16 | * 命令类型 17 | */ 18 | @Schema(description = "命令类型", required = true) 19 | private DeviceCommandEnum command; 20 | 21 | /** 22 | * 命令id 23 | */ 24 | @Schema(description = "命令id", required = true) 25 | private String id; 26 | 27 | /** 28 | * 命令内容 29 | */ 30 | @Schema(description = "命令内容") 31 | private String payload; 32 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-monitor/src/main/java/net/maku/monitor/vo/UserOnlineVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.monitor.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | /** 7 | * 在线用户 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Data 13 | @Schema(description = "在线用户") 14 | public class UserOnlineVO { 15 | @Schema(description = "id") 16 | private Long id; 17 | 18 | @Schema(description = "用户名") 19 | private String username; 20 | 21 | @Schema(description = "姓名") 22 | private String realName; 23 | 24 | @Schema(description = "性别") 25 | private Integer gender; 26 | 27 | @Schema(description = "邮箱") 28 | private String email; 29 | 30 | @Schema(description = "accessToken") 31 | private String accessToken; 32 | } 33 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/email/param/EmailAliyunSendParam.java: -------------------------------------------------------------------------------- 1 | package net.maku.email.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 阿里云 发送邮件参数 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class EmailAliyunSendParam { 13 | /** 14 | * 分组名称,非必填 15 | */ 16 | private String groupName; 17 | /** 18 | * 发件人邮箱 19 | */ 20 | private String from; 21 | /** 22 | * 发件人昵称 23 | */ 24 | private String formAlias; 25 | /** 26 | * 收件人邮箱列表,逗号拼接 27 | */ 28 | private String tos; 29 | /** 30 | * 邮件主题 31 | */ 32 | private String subject; 33 | /** 34 | * 邮件内容 35 | */ 36 | private String content; 37 | /** 38 | * 是否为html格式 39 | */ 40 | private boolean html; 41 | } 42 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/operatelog/enums/OperateTypeEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.operatelog.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 操作类型 8 | * 9 | * @author 阿沐 babamu@126.com 10 | * MAKU 11 | */ 12 | @Getter 13 | @AllArgsConstructor 14 | public enum OperateTypeEnum { 15 | /** 16 | * 查询 17 | */ 18 | GET(1), 19 | /** 20 | * 新增 21 | */ 22 | INSERT(2), 23 | /** 24 | * 修改 25 | */ 26 | UPDATE(3), 27 | /** 28 | * 删除 29 | */ 30 | DELETE(4), 31 | /** 32 | * 导出 33 | */ 34 | EXPORT(5), 35 | /** 36 | * 导入 37 | */ 38 | IMPORT(6), 39 | /** 40 | * 其它 41 | */ 42 | OTHER(0); 43 | 44 | private final int value; 45 | } 46 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysParamsDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import net.maku.framework.mybatis.dao.BaseDao; 5 | import net.maku.system.entity.SysParamsEntity; 6 | import org.apache.ibatis.annotations.Mapper; 7 | 8 | /** 9 | * 参数管理 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Mapper 15 | public interface SysParamsDao extends BaseDao { 16 | 17 | default boolean isExist(String paramKey) { 18 | return this.exists(new QueryWrapper().eq("param_key", paramKey)); 19 | } 20 | 21 | default SysParamsEntity get(String paramKey) { 22 | return this.selectOne(new QueryWrapper().eq("param_key", paramKey)); 23 | } 24 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/utils/TreeNode.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.utils; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * 树节点,所有需要实现树节点的,都需要继承该类 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Data 17 | public class TreeNode implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | /** 20 | * 主键 21 | */ 22 | @Schema(description = "id") 23 | private Long id; 24 | /** 25 | * 上级ID 26 | */ 27 | @Schema(description = "上级ID") 28 | private Long pid; 29 | /** 30 | * 子节点列表 31 | */ 32 | private List children = new ArrayList<>(); 33 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | net.maku 4 | maku-boot-module 5 | ${revision} 6 | 7 | 4.0.0 8 | maku-module-quartz 9 | jar 10 | 11 | 12 | 13 | net.maku 14 | maku-framework 15 | ${revision} 16 | 17 | 18 | org.quartz-scheduler 19 | quartz 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/query/SysUserQuery.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.common.query.Query; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 用户查询 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Data 17 | @EqualsAndHashCode(callSuper = false) 18 | @Schema(description = "用户查询") 19 | public class SysUserQuery extends Query { 20 | @Schema(description = "用户名") 21 | private String username; 22 | 23 | @Schema(description = "手机号") 24 | private String mobile; 25 | 26 | @Schema(description = "性别") 27 | private Integer gender; 28 | 29 | @Schema(description = "机构ID") 30 | private List orgId; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-generator/src/main/resources/template/java/Service.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package}.${moduleName}.service; 2 | 3 | import ${package}.framework.common.utils.PageResult; 4 | import ${package}.framework.mybatis.service.BaseService; 5 | import ${package}.${moduleName}.vo.${ClassName}VO; 6 | import ${package}.${moduleName}.query.${ClassName}Query; 7 | import ${package}.${moduleName}.entity.${ClassName}Entity; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * ${tableComment} 13 | * 14 | * @author ${author} ${email} 15 | * @since ${version} ${date} 16 | */ 17 | public interface ${ClassName}Service extends BaseService<${ClassName}Entity> { 18 | 19 | PageResult<${ClassName}VO> page(${ClassName}Query query); 20 | 21 | void save(${ClassName}VO vo); 22 | 23 | void update(${ClassName}VO vo); 24 | 25 | void delete(List idList); 26 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysPostService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysPostEntity; 6 | import net.maku.system.query.SysPostQuery; 7 | import net.maku.system.vo.SysPostVO; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 岗位管理 13 | * 14 | * @author 阿沐 babamu@126.com 15 | * MAKU 16 | */ 17 | public interface SysPostService extends BaseService { 18 | 19 | PageResult page(SysPostQuery query); 20 | 21 | List getList(); 22 | 23 | List getNameList(List idList); 24 | 25 | void save(SysPostVO vo); 26 | 27 | void update(SysPostVO vo); 28 | 29 | void delete(List idList); 30 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-websocket/src/main/java/net/maku/websocket/util/SessionUserUtil.java: -------------------------------------------------------------------------------- 1 | package net.maku.websocket.util; 2 | 3 | import net.maku.framework.security.user.UserDetail; 4 | import org.springframework.web.socket.WebSocketSession; 5 | 6 | import java.util.Map; 7 | 8 | public class SessionUserUtil { 9 | private static final String SESSION_USER = "SESSION_USER"; 10 | 11 | /** 12 | * 设置用户 13 | * 14 | * @param user 用户 15 | * @param attributes attributes 16 | */ 17 | public static void setUser(UserDetail user, Map attributes) { 18 | attributes.put(SESSION_USER, user); 19 | } 20 | 21 | /** 22 | * 获取用户 23 | */ 24 | public static UserDetail getUser(WebSocketSession session) { 25 | return (UserDetail) session.getAttributes().get(SESSION_USER); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysThirdLoginConfigConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.system.entity.SysThirdLoginConfigEntity; 4 | import net.maku.system.vo.SysThirdLoginConfigVO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 第三方登录配置 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysThirdLoginConfigConvert { 18 | SysThirdLoginConfigConvert INSTANCE = Mappers.getMapper(SysThirdLoginConfigConvert.class); 19 | 20 | SysThirdLoginConfigEntity convert(SysThirdLoginConfigVO vo); 21 | 22 | SysThirdLoginConfigVO convert(SysThirdLoginConfigEntity entity); 23 | 24 | List convertList(List list); 25 | 26 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/operatelog/annotations/OperateLog.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.operatelog.annotations; 2 | 3 | import net.maku.framework.operatelog.enums.OperateTypeEnum; 4 | 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | /** 11 | * 操作日志 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Target({ElementType.METHOD}) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | public @interface OperateLog { 19 | /** 20 | * 模块名 21 | */ 22 | String module() default ""; 23 | 24 | /** 25 | * 操作名 26 | */ 27 | String name() default ""; 28 | 29 | /** 30 | * 操作类型 31 | */ 32 | OperateTypeEnum[] type() default OperateTypeEnum.OTHER; 33 | } 34 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysPostEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.mybatis.entity.BaseEntity; 7 | 8 | /** 9 | * 岗位管理 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @TableName("sys_post") 17 | public class SysPostEntity extends BaseEntity { 18 | /** 19 | * 岗位编码 20 | */ 21 | private String postCode; 22 | /** 23 | * 岗位名称 24 | */ 25 | private String postName; 26 | /** 27 | * 排序 28 | */ 29 | private Integer sort; 30 | /** 31 | * 状态 0:停用 1:正常 32 | */ 33 | private Integer status; 34 | /** 35 | * 租户ID 36 | */ 37 | private Long tenantId; 38 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/email/param/EmailLocalSendParam.java: -------------------------------------------------------------------------------- 1 | package net.maku.email.param; 2 | 3 | import cn.hutool.core.collection.CollectionUtil; 4 | import lombok.Data; 5 | 6 | import java.io.File; 7 | import java.util.List; 8 | 9 | /** 10 | * 本地 发送邮件参数 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | @Data 16 | public class EmailLocalSendParam { 17 | /** 18 | * 分组名称,非必填 19 | */ 20 | private String groupName; 21 | /** 22 | * 收件人邮箱列表,逗号拼接 23 | */ 24 | private String tos; 25 | /** 26 | * 邮件主题 27 | */ 28 | private String subject; 29 | /** 30 | * 邮件内容 31 | */ 32 | private String content; 33 | /** 34 | * 是否为html格式 35 | */ 36 | private boolean html; 37 | /** 38 | * 附件列表 39 | */ 40 | private List files = CollectionUtil.newArrayList(); 41 | } 42 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/service/ScheduleJobService.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.quartz.entity.ScheduleJobEntity; 6 | import net.maku.quartz.query.ScheduleJobQuery; 7 | import net.maku.quartz.vo.ScheduleJobVO; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 定时任务 13 | * 14 | * @author 阿沐 babamu@126.com 15 | * MAKU 16 | */ 17 | public interface ScheduleJobService extends BaseService { 18 | 19 | PageResult page(ScheduleJobQuery query); 20 | 21 | void save(ScheduleJobVO vo); 22 | 23 | void update(ScheduleJobVO vo); 24 | 25 | void delete(List idList); 26 | 27 | void run(ScheduleJobVO vo); 28 | 29 | void changeStatus(ScheduleJobVO vo); 30 | } -------------------------------------------------------------------------------- /maku-boot-new/src/main/java/net/maku/module/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package net.maku.module.controller; 2 | 3 | import io.swagger.v3.oas.annotations.Operation; 4 | import io.swagger.v3.oas.annotations.tags.Tag; 5 | import lombok.AllArgsConstructor; 6 | import net.maku.framework.common.utils.Result; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * 新模块测试 13 | * 14 | * @author 阿沐 babamu@126.com 15 | * MAKU 16 | */ 17 | @RestController 18 | @RequestMapping("new/test") 19 | @Tag(name="新模块测试") 20 | @AllArgsConstructor 21 | public class TestController { 22 | 23 | @GetMapping() 24 | @Operation(summary = "测试接口") 25 | public Result test(){ 26 | 27 | return Result.ok("测试数据"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysRoleDataScopeService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.mybatis.service.BaseService; 4 | import net.maku.system.entity.SysRoleDataScopeEntity; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 角色数据权限 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | public interface SysRoleDataScopeService extends BaseService { 15 | 16 | /** 17 | * 保存或修改 18 | * @param roleId 角色ID 19 | * @param orgIdList 机构ID列表 20 | */ 21 | void saveOrUpdate(Long roleId, List orgIdList); 22 | 23 | /** 24 | * 根据角色ID,获取机构ID列表 25 | */ 26 | List getOrgIdList(Long roleId); 27 | 28 | /** 29 | * 根据角色id列表,删除角色数据权限关系 30 | * @param roleIdList 角色id列表 31 | */ 32 | void deleteByRoleIdList(List roleIdList); 33 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysUserPasswordVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import jakarta.validation.constraints.NotBlank; 5 | import lombok.Data; 6 | import org.hibernate.validator.constraints.Length; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * 用户修改密码 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Data 17 | @Schema(description = "用户修改密码") 18 | public class SysUserPasswordVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | @Schema(description = "原密码", required = true) 22 | @NotBlank(message = "原密码不能为空") 23 | private String password; 24 | 25 | @Schema(description = "新密码,密码长度为 4-20 位", required = true) 26 | @Length(min = 4, max = 20, message = "新密码长度为 4-20 位") 27 | private String newPassword; 28 | 29 | } -------------------------------------------------------------------------------- /maku-server/src/test/java/net/maku/FileUploadTest.java: -------------------------------------------------------------------------------- 1 | package net.maku; 2 | 3 | import cn.hutool.core.io.IoUtil; 4 | import net.maku.storage.service.StorageService; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | 9 | import java.io.File; 10 | import java.nio.file.Files; 11 | 12 | @SpringBootTest 13 | public class FileUploadTest { 14 | @Autowired 15 | private StorageService storageService; 16 | 17 | @Test 18 | public void uploadTest() throws Exception { 19 | File file = new File("D://upload//1.png"); 20 | byte[] data = IoUtil.readBytes(Files.newInputStream(file.toPath())); 21 | 22 | String path = storageService.getPath(file.getName()); 23 | String url = storageService.upload(data, path); 24 | System.out.println(url); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysSmsConfigConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.sms.config.SmsConfig; 4 | import net.maku.system.entity.SysSmsConfigEntity; 5 | import net.maku.system.vo.SysSmsConfigVO; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.factory.Mappers; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 短信配置 13 | * 14 | * @author 阿沐 babamu@126.com 15 | */ 16 | @Mapper 17 | public interface SysSmsConfigConvert { 18 | SysSmsConfigConvert INSTANCE = Mappers.getMapper(SysSmsConfigConvert.class); 19 | 20 | SysSmsConfigEntity convert(SysSmsConfigVO vo); 21 | 22 | SysSmsConfigVO convert(SysSmsConfigEntity entity); 23 | 24 | List convertList(List list); 25 | 26 | SmsConfig convert2(SysSmsConfigEntity entity); 27 | 28 | List convertList2(List list); 29 | 30 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/utils/PageResult.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.utils; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | * 分页工具类 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | @Data 16 | @Schema(description = "分页数据") 17 | public class PageResult implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @Schema(description = "总记录数") 21 | private int total; 22 | 23 | @Schema(description = "列表数据") 24 | private List list; 25 | 26 | /** 27 | * 分页 28 | * @param list 列表数据 29 | * @param total 总记录数 30 | */ 31 | public PageResult(List list, long total) { 32 | this.list = list; 33 | this.total = (int)total; 34 | } 35 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysUserRoleDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysUserRoleEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 用户角色关系 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysUserRoleDao extends BaseDao { 18 | 19 | /** 20 | * 角色ID列表 21 | * @param userId 用户ID 22 | * 23 | * @return 返回角色ID列表 24 | */ 25 | List getRoleIdList(@Param("userId") Long userId); 26 | 27 | /** 28 | * 根据角色ID查询对应的用户ID列表 29 | * @param roleId 角色ID 30 | * 31 | * @return 返回用户ID列表 32 | */ 33 | List getExistsUserIdList(@Param("roleId") Long roleId); 34 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/operatelog/service/OperateLogService.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.operatelog.service; 2 | 3 | import lombok.AllArgsConstructor; 4 | import net.maku.framework.common.cache.RedisCache; 5 | import net.maku.framework.common.cache.RedisKeys; 6 | import net.maku.framework.operatelog.dto.OperateLogDTO; 7 | import org.springframework.scheduling.annotation.Async; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * 操作日志服务 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Service 17 | @AllArgsConstructor 18 | public class OperateLogService { 19 | private final RedisCache redisCache; 20 | 21 | @Async 22 | public void saveLog(OperateLogDTO log) { 23 | String key = RedisKeys.getLogKey(); 24 | 25 | // 保存到Redis队列 26 | redisCache.leftPush(key, log, RedisCache.NOT_EXPIRE); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysMailConfigConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.email.config.EmailConfig; 4 | import net.maku.system.entity.SysMailConfigEntity; 5 | import net.maku.system.vo.SysMailConfigVO; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.factory.Mappers; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 邮件配置 13 | * 14 | * @author 阿沐 babamu@126.com 15 | */ 16 | @Mapper 17 | public interface SysMailConfigConvert { 18 | SysMailConfigConvert INSTANCE = Mappers.getMapper(SysMailConfigConvert.class); 19 | 20 | SysMailConfigEntity convert(SysMailConfigVO vo); 21 | 22 | SysMailConfigVO convert(SysMailConfigEntity entity); 23 | 24 | List convertList(List list); 25 | 26 | EmailConfig convert2(SysMailConfigEntity entity); 27 | 28 | List convertList2(List list); 29 | 30 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysRoleDataScopeVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import jakarta.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | * 角色数据权限 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Data 17 | @Schema(description = "角色数据权限") 18 | public class SysRoleDataScopeVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | @Schema(description = "id") 22 | @NotNull(message = "角色ID不能为空") 23 | private Long id; 24 | 25 | @Schema(description = "数据范围 0:全部数据 1:本机构及子机构数据 2:本机构数据 3:本人数据 4:自定义数据") 26 | @NotNull(message = "数据范围不能为空") 27 | private Integer dataScope; 28 | 29 | @Schema(description = "机构ID列表") 30 | private List orgIdList; 31 | 32 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-websocket/src/main/java/net/maku/websocket/vo/MessageVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.websocket.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import io.swagger.v3.oas.annotations.media.Schema; 5 | import io.swagger.v3.oas.annotations.tags.Tag; 6 | import lombok.Data; 7 | import net.maku.framework.common.utils.DateUtils; 8 | 9 | import java.time.LocalDateTime; 10 | 11 | 12 | /** 13 | * 发送消息的对象 14 | * 15 | * @author 阿沐 babamu@126.com 16 | * MAKU 17 | */ 18 | @Data 19 | @Tag(name = "发送消息的对象") 20 | public class MessageVO { 21 | @Schema(description = "用户名") 22 | private String name; 23 | 24 | @Schema(description = "用户头像") 25 | private String avatar; 26 | 27 | @Schema(description = "消息内容") 28 | private String content; 29 | 30 | @Schema(description = "发送时间") 31 | @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN) 32 | private LocalDateTime sendTime; 33 | } 34 | -------------------------------------------------------------------------------- /db/mysql/module/maku-module-member.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE member_user 2 | ( 3 | id bigint NOT NULL AUTO_INCREMENT COMMENT 'id', 4 | nick_name varchar(100) NOT NULL COMMENT '昵称', 5 | mobile varchar(20) NOT NULL COMMENT '手机号', 6 | avatar varchar(200) COMMENT '头像', 7 | birthday date COMMENT '出生日期', 8 | gender tinyint COMMENT '性别 0:男 1:女 2:未知', 9 | openid varchar(200) COMMENT '第三方平台,唯一标识', 10 | last_login_ip varchar(100) COMMENT '最后登录IP', 11 | last_login_time datetime COMMENT '最后登录时间', 12 | tenant_id bigint COMMENT '租户ID', 13 | remark varchar(500) COMMENT '备注', 14 | status tinyint COMMENT '状态 0:禁用 1:启用', 15 | version int COMMENT '版本号', 16 | deleted tinyint COMMENT '删除标识 0:正常 1:已删除', 17 | create_time datetime COMMENT '创建时间', 18 | primary key (id) 19 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='会员管理'; -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysMailConfigService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.email.config.EmailConfig; 4 | import net.maku.framework.common.utils.PageResult; 5 | import net.maku.framework.mybatis.service.BaseService; 6 | import net.maku.system.entity.SysMailConfigEntity; 7 | import net.maku.system.query.SysMailConfigQuery; 8 | import net.maku.system.vo.SysMailConfigVO; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 邮件平台 14 | * 15 | * @author 阿沐 babamu@126.com 16 | */ 17 | public interface SysMailConfigService extends BaseService { 18 | 19 | PageResult page(SysMailConfigQuery query); 20 | 21 | List list(Integer platform); 22 | 23 | /** 24 | * 启用的邮件平台列表 25 | */ 26 | List listByEnable(); 27 | 28 | void save(SysMailConfigVO vo); 29 | 30 | void update(SysMailConfigVO vo); 31 | 32 | void delete(List idList); 33 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysOrgService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.mybatis.service.BaseService; 4 | import net.maku.system.entity.SysOrgEntity; 5 | import net.maku.system.vo.SysOrgVO; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 机构管理 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | public interface SysOrgService extends BaseService { 16 | 17 | List getList(); 18 | 19 | List listByPid(Long pid); 20 | 21 | void save(SysOrgVO vo); 22 | 23 | void update(SysOrgVO vo); 24 | 25 | void delete(Long id); 26 | 27 | /** 28 | * 根据机构ID,获取子机构ID列表(包含本机构ID) 29 | * 30 | * @param id 机构ID 31 | */ 32 | List getSubOrgIdList(Long id); 33 | 34 | /** 35 | * 根据机构ID列表,获取机构名称列表 36 | * 37 | * @param idList 机构ID列表 38 | */ 39 | List getNameList(List idList); 40 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysRoleMenuService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysRoleMenuEntity; 6 | 7 | import java.util.List; 8 | 9 | 10 | /** 11 | * 角色与菜单对应关系 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | public interface SysRoleMenuService extends BaseService { 17 | 18 | /** 19 | * 根据角色ID,获取菜单ID列表 20 | */ 21 | List getMenuIdList(Long roleId); 22 | 23 | /** 24 | * 保存或修改 25 | * @param roleId 角色ID 26 | * @param menuIdList 菜单ID列表 27 | */ 28 | void saveOrUpdate(Long roleId, List menuIdList); 29 | 30 | /** 31 | * 根据角色id列表,删除角色菜单关系 32 | * @param roleIdList 角色id列表 33 | */ 34 | void deleteByRoleIdList(List roleIdList); 35 | 36 | /** 37 | * 根据菜单id,删除角色菜单关系 38 | * @param menuId 菜单id 39 | */ 40 | void deleteByMenuId(Long menuId); 41 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/query/Query.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import jakarta.validation.constraints.Min; 5 | import jakarta.validation.constraints.NotNull; 6 | import lombok.Data; 7 | import org.hibernate.validator.constraints.Range; 8 | 9 | /** 10 | * 查询公共参数 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | @Data 16 | public class Query { 17 | @NotNull(message = "页码不能为空") 18 | @Min(value = 1, message = "页码最小值为 1") 19 | @Schema(description = "当前页码", required = true) 20 | Integer page; 21 | 22 | @NotNull(message = "每页条数不能为空") 23 | @Range(min = 1, max = 1000, message = "每页条数,取值范围 1-1000") 24 | @Schema(description = "每页条数", required = true) 25 | Integer limit; 26 | 27 | @Schema(description = "排序字段") 28 | String order; 29 | 30 | @Schema(description = "是否升序") 31 | boolean asc; 32 | } 33 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysThirdLoginService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import me.zhyd.oauth.model.AuthUser; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysThirdLoginEntity; 6 | import net.maku.system.vo.SysThirdLoginVO; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 第三方登录 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | public interface SysThirdLoginService extends BaseService { 17 | 18 | List listByUserId(Long userId); 19 | 20 | void unBind(Long userId, String openType); 21 | 22 | void bind(Long userId, String openType, AuthUser authUser); 23 | 24 | /** 25 | * 根据第三方登录类型和openId,查询用户Id 26 | * 27 | * @param openType 第三方登录类型 28 | * @param openId 第三方用户唯一标识 29 | * @return 用户Id 30 | */ 31 | Long getUserIdByOpenTypeAndOpenId(String openType, String openId); 32 | 33 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-generator/src/main/resources/template/java/VO.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package}.${moduleName}.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import com.fasterxml.jackson.annotation.JsonFormat; 5 | import lombok.Data; 6 | import java.io.Serializable; 7 | import ${package}.framework.common.utils.DateUtils; 8 | <#list importList as i> 9 | import ${i!}; 10 | 11 | 12 | /** 13 | * ${tableComment} 14 | * 15 | * @author ${author} ${email} 16 | * @since ${version} ${date} 17 | */ 18 | @Data 19 | @Schema(description = "${tableComment}") 20 | public class ${ClassName}VO implements Serializable { 21 | private static final long serialVersionUID = 1L; 22 | 23 | <#list fieldList as field> 24 | <#if field.fieldComment!?length gt 0> 25 | @Schema(description = "${field.fieldComment}") 26 | 27 | <#if field.attrType == 'Date'> 28 | @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN) 29 | 30 | private ${field.attrType} ${field.attrName}; 31 | 32 | 33 | 34 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-websocket/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | net.maku 5 | maku-boot-module 6 | ${revision} 7 | 8 | 4.0.0 9 | maku-module-websocket 10 | jar 11 | 12 | 13 | 14 | net.maku 15 | maku-framework 16 | ${revision} 17 | 18 | 19 | org.springframework.boot 20 | spring-boot-starter-websocket 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-monitor/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | net.maku 5 | maku-boot-module 6 | ${revision} 7 | 8 | 4.0.0 9 | maku-module-monitor 10 | jar 11 | 12 | 13 | 14 | net.maku 15 | maku-framework 16 | ${revision} 17 | 18 | 19 | com.github.oshi 20 | oshi-core 21 | 6.4.0 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysSmsConfigService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.sms.config.SmsConfig; 6 | import net.maku.system.entity.SysSmsConfigEntity; 7 | import net.maku.system.query.SysSmsConfigQuery; 8 | import net.maku.system.vo.SysSmsConfigVO; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 短信配置 14 | * 15 | * @author 阿沐 babamu@126.com 16 | * MAKU 17 | */ 18 | public interface SysSmsConfigService extends BaseService { 19 | 20 | PageResult page(SysSmsConfigQuery query); 21 | 22 | List list(Integer platform); 23 | 24 | /** 25 | * 启用的短信平台列表 26 | */ 27 | List listByEnable(); 28 | 29 | void save(SysSmsConfigVO vo); 30 | 31 | void update(SysSmsConfigVO vo); 32 | 33 | void delete(List idList); 34 | 35 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysAttachmentEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import net.maku.framework.mybatis.entity.BaseEntity; 8 | 9 | /** 10 | * 附件管理 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | @Data 16 | @EqualsAndHashCode(callSuper = false) 17 | @TableName("sys_attachment") 18 | public class SysAttachmentEntity extends BaseEntity { 19 | /** 20 | * 附件名称 21 | */ 22 | private String name; 23 | 24 | /** 25 | * 附件地址 26 | */ 27 | private String url; 28 | 29 | /** 30 | * 附件大小 31 | */ 32 | @TableField("size_") 33 | private Long size; 34 | 35 | /** 36 | * 存储平台 37 | */ 38 | private String platform; 39 | /** 40 | * 租户ID 41 | */ 42 | private Long tenantId; 43 | 44 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysParamsEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.mybatis.entity.BaseEntity; 7 | 8 | /** 9 | * 参数管理 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @TableName("sys_params") 17 | public class SysParamsEntity extends BaseEntity { 18 | 19 | /** 20 | * 参数名称 21 | */ 22 | private String paramName; 23 | 24 | /** 25 | * 系统参数 26 | */ 27 | private Integer paramType; 28 | 29 | /** 30 | * 参数键 31 | */ 32 | private String paramKey; 33 | 34 | /** 35 | * 参数值 36 | */ 37 | private String paramValue; 38 | 39 | /** 40 | * 备注 41 | */ 42 | private String remark; 43 | 44 | /** 45 | * 租户ID 46 | */ 47 | private Long tenantId; 48 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/constant/Constant.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.constant; 2 | 3 | /** 4 | * 常量 5 | * 6 | * @author 阿沐 babamu@126.com 7 | * MAKU 8 | */ 9 | public interface Constant { 10 | /** 11 | * 根节点标识 12 | */ 13 | Long ROOT = 0L; 14 | /** 15 | * 当前页码 16 | */ 17 | String PAGE = "page"; 18 | /** 19 | * 数据权限 20 | */ 21 | String DATA_SCOPE = "dataScope"; 22 | /** 23 | * 超级管理员 24 | */ 25 | Integer SUPER_ADMIN = 1; 26 | /** 27 | * 禁用 28 | */ 29 | Integer DISABLE = 0; 30 | /** 31 | * 启用 32 | */ 33 | Integer ENABLE = 1; 34 | /** 35 | * 失败 36 | */ 37 | Integer FAIL = 0; 38 | /** 39 | * 成功 40 | */ 41 | Integer SUCCESS = 1; 42 | /** 43 | * OK 44 | */ 45 | String OK = "OK"; 46 | 47 | /** 48 | * pgsql的driver 49 | */ 50 | String PGSQL_DRIVER = "org.postgresql.Driver"; 51 | 52 | } -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/utils/AssertUtils.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.utils; 2 | 3 | import cn.hutool.core.util.ArrayUtil; 4 | import cn.hutool.core.util.StrUtil; 5 | import net.maku.framework.common.exception.ServerException; 6 | 7 | /** 8 | * 校验工具类 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | public class AssertUtils { 14 | 15 | public static void isBlank(String str, String variable) { 16 | if (StrUtil.isBlank(str)) { 17 | throw new ServerException(variable + "不能为空"); 18 | } 19 | } 20 | 21 | public static void isNull(Object object, String variable) { 22 | if (object == null) { 23 | throw new ServerException(variable + "不能为空"); 24 | } 25 | } 26 | 27 | public static void isArrayEmpty(Object[] array, String variable) { 28 | if(ArrayUtil.isEmpty(array)){ 29 | throw new ServerException(variable + "不能为空"); 30 | } 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/utils/CronUtils.java: -------------------------------------------------------------------------------- 1 | package net.maku.quartz.utils; 2 | 3 | import org.quartz.CronExpression; 4 | 5 | import java.text.ParseException; 6 | import java.util.Date; 7 | 8 | /** 9 | * cron 工具类 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | * 14 | */ 15 | public class CronUtils { 16 | /** 17 | * 验证Cron表达式是否有效 18 | */ 19 | public static boolean isValid(String cronExpression) { 20 | return CronExpression.isValidExpression(cronExpression); 21 | } 22 | 23 | /** 24 | * 根据给定的Cron表达式,返回下一个执行时间 25 | */ 26 | public static Date getNextExecution(String cronExpression) { 27 | try { 28 | CronExpression cron = new CronExpression(cronExpression); 29 | return cron.getNextValidTimeAfter(new Date(System.currentTimeMillis())); 30 | } catch (ParseException e) { 31 | throw new IllegalArgumentException(e.getMessage()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysThirdLoginConfigService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import me.zhyd.oauth.request.AuthRequest; 4 | import net.maku.framework.common.query.Query; 5 | import net.maku.framework.common.utils.PageResult; 6 | import net.maku.framework.mybatis.service.BaseService; 7 | import net.maku.system.entity.SysThirdLoginConfigEntity; 8 | import net.maku.system.vo.SysThirdLoginConfigVO; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 第三方登录配置 14 | * 15 | * @author 阿沐 babamu@126.com 16 | * MAKU 17 | */ 18 | public interface SysThirdLoginConfigService extends BaseService { 19 | 20 | PageResult page(Query query); 21 | 22 | void save(SysThirdLoginConfigVO vo); 23 | 24 | void update(SysThirdLoginConfigVO vo); 25 | 26 | void delete(List idList); 27 | 28 | /** 29 | * 根据类型,获取授权请求 30 | * 31 | * @param openType 第三方登录类型 32 | */ 33 | AuthRequest getAuthRequest(String openType); 34 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/AccessTokenVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import lombok.Data; 7 | import net.maku.framework.common.utils.DateUtils; 8 | 9 | import java.io.Serial; 10 | import java.io.Serializable; 11 | import java.time.LocalDateTime; 12 | 13 | /** 14 | * AccessToken 15 | * 16 | * @author 阿沐 babamu@126.com 17 | * MAKU 18 | */ 19 | @Data 20 | @Schema(description = "AccessToken") 21 | public class AccessTokenVO implements Serializable { 22 | @Serial 23 | private static final long serialVersionUID = 1L; 24 | 25 | @Schema(description = "access_token") 26 | @JsonProperty(value = "access_token") 27 | private String accessToken; 28 | 29 | @Schema(description = "access_token 过期时间") 30 | @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN) 31 | private LocalDateTime accessTokenExpire; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysDictDataEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.mybatis.entity.BaseEntity; 7 | 8 | /** 9 | * 数据字典 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Data 15 | @EqualsAndHashCode(callSuper = false) 16 | @TableName("sys_dict_data") 17 | public class SysDictDataEntity extends BaseEntity { 18 | /** 19 | * 字典类型ID 20 | */ 21 | private Long dictTypeId; 22 | /** 23 | * 字典标签 24 | */ 25 | private String dictLabel; 26 | /** 27 | * 字典值 28 | */ 29 | private String dictValue; 30 | /** 31 | * 标签样式 32 | */ 33 | private String labelClass; 34 | /** 35 | * 备注 36 | */ 37 | private String remark; 38 | /** 39 | * 排序 40 | */ 41 | private Integer sort; 42 | /** 43 | * 租户ID 44 | */ 45 | private Long tenantId; 46 | } 47 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysLogLoginService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysLogLoginEntity; 6 | import net.maku.system.query.SysLogLoginQuery; 7 | import net.maku.system.vo.SysLogLoginVO; 8 | 9 | /** 10 | * 登录日志 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | public interface SysLogLoginService extends BaseService { 16 | 17 | /** 18 | * Page result. 19 | * 20 | * @param query the query 21 | * @return the page result 22 | */ 23 | PageResult page(SysLogLoginQuery query); 24 | 25 | /** 26 | * 保存登录日志 27 | * 28 | * @param username 用户名 29 | * @param status 登录状态 30 | * @param operation 操作信息 31 | */ 32 | void save(String username, Integer status, Integer operation); 33 | 34 | /** 35 | * 导出登录日志 36 | */ 37 | void export(); 38 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysUserPostService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.mybatis.service.BaseService; 4 | import net.maku.system.entity.SysUserPostEntity; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 用户岗位关系 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | public interface SysUserPostService extends BaseService { 15 | 16 | /** 17 | * 保存或修改 18 | * @param userId 用户ID 19 | * @param postIdList 岗位ID列表 20 | */ 21 | void saveOrUpdate(Long userId, List postIdList); 22 | 23 | /** 24 | * 根据岗位id列表,删除用户岗位关系 25 | * @param postIdList 岗位id列表 26 | */ 27 | void deleteByPostIdList(List postIdList); 28 | 29 | /** 30 | * 根据用户id列表,删除用户岗位关系 31 | * @param userIdList 用户id列表 32 | */ 33 | void deleteByUserIdList(List userIdList); 34 | 35 | /** 36 | * 岗位ID列表 37 | * @param userId 用户ID 38 | */ 39 | List getPostIdList(Long userId); 40 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/entity/IotDeviceEventLogEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.mybatis.entity.BaseEntity; 7 | 8 | import java.time.LocalDateTime; 9 | 10 | /** 11 | * 设备事件日志 12 | * 13 | * @author LSF maku_lsf@163.com 14 | */ 15 | @EqualsAndHashCode(callSuper = false) 16 | @Data 17 | @TableName("iot_device_event_log") 18 | public class IotDeviceEventLogEntity extends BaseEntity { 19 | 20 | /** 21 | * 设备id 22 | */ 23 | private Long deviceId; 24 | 25 | /** 26 | * 事件类型 27 | */ 28 | private Integer eventType; 29 | 30 | /** 31 | * 事件标识id 32 | */ 33 | private String eventUid; 34 | 35 | /** 36 | * 事件数据 37 | */ 38 | private String eventPayload; 39 | 40 | /** 41 | * 事件时间 42 | */ 43 | private LocalDateTime eventTime; 44 | 45 | /** 46 | * 租户ID 47 | */ 48 | private Long tenantId; 49 | 50 | 51 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/service/CommunicationServiceFactory.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.service; 2 | 3 | import lombok.AllArgsConstructor; 4 | import net.maku.framework.common.exception.ServerException; 5 | import org.springframework.stereotype.Service; 6 | 7 | /** 8 | * 设备协议服务工厂 9 | * 10 | * @author LSF maku_lsf@163.com 11 | */ 12 | @Service 13 | @AllArgsConstructor 14 | public class CommunicationServiceFactory { 15 | 16 | private final MQTTService mqttService; 17 | private final TCPService tcpService; 18 | 19 | public BaseCommunication getProtocol(String protocolType) { 20 | if (protocolType == null) { 21 | new ServerException("协议不存在!"); 22 | } 23 | switch (protocolType) { 24 | case "MQTT": 25 | return mqttService; 26 | case "TCP": 27 | return tcpService; 28 | // case "Modbus": 29 | // return tcpService; 30 | default: 31 | return null; 32 | } 33 | } 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/entity/IotDeviceServiceLogEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import net.maku.framework.mybatis.entity.BaseEntity; 7 | 8 | import java.time.LocalDateTime; 9 | 10 | /** 11 | * 设备服务日志 12 | * 13 | * @author LSF maku_lsf@163.com 14 | */ 15 | @EqualsAndHashCode(callSuper = false) 16 | @Data 17 | @TableName("iot_device_service_log") 18 | public class IotDeviceServiceLogEntity extends BaseEntity { 19 | 20 | /** 21 | * 设备id 22 | */ 23 | private Long deviceId; 24 | 25 | /** 26 | * 服务类型 27 | */ 28 | private Integer serviceType; 29 | 30 | /** 31 | * 服务标识id 32 | */ 33 | private String serviceUid; 34 | 35 | /** 36 | * 服务数据 37 | */ 38 | private String servicePayload; 39 | 40 | /** 41 | * 服务时间 42 | */ 43 | private LocalDateTime serviceTime; 44 | 45 | /** 46 | * 租户ID 47 | */ 48 | private Long tenantId; 49 | 50 | 51 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/convert/SysUserConvert.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.convert; 2 | 3 | import net.maku.framework.security.user.UserDetail; 4 | import net.maku.system.entity.SysUserEntity; 5 | import net.maku.system.vo.SysUserBaseVO; 6 | import net.maku.system.vo.SysUserExcelVO; 7 | import net.maku.system.vo.SysUserVO; 8 | import org.mapstruct.Mapper; 9 | import org.mapstruct.factory.Mappers; 10 | 11 | import java.util.List; 12 | 13 | 14 | @Mapper 15 | public interface SysUserConvert { 16 | SysUserConvert INSTANCE = Mappers.getMapper(SysUserConvert.class); 17 | 18 | SysUserVO convert(SysUserEntity entity); 19 | 20 | SysUserEntity convert(SysUserVO vo); 21 | 22 | SysUserEntity convert(SysUserBaseVO vo); 23 | 24 | SysUserVO convert(UserDetail userDetail); 25 | 26 | UserDetail convertDetail(SysUserEntity entity); 27 | 28 | List convertList(List list); 29 | 30 | List convert2List(List list); 31 | 32 | List convertListEntity(List list); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysMenuDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysMenuEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 菜单管理 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Mapper 17 | public interface SysMenuDao extends BaseDao { 18 | 19 | /** 20 | * 查询所有菜单列表 21 | * 22 | * @param type 菜单类型 23 | */ 24 | List getMenuList(@Param("type") Integer type); 25 | 26 | /** 27 | * 查询用户菜单列表 28 | * 29 | * @param userId 用户ID 30 | * @param type 菜单类型 31 | */ 32 | List getUserMenuList(@Param("userId") Long userId, @Param("type") Integer type); 33 | 34 | /** 35 | * 查询用户权限列表 36 | * @param userId 用户ID 37 | */ 38 | List getUserAuthorityList(@Param("userId") Long userId); 39 | 40 | /** 41 | * 查询所有权限列表 42 | */ 43 | List getAuthorityList(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/ThirdLoginEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import cn.hutool.core.util.StrUtil; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Getter; 6 | 7 | /** 8 | * 第三方登录枚举 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Getter 14 | @AllArgsConstructor 15 | public enum ThirdLoginEnum { 16 | /** 17 | * 企业微信 18 | */ 19 | WECHAT_WORK("wechat_work"), 20 | 21 | /** 22 | * 钉钉 23 | */ 24 | DING_TALK("dingtalk"), 25 | /** 26 | * 飞书 27 | */ 28 | FEI_SHU("feishu"), 29 | 30 | /** 31 | * 微信开放平台 32 | */ 33 | WECHAT_OPEN("wechat_open"); 34 | 35 | private final String value; 36 | 37 | public static ThirdLoginEnum toEnum(String value) { 38 | for (ThirdLoginEnum item : values()) { 39 | if (StrUtil.equalsIgnoreCase(item.getValue(), value)) { 40 | return item; 41 | } 42 | } 43 | 44 | throw new IllegalArgumentException("Unsupported third login type: " + value); 45 | } 46 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysRoleService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysRoleEntity; 6 | import net.maku.system.query.SysRoleQuery; 7 | import net.maku.system.vo.SysRoleDataScopeVO; 8 | import net.maku.system.vo.SysRoleVO; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 角色 14 | * 15 | * @author 阿沐 babamu@126.com 16 | * MAKU 17 | */ 18 | public interface SysRoleService extends BaseService { 19 | 20 | PageResult page(SysRoleQuery query); 21 | 22 | List getList(SysRoleQuery query); 23 | 24 | void save(SysRoleVO vo); 25 | 26 | void update(SysRoleVO vo); 27 | 28 | void dataScope(SysRoleDataScopeVO vo); 29 | 30 | void delete(List idList); 31 | 32 | /** 33 | * 获取角色名称列表 34 | * 35 | * @param idList 角色ID列表 36 | * @return 角色名称列表 37 | */ 38 | List getNameList(List idList); 39 | } 40 | -------------------------------------------------------------------------------- /db/mysql/module/maku-module-monitor.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO sys_menu (pid, name, url, authority, type, open_style, icon, sort, version, deleted, creator, create_time, updater, update_time) VALUES (33, '系统监控', '', '', 0, 0, 'icon-Report', 10, 0, 0, 10000, now(), 10000, now()); 2 | 3 | set @menuId = @@identity; 4 | INSERT INTO sys_menu (pid, name, url, authority, type, open_style, icon, sort, version, deleted, creator, create_time, updater, update_time) VALUES ((SELECT @menuId), '服务监控', 'monitor/server/index', 'monitor:server:all', 0, 0, 'icon-sever', 0, 0, 0, 10000, now(), 10000, now()); 5 | INSERT INTO sys_menu (pid, name, url, authority, type, open_style, icon, sort, version, deleted, creator, create_time, updater, update_time) VALUES ((SELECT @menuId), '缓存监控', 'monitor/cache/index', 'monitor:cache:all', 0, 0, 'icon-fund-fill', 2, 0, 0, 10000, now(), 10000, now()); 6 | INSERT INTO sys_menu (pid, name, url, authority, type, open_style, icon, sort, version, deleted, creator, create_time, updater, update_time) VALUES ((SELECT @menuId), '在线用户', 'monitor/user/index', 'monitor:user:all', 0, 0, 'icon-user', 3, 0, 0, 10000, now(), 10000, now()); 7 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/sms/config/SmsConfig.java: -------------------------------------------------------------------------------- 1 | package net.maku.sms.config; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 短信配置项 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class SmsConfig { 13 | /** 14 | * 平台ID 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 平台类型 20 | */ 21 | private Integer platform; 22 | 23 | /** 24 | * 分组名称 25 | */ 26 | private String groupName; 27 | 28 | /** 29 | * 短信签名 30 | */ 31 | private String signName; 32 | 33 | /** 34 | * 短信模板 35 | */ 36 | private String templateId; 37 | 38 | /** 39 | * 短信应用的ID,如:腾讯云等 40 | */ 41 | private String appId; 42 | 43 | /** 44 | * 腾讯云国际短信、华为云等需要 45 | */ 46 | private String senderId; 47 | 48 | /** 49 | * 接入地址,如:华为云 50 | */ 51 | private String url; 52 | 53 | /** 54 | * AccessKey 55 | */ 56 | private String accessKey; 57 | 58 | /** 59 | * SecretKey 60 | */ 61 | private String secretKey; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/communication/service/BaseCommunication.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.communication.service; 2 | 3 | import net.maku.iot.entity.IotDeviceEntity; 4 | import net.maku.iot.enums.DeviceCommandEnum; 5 | import net.maku.iot.communication.dto.DeviceCommandResponseDTO; 6 | 7 | 8 | /** 9 | * 通信协议具备功能 10 | * 11 | * @author LSF maku_lsf@163.com 12 | */ 13 | public interface BaseCommunication { 14 | 15 | // 异步发送指令,不等待设备响应 16 | String asyncSendCommand(IotDeviceEntity device, DeviceCommandEnum command, String payload); 17 | 18 | //同步发送指定,等待设备响应 19 | DeviceCommandResponseDTO syncSendCommand(IotDeviceEntity device, DeviceCommandEnum command, String payload); 20 | 21 | //同步发送指定,等待设备响应,调试实现 22 | DeviceCommandResponseDTO syncSendCommandDebug(IotDeviceEntity device, DeviceCommandEnum command, String payload); 23 | 24 | //模拟设备属性上报 25 | void simulateDeviceReportAttributeData(IotDeviceEntity device, String payload); 26 | 27 | //模拟设备服务指令响应数据 28 | void simulateDeviceCommandResponseAttributeData(IotDeviceEntity device, String payload); 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-monitor/src/main/java/net/maku/monitor/model/Sys.java: -------------------------------------------------------------------------------- 1 | package net.maku.monitor.model; 2 | 3 | import cn.hutool.system.SystemUtil; 4 | import cn.hutool.system.oshi.OshiUtil; 5 | import lombok.Data; 6 | 7 | /** 8 | * System Info 9 | * 10 | * @author Pure tea 11 | */ 12 | @Data 13 | public class Sys { 14 | 15 | /** 16 | * 操作系统 17 | */ 18 | private String osName; 19 | 20 | /** 21 | * 系统架构 22 | */ 23 | private String osArch; 24 | 25 | /** 26 | * 系统版本 27 | */ 28 | private String osVersion; 29 | 30 | 31 | /** 32 | * 服务器名称 33 | */ 34 | private String computerName; 35 | 36 | /** 37 | * 服务器Ip 38 | */ 39 | private String computerIp; 40 | 41 | public Sys() { 42 | this.setOsName(SystemUtil.getOsInfo().getName()); 43 | this.setOsArch(SystemUtil.getOsInfo().getArch()); 44 | this.setOsVersion(SystemUtil.getOsInfo().getVersion()); 45 | this.setComputerName(OshiUtil.getOs().getNetworkParams().getHostName()); 46 | this.setComputerIp(SystemUtil.getHostInfo().getAddress()); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysUserTokenDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import net.maku.framework.mybatis.dao.BaseDao; 4 | import net.maku.system.entity.SysUserTokenEntity; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.time.LocalDateTime; 9 | import java.util.List; 10 | 11 | /** 12 | * 用户Token 13 | * 14 | * @author 阿沐 babamu@126.com 15 | */ 16 | @Mapper 17 | public interface SysUserTokenDao extends BaseDao { 18 | 19 | /** 20 | * 根据角色ID,查询在线用户 access_token 列表 21 | * 22 | * @param roleId 角色ID 23 | * @param time 当前时间 24 | * @return 返回 access_token 列表 25 | */ 26 | List getOnlineAccessTokenListByRoleId(@Param("roleId") Long roleId, @Param("time") LocalDateTime time); 27 | 28 | /** 29 | * 根据用户ID,查询在线用户 access_token 列表 30 | * 31 | * @param userId 用户ID 32 | * @param time 当前时间 33 | * @return 返回 access_token 列表 34 | */ 35 | List getOnlineAccessTokenListByUserId(@Param("userId") Long userId, @Param("time") LocalDateTime time); 36 | 37 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysAttachmentVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import io.swagger.v3.oas.annotations.media.Schema; 5 | import lombok.Data; 6 | import net.maku.framework.common.utils.DateUtils; 7 | 8 | import java.io.Serializable; 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | * 附件管理 13 | * 14 | * @author 阿沐 babamu@126.com 15 | * MAKU 16 | */ 17 | @Data 18 | @Schema(description = "附件管理") 19 | public class SysAttachmentVO implements Serializable { 20 | private static final long serialVersionUID = 1L; 21 | 22 | @Schema(description = "id") 23 | private Long id; 24 | 25 | @Schema(description = "附件名称") 26 | private String name; 27 | 28 | @Schema(description = "附件地址") 29 | private String url; 30 | 31 | @Schema(description = "附件大小") 32 | private Long size; 33 | 34 | @Schema(description = "存储平台") 35 | private String platform; 36 | 37 | @Schema(description = "创建时间") 38 | @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN) 39 | private LocalDateTime createTime; 40 | 41 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/vo/IotDeviceEventLogVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.vo; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import io.swagger.v3.oas.annotations.media.Schema; 5 | import lombok.Data; 6 | import net.maku.framework.common.utils.DateUtils; 7 | import net.maku.iot.enums.DeviceEventTypeEnum; 8 | 9 | import java.io.Serializable; 10 | import java.time.LocalDateTime; 11 | 12 | /** 13 | * 设备事件日志 14 | * 15 | * @author LSF maku_lsf@163.com 16 | */ 17 | @Data 18 | @Schema(description = "设备事件日志") 19 | public class IotDeviceEventLogVO implements Serializable { 20 | private static final long serialVersionUID = 1L; 21 | 22 | @Schema(description = "事件类型") 23 | private Integer eventType; 24 | 25 | @Schema(description = "事件") 26 | private DeviceEventTypeEnum eventTypeEnum; 27 | 28 | @Schema(description = "事件标识id") 29 | private String eventUid; 30 | 31 | @Schema(description = "事件数据") 32 | private String eventPayload; 33 | 34 | @Schema(description = "事件时间") 35 | @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN) 36 | private LocalDateTime eventTime; 37 | 38 | } -------------------------------------------------------------------------------- /maku-boot-module/maku-module-monitor/src/main/java/net/maku/monitor/model/Mem.java: -------------------------------------------------------------------------------- 1 | package net.maku.monitor.model; 2 | 3 | import cn.hutool.system.oshi.OshiUtil; 4 | import lombok.Data; 5 | import net.maku.monitor.utils.ArityUtil; 6 | import oshi.hardware.GlobalMemory; 7 | 8 | /** 9 | * Mem Info 10 | * 11 | * @author Pure tea 12 | */ 13 | @Data 14 | public class Mem { 15 | 16 | /** 17 | * 内存总数(G) 18 | */ 19 | private double total; 20 | 21 | /** 22 | * 已用内存(G) 23 | */ 24 | private double used; 25 | 26 | /** 27 | * 剩余内存(G) 28 | */ 29 | private double free; 30 | 31 | /** 32 | * 内存使用率 33 | */ 34 | private double usage; 35 | 36 | public Mem() { 37 | GlobalMemory globalMemory = OshiUtil.getMemory(); 38 | this.setTotal(ArityUtil.div(globalMemory.getTotal(), 1024 * 1024 * 1024, 2)); 39 | this.setFree(ArityUtil.div(globalMemory.getAvailable(), 1024 * 1024 * 1024, 2)); 40 | this.setUsed(ArityUtil.sub(this.getTotal(), this.getFree())); 41 | this.setUsage(ArityUtil.round(ArityUtil.div(this.getUsed(), this.getTotal(), 4) * 100, 2)); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/dao/SysUserDao.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.dao; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import net.maku.framework.mybatis.dao.BaseDao; 5 | import net.maku.system.entity.SysUserEntity; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | /** 13 | * 系统用户 14 | * 15 | * @author 阿沐 babamu@126.com 16 | * MAKU 17 | */ 18 | @Mapper 19 | public interface SysUserDao extends BaseDao { 20 | 21 | List getList(Map params); 22 | 23 | SysUserEntity getById(@Param("id") Long id); 24 | 25 | List getRoleUserList(Map params); 26 | 27 | default SysUserEntity getByUsername(String username) { 28 | return this.selectOne(new QueryWrapper().eq("username", username)); 29 | } 30 | 31 | default SysUserEntity getByMobile(String mobile) { 32 | return this.selectOne(new QueryWrapper().eq("mobile", mobile)); 33 | } 34 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/SuperAdminEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | import java.util.Objects; 7 | 8 | /** 9 | * 超级管理员枚举 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Getter 15 | @AllArgsConstructor 16 | public enum SuperAdminEnum { 17 | /** 18 | * 是 19 | */ 20 | YES(1, "是"), 21 | /** 22 | * 否 23 | */ 24 | NO(0, "否"); 25 | 26 | private final Integer value; 27 | private final String name; 28 | 29 | public static String getNameByValue(int value) { 30 | for (SuperAdminEnum s : SuperAdminEnum.values()) { 31 | if (s.getValue() == value) { 32 | return s.getName(); 33 | } 34 | } 35 | return ""; 36 | } 37 | 38 | public static Integer getValueByName(String name) { 39 | for (SuperAdminEnum s : SuperAdminEnum.values()) { 40 | if (Objects.equals(s.getName(), name)) { 41 | return s.getValue(); 42 | } 43 | } 44 | return null; 45 | } 46 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysMenuService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.mybatis.service.BaseService; 4 | import net.maku.framework.security.user.UserDetail; 5 | import net.maku.system.entity.SysMenuEntity; 6 | import net.maku.system.vo.SysMenuVO; 7 | 8 | import java.util.List; 9 | import java.util.Set; 10 | 11 | 12 | /** 13 | * 菜单管理 14 | * 15 | * @author 阿沐 babamu@126.com 16 | * MAKU 17 | */ 18 | public interface SysMenuService extends BaseService { 19 | 20 | void save(SysMenuVO vo); 21 | 22 | void update(SysMenuVO vo); 23 | 24 | void delete(Long id); 25 | 26 | /** 27 | * 菜单列表 28 | * 29 | * @param type 菜单类型 30 | */ 31 | List getMenuList(Integer type); 32 | 33 | /** 34 | * 用户菜单列表 35 | * 36 | * @param user 用户 37 | * @param type 菜单类型 38 | */ 39 | List getUserMenuList(UserDetail user, Integer type); 40 | 41 | /** 42 | * 获取子菜单的数量 43 | * @param pid 父菜单ID 44 | */ 45 | Long getSubMenuCount(Long pid); 46 | 47 | /** 48 | * 获取用户权限列表 49 | */ 50 | Set getUserAuthority(UserDetail user); 51 | } 52 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-iot/src/main/java/net/maku/iot/utils/MqttUtils.java: -------------------------------------------------------------------------------- 1 | package net.maku.iot.utils; 2 | 3 | import lombok.RequiredArgsConstructor; 4 | import org.springframework.integration.mqtt.inbound.AbstractMqttMessageDrivenChannelAdapter; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * Mqtt工具类 9 | * 10 | * @author LSF maku_lsf@163.com 11 | */ 12 | @Component 13 | @RequiredArgsConstructor 14 | public class MqttUtils { 15 | private final AbstractMqttMessageDrivenChannelAdapter mqttMessageAdapter; 16 | 17 | /** 18 | * 动态订阅主题,默认使用qos 1 19 | * 20 | * @param topics 21 | */ 22 | public void addTopic(String... topics) { 23 | mqttMessageAdapter.addTopic(topics); 24 | } 25 | 26 | /** 27 | * 动态订阅主题 28 | * 29 | * @param topic 30 | * @param qos 31 | */ 32 | public void addTopic(String topic, int qos) { 33 | mqttMessageAdapter.addTopic(topic, qos); 34 | } 35 | 36 | /** 37 | * 动态取消主题订阅 38 | * 39 | * @param topics 40 | */ 41 | public void removeTopic(String... topics) { 42 | mqttMessageAdapter.removeTopic(topics); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/enums/UserStatusEnum.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.enums; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | import java.util.Objects; 7 | 8 | /** 9 | * 用户状态 10 | * 11 | * @author 阿沐 babamu@126.com 12 | * MAKU 13 | */ 14 | @Getter 15 | @AllArgsConstructor 16 | public enum UserStatusEnum { 17 | /** 18 | * 停用 19 | */ 20 | DISABLE(0, "停用"), 21 | /** 22 | * 正常 23 | */ 24 | ENABLED(1, "正常"); 25 | 26 | private final int value; 27 | private final String name; 28 | 29 | public static String getNameByValue(int value) { 30 | for (UserStatusEnum s : UserStatusEnum.values()) { 31 | if (s.getValue() == value) { 32 | return s.getName(); 33 | } 34 | } 35 | return ""; 36 | } 37 | 38 | public static Integer getValueByName(String name) { 39 | for (UserStatusEnum s : UserStatusEnum.values()) { 40 | if (Objects.equals(s.getName(), name)) { 41 | return s.getValue(); 42 | } 43 | } 44 | return null; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /maku-framework/src/main/java/net/maku/framework/common/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package net.maku.framework.common.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.cors.CorsConfiguration; 6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 7 | import org.springframework.web.filter.CorsFilter; 8 | 9 | /** 10 | * 跨域配置 11 | * 12 | * @author 阿沐 babamu@126.com 13 | * MAKU 14 | */ 15 | @Configuration 16 | public class CorsConfig { 17 | 18 | @Bean 19 | public CorsFilter corsFilter() { 20 | final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 21 | final CorsConfiguration corsConfiguration = new CorsConfiguration(); 22 | corsConfiguration.setAllowCredentials(true); 23 | corsConfiguration.addAllowedHeader("*"); 24 | corsConfiguration.addAllowedOriginPattern("*"); 25 | corsConfiguration.addAllowedMethod("*"); 26 | source.registerCorsConfiguration("/**", corsConfiguration); 27 | return new CorsFilter(source); 28 | } 29 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysDictTypeService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.framework.common.utils.PageResult; 4 | import net.maku.framework.mybatis.service.BaseService; 5 | import net.maku.system.entity.SysDictTypeEntity; 6 | import net.maku.system.query.SysDictTypeQuery; 7 | import net.maku.system.vo.SysDictTypeVO; 8 | import net.maku.system.vo.SysDictVO; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 数据字典 14 | * 15 | * @author 阿沐 babamu@126.com 16 | * MAKU 17 | */ 18 | public interface SysDictTypeService extends BaseService { 19 | 20 | PageResult page(SysDictTypeQuery query); 21 | 22 | List list(Long pid); 23 | 24 | void save(SysDictTypeVO vo); 25 | 26 | void update(SysDictTypeVO vo); 27 | 28 | void delete(List idList); 29 | 30 | /** 31 | * 获取动态SQL数据 32 | */ 33 | List getDictSql(Long id); 34 | 35 | /** 36 | * 获取全部字典列表 37 | */ 38 | List getDictList(); 39 | 40 | /** 41 | * 刷新字典缓存 42 | */ 43 | void refreshTransCache(); 44 | 45 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/vo/SysDictVO.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.vo; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | /** 12 | * 全部字典 13 | * 14 | * @author 阿沐 babamu@126.com 15 | * MAKU 16 | */ 17 | @Data 18 | @Schema(description = "全部字典") 19 | public class SysDictVO { 20 | @Schema(description = "字典类型") 21 | private String dictType; 22 | 23 | @Schema(description = "字典数据列表") 24 | private List dataList = new ArrayList<>(); 25 | 26 | @Data 27 | @AllArgsConstructor 28 | @NoArgsConstructor 29 | @Schema(description = "字典数据") 30 | public static class DictData { 31 | @Schema(description = "字典标签") 32 | private String dictLabel; 33 | 34 | @Schema(description = "字典值") 35 | private String dictValue; 36 | 37 | @Schema(description = "标签样式") 38 | private String labelClass; 39 | 40 | @Schema(description = "上级节点") 41 | private String pid; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /maku-boot-api/src/main/java/net/maku/api/module/system/StorageApi.java: -------------------------------------------------------------------------------- 1 | package net.maku.api.module.system; 2 | 3 | import java.io.InputStream; 4 | 5 | /** 6 | * 存储服务API 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | public interface StorageApi { 12 | 13 | /** 14 | * 根据文件名,生成带时间戳的新文件名 15 | * 16 | * @param fileName 文件名 17 | * @return 返回带时间戳的文件名 18 | */ 19 | String getNewFileName(String fileName); 20 | 21 | /** 22 | * 生成路径,不包含文件名 23 | * 24 | * @return 返回生成的路径 25 | */ 26 | String getPath(); 27 | 28 | /** 29 | * 根据文件名,生成路径 30 | * 31 | * @param fileName 文件名 32 | * @return 生成文件路径 33 | */ 34 | String getPath(String fileName); 35 | 36 | /** 37 | * 文件上传 38 | * 39 | * @param data 文件字节数组 40 | * @param path 文件路径,包含文件名 41 | * @return 返回http地址 42 | */ 43 | String upload(byte[] data, String path); 44 | 45 | /** 46 | * 文件上传 47 | * 48 | * @param inputStream 字节流 49 | * @param path 文件路径,包含文件名 50 | * @return 返回http地址 51 | */ 52 | String upload(InputStream inputStream, String path); 53 | } 54 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-generator/src/main/resources/template/java/Query.java.ftl: -------------------------------------------------------------------------------- 1 | package ${package}.${moduleName}.query; 2 | 3 | import io.swagger.v3.oas.annotations.media.Schema; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | import ${package}.framework.common.query.Query; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | <#list importList as i> 10 | import ${i!}; 11 | 12 | 13 | /** 14 | * ${tableComment}查询 15 | * 16 | * @author ${author} ${email} 17 | * @since ${version} ${date} 18 | */ 19 | @Data 20 | @EqualsAndHashCode(callSuper = false) 21 | @Schema(description = "${tableComment}查询") 22 | public class ${ClassName}Query extends Query { 23 | <#list queryList as field> 24 | <#if field.fieldComment!?length gt 0> 25 | @Schema(description = "${field.fieldComment}") 26 | 27 | <#if field.queryFormType == 'date'> 28 | @DateTimeFormat(pattern="yyyy-MM-dd") 29 | <#elseif field.queryFormType == 'datetime'> 30 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 31 | 32 | private ${field.attrType}<#if field.queryFormType == 'date' || field.queryFormType == 'datetime'>[] ${field.attrName}; 33 | 34 | 35 | } -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysRoleEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import net.maku.framework.mybatis.entity.BaseEntity; 9 | import net.maku.system.enums.DataScopeEnum; 10 | 11 | /** 12 | * 角色 13 | * 14 | * @author 阿沐 babamu@126.com 15 | * MAKU 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = false) 19 | @TableName("sys_role") 20 | public class SysRoleEntity extends BaseEntity { 21 | /** 22 | * 角色名称 23 | */ 24 | private String name; 25 | /** 26 | * 角色编码 27 | */ 28 | private String roleCode; 29 | /** 30 | * 备注 31 | */ 32 | private String remark; 33 | /** 34 | * 数据范围 {@link DataScopeEnum} 35 | */ 36 | private Integer dataScope; 37 | /** 38 | * 机构ID 39 | */ 40 | @TableField(fill = FieldFill.INSERT) 41 | private Long orgId; 42 | /** 43 | * 租户ID 44 | */ 45 | private Long tenantId; 46 | } 47 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/email/config/EmailConfig.java: -------------------------------------------------------------------------------- 1 | package net.maku.email.config; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 邮箱配置项 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | @Data 12 | public class EmailConfig { 13 | /** 14 | * 平台ID 15 | */ 16 | private Long id; 17 | 18 | /** 19 | * 平台类型 20 | */ 21 | private Integer platform; 22 | 23 | /** 24 | * 分组名称,发送邮件时,可指定分组 25 | */ 26 | private String groupName; 27 | 28 | /** 29 | * SMTP服务器 30 | */ 31 | private String mailHost; 32 | 33 | /** 34 | * SMTP端口 35 | */ 36 | private Integer mailPort; 37 | 38 | /** 39 | * 发件人邮箱 40 | */ 41 | private String mailFrom; 42 | 43 | /** 44 | * 发件人密码 45 | */ 46 | private String mailPass; 47 | 48 | /** 49 | * regionId 50 | */ 51 | private String regionId; 52 | 53 | /** 54 | * 阿里云 endpoint 55 | */ 56 | private String endpoint; 57 | 58 | /** 59 | * AccessKey 60 | */ 61 | private String accessKey; 62 | 63 | /** 64 | * SecretKey 65 | */ 66 | private String secretKey; 67 | 68 | } 69 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/service/SysAuthService.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.service; 2 | 3 | import net.maku.system.vo.*; 4 | 5 | /** 6 | * 权限认证服务 7 | * 8 | * @author 阿沐 babamu@126.com 9 | * MAKU 10 | */ 11 | public interface SysAuthService { 12 | 13 | /** 14 | * 账号密码登录 15 | * 16 | * @param login 登录信息 17 | */ 18 | SysUserTokenVO loginByAccount(SysAccountLoginVO login); 19 | 20 | /** 21 | * 手机短信登录 22 | * 23 | * @param login 登录信息 24 | */ 25 | SysUserTokenVO loginByMobile(SysMobileLoginVO login); 26 | 27 | /** 28 | * 第三方登录 29 | * 30 | * @param login 登录信息 31 | */ 32 | SysUserTokenVO loginByThird(SysThirdCallbackVO login); 33 | 34 | /** 35 | * 发送手机验证码 36 | * 37 | * @param mobile 手机号 38 | */ 39 | boolean sendCode(String mobile); 40 | 41 | /** 42 | * 根据刷新Token,获取AccessToken 43 | * 44 | * @param refreshToken refreshToken 45 | */ 46 | AccessTokenVO getAccessToken(String refreshToken); 47 | 48 | /** 49 | * 退出登录 50 | * 51 | * @param accessToken accessToken 52 | */ 53 | void logout(String accessToken); 54 | } 55 | -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/cache/SmsSendCache.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.cache; 2 | 3 | import lombok.AllArgsConstructor; 4 | import net.maku.framework.common.cache.RedisCache; 5 | import org.springframework.stereotype.Service; 6 | 7 | /** 8 | * 短信发送 Cache 9 | * 10 | * @author 阿沐 babamu@126.com 11 | * MAKU 12 | */ 13 | @Service 14 | @AllArgsConstructor 15 | public class SmsSendCache { 16 | private final RedisCache redisCache; 17 | 18 | /** 19 | * 获取发送手机短信验证码KEY 20 | * 21 | * @param mobile 手机号 22 | * @return KEY 23 | */ 24 | private String getCodeKey(String mobile) { 25 | return "sys:sms:code" + mobile; 26 | } 27 | 28 | public void saveCode(String mobile, String code) { 29 | String key = getCodeKey(mobile); 30 | 31 | // 保存到Redis,有效期10分钟 32 | redisCache.set(key, code, 10 * 60); 33 | } 34 | 35 | public String getCode(String mobile) { 36 | String key = getCodeKey(mobile); 37 | return (String) redisCache.get(key); 38 | } 39 | 40 | public void deleteCode(String mobile) { 41 | String key = getCodeKey(mobile); 42 | redisCache.delete(key); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /maku-boot-module/maku-module-websocket/src/main/java/net/maku/websocket/config/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package net.maku.websocket.config; 2 | 3 | import lombok.AllArgsConstructor; 4 | import net.maku.websocket.handler.MessageWebSocketHandler; 5 | import net.maku.websocket.handler.UserHandshakeInterceptor; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.web.socket.config.annotation.EnableWebSocket; 8 | import org.springframework.web.socket.config.annotation.WebSocketConfigurer; 9 | import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; 10 | 11 | 12 | /** 13 | * WebSocket配置 14 | * 15 | * @author 阿沐 babamu@126.com 16 | * MAKU 17 | */ 18 | @Configuration 19 | @EnableWebSocket 20 | @AllArgsConstructor 21 | public class WebSocketConfig implements WebSocketConfigurer { 22 | private final MessageWebSocketHandler handler; 23 | private final UserHandshakeInterceptor interceptor; 24 | 25 | @Override 26 | public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { 27 | registry.addHandler(handler, "/ws") 28 | .addInterceptors(interceptor).setAllowedOriginPatterns("*"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /maku-server/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | data: 3 | redis: 4 | database: 1 5 | host: localhost 6 | port: 6379 7 | #password: 8 | #timeout: 6000ms # 连接超时时长(毫秒) 9 | datasource: 10 | dynamic: 11 | hikari: # Hikari 连接池全局配置 12 | connection-timeout: 30000 # 等待连接池分配链接的最大时长(毫秒),超过这个时长还没有可用的连接则发生 SQLException,默认:30 秒 13 | minimum-idle: 2 # 最小空闲连接数 14 | maximum-pool-size: 10 # 最大连接数 15 | idle-timeout: 600000 # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10 分钟 16 | max-lifetime: 1800000 # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认: 30 分钟 17 | connection-test-query: SELECT 1 18 | primary: master 19 | datasource: 20 | master: 21 | # MySQL8 22 | driver-class-name: com.mysql.cj.jdbc.Driver 23 | url: jdbc:mysql://localhost:3306/maku_boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true 24 | username: maku 25 | password: 123456 26 | mqtt: 27 | host: tcp://localhost:1883 28 | username: maku 29 | password: maku 30 | clientId: maku_boot_service_dev 31 | default-topic: topic_default -------------------------------------------------------------------------------- /maku-server/src/main/resources/application-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | data: 3 | redis: 4 | database: 1 5 | host: localhost 6 | port: 6379 7 | #password: 8 | #timeout: 6000ms # 连接超时时长(毫秒) 9 | datasource: 10 | dynamic: 11 | hikari: # Hikari 连接池全局配置 12 | connection-timeout: 30000 # 等待连接池分配链接的最大时长(毫秒),超过这个时长还没有可用的连接则发生 SQLException,默认:30 秒 13 | minimum-idle: 2 # 最小空闲连接数 14 | maximum-pool-size: 10 # 最大连接数 15 | idle-timeout: 600000 # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10 分钟 16 | max-lifetime: 1800000 # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认: 30 分钟 17 | connection-test-query: SELECT 1 18 | primary: master 19 | datasource: 20 | master: 21 | # MySQL8 22 | driver-class-name: com.mysql.cj.jdbc.Driver 23 | url: jdbc:mysql://localhost:3306/maku_boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true 24 | username: maku 25 | password: 123456 26 | mqtt: 27 | host: tcp://localhost:1883 28 | username: maku 29 | password: maku 30 | clientId: maku_boot_service_dev 31 | default-topic: topic_default -------------------------------------------------------------------------------- /maku-server/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | data: 3 | redis: 4 | database: 1 5 | host: localhost 6 | port: 6379 7 | #password: 8 | #timeout: 6000ms # 连接超时时长(毫秒) 9 | datasource: 10 | dynamic: 11 | hikari: # Hikari 连接池全局配置 12 | connection-timeout: 30000 # 等待连接池分配链接的最大时长(毫秒),超过这个时长还没有可用的连接则发生 SQLException,默认:30 秒 13 | minimum-idle: 2 # 最小空闲连接数 14 | maximum-pool-size: 10 # 最大连接数 15 | idle-timeout: 600000 # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10 分钟 16 | max-lifetime: 1800000 # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认: 30 分钟 17 | connection-test-query: SELECT 1 18 | primary: master 19 | datasource: 20 | master: 21 | # MySQL8 22 | driver-class-name: com.mysql.cj.jdbc.Driver 23 | url: jdbc:mysql://localhost:3306/maku_boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true 24 | username: maku 25 | password: 123456 26 | mqtt: 27 | host: tcp://localhost:1883 28 | username: maku 29 | password: maku 30 | clientId: maku_boot_service_dev 31 | default-topic: topic_default -------------------------------------------------------------------------------- /maku-boot-system/src/main/java/net/maku/system/entity/SysOrgEntity.java: -------------------------------------------------------------------------------- 1 | package net.maku.system.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldStrategy; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import net.maku.framework.mybatis.entity.BaseEntity; 9 | 10 | /** 11 | * 机构管理 12 | * 13 | * @author 阿沐 babamu@126.com 14 | * MAKU 15 | */ 16 | @Data 17 | @EqualsAndHashCode(callSuper = false) 18 | @TableName("sys_org") 19 | public class SysOrgEntity extends BaseEntity { 20 | /** 21 | * 上级ID 22 | */ 23 | @TableField(updateStrategy = FieldStrategy.ALWAYS) 24 | private Long pid; 25 | /** 26 | * 机构名称 27 | */ 28 | private String name; 29 | /** 30 | * 排序 31 | */ 32 | private Integer sort; 33 | /** 34 | * 负责人ID 35 | */ 36 | @TableField(updateStrategy = FieldStrategy.ALWAYS) 37 | private Long leaderId; 38 | /** 39 | * 上级名称 40 | */ 41 | @TableField(exist = false) 42 | private String parentName; 43 | /** 44 | * 租户ID 45 | */ 46 | private Long tenantId; 47 | } --------------------------------------------------------------------------------