├── doc ├── 开源字节环境使用手册.docx └── application-druid.yml ├── source-admin └── src │ └── main │ ├── resources │ ├── META-INF │ │ └── spring-devtools.properties │ ├── mybatis │ │ └── mybatis-config.xml │ ├── i18n │ │ └── messages.properties │ └── banner.txt │ └── java │ └── cn │ └── source │ ├── RuoYiServletInitializer.java │ ├── web │ └── controller │ │ ├── tool │ │ └── SwaggerController.java │ │ ├── system │ │ ├── SysIndexController.java │ │ └── SysRegisterController.java │ │ └── monitor │ │ └── ServerController.java │ └── RuoYiApplication.java ├── source-generator ├── src │ └── main │ │ ├── resources │ │ ├── vm │ │ │ ├── vue │ │ │ │ └── v3 │ │ │ │ │ └── readme.txt │ │ │ ├── js │ │ │ │ └── api.js.vm │ │ │ ├── java │ │ │ │ └── service.java.vm │ │ │ └── sql │ │ │ │ └── sql.vm │ │ └── generator.yml │ │ └── java │ │ └── cn │ │ └── source │ │ └── generator │ │ ├── util │ │ └── VelocityInitializer.java │ │ ├── service │ │ ├── IGenTableColumnService.java │ │ └── GenTableColumnServiceImpl.java │ │ ├── mapper │ │ ├── GenTableColumnMapper.java │ │ └── GenTableMapper.java │ │ └── config │ │ └── GenConfig.java └── pom.xml ├── source-common └── src │ └── main │ └── java │ └── cn │ └── source │ └── common │ ├── core │ ├── domain │ │ ├── model │ │ │ ├── RegisterBody.java │ │ │ ├── LoginBody.java │ │ │ └── FlowModel.java │ │ ├── TreeEntity.java │ │ └── TreeSelect.java │ └── page │ │ ├── TableSupport.java │ │ └── TableDataInfo.java │ ├── enums │ ├── DataSourceType.java │ ├── BusinessStatus.java │ ├── LimitType.java │ ├── OperatorType.java │ ├── UserStatus.java │ ├── AccessType.java │ ├── BusinessType.java │ └── HttpMethod.java │ ├── exception │ ├── DemoModeException.java │ ├── user │ │ ├── CaptchaException.java │ │ ├── CaptchaExpireException.java │ │ ├── UserPasswordNotMatchException.java │ │ └── UserException.java │ ├── file │ │ ├── FileException.java │ │ ├── FileSizeLimitExceededException.java │ │ └── FileNameLengthLimitExceededException.java │ ├── UtilException.java │ ├── job │ │ └── TaskException.java │ ├── GlobalException.java │ ├── ServiceException.java │ └── base │ │ └── BaseException.java │ ├── utils │ ├── LogUtils.java │ ├── poi │ │ └── ExcelHandlerAdapter.java │ ├── MessageUtils.java │ ├── bean │ │ └── BeanValidators.java │ ├── PageUtils.java │ ├── uuid │ │ └── IdUtils.java │ ├── ExceptionUtil.java │ ├── sms │ │ └── DySmsUtil.java │ ├── sql │ │ └── SqlUtil.java │ ├── http │ │ └── HttpHelper.java │ ├── sign │ │ └── Md5Utils.java │ ├── ip │ │ └── AddressUtils.java │ └── file │ │ ├── MimeTypeUtils.java │ │ └── FileTypeUtils.java │ ├── annotation │ ├── Excels.java │ ├── DataScope.java │ ├── RepeatSubmit.java │ ├── DataSource.java │ ├── RateLimiter.java │ └── Log.java │ ├── xss │ ├── Xss.java │ └── XssValidator.java │ ├── constant │ ├── ScheduleConstants.java │ ├── HttpStatus.java │ └── UserConstants.java │ └── filter │ ├── RepeatableFilter.java │ └── RepeatedlyRequestWrapper.java ├── source-quartz ├── src │ └── main │ │ └── java │ │ └── cn │ │ └── source │ │ └── quartz │ │ ├── util │ │ ├── QuartzJobExecution.java │ │ ├── QuartzDisallowConcurrentExecution.java │ │ └── CronUtils.java │ │ ├── task │ │ └── RyTask.java │ │ ├── service │ │ ├── ISysJobLogService.java │ │ └── impl │ │ │ └── SysJobLogServiceImpl.java │ │ └── mapper │ │ ├── SysJobMapper.java │ │ └── SysJobLogMapper.java └── pom.xml ├── source-im ├── src │ └── main │ │ └── java │ │ └── cn │ │ └── source │ │ └── system │ │ ├── websocket │ │ ├── WebSocketConfig.java │ │ └── SemaphoreUtils.java │ │ └── constant │ │ └── MsgConstant.java └── pom.xml ├── source-flow └── pom.xml ├── source-framework ├── src │ └── main │ │ └── java │ │ └── cn │ │ └── source │ │ └── framework │ │ ├── datasource │ │ ├── DynamicDataSource.java │ │ └── DynamicDataSourceContextHolder.java │ │ ├── manager │ │ ├── ShutdownManager.java │ │ └── AsyncManager.java │ │ ├── config │ │ ├── ServerConfig.java │ │ ├── ApplicationConfig.java │ │ └── ThreadPoolConfig.java │ │ ├── web │ │ ├── domain │ │ │ └── server │ │ │ │ ├── Mem.java │ │ │ │ ├── Sys.java │ │ │ │ ├── Cpu.java │ │ │ │ └── SysFile.java │ │ └── service │ │ │ └── SysPermissionService.java │ │ ├── security │ │ ├── handle │ │ │ ├── AuthenticationEntryPointImpl.java │ │ │ └── LogoutSuccessHandlerImpl.java │ │ └── filter │ │ │ └── JwtAuthenticationTokenFilter.java │ │ └── interceptor │ │ └── RepeatSubmitInterceptor.java └── pom.xml ├── source-love └── pom.xml ├── source-system ├── pom.xml └── src │ └── main │ ├── java │ └── cn │ │ └── source │ │ └── system │ │ ├── service │ │ ├── ISysLogininforService.java │ │ ├── ISysOperLogService.java │ │ ├── ISysUserOnlineService.java │ │ ├── ISysNoticeService.java │ │ ├── ISysDictDataService.java │ │ ├── impl │ │ │ ├── SysLogininforServiceImpl.java │ │ │ ├── SysOperLogServiceImpl.java │ │ │ └── SysNoticeServiceImpl.java │ │ ├── ISysConfigService.java │ │ └── ISysPostService.java │ │ ├── mapper │ │ ├── SysLogininforMapper.java │ │ ├── SysRoleMenuMapper.java │ │ ├── SysUserPostMapper.java │ │ ├── SysRoleDeptMapper.java │ │ ├── SysOperLogMapper.java │ │ ├── SysNoticeMapper.java │ │ ├── SysUserRoleMapper.java │ │ ├── SysConfigMapper.java │ │ ├── SysDictTypeMapper.java │ │ └── SysPostMapper.java │ │ └── domain │ │ ├── SysRoleDept.java │ │ ├── SysRoleMenu.java │ │ ├── SysUserPost.java │ │ └── SysUserRole.java │ └── resources │ └── mapper │ └── system │ ├── SysRoleMenuMapper.xml │ ├── SysUserPostMapper.xml │ ├── SysRoleDeptMapper.xml │ └── SysUserRoleMapper.xml ├── source-wms └── pom.xml ├── .gitignore ├── source-house ├── pom.xml └── src │ └── main │ └── java │ └── cn │ └── source │ └── system │ ├── mapper │ ├── HouseUserMapper.java │ ├── HouseImageMapper.java │ ├── HouseFeatureMapper.java │ ├── HouseVillageMapper.java │ └── HouseRoomMapper.java │ ├── service │ ├── IHouseUserService.java │ ├── IHouseImageService.java │ ├── IHouseFeatureService.java │ ├── IHouseVillageService.java │ └── IHouseRoomService.java │ └── domain │ └── HouseFeature.java ├── LICENSE └── source-cms ├── pom.xml └── src └── main └── java └── cn └── source └── system ├── mapper ├── CmsMsgMapper.java ├── CmsLinkMapper.java ├── CmsFeedbackMapper.java ├── CmsServiceItemMapper.java └── CmsArticleMapper.java ├── service ├── ICmsMsgService.java ├── ICmsLinkService.java ├── ICmsFeedbackService.java ├── ICmsServiceItemService.java └── ICmsArticleService.java └── domain └── CmsFeedback.java /doc/开源字节环境使用手册.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smileBoy123456/source-vue/HEAD/doc/开源字节环境使用手册.docx -------------------------------------------------------------------------------- /source-admin/src/main/resources/META-INF/spring-devtools.properties: -------------------------------------------------------------------------------- 1 | restart.include.json=/com.alibaba.fastjson.*.jar -------------------------------------------------------------------------------- /source-generator/src/main/resources/vm/vue/v3/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smileBoy123456/source-vue/HEAD/source-generator/src/main/resources/vm/vue/v3/readme.txt -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/core/domain/model/RegisterBody.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.core.domain.model; 2 | 3 | /** 4 | * 用户注册对象 5 | * 6 | * @author ruoyi 7 | */ 8 | public class RegisterBody extends LoginBody 9 | { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /source-generator/src/main/resources/generator.yml: -------------------------------------------------------------------------------- 1 | # 代码生成 2 | gen: 3 | # 作者 4 | author: Mr Sir 5 | # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool 6 | packageName: cn.source.system 7 | # 自动去除表前缀,默认是false 8 | autoRemovePre: false 9 | # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) 10 | tablePrefix: sys_ 11 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/enums/DataSourceType.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.enums; 2 | 3 | /** 4 | * 数据源 5 | * 6 | * @author ruoyi 7 | */ 8 | public enum DataSourceType 9 | { 10 | /** 11 | * 主库 12 | */ 13 | MASTER, 14 | 15 | /** 16 | * 从库 17 | */ 18 | SLAVE 19 | } 20 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/enums/BusinessStatus.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.enums; 2 | 3 | /** 4 | * 操作状态 5 | * 6 | * @author ruoyi 7 | * 8 | */ 9 | public enum BusinessStatus 10 | { 11 | /** 12 | * 成功 13 | */ 14 | SUCCESS, 15 | 16 | /** 17 | * 失败 18 | */ 19 | FAIL, 20 | } 21 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/enums/LimitType.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.enums; 2 | 3 | /** 4 | * 限流类型 5 | * 6 | * @author ruoyi 7 | */ 8 | 9 | public enum LimitType 10 | { 11 | /** 12 | * 默认策略全局限流 13 | */ 14 | DEFAULT, 15 | 16 | /** 17 | * 根据请求者IP进行限流 18 | */ 19 | IP 20 | } 21 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/DemoModeException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception; 2 | 3 | /** 4 | * 演示模式异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public class DemoModeException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public DemoModeException() 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/enums/OperatorType.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.enums; 2 | 3 | /** 4 | * 操作人类别 5 | * 6 | * @author ruoyi 7 | */ 8 | public enum OperatorType 9 | { 10 | /** 11 | * 其它 12 | */ 13 | OTHER, 14 | 15 | /** 16 | * 后台用户 17 | */ 18 | MANAGE, 19 | 20 | /** 21 | * 手机端用户 22 | */ 23 | MOBILE 24 | } 25 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/LogUtils.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils; 2 | 3 | /** 4 | * 处理并记录日志文件 5 | * 6 | * @author ruoyi 7 | */ 8 | public class LogUtils 9 | { 10 | public static String getBlock(Object msg) 11 | { 12 | if (msg == null) 13 | { 14 | msg = ""; 15 | } 16 | return "[" + msg.toString() + "]"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/user/CaptchaException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception.user; 2 | 3 | /** 4 | * 验证码错误异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class CaptchaException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public CaptchaException() 13 | { 14 | super("user.jcaptcha.error", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/user/CaptchaExpireException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception.user; 2 | 3 | /** 4 | * 验证码失效异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class CaptchaExpireException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public CaptchaExpireException() 13 | { 14 | super("user.jcaptcha.expire", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/poi/ExcelHandlerAdapter.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.poi; 2 | 3 | /** 4 | * Excel数据格式处理适配器 5 | * 6 | * @author ruoyi 7 | */ 8 | public interface ExcelHandlerAdapter 9 | { 10 | /** 11 | * 格式化 12 | * 13 | * @param value 单元格数据值 14 | * @param args excel注解args参数组 15 | * 16 | * @return 处理后的值 17 | */ 18 | Object format(Object value, String[] args); 19 | } 20 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/user/UserPasswordNotMatchException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception.user; 2 | 3 | /** 4 | * 用户密码不正确或不符合规范异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UserPasswordNotMatchException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserPasswordNotMatchException() 13 | { 14 | super("user.password.not.match", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/annotation/Excels.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Excel注解集 10 | * 11 | * @author ruoyi 12 | */ 13 | @Target(ElementType.FIELD) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface Excels 16 | { 17 | public Excel[] value(); 18 | } 19 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/user/UserException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception.user; 2 | 3 | import cn.source.common.exception.base.BaseException; 4 | 5 | /** 6 | * 用户信息异常类 7 | * 8 | * @author ruoyi 9 | */ 10 | public class UserException extends BaseException 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | public UserException(String code, Object[] args) 15 | { 16 | super("user", code, args, null); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/file/FileException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception.file; 2 | 3 | import cn.source.common.exception.base.BaseException; 4 | 5 | /** 6 | * 文件信息异常类 7 | * 8 | * @author ruoyi 9 | */ 10 | public class FileException extends BaseException 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | public FileException(String code, Object[] args) 15 | { 16 | super("file", code, args, null); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/file/FileSizeLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception.file; 2 | 3 | /** 4 | * 文件名大小限制异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class FileSizeLimitExceededException extends FileException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public FileSizeLimitExceededException(long defaultMaxSize) 13 | { 14 | super("upload.exceed.maxSize", new Object[] { defaultMaxSize }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source-quartz/src/main/java/cn/source/quartz/util/QuartzJobExecution.java: -------------------------------------------------------------------------------- 1 | package cn.source.quartz.util; 2 | 3 | import org.quartz.JobExecutionContext; 4 | import cn.source.quartz.domain.SysJob; 5 | 6 | /** 7 | * 定时任务处理(允许并发执行) 8 | * 9 | * @author ruoyi 10 | * 11 | */ 12 | public class QuartzJobExecution extends AbstractQuartzJob 13 | { 14 | @Override 15 | protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception 16 | { 17 | JobInvokeUtil.invokeMethod(sysJob); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/file/FileNameLengthLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception.file; 2 | 3 | /** 4 | * 文件名称超长限制异常类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class FileNameLengthLimitExceededException extends FileException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public FileNameLengthLimitExceededException(int defaultFileNameLength) 13 | { 14 | super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source-admin/src/main/java/cn/source/RuoYiServletInitializer.java: -------------------------------------------------------------------------------- 1 | package cn.source; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * web容器中进行部署 8 | * 9 | * @author ruoyi 10 | */ 11 | public class RuoYiServletInitializer extends SpringBootServletInitializer 12 | { 13 | @Override 14 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) 15 | { 16 | return application.sources(RuoYiApplication.class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source-im/src/main/java/cn/source/system/websocket/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.websocket; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.socket.server.standard.ServerEndpointExporter; 6 | 7 | /** 8 | * websocket 配置 9 | * 10 | * @author ruoyi 11 | */ 12 | @Configuration 13 | public class WebSocketConfig 14 | { 15 | @Bean 16 | public ServerEndpointExporter serverEndpointExporter() 17 | { 18 | return new ServerEndpointExporter(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/enums/UserStatus.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.enums; 2 | 3 | /** 4 | * 用户状态 5 | * 6 | * @author ruoyi 7 | */ 8 | public enum UserStatus 9 | { 10 | OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"); 11 | 12 | private final String code; 13 | private final String info; 14 | 15 | UserStatus(String code, String info) 16 | { 17 | this.code = code; 18 | this.info = info; 19 | } 20 | 21 | public String getCode() 22 | { 23 | return code; 24 | } 25 | 26 | public String getInfo() 27 | { 28 | return info; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /source-quartz/src/main/java/cn/source/quartz/util/QuartzDisallowConcurrentExecution.java: -------------------------------------------------------------------------------- 1 | package cn.source.quartz.util; 2 | 3 | import org.quartz.DisallowConcurrentExecution; 4 | import org.quartz.JobExecutionContext; 5 | import cn.source.quartz.domain.SysJob; 6 | 7 | /** 8 | * 定时任务处理(禁止并发执行) 9 | * 10 | * @author ruoyi 11 | * 12 | */ 13 | @DisallowConcurrentExecution 14 | public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob 15 | { 16 | @Override 17 | protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception 18 | { 19 | JobInvokeUtil.invokeMethod(sysJob); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/UtilException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception; 2 | 3 | /** 4 | * 工具类异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UtilException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 8247610319171014183L; 11 | 12 | public UtilException(Throwable e) 13 | { 14 | super(e.getMessage(), e); 15 | } 16 | 17 | public UtilException(String message) 18 | { 19 | super(message); 20 | } 21 | 22 | public UtilException(String message, Throwable throwable) 23 | { 24 | super(message, throwable); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/annotation/DataScope.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 数据权限过滤注解 11 | * 12 | * @author ruoyi 13 | */ 14 | @Target(ElementType.METHOD) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Documented 17 | public @interface DataScope 18 | { 19 | /** 20 | * 部门表的别名 21 | */ 22 | public String deptAlias() default ""; 23 | 24 | /** 25 | * 用户表的别名 26 | */ 27 | public String userAlias() default ""; 28 | } 29 | -------------------------------------------------------------------------------- /source-im/src/main/java/cn/source/system/constant/MsgConstant.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.constant; 2 | 3 | /** 4 | * 消息常量信息 5 | * 6 | * @author ruoyi 7 | */ 8 | public class MsgConstant 9 | { 10 | /** 11 | * 管理员消息 12 | */ 13 | public static final int SYS_ADMIN =1; 14 | 15 | /** 16 | * 访客消息 17 | */ 18 | public static final int SYS_USER =2; 19 | 20 | 21 | /** 22 | * 管理员头像 23 | */ 24 | public static final String ADMIN_AVATAR ="https://sourcebyte.cn/assets/logo_c_64.5eb3acc5.png"; 25 | 26 | 27 | 28 | /** 29 | * 访客头像 30 | */ 31 | public static final String USER_AVATAR ="https://preview.qiantucdn.com/58pic/41/98/56/04F58PIC58PICrW2QFmdIrmsz_PIC2018.png!qt324_nowater_jpg"; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /source-quartz/src/main/java/cn/source/quartz/task/RyTask.java: -------------------------------------------------------------------------------- 1 | package cn.source.quartz.task; 2 | 3 | import org.springframework.stereotype.Component; 4 | import cn.source.common.utils.StringUtils; 5 | 6 | /** 7 | * 定时任务调度测试 8 | * 9 | * @author ruoyi 10 | */ 11 | @Component("ryTask") 12 | public class RyTask 13 | { 14 | public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) 15 | { 16 | System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i)); 17 | } 18 | 19 | public void ryParams(String params) 20 | { 21 | System.out.println("执行有参方法:" + params); 22 | } 23 | 24 | public void ryNoParams() 25 | { 26 | System.out.println("执行无参方法"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /source-admin/src/main/java/cn/source/web/controller/tool/SwaggerController.java: -------------------------------------------------------------------------------- 1 | package cn.source.web.controller.tool; 2 | 3 | import org.springframework.security.access.prepost.PreAuthorize; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import cn.source.common.core.controller.BaseController; 8 | 9 | /** 10 | * swagger 接口 11 | * 12 | * @author ruoyi 13 | */ 14 | @Controller 15 | @RequestMapping("/tool/swagger") 16 | public class SwaggerController extends BaseController 17 | { 18 | @PreAuthorize("@ss.hasPermi('tool:swagger:view')") 19 | @GetMapping() 20 | public String index() 21 | { 22 | return redirect("/swagger-ui.html"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/annotation/RepeatSubmit.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Inherited; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | /** 11 | * 自定义注解防止表单重复提交 12 | * 13 | * @author ruoyi 14 | * 15 | */ 16 | @Inherited 17 | @Target(ElementType.METHOD) 18 | @Retention(RetentionPolicy.RUNTIME) 19 | @Documented 20 | public @interface RepeatSubmit 21 | { 22 | /** 23 | * 间隔时间(ms),小于此时间视为重复提交 24 | */ 25 | public int interval() default 5000; 26 | 27 | /** 28 | * 提示消息 29 | */ 30 | public String message() default "不允许重复提交,请稍候再试"; 31 | } 32 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/MessageUtils.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils; 2 | 3 | import org.springframework.context.MessageSource; 4 | import org.springframework.context.i18n.LocaleContextHolder; 5 | import cn.source.common.utils.spring.SpringUtils; 6 | 7 | /** 8 | * 获取i18n资源文件 9 | * 10 | * @author ruoyi 11 | */ 12 | public class MessageUtils 13 | { 14 | /** 15 | * 根据消息键和参数 获取消息 委托给spring messageSource 16 | * 17 | * @param code 消息键 18 | * @param args 参数 19 | * @return 获取国际化翻译值 20 | */ 21 | public static String message(String code, Object... args) 22 | { 23 | MessageSource messageSource = SpringUtils.getBean(MessageSource.class); 24 | return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/enums/AccessType.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.enums; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * 操作人类别 8 | * 9 | * @author ruoyi 10 | */ 11 | public enum AccessType { 12 | /** 13 | * PC 14 | */ 15 | PC, 16 | 17 | /** 18 | * 手机端用户 19 | */ 20 | H5, 21 | 22 | /** 23 | * 小程序 24 | */ 25 | MINI, 26 | 27 | /** 28 | * APP 29 | */ 30 | APP; 31 | 32 | /** 33 | * 获取枚举值常量列表 34 | * @return 35 | */ 36 | public static List getEumValueList() { 37 | List list=new ArrayList(); 38 | for(Object object:AccessType.values()) { 39 | list.add(object.toString()); 40 | } 41 | return list; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/xss/Xss.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.xss; 2 | 3 | import javax.validation.Constraint; 4 | import javax.validation.Payload; 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 | * 自定义xss校验注解 12 | * 13 | * @author ruoyi 14 | */ 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target(value = { ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER }) 17 | @Constraint(validatedBy = { XssValidator.class }) 18 | public @interface Xss 19 | { 20 | String message() 21 | 22 | default "不允许任何脚本运行"; 23 | 24 | Class[] groups() default {}; 25 | 26 | Class[] payload() default {}; 27 | } 28 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/enums/BusinessType.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.enums; 2 | 3 | /** 4 | * 业务操作类型 5 | * 6 | * @author ruoyi 7 | */ 8 | public enum BusinessType 9 | { 10 | /** 11 | * 其它 12 | */ 13 | OTHER, 14 | 15 | /** 16 | * 新增 17 | */ 18 | INSERT, 19 | 20 | /** 21 | * 修改 22 | */ 23 | UPDATE, 24 | 25 | /** 26 | * 删除 27 | */ 28 | DELETE, 29 | 30 | /** 31 | * 授权 32 | */ 33 | GRANT, 34 | 35 | /** 36 | * 导出 37 | */ 38 | EXPORT, 39 | 40 | /** 41 | * 导入 42 | */ 43 | IMPORT, 44 | 45 | /** 46 | * 强退 47 | */ 48 | FORCE, 49 | 50 | /** 51 | * 生成代码 52 | */ 53 | GENCODE, 54 | 55 | /** 56 | * 清空数据 57 | */ 58 | CLEAN, 59 | } 60 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/annotation/DataSource.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Inherited; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | import cn.source.common.enums.DataSourceType; 10 | 11 | /** 12 | * 自定义多数据源切换注解 13 | * 14 | * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准 15 | * 16 | * @author ruoyi 17 | */ 18 | @Target({ ElementType.METHOD, ElementType.TYPE }) 19 | @Retention(RetentionPolicy.RUNTIME) 20 | @Documented 21 | @Inherited 22 | public @interface DataSource 23 | { 24 | /** 25 | * 切换数据源名称 26 | */ 27 | public DataSourceType value() default DataSourceType.MASTER; 28 | } 29 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/bean/BeanValidators.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.bean; 2 | 3 | import java.util.Set; 4 | import javax.validation.ConstraintViolation; 5 | import javax.validation.ConstraintViolationException; 6 | import javax.validation.Validator; 7 | 8 | /** 9 | * bean对象属性验证 10 | * 11 | * @author ruoyi 12 | */ 13 | public class BeanValidators 14 | { 15 | public static void validateWithException(Validator validator, Object object, Class... groups) 16 | throws ConstraintViolationException 17 | { 18 | Set> constraintViolations = validator.validate(object, groups); 19 | if (!constraintViolations.isEmpty()) 20 | { 21 | throw new ConstraintViolationException(constraintViolations); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/job/TaskException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception.job; 2 | 3 | /** 4 | * 计划策略异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public class TaskException extends Exception 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | private Code code; 13 | 14 | public TaskException(String msg, Code code) 15 | { 16 | this(msg, code, null); 17 | } 18 | 19 | public TaskException(String msg, Code code, Exception nestedEx) 20 | { 21 | super(msg, nestedEx); 22 | this.code = code; 23 | } 24 | 25 | public Code getCode() 26 | { 27 | return code; 28 | } 29 | 30 | public enum Code 31 | { 32 | TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE 33 | } 34 | } -------------------------------------------------------------------------------- /source-flow/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-flow 13 | 14 | 15 | 16 | 工作流管理 17 | 18 | 19 | 20 | 21 | 22 | 23 | cn.source 24 | source-common 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/datasource/DynamicDataSource.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.datasource; 2 | 3 | import java.util.Map; 4 | import javax.sql.DataSource; 5 | import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; 6 | 7 | /** 8 | * 动态数据源 9 | * 10 | * @author ruoyi 11 | */ 12 | public class DynamicDataSource extends AbstractRoutingDataSource 13 | { 14 | public DynamicDataSource(DataSource defaultTargetDataSource, Map targetDataSources) 15 | { 16 | super.setDefaultTargetDataSource(defaultTargetDataSource); 17 | super.setTargetDataSources(targetDataSources); 18 | super.afterPropertiesSet(); 19 | } 20 | 21 | @Override 22 | protected Object determineCurrentLookupKey() 23 | { 24 | return DynamicDataSourceContextHolder.getDataSourceType(); 25 | } 26 | } -------------------------------------------------------------------------------- /source-love/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-love 13 | 14 | 15 | 16 | 相亲平台 17 | 18 | 19 | 20 | 21 | 22 | 23 | cn.source 24 | source-common 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /source-system/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-system 13 | 14 | 15 | system系统模块 16 | 17 | 18 | 19 | 20 | 21 | 22 | cn.source 23 | source-common 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /source-wms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-wms 13 | 14 | 15 | wms 16 | 17 | 18 | 19 | 20 | 21 | 22 | cn.source 23 | source-common 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /source-admin/src/main/java/cn/source/web/controller/system/SysIndexController.java: -------------------------------------------------------------------------------- 1 | package cn.source.web.controller.system; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import cn.source.common.config.RuoYiConfig; 7 | import cn.source.common.utils.StringUtils; 8 | 9 | /** 10 | * 首页 11 | * 12 | * @author ruoyi 13 | */ 14 | @RestController 15 | public class SysIndexController 16 | { 17 | /** 系统基础配置 */ 18 | @Autowired 19 | private RuoYiConfig ruoyiConfig; 20 | 21 | /** 22 | * 访问首页,提示语 23 | */ 24 | @RequestMapping("/") 25 | public String index() 26 | { 27 | return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Build Tools 3 | 4 | .gradle 5 | /build/ 6 | !gradle/wrapper/gradle-wrapper.jar 7 | 8 | target/ 9 | !.mvn/wrapper/maven-wrapper.jar 10 | 11 | ###################################################################### 12 | # IDE 13 | 14 | ### STS ### 15 | .apt_generated 16 | .classpath 17 | .factorypath 18 | .project 19 | .settings 20 | .springBeans 21 | 22 | ### IntelliJ IDEA ### 23 | .idea 24 | *.iws 25 | *.iml 26 | *.ipr 27 | 28 | ### NetBeans ### 29 | nbproject/private/ 30 | build/* 31 | nbbuild/ 32 | dist/ 33 | nbdist/ 34 | .nb-gradle/ 35 | 36 | ###################################################################### 37 | # Others 38 | *.log 39 | *.xml.versionsBackup 40 | *.swp 41 | 42 | !*/build/*.java 43 | !*/build/*.html 44 | !*/build/*.xml 45 | /source-admin/src/main/resources/*.yml 46 | /source-wms/ 47 | /source-love/ 48 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/xss/XssValidator.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.xss; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | import java.util.regex.Matcher; 6 | import java.util.regex.Pattern; 7 | 8 | /** 9 | * 自定义xss校验注解实现 10 | * 11 | * @author ruoyi 12 | */ 13 | public class XssValidator implements ConstraintValidator 14 | { 15 | private final String HTML_PATTERN = "<(\\S*?)[^>]*>.*?|<.*? />"; 16 | 17 | @Override 18 | public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) 19 | { 20 | return !containsHtml(value); 21 | } 22 | 23 | public boolean containsHtml(String value) 24 | { 25 | Pattern pattern = Pattern.compile(HTML_PATTERN); 26 | Matcher matcher = pattern.matcher(value); 27 | return matcher.matches(); 28 | } 29 | } -------------------------------------------------------------------------------- /source-admin/src/main/resources/mybatis/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/enums/HttpMethod.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.enums; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import org.springframework.lang.Nullable; 6 | 7 | /** 8 | * 请求方式 9 | * 10 | * @author ruoyi 11 | */ 12 | public enum HttpMethod 13 | { 14 | GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; 15 | 16 | private static final Map mappings = new HashMap<>(16); 17 | 18 | static 19 | { 20 | for (HttpMethod httpMethod : values()) 21 | { 22 | mappings.put(httpMethod.name(), httpMethod); 23 | } 24 | } 25 | 26 | @Nullable 27 | public static HttpMethod resolve(@Nullable String method) 28 | { 29 | return (method != null ? mappings.get(method) : null); 30 | } 31 | 32 | public boolean matches(String method) 33 | { 34 | return (this == resolve(method)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /source-admin/src/main/java/cn/source/web/controller/monitor/ServerController.java: -------------------------------------------------------------------------------- 1 | package cn.source.web.controller.monitor; 2 | 3 | import org.springframework.security.access.prepost.PreAuthorize; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import cn.source.common.core.domain.AjaxResult; 8 | import cn.source.framework.web.domain.Server; 9 | 10 | /** 11 | * 服务器监控 12 | * 13 | * @author ruoyi 14 | */ 15 | @RestController 16 | @RequestMapping("/monitor/server") 17 | public class ServerController 18 | { 19 | @PreAuthorize("@ss.hasPermi('monitor:server:list')") 20 | @GetMapping() 21 | public AjaxResult getInfo() throws Exception 22 | { 23 | Server server = new Server(); 24 | server.copyTo(); 25 | return AjaxResult.success(server); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/ISysLogininforService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysLogininfor; 5 | 6 | /** 7 | * 系统访问日志情况信息 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysLogininforService 12 | { 13 | /** 14 | * 新增系统登录日志 15 | * 16 | * @param logininfor 访问日志对象 17 | */ 18 | public void insertLogininfor(SysLogininfor logininfor); 19 | 20 | /** 21 | * 查询系统登录日志集合 22 | * 23 | * @param logininfor 访问日志对象 24 | * @return 登录记录集合 25 | */ 26 | public List selectLogininforList(SysLogininfor logininfor); 27 | 28 | /** 29 | * 批量删除系统登录日志 30 | * 31 | * @param infoIds 需要删除的登录日志ID 32 | * @return 33 | */ 34 | public int deleteLogininforByIds(Long[] infoIds); 35 | 36 | /** 37 | * 清空系统登录日志 38 | */ 39 | public void cleanLogininfor(); 40 | } 41 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/manager/ShutdownManager.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.manager; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.stereotype.Component; 6 | import javax.annotation.PreDestroy; 7 | 8 | /** 9 | * 确保应用退出时能关闭后台线程 10 | * 11 | * @author ruoyi 12 | */ 13 | @Component 14 | public class ShutdownManager 15 | { 16 | private static final Logger logger = LoggerFactory.getLogger("sys-user"); 17 | 18 | @PreDestroy 19 | public void destroy() 20 | { 21 | shutdownAsyncManager(); 22 | } 23 | 24 | /** 25 | * 停止异步执行任务 26 | */ 27 | private void shutdownAsyncManager() 28 | { 29 | try 30 | { 31 | logger.info("====关闭后台任务任务线程池===="); 32 | AsyncManager.me().shutdown(); 33 | } 34 | catch (Exception e) 35 | { 36 | logger.error(e.getMessage(), e); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/config/ServerConfig.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.config; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import org.springframework.stereotype.Component; 5 | import cn.source.common.utils.ServletUtils; 6 | 7 | /** 8 | * 服务相关配置 9 | * 10 | * @author ruoyi 11 | */ 12 | @Component 13 | public class ServerConfig 14 | { 15 | /** 16 | * 获取完整的请求路径,包括:域名,端口,上下文访问路径 17 | * 18 | * @return 服务地址 19 | */ 20 | public String getUrl() 21 | { 22 | HttpServletRequest request = ServletUtils.getRequest(); 23 | return getDomain(request); 24 | } 25 | 26 | public static String getDomain(HttpServletRequest request) 27 | { 28 | StringBuffer url = request.getRequestURL(); 29 | String contextPath = request.getServletContext().getContextPath(); 30 | return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysLogininforMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysLogininfor; 5 | 6 | /** 7 | * 系统访问日志情况信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysLogininforMapper 12 | { 13 | /** 14 | * 新增系统登录日志 15 | * 16 | * @param logininfor 访问日志对象 17 | */ 18 | public void insertLogininfor(SysLogininfor logininfor); 19 | 20 | /** 21 | * 查询系统登录日志集合 22 | * 23 | * @param logininfor 访问日志对象 24 | * @return 登录记录集合 25 | */ 26 | public List selectLogininforList(SysLogininfor logininfor); 27 | 28 | /** 29 | * 批量删除系统登录日志 30 | * 31 | * @param infoIds 需要删除的登录日志ID 32 | * @return 结果 33 | */ 34 | public int deleteLogininforByIds(Long[] infoIds); 35 | 36 | /** 37 | * 清空系统登录日志 38 | * 39 | * @return 结果 40 | */ 41 | public int cleanLogininfor(); 42 | } 43 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysRoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysRoleMenu; 5 | 6 | /** 7 | * 角色与菜单关联表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysRoleMenuMapper 12 | { 13 | /** 14 | * 查询菜单使用数量 15 | * 16 | * @param menuId 菜单ID 17 | * @return 结果 18 | */ 19 | public int checkMenuExistRole(Long menuId); 20 | 21 | /** 22 | * 通过角色ID删除角色和菜单关联 23 | * 24 | * @param roleId 角色ID 25 | * @return 结果 26 | */ 27 | public int deleteRoleMenuByRoleId(Long roleId); 28 | 29 | /** 30 | * 批量删除角色菜单关联信息 31 | * 32 | * @param ids 需要删除的数据ID 33 | * @return 结果 34 | */ 35 | public int deleteRoleMenu(Long[] ids); 36 | 37 | /** 38 | * 批量新增角色菜单信息 39 | * 40 | * @param roleMenuList 角色菜单列表 41 | * @return 结果 42 | */ 43 | public int batchRoleMenu(List roleMenuList); 44 | } 45 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/annotation/RateLimiter.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | import cn.source.common.constant.Constants; 9 | import cn.source.common.enums.LimitType; 10 | 11 | /** 12 | * 限流注解 13 | * 14 | * @author ruoyi 15 | */ 16 | @Target(ElementType.METHOD) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | @Documented 19 | public @interface RateLimiter 20 | { 21 | /** 22 | * 限流key 23 | */ 24 | public String key() default Constants.RATE_LIMIT_KEY; 25 | 26 | /** 27 | * 限流时间,单位秒 28 | */ 29 | public int time() default 60; 30 | 31 | /** 32 | * 限流次数 33 | */ 34 | public int count() default 100; 35 | 36 | /** 37 | * 限流类型 38 | */ 39 | public LimitType limitType() default LimitType.DEFAULT; 40 | } 41 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysUserPostMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysUserPost; 5 | 6 | /** 7 | * 用户与岗位关联表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysUserPostMapper 12 | { 13 | /** 14 | * 通过用户ID删除用户和岗位关联 15 | * 16 | * @param userId 用户ID 17 | * @return 结果 18 | */ 19 | public int deleteUserPostByUserId(Long userId); 20 | 21 | /** 22 | * 通过岗位ID查询岗位使用数量 23 | * 24 | * @param postId 岗位ID 25 | * @return 结果 26 | */ 27 | public int countUserPostById(Long postId); 28 | 29 | /** 30 | * 批量删除用户和岗位关联 31 | * 32 | * @param ids 需要删除的数据ID 33 | * @return 结果 34 | */ 35 | public int deleteUserPost(Long[] ids); 36 | 37 | /** 38 | * 批量新增用户岗位信息 39 | * 40 | * @param userPostList 用户角色列表 41 | * @return 结果 42 | */ 43 | public int batchUserPost(List userPostList); 44 | } 45 | -------------------------------------------------------------------------------- /source-generator/src/main/java/cn/source/generator/util/VelocityInitializer.java: -------------------------------------------------------------------------------- 1 | package cn.source.generator.util; 2 | 3 | import java.util.Properties; 4 | import org.apache.velocity.app.Velocity; 5 | import cn.source.common.constant.Constants; 6 | 7 | /** 8 | * VelocityEngine工厂 9 | * 10 | * @author ruoyi 11 | */ 12 | public class VelocityInitializer 13 | { 14 | /** 15 | * 初始化vm方法 16 | */ 17 | public static void initVelocity() 18 | { 19 | Properties p = new Properties(); 20 | try 21 | { 22 | // 加载classpath目录下的vm文件 23 | p.setProperty("resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); 24 | // 定义字符集 25 | p.setProperty(Velocity.INPUT_ENCODING, Constants.UTF8); 26 | // 初始化Velocity引擎,指定配置Properties 27 | Velocity.init(p); 28 | } 29 | catch (Exception e) 30 | { 31 | throw new RuntimeException(e); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysRoleDeptMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysRoleDept; 5 | 6 | /** 7 | * 角色与部门关联表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysRoleDeptMapper 12 | { 13 | /** 14 | * 通过角色ID删除角色和部门关联 15 | * 16 | * @param roleId 角色ID 17 | * @return 结果 18 | */ 19 | public int deleteRoleDeptByRoleId(Long roleId); 20 | 21 | /** 22 | * 批量删除角色部门关联信息 23 | * 24 | * @param ids 需要删除的数据ID 25 | * @return 结果 26 | */ 27 | public int deleteRoleDept(Long[] ids); 28 | 29 | /** 30 | * 查询部门使用数量 31 | * 32 | * @param deptId 部门ID 33 | * @return 结果 34 | */ 35 | public int selectCountRoleDeptByDeptId(Long deptId); 36 | 37 | /** 38 | * 批量新增角色部门信息 39 | * 40 | * @param roleDeptList 角色部门列表 41 | * @return 结果 42 | */ 43 | public int batchRoleDept(List roleDeptList); 44 | } 45 | -------------------------------------------------------------------------------- /source-house/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-house 13 | 14 | 15 | 租房管理 16 | 17 | 18 | 19 | 20 | 21 | 22 | cn.source 23 | source-common 24 | 25 | 26 | cn.source 27 | source-system 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/PageUtils.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import cn.source.common.core.page.PageDomain; 5 | import cn.source.common.core.page.TableSupport; 6 | import cn.source.common.utils.sql.SqlUtil; 7 | 8 | /** 9 | * 分页工具类 10 | * 11 | * @author ruoyi 12 | */ 13 | public class PageUtils extends PageHelper 14 | { 15 | /** 16 | * 设置请求分页数据 17 | */ 18 | public static void startPage() 19 | { 20 | PageDomain pageDomain = TableSupport.buildPageRequest(); 21 | Integer pageNum = pageDomain.getPageNum(); 22 | Integer pageSize = pageDomain.getPageSize(); 23 | if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) 24 | { 25 | String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); 26 | Boolean reasonable = pageDomain.getReasonable(); 27 | PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/config/ApplicationConfig.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.config; 2 | 3 | import java.util.TimeZone; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 9 | 10 | /** 11 | * 程序注解配置 12 | * 13 | * @author ruoyi 14 | */ 15 | @Configuration 16 | // 表示通过aop框架暴露该代理对象,AopContext能够访问 17 | @EnableAspectJAutoProxy(exposeProxy = true) 18 | // 指定要扫描的Mapper类的包的路径 19 | @MapperScan("cn.source.**.mapper") 20 | public class ApplicationConfig 21 | { 22 | /** 23 | * 时区配置 24 | */ 25 | @Bean 26 | public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() 27 | { 28 | return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysOperLogMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysOperLog; 5 | 6 | /** 7 | * 操作日志 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysOperLogMapper 12 | { 13 | /** 14 | * 新增操作日志 15 | * 16 | * @param operLog 操作日志对象 17 | */ 18 | public void insertOperlog(SysOperLog operLog); 19 | 20 | /** 21 | * 查询系统操作日志集合 22 | * 23 | * @param operLog 操作日志对象 24 | * @return 操作日志集合 25 | */ 26 | public List selectOperLogList(SysOperLog operLog); 27 | 28 | /** 29 | * 批量删除系统操作日志 30 | * 31 | * @param operIds 需要删除的操作日志ID 32 | * @return 结果 33 | */ 34 | public int deleteOperLogByIds(Long[] operIds); 35 | 36 | /** 37 | * 查询操作日志详细 38 | * 39 | * @param operId 操作ID 40 | * @return 操作日志对象 41 | */ 42 | public SysOperLog selectOperLogById(Long operId); 43 | 44 | /** 45 | * 清空操作日志 46 | */ 47 | public void cleanOperLog(); 48 | } 49 | -------------------------------------------------------------------------------- /source-im/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-im 13 | 14 | 15 | 即时通讯 16 | 17 | 18 | 19 | 20 | 21 | 22 | cn.source 23 | source-common 24 | 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-websocket 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/ISysOperLogService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysOperLog; 5 | 6 | /** 7 | * 操作日志 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysOperLogService 12 | { 13 | /** 14 | * 新增操作日志 15 | * 16 | * @param operLog 操作日志对象 17 | */ 18 | public void insertOperlog(SysOperLog operLog); 19 | 20 | /** 21 | * 查询系统操作日志集合 22 | * 23 | * @param operLog 操作日志对象 24 | * @return 操作日志集合 25 | */ 26 | public List selectOperLogList(SysOperLog operLog); 27 | 28 | /** 29 | * 批量删除系统操作日志 30 | * 31 | * @param operIds 需要删除的操作日志ID 32 | * @return 结果 33 | */ 34 | public int deleteOperLogByIds(Long[] operIds); 35 | 36 | /** 37 | * 查询操作日志详细 38 | * 39 | * @param operId 操作ID 40 | * @return 操作日志对象 41 | */ 42 | public SysOperLog selectOperLogById(Long operId); 43 | 44 | /** 45 | * 清空操作日志 46 | */ 47 | public void cleanOperLog(); 48 | } 49 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/uuid/IdUtils.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.uuid; 2 | 3 | /** 4 | * ID生成器工具类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class IdUtils 9 | { 10 | /** 11 | * 获取随机UUID 12 | * 13 | * @return 随机UUID 14 | */ 15 | public static String randomUUID() 16 | { 17 | return UUID.randomUUID().toString(); 18 | } 19 | 20 | /** 21 | * 简化的UUID,去掉了横线 22 | * 23 | * @return 简化的UUID,去掉了横线 24 | */ 25 | public static String simpleUUID() 26 | { 27 | return UUID.randomUUID().toString(true); 28 | } 29 | 30 | /** 31 | * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID 32 | * 33 | * @return 随机UUID 34 | */ 35 | public static String fastUUID() 36 | { 37 | return UUID.fastUUID().toString(); 38 | } 39 | 40 | /** 41 | * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID 42 | * 43 | * @return 简化的UUID,去掉了横线 44 | */ 45 | public static String fastSimpleUUID() 46 | { 47 | return UUID.fastUUID().toString(true); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /source-generator/src/main/java/cn/source/generator/service/IGenTableColumnService.java: -------------------------------------------------------------------------------- 1 | package cn.source.generator.service; 2 | 3 | import java.util.List; 4 | import cn.source.generator.domain.GenTableColumn; 5 | 6 | /** 7 | * 业务字段 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface IGenTableColumnService 12 | { 13 | /** 14 | * 查询业务字段列表 15 | * 16 | * @param tableId 业务字段编号 17 | * @return 业务字段集合 18 | */ 19 | public List selectGenTableColumnListByTableId(Long tableId); 20 | 21 | /** 22 | * 新增业务字段 23 | * 24 | * @param genTableColumn 业务字段信息 25 | * @return 结果 26 | */ 27 | public int insertGenTableColumn(GenTableColumn genTableColumn); 28 | 29 | /** 30 | * 修改业务字段 31 | * 32 | * @param genTableColumn 业务字段信息 33 | * @return 结果 34 | */ 35 | public int updateGenTableColumn(GenTableColumn genTableColumn); 36 | 37 | /** 38 | * 删除业务字段信息 39 | * 40 | * @param ids 需要删除的数据ID 41 | * @return 结果 42 | */ 43 | public int deleteGenTableColumnByIds(String ids); 44 | } 45 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/domain/SysRoleDept.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 角色和部门关联 sys_role_dept 8 | * 9 | * @author ruoyi 10 | */ 11 | public class SysRoleDept 12 | { 13 | /** 角色ID */ 14 | private Long roleId; 15 | 16 | /** 部门ID */ 17 | private Long deptId; 18 | 19 | public Long getRoleId() 20 | { 21 | return roleId; 22 | } 23 | 24 | public void setRoleId(Long roleId) 25 | { 26 | this.roleId = roleId; 27 | } 28 | 29 | public Long getDeptId() 30 | { 31 | return deptId; 32 | } 33 | 34 | public void setDeptId(Long deptId) 35 | { 36 | this.deptId = deptId; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 42 | .append("roleId", getRoleId()) 43 | .append("deptId", getDeptId()) 44 | .toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/domain/SysRoleMenu.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 角色和菜单关联 sys_role_menu 8 | * 9 | * @author ruoyi 10 | */ 11 | public class SysRoleMenu 12 | { 13 | /** 角色ID */ 14 | private Long roleId; 15 | 16 | /** 菜单ID */ 17 | private Long menuId; 18 | 19 | public Long getRoleId() 20 | { 21 | return roleId; 22 | } 23 | 24 | public void setRoleId(Long roleId) 25 | { 26 | this.roleId = roleId; 27 | } 28 | 29 | public Long getMenuId() 30 | { 31 | return menuId; 32 | } 33 | 34 | public void setMenuId(Long menuId) 35 | { 36 | this.menuId = menuId; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 42 | .append("roleId", getRoleId()) 43 | .append("menuId", getMenuId()) 44 | .toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/domain/SysUserPost.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 用户和岗位关联 sys_user_post 8 | * 9 | * @author ruoyi 10 | */ 11 | public class SysUserPost 12 | { 13 | /** 用户ID */ 14 | private Long userId; 15 | 16 | /** 岗位ID */ 17 | private Long postId; 18 | 19 | public Long getUserId() 20 | { 21 | return userId; 22 | } 23 | 24 | public void setUserId(Long userId) 25 | { 26 | this.userId = userId; 27 | } 28 | 29 | public Long getPostId() 30 | { 31 | return postId; 32 | } 33 | 34 | public void setPostId(Long postId) 35 | { 36 | this.postId = postId; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 42 | .append("userId", getUserId()) 43 | .append("postId", getPostId()) 44 | .toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/domain/SysUserRole.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 用户和角色关联 sys_user_role 8 | * 9 | * @author ruoyi 10 | */ 11 | public class SysUserRole 12 | { 13 | /** 用户ID */ 14 | private Long userId; 15 | 16 | /** 角色ID */ 17 | private Long roleId; 18 | 19 | public Long getUserId() 20 | { 21 | return userId; 22 | } 23 | 24 | public void setUserId(Long userId) 25 | { 26 | this.userId = userId; 27 | } 28 | 29 | public Long getRoleId() 30 | { 31 | return roleId; 32 | } 33 | 34 | public void setRoleId(Long roleId) 35 | { 36 | this.roleId = roleId; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 42 | .append("userId", getUserId()) 43 | .append("roleId", getRoleId()) 44 | .toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/ExceptionUtil.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils; 2 | 3 | import java.io.PrintWriter; 4 | import java.io.StringWriter; 5 | import org.apache.commons.lang3.exception.ExceptionUtils; 6 | 7 | /** 8 | * 错误信息处理类。 9 | * 10 | * @author ruoyi 11 | */ 12 | public class ExceptionUtil 13 | { 14 | /** 15 | * 获取exception的详细错误信息。 16 | */ 17 | public static String getExceptionMessage(Throwable e) 18 | { 19 | StringWriter sw = new StringWriter(); 20 | e.printStackTrace(new PrintWriter(sw, true)); 21 | String str = sw.toString(); 22 | return str; 23 | } 24 | 25 | public static String getRootErrorMessage(Exception e) 26 | { 27 | Throwable root = ExceptionUtils.getRootCause(e); 28 | root = (root == null ? e : root); 29 | if (root == null) 30 | { 31 | return ""; 32 | } 33 | String msg = root.getMessage(); 34 | if (msg == null) 35 | { 36 | return "null"; 37 | } 38 | return StringUtils.defaultString(msg); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2021 开源字节(http://8.136.213.245/index) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /source-generator/src/main/resources/vm/js/api.js.vm: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | // 查询${functionName}列表 4 | export function list${BusinessName}(query) { 5 | return request({ 6 | url: '/${moduleName}/${businessName}/list', 7 | method: 'get', 8 | params: query 9 | }) 10 | } 11 | 12 | // 查询${functionName}详细 13 | export function get${BusinessName}(${pkColumn.javaField}) { 14 | return request({ 15 | url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, 16 | method: 'get' 17 | }) 18 | } 19 | 20 | // 新增${functionName} 21 | export function add${BusinessName}(data) { 22 | return request({ 23 | url: '/${moduleName}/${businessName}', 24 | method: 'post', 25 | data: data 26 | }) 27 | } 28 | 29 | // 修改${functionName} 30 | export function update${BusinessName}(data) { 31 | return request({ 32 | url: '/${moduleName}/${businessName}', 33 | method: 'put', 34 | data: data 35 | }) 36 | } 37 | 38 | // 删除${functionName} 39 | export function del${BusinessName}(${pkColumn.javaField}) { 40 | return request({ 41 | url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, 42 | method: 'delete' 43 | }) 44 | } 45 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/annotation/Log.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | import cn.source.common.enums.BusinessType; 9 | import cn.source.common.enums.OperatorType; 10 | 11 | /** 12 | * 自定义操作日志记录注解 13 | * 14 | * @author ruoyi 15 | * 16 | */ 17 | @Target({ ElementType.PARAMETER, ElementType.METHOD }) 18 | @Retention(RetentionPolicy.RUNTIME) 19 | @Documented 20 | public @interface Log 21 | { 22 | /** 23 | * 模块 24 | */ 25 | public String title() default ""; 26 | 27 | /** 28 | * 功能 29 | */ 30 | public BusinessType businessType() default BusinessType.OTHER; 31 | 32 | /** 33 | * 操作人类别 34 | */ 35 | public OperatorType operatorType() default OperatorType.MANAGE; 36 | 37 | /** 38 | * 是否保存请求的参数 39 | */ 40 | public boolean isSaveRequestData() default true; 41 | 42 | /** 43 | * 是否保存响应的参数 44 | */ 45 | public boolean isSaveResponseData() default true; 46 | } 47 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/datasource/DynamicDataSourceContextHolder.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.datasource; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | /** 7 | * 数据源切换处理 8 | * 9 | * @author ruoyi 10 | */ 11 | public class DynamicDataSourceContextHolder 12 | { 13 | public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class); 14 | 15 | /** 16 | * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本, 17 | * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 18 | */ 19 | private static final ThreadLocal CONTEXT_HOLDER = new ThreadLocal<>(); 20 | 21 | /** 22 | * 设置数据源的变量 23 | */ 24 | public static void setDataSourceType(String dsType) 25 | { 26 | log.info("切换到{}数据源", dsType); 27 | CONTEXT_HOLDER.set(dsType); 28 | } 29 | 30 | /** 31 | * 获得数据源的变量 32 | */ 33 | public static String getDataSourceType() 34 | { 35 | return CONTEXT_HOLDER.get(); 36 | } 37 | 38 | /** 39 | * 清空数据源变量 40 | */ 41 | public static void clearDataSourceType() 42 | { 43 | CONTEXT_HOLDER.remove(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/constant/ScheduleConstants.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.constant; 2 | 3 | /** 4 | * 任务调度通用常量 5 | * 6 | * @author ruoyi 7 | */ 8 | public class ScheduleConstants 9 | { 10 | public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; 11 | 12 | /** 执行目标key */ 13 | public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; 14 | 15 | /** 默认 */ 16 | public static final String MISFIRE_DEFAULT = "0"; 17 | 18 | /** 立即触发执行 */ 19 | public static final String MISFIRE_IGNORE_MISFIRES = "1"; 20 | 21 | /** 触发一次执行 */ 22 | public static final String MISFIRE_FIRE_AND_PROCEED = "2"; 23 | 24 | /** 不触发立即执行 */ 25 | public static final String MISFIRE_DO_NOTHING = "3"; 26 | 27 | public enum Status 28 | { 29 | /** 30 | * 正常 31 | */ 32 | NORMAL("0"), 33 | /** 34 | * 暂停 35 | */ 36 | PAUSE("1"); 37 | 38 | private String value; 39 | 40 | private Status(String value) 41 | { 42 | this.value = value; 43 | } 44 | 45 | public String getValue() 46 | { 47 | return value; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /source-cms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-cms 13 | 14 | 15 | cms内容管理 16 | 17 | 18 | 19 | 20 | 21 | 22 | cn.source 23 | source-common 24 | 25 | 26 | 27 | dom4j 28 | dom4j 29 | 1.6.1 30 | 31 | 32 | 33 | cn.source 34 | source-im 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/web/domain/server/Mem.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.web.domain.server; 2 | 3 | import cn.source.common.utils.Arith; 4 | 5 | /** 6 | * 內存相关信息 7 | * 8 | * @author ruoyi 9 | */ 10 | public class Mem 11 | { 12 | /** 13 | * 内存总量 14 | */ 15 | private double total; 16 | 17 | /** 18 | * 已用内存 19 | */ 20 | private double used; 21 | 22 | /** 23 | * 剩余内存 24 | */ 25 | private double free; 26 | 27 | public double getTotal() 28 | { 29 | return Arith.div(total, (1024 * 1024 * 1024), 2); 30 | } 31 | 32 | public void setTotal(long total) 33 | { 34 | this.total = total; 35 | } 36 | 37 | public double getUsed() 38 | { 39 | return Arith.div(used, (1024 * 1024 * 1024), 2); 40 | } 41 | 42 | public void setUsed(long used) 43 | { 44 | this.used = used; 45 | } 46 | 47 | public double getFree() 48 | { 49 | return Arith.div(free, (1024 * 1024 * 1024), 2); 50 | } 51 | 52 | public void setFree(long free) 53 | { 54 | this.free = free; 55 | } 56 | 57 | public double getUsage() 58 | { 59 | return Arith.mul(Arith.div(used, total, 4), 100); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/GlobalException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception; 2 | 3 | /** 4 | * 全局异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public class GlobalException extends RuntimeException 9 | { 10 | 11 | private static final long serialVersionUID = 1L; 12 | 13 | /** 14 | * 错误提示 15 | */ 16 | private String message; 17 | 18 | /** 19 | * 错误明细,内部调试错误 20 | * 21 | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 22 | */ 23 | private String detailMessage; 24 | 25 | /** 26 | * 空构造方法,避免反序列化问题 27 | */ 28 | public GlobalException() 29 | { 30 | } 31 | 32 | public GlobalException(String message) 33 | { 34 | this.message = message; 35 | } 36 | 37 | public String getDetailMessage() 38 | { 39 | return detailMessage; 40 | } 41 | 42 | public GlobalException setDetailMessage(String detailMessage) 43 | { 44 | this.detailMessage = detailMessage; 45 | return this; 46 | } 47 | 48 | public String getMessage() 49 | { 50 | return message; 51 | } 52 | 53 | public GlobalException setMessage(String message) 54 | { 55 | this.message = message; 56 | return this; 57 | } 58 | } -------------------------------------------------------------------------------- /source-quartz/src/main/java/cn/source/quartz/service/ISysJobLogService.java: -------------------------------------------------------------------------------- 1 | package cn.source.quartz.service; 2 | 3 | import java.util.List; 4 | import cn.source.quartz.domain.SysJobLog; 5 | 6 | /** 7 | * 定时任务调度日志信息信息 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysJobLogService 12 | { 13 | /** 14 | * 获取quartz调度器日志的计划任务 15 | * 16 | * @param jobLog 调度日志信息 17 | * @return 调度任务日志集合 18 | */ 19 | public List selectJobLogList(SysJobLog jobLog); 20 | 21 | /** 22 | * 通过调度任务日志ID查询调度信息 23 | * 24 | * @param jobLogId 调度任务日志ID 25 | * @return 调度任务日志对象信息 26 | */ 27 | public SysJobLog selectJobLogById(Long jobLogId); 28 | 29 | /** 30 | * 新增任务日志 31 | * 32 | * @param jobLog 调度日志信息 33 | */ 34 | public void addJobLog(SysJobLog jobLog); 35 | 36 | /** 37 | * 批量删除调度日志信息 38 | * 39 | * @param logIds 需要删除的日志ID 40 | * @return 结果 41 | */ 42 | public int deleteJobLogByIds(Long[] logIds); 43 | 44 | /** 45 | * 删除任务日志 46 | * 47 | * @param jobId 调度日志ID 48 | * @return 结果 49 | */ 50 | public int deleteJobLogById(Long jobId); 51 | 52 | /** 53 | * 清空任务日志 54 | */ 55 | public void cleanJobLog(); 56 | } 57 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/ISysUserOnlineService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.common.core.domain.model.LoginUser; 4 | import cn.source.system.domain.SysUserOnline; 5 | 6 | /** 7 | * 在线用户 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysUserOnlineService 12 | { 13 | /** 14 | * 通过登录地址查询信息 15 | * 16 | * @param ipaddr 登录地址 17 | * @param user 用户信息 18 | * @return 在线用户信息 19 | */ 20 | public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user); 21 | 22 | /** 23 | * 通过用户名称查询信息 24 | * 25 | * @param userName 用户名称 26 | * @param user 用户信息 27 | * @return 在线用户信息 28 | */ 29 | public SysUserOnline selectOnlineByUserName(String userName, LoginUser user); 30 | 31 | /** 32 | * 通过登录地址/用户名称查询信息 33 | * 34 | * @param ipaddr 登录地址 35 | * @param userName 用户名称 36 | * @param user 用户信息 37 | * @return 在线用户信息 38 | */ 39 | public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user); 40 | 41 | /** 42 | * 设置在线用户信息 43 | * 44 | * @param user 用户信息 45 | * @return 在线用户 46 | */ 47 | public SysUserOnline loginUserToUserOnline(LoginUser user); 48 | } 49 | -------------------------------------------------------------------------------- /source-admin/src/main/resources/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | #错误消息 2 | not.null=* 必须填写 3 | user.jcaptcha.error=验证码错误 4 | user.jcaptcha.expire=验证码已失效 5 | user.not.exists=用户不存在/密码错误 6 | user.password.not.match=用户不存在/密码错误 7 | user.password.retry.limit.count=密码输入错误{0}次 8 | user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟 9 | user.password.delete=对不起,您的账号已被删除 10 | user.blocked=用户已封禁,请联系管理员 11 | role.blocked=角色已封禁,请联系管理员 12 | user.logout.success=退出成功 13 | 14 | length.not.valid=长度必须在{min}到{max}个字符之间 15 | 16 | user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 17 | user.password.not.valid=* 5-50个字符 18 | 19 | user.email.not.valid=邮箱格式错误 20 | user.mobile.phone.number.not.valid=手机号格式错误 21 | user.login.success=登录成功 22 | user.register.success=注册成功 23 | user.notfound=请重新登录 24 | user.forcelogout=管理员强制退出,请重新登录 25 | user.unknown.error=未知错误,请重新登录 26 | 27 | ##文件上传消息 28 | upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! 29 | upload.filename.exceed.length=上传的文件名最长{0}个字符 30 | 31 | ##权限 32 | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] 33 | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] 34 | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] 35 | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] 36 | no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] 37 | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] 38 | -------------------------------------------------------------------------------- /source-quartz/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-quartz 13 | 14 | 15 | quartz定时任务 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.quartz-scheduler 23 | quartz 24 | 25 | 26 | com.mchange 27 | c3p0 28 | 29 | 30 | 31 | 32 | 33 | 34 | cn.source 35 | source-common 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /source-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | delete from sys_role_menu where role_id=#{roleId} 18 | 19 | 20 | 21 | delete from sys_role_menu where role_id in 22 | 23 | #{roleId} 24 | 25 | 26 | 27 | 28 | insert into sys_role_menu(role_id, menu_id) values 29 | 30 | (#{item.roleId},#{item.menuId}) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /source-system/src/main/resources/mapper/system/SysUserPostMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_user_post where user_id=#{userId} 14 | 15 | 16 | 19 | 20 | 21 | delete from sys_user_post where user_id in 22 | 23 | #{userId} 24 | 25 | 26 | 27 | 28 | insert into sys_user_post(user_id, post_id) values 29 | 30 | (#{item.userId},#{item.postId}) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /source-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_role_dept where role_id=#{roleId} 14 | 15 | 16 | 19 | 20 | 21 | delete from sys_role_dept where role_id in 22 | 23 | #{roleId} 24 | 25 | 26 | 27 | 28 | insert into sys_role_dept(role_id, dept_id) values 29 | 30 | (#{item.roleId},#{item.deptId}) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /source-generator/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-generator 13 | 14 | 15 | generator代码生成 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.apache.velocity 23 | velocity-engine-core 24 | 25 | 26 | 27 | 28 | commons-collections 29 | commons-collections 30 | 31 | 32 | 33 | 34 | cn.source 35 | source-common 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /source-im/src/main/java/cn/source/system/websocket/SemaphoreUtils.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.websocket; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | import java.util.concurrent.Semaphore; 7 | 8 | /** 9 | * 信号量相关处理 10 | * 11 | * @author ruoyi 12 | */ 13 | public class SemaphoreUtils 14 | { 15 | /** 16 | * SemaphoreUtils 日志控制器 17 | */ 18 | private static final Logger LOGGER = LoggerFactory.getLogger(SemaphoreUtils.class); 19 | 20 | /** 21 | * 获取信号量 22 | * 23 | * @param semaphore 24 | * @return 25 | */ 26 | public static boolean tryAcquire(Semaphore semaphore) 27 | { 28 | boolean flag = false; 29 | 30 | try 31 | { 32 | flag = semaphore.tryAcquire(); 33 | } 34 | catch (Exception e) 35 | { 36 | LOGGER.error("获取信号量异常", e); 37 | } 38 | 39 | return flag; 40 | } 41 | 42 | /** 43 | * 释放信号量 44 | * 45 | * @param semaphore 46 | */ 47 | public static void release(Semaphore semaphore) 48 | { 49 | 50 | try 51 | { 52 | semaphore.release(); 53 | } 54 | catch (Exception e) 55 | { 56 | LOGGER.error("释放信号量异常", e); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/mapper/CmsMsgMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.CmsMsg; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 消息管理Mapper接口 9 | * 10 | * @author 詹Sir 11 | * @date 2022-04-03 12 | */ 13 | public interface CmsMsgMapper 14 | { 15 | /** 16 | * 查询消息管理 17 | * 18 | * @param id 消息管理主键 19 | * @return 消息管理 20 | */ 21 | public CmsMsg selectCmsMsgById(Long id); 22 | 23 | /** 24 | * 查询消息管理列表 25 | * 26 | * @param cmsMsg 消息管理 27 | * @return 消息管理集合 28 | */ 29 | public List selectCmsMsgList(CmsMsg cmsMsg); 30 | 31 | /** 32 | * 新增消息管理 33 | * 34 | * @param cmsMsg 消息管理 35 | * @return 结果 36 | */ 37 | public int insertCmsMsg(CmsMsg cmsMsg); 38 | 39 | /** 40 | * 修改消息管理 41 | * 42 | * @param cmsMsg 消息管理 43 | * @return 结果 44 | */ 45 | public int updateCmsMsg(CmsMsg cmsMsg); 46 | 47 | /** 48 | * 删除消息管理 49 | * 50 | * @param id 消息管理主键 51 | * @return 结果 52 | */ 53 | public int deleteCmsMsgById(Long id); 54 | 55 | /** 56 | * 批量删除消息管理 57 | * 58 | * @param ids 需要删除的数据主键集合 59 | * @return 结果 60 | */ 61 | public int deleteCmsMsgByIds(Long[] ids); 62 | } 63 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/service/ICmsMsgService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.CmsMsg; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 消息管理Service接口 9 | * 10 | * @author 詹Sir 11 | * @date 2022-04-03 12 | */ 13 | public interface ICmsMsgService 14 | { 15 | /** 16 | * 查询消息管理 17 | * 18 | * @param id 消息管理主键 19 | * @return 消息管理 20 | */ 21 | public CmsMsg selectCmsMsgById(Long id); 22 | 23 | /** 24 | * 查询消息管理列表 25 | * 26 | * @param cmsMsg 消息管理 27 | * @return 消息管理集合 28 | */ 29 | public List selectCmsMsgList(CmsMsg cmsMsg); 30 | 31 | /** 32 | * 新增消息管理 33 | * 34 | * @param cmsMsg 消息管理 35 | * @return 结果 36 | */ 37 | public int insertCmsMsg(CmsMsg cmsMsg); 38 | 39 | /** 40 | * 修改消息管理 41 | * 42 | * @param cmsMsg 消息管理 43 | * @return 结果 44 | */ 45 | public int updateCmsMsg(CmsMsg cmsMsg); 46 | 47 | /** 48 | * 批量删除消息管理 49 | * 50 | * @param ids 需要删除的消息管理主键集合 51 | * @return 结果 52 | */ 53 | public int deleteCmsMsgByIds(Long[] ids); 54 | 55 | /** 56 | * 删除消息管理信息 57 | * 58 | * @param id 消息管理主键 59 | * @return 结果 60 | */ 61 | public int deleteCmsMsgById(Long id); 62 | } 63 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/core/domain/model/LoginBody.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.core.domain.model; 2 | 3 | /** 4 | * 用户登录对象 5 | * 6 | * @author ruoyi 7 | */ 8 | public class LoginBody 9 | { 10 | /** 11 | * 用户名 12 | */ 13 | private String username; 14 | 15 | /** 16 | * 用户密码 17 | */ 18 | private String password; 19 | 20 | /** 21 | * 验证码 22 | */ 23 | private String code; 24 | 25 | /** 26 | * 唯一标识 27 | */ 28 | private String uuid = ""; 29 | 30 | public String getUsername() 31 | { 32 | return username; 33 | } 34 | 35 | public void setUsername(String username) 36 | { 37 | this.username = username; 38 | } 39 | 40 | public String getPassword() 41 | { 42 | return password; 43 | } 44 | 45 | public void setPassword(String password) 46 | { 47 | this.password = password; 48 | } 49 | 50 | public String getCode() 51 | { 52 | return code; 53 | } 54 | 55 | public void setCode(String code) 56 | { 57 | this.code = code; 58 | } 59 | 60 | public String getUuid() 61 | { 62 | return uuid; 63 | } 64 | 65 | public void setUuid(String uuid) 66 | { 67 | this.uuid = uuid; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/mapper/CmsLinkMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.CmsLink; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 友情链接Mapper接口 9 | * 10 | * @author 詹Sir 11 | * @date 2022-03-12 12 | */ 13 | public interface CmsLinkMapper 14 | { 15 | /** 16 | * 查询友情链接 17 | * 18 | * @param id 友情链接主键 19 | * @return 友情链接 20 | */ 21 | public CmsLink selectCmsLinkById(Long id); 22 | 23 | /** 24 | * 查询友情链接列表 25 | * 26 | * @param cmsLink 友情链接 27 | * @return 友情链接集合 28 | */ 29 | public List selectCmsLinkList(CmsLink cmsLink); 30 | 31 | /** 32 | * 新增友情链接 33 | * 34 | * @param cmsLink 友情链接 35 | * @return 结果 36 | */ 37 | public int insertCmsLink(CmsLink cmsLink); 38 | 39 | /** 40 | * 修改友情链接 41 | * 42 | * @param cmsLink 友情链接 43 | * @return 结果 44 | */ 45 | public int updateCmsLink(CmsLink cmsLink); 46 | 47 | /** 48 | * 删除友情链接 49 | * 50 | * @param id 友情链接主键 51 | * @return 结果 52 | */ 53 | public int deleteCmsLinkById(Long id); 54 | 55 | /** 56 | * 批量删除友情链接 57 | * 58 | * @param ids 需要删除的数据主键集合 59 | * @return 结果 60 | */ 61 | public int deleteCmsLinkByIds(Long[] ids); 62 | } 63 | -------------------------------------------------------------------------------- /source-admin/src/main/java/cn/source/RuoYiApplication.java: -------------------------------------------------------------------------------- 1 | package cn.source; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; 6 | 7 | /** 8 | * 启动程序 9 | * 10 | * @author ruoyi 11 | */ 12 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) 13 | public class RuoYiApplication 14 | { 15 | public static void main(String[] args) 16 | { 17 | // System.setProperty("spring.devtools.restart.enabled", "false"); 18 | SpringApplication.run(RuoYiApplication.class, args); 19 | System.out.println("(♥◠‿◠)ノ゙ 开源字节(https://sourcebyte.cn) ლ(´ڡ`ლ)゙ \n" + 20 | " .-------. ____ __ \n" + 21 | " | _ _ \\ \\ \\ / / \n" + 22 | " | ( ' ) | \\ _. / ' \n" + 23 | " |(_ o _) / _( )_ .' \n" + 24 | " | (_,_).' __ ___(_ o _)' \n" + 25 | " | |\\ \\ | || |(_,_)' \n" + 26 | " | | \\ `' /| `-' / \n" + 27 | " | | \\ / \\ / \n" + 28 | " ''-' `'-' `-..-' "); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysNoticeMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysNotice; 5 | 6 | /** 7 | * 通知公告表 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysNoticeMapper 12 | { 13 | /** 14 | * 查询公告信息 15 | * 16 | * @param noticeId 公告ID 17 | * @return 公告信息 18 | */ 19 | public SysNotice selectNoticeById(Long noticeId); 20 | 21 | /** 22 | * 查询公告列表 23 | * 24 | * @param notice 公告信息 25 | * @return 公告集合 26 | */ 27 | public List selectNoticeList(SysNotice notice); 28 | 29 | /** 30 | * 新增公告 31 | * 32 | * @param notice 公告信息 33 | * @return 结果 34 | */ 35 | public int insertNotice(SysNotice notice); 36 | 37 | /** 38 | * 修改公告 39 | * 40 | * @param notice 公告信息 41 | * @return 结果 42 | */ 43 | public int updateNotice(SysNotice notice); 44 | 45 | /** 46 | * 批量删除公告 47 | * 48 | * @param noticeId 公告ID 49 | * @return 结果 50 | */ 51 | public int deleteNoticeById(Long noticeId); 52 | 53 | /** 54 | * 批量删除公告信息 55 | * 56 | * @param noticeIds 需要删除的公告ID 57 | * @return 结果 58 | */ 59 | public int deleteNoticeByIds(Long[] noticeIds); 60 | } 61 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/service/ICmsLinkService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.CmsLink; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 友情链接Service接口 9 | * 10 | * @author 詹Sir 11 | * @date 2022-03-12 12 | */ 13 | public interface ICmsLinkService 14 | { 15 | /** 16 | * 查询友情链接 17 | * 18 | * @param id 友情链接主键 19 | * @return 友情链接 20 | */ 21 | public CmsLink selectCmsLinkById(Long id); 22 | 23 | /** 24 | * 查询友情链接列表 25 | * 26 | * @param cmsLink 友情链接 27 | * @return 友情链接集合 28 | */ 29 | public List selectCmsLinkList(CmsLink cmsLink); 30 | 31 | /** 32 | * 新增友情链接 33 | * 34 | * @param cmsLink 友情链接 35 | * @return 结果 36 | */ 37 | public int insertCmsLink(CmsLink cmsLink); 38 | 39 | /** 40 | * 修改友情链接 41 | * 42 | * @param cmsLink 友情链接 43 | * @return 结果 44 | */ 45 | public int updateCmsLink(CmsLink cmsLink); 46 | 47 | /** 48 | * 批量删除友情链接 49 | * 50 | * @param ids 需要删除的友情链接主键集合 51 | * @return 结果 52 | */ 53 | public int deleteCmsLinkByIds(Long[] ids); 54 | 55 | /** 56 | * 删除友情链接信息 57 | * 58 | * @param id 友情链接主键 59 | * @return 结果 60 | */ 61 | public int deleteCmsLinkById(Long id); 62 | } 63 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/manager/AsyncManager.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.manager; 2 | 3 | import java.util.TimerTask; 4 | import java.util.concurrent.ScheduledExecutorService; 5 | import java.util.concurrent.TimeUnit; 6 | import cn.source.common.utils.Threads; 7 | import cn.source.common.utils.spring.SpringUtils; 8 | 9 | /** 10 | * 异步任务管理器 11 | * 12 | * @author ruoyi 13 | */ 14 | public class AsyncManager 15 | { 16 | /** 17 | * 操作延迟10毫秒 18 | */ 19 | private final int OPERATE_DELAY_TIME = 10; 20 | 21 | /** 22 | * 异步操作任务调度线程池 23 | */ 24 | private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService"); 25 | 26 | /** 27 | * 单例模式 28 | */ 29 | private AsyncManager(){} 30 | 31 | private static AsyncManager me = new AsyncManager(); 32 | 33 | public static AsyncManager me() 34 | { 35 | return me; 36 | } 37 | 38 | /** 39 | * 执行任务 40 | * 41 | * @param task 任务 42 | */ 43 | public void execute(TimerTask task) 44 | { 45 | executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); 46 | } 47 | 48 | /** 49 | * 停止任务线程池 50 | */ 51 | public void shutdown() 52 | { 53 | Threads.shutdownAndAwaitTermination(executor); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/ISysNoticeService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysNotice; 5 | 6 | /** 7 | * 公告 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysNoticeService 12 | { 13 | /** 14 | * 查询公告信息 15 | * 16 | * @param noticeId 公告ID 17 | * @return 公告信息 18 | */ 19 | public SysNotice selectNoticeById(Long noticeId); 20 | 21 | /** 22 | * 查询公告列表 23 | * 24 | * @param notice 公告信息 25 | * @return 公告集合 26 | */ 27 | public List selectNoticeList(SysNotice notice); 28 | 29 | /** 30 | * 新增公告 31 | * 32 | * @param notice 公告信息 33 | * @return 结果 34 | */ 35 | public int insertNotice(SysNotice notice); 36 | 37 | /** 38 | * 修改公告 39 | * 40 | * @param notice 公告信息 41 | * @return 结果 42 | */ 43 | public int updateNotice(SysNotice notice); 44 | 45 | /** 46 | * 删除公告信息 47 | * 48 | * @param noticeId 公告ID 49 | * @return 结果 50 | */ 51 | public int deleteNoticeById(Long noticeId); 52 | 53 | /** 54 | * 批量删除公告信息 55 | * 56 | * @param noticeIds 需要删除的公告ID 57 | * @return 结果 58 | */ 59 | public int deleteNoticeByIds(Long[] noticeIds); 60 | } 61 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/mapper/HouseUserMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.HouseUser; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 出租信息Mapper接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-27 12 | */ 13 | public interface HouseUserMapper 14 | { 15 | /** 16 | * 查询出租信息 17 | * 18 | * @param id 出租信息主键 19 | * @return 出租信息 20 | */ 21 | public HouseUser selectHouseUserById(Long id); 22 | 23 | /** 24 | * 查询出租信息列表 25 | * 26 | * @param houseUser 出租信息 27 | * @return 出租信息集合 28 | */ 29 | public List selectHouseUserList(HouseUser houseUser); 30 | 31 | /** 32 | * 新增出租信息 33 | * 34 | * @param houseUser 出租信息 35 | * @return 结果 36 | */ 37 | public int insertHouseUser(HouseUser houseUser); 38 | 39 | /** 40 | * 修改出租信息 41 | * 42 | * @param houseUser 出租信息 43 | * @return 结果 44 | */ 45 | public int updateHouseUser(HouseUser houseUser); 46 | 47 | /** 48 | * 删除出租信息 49 | * 50 | * @param id 出租信息主键 51 | * @return 结果 52 | */ 53 | public int deleteHouseUserById(Long id); 54 | 55 | /** 56 | * 批量删除出租信息 57 | * 58 | * @param ids 需要删除的数据主键集合 59 | * @return 结果 60 | */ 61 | public int deleteHouseUserByIds(Long[] ids); 62 | } 63 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/service/IHouseUserService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.HouseUser; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 出租信息Service接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-27 12 | */ 13 | public interface IHouseUserService 14 | { 15 | /** 16 | * 查询出租信息 17 | * 18 | * @param id 出租信息主键 19 | * @return 出租信息 20 | */ 21 | public HouseUser selectHouseUserById(Long id); 22 | 23 | /** 24 | * 查询出租信息列表 25 | * 26 | * @param houseUser 出租信息 27 | * @return 出租信息集合 28 | */ 29 | public List selectHouseUserList(HouseUser houseUser); 30 | 31 | /** 32 | * 新增出租信息 33 | * 34 | * @param houseUser 出租信息 35 | * @return 结果 36 | */ 37 | public int insertHouseUser(HouseUser houseUser); 38 | 39 | /** 40 | * 修改出租信息 41 | * 42 | * @param houseUser 出租信息 43 | * @return 结果 44 | */ 45 | public int updateHouseUser(HouseUser houseUser); 46 | 47 | /** 48 | * 批量删除出租信息 49 | * 50 | * @param ids 需要删除的出租信息主键集合 51 | * @return 结果 52 | */ 53 | public int deleteHouseUserByIds(Long[] ids); 54 | 55 | /** 56 | * 删除出租信息信息 57 | * 58 | * @param id 出租信息主键 59 | * @return 结果 60 | */ 61 | public int deleteHouseUserById(Long id); 62 | } 63 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/mapper/HouseImageMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.HouseImage; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 房源图片Mapper接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-27 12 | */ 13 | public interface HouseImageMapper 14 | { 15 | /** 16 | * 查询房源图片 17 | * 18 | * @param id 房源图片主键 19 | * @return 房源图片 20 | */ 21 | public HouseImage selectHouseImageById(Long id); 22 | 23 | /** 24 | * 查询房源图片列表 25 | * 26 | * @param houseImage 房源图片 27 | * @return 房源图片集合 28 | */ 29 | public List selectHouseImageList(HouseImage houseImage); 30 | 31 | /** 32 | * 新增房源图片 33 | * 34 | * @param houseImage 房源图片 35 | * @return 结果 36 | */ 37 | public int insertHouseImage(HouseImage houseImage); 38 | 39 | /** 40 | * 修改房源图片 41 | * 42 | * @param houseImage 房源图片 43 | * @return 结果 44 | */ 45 | public int updateHouseImage(HouseImage houseImage); 46 | 47 | /** 48 | * 删除房源图片 49 | * 50 | * @param id 房源图片主键 51 | * @return 结果 52 | */ 53 | public int deleteHouseImageById(Long id); 54 | 55 | /** 56 | * 批量删除房源图片 57 | * 58 | * @param ids 需要删除的数据主键集合 59 | * @return 结果 60 | */ 61 | public int deleteHouseImageByIds(Long[] ids); 62 | } 63 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/service/IHouseImageService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.HouseImage; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 房源图片Service接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-27 12 | */ 13 | public interface IHouseImageService 14 | { 15 | /** 16 | * 查询房源图片 17 | * 18 | * @param id 房源图片主键 19 | * @return 房源图片 20 | */ 21 | public HouseImage selectHouseImageById(Long id); 22 | 23 | /** 24 | * 查询房源图片列表 25 | * 26 | * @param houseImage 房源图片 27 | * @return 房源图片集合 28 | */ 29 | public List selectHouseImageList(HouseImage houseImage); 30 | 31 | /** 32 | * 新增房源图片 33 | * 34 | * @param houseImage 房源图片 35 | * @return 结果 36 | */ 37 | public int insertHouseImage(HouseImage houseImage); 38 | 39 | /** 40 | * 修改房源图片 41 | * 42 | * @param houseImage 房源图片 43 | * @return 结果 44 | */ 45 | public int updateHouseImage(HouseImage houseImage); 46 | 47 | /** 48 | * 批量删除房源图片 49 | * 50 | * @param ids 需要删除的房源图片主键集合 51 | * @return 结果 52 | */ 53 | public int deleteHouseImageByIds(Long[] ids); 54 | 55 | /** 56 | * 删除房源图片信息 57 | * 58 | * @param id 房源图片主键 59 | * @return 结果 60 | */ 61 | public int deleteHouseImageById(Long id); 62 | } 63 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/mapper/CmsFeedbackMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.CmsFeedback; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 意见反馈Mapper接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-01 12 | */ 13 | public interface CmsFeedbackMapper 14 | { 15 | /** 16 | * 查询意见反馈 17 | * 18 | * @param id 意见反馈主键 19 | * @return 意见反馈 20 | */ 21 | public CmsFeedback selectCmsFeedbackById(Long id); 22 | 23 | /** 24 | * 查询意见反馈列表 25 | * 26 | * @param cmsFeedback 意见反馈 27 | * @return 意见反馈集合 28 | */ 29 | public List selectCmsFeedbackList(CmsFeedback cmsFeedback); 30 | 31 | /** 32 | * 新增意见反馈 33 | * 34 | * @param cmsFeedback 意见反馈 35 | * @return 结果 36 | */ 37 | public int insertCmsFeedback(CmsFeedback cmsFeedback); 38 | 39 | /** 40 | * 修改意见反馈 41 | * 42 | * @param cmsFeedback 意见反馈 43 | * @return 结果 44 | */ 45 | public int updateCmsFeedback(CmsFeedback cmsFeedback); 46 | 47 | /** 48 | * 删除意见反馈 49 | * 50 | * @param id 意见反馈主键 51 | * @return 结果 52 | */ 53 | public int deleteCmsFeedbackById(Long id); 54 | 55 | /** 56 | * 批量删除意见反馈 57 | * 58 | * @param ids 需要删除的数据主键集合 59 | * @return 结果 60 | */ 61 | public int deleteCmsFeedbackByIds(Long[] ids); 62 | } 63 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/core/domain/model/FlowModel.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.core.domain.model; 2 | 3 | /** 4 | * @Description: 首页展示流量模型 5 | * @author: zy 6 | */ 7 | public class FlowModel { 8 | 9 | // ip日流量 10 | private Long ipFlowDay; 11 | 12 | // ip总流量 13 | private Long ipAllFlow; 14 | 15 | private Long uvFlowDay; 16 | 17 | private Long pvFlowDay; 18 | 19 | private String flowDate; 20 | 21 | public Long getIpFlowDay() { 22 | return ipFlowDay; 23 | } 24 | 25 | public void setIpFlowDay(Long ipFlowDay) { 26 | this.ipFlowDay = ipFlowDay; 27 | } 28 | 29 | public Long getIpAllFlow() { 30 | return ipAllFlow; 31 | } 32 | 33 | public void setIpAllFlow(Long ipAllFlow) { 34 | this.ipAllFlow = ipAllFlow; 35 | } 36 | 37 | public Long getUvFlowDay() { 38 | return uvFlowDay; 39 | } 40 | 41 | public void setUvFlowDay(Long uvFlowDay) { 42 | this.uvFlowDay = uvFlowDay; 43 | } 44 | 45 | public Long getPvFlowDay() { 46 | return pvFlowDay; 47 | } 48 | 49 | public void setPvFlowDay(Long pvFlowDay) { 50 | this.pvFlowDay = pvFlowDay; 51 | } 52 | 53 | public String getFlowDate() { 54 | return flowDate; 55 | } 56 | 57 | public void setFlowDate(String flowDate) { 58 | this.flowDate = flowDate; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/service/ICmsFeedbackService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.CmsFeedback; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 意见反馈Service接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-01 12 | */ 13 | public interface ICmsFeedbackService 14 | { 15 | /** 16 | * 查询意见反馈 17 | * 18 | * @param id 意见反馈主键 19 | * @return 意见反馈 20 | */ 21 | public CmsFeedback selectCmsFeedbackById(Long id); 22 | 23 | /** 24 | * 查询意见反馈列表 25 | * 26 | * @param cmsFeedback 意见反馈 27 | * @return 意见反馈集合 28 | */ 29 | public List selectCmsFeedbackList(CmsFeedback cmsFeedback); 30 | 31 | /** 32 | * 新增意见反馈 33 | * 34 | * @param cmsFeedback 意见反馈 35 | * @return 结果 36 | */ 37 | public int insertCmsFeedback(CmsFeedback cmsFeedback); 38 | 39 | /** 40 | * 修改意见反馈 41 | * 42 | * @param cmsFeedback 意见反馈 43 | * @return 结果 44 | */ 45 | public int updateCmsFeedback(CmsFeedback cmsFeedback); 46 | 47 | /** 48 | * 批量删除意见反馈 49 | * 50 | * @param ids 需要删除的意见反馈主键集合 51 | * @return 结果 52 | */ 53 | public int deleteCmsFeedbackByIds(Long[] ids); 54 | 55 | /** 56 | * 删除意见反馈信息 57 | * 58 | * @param id 意见反馈主键 59 | * @return 结果 60 | */ 61 | public int deleteCmsFeedbackById(Long id); 62 | } 63 | -------------------------------------------------------------------------------- /source-quartz/src/main/java/cn/source/quartz/mapper/SysJobMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.quartz.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.quartz.domain.SysJob; 5 | 6 | /** 7 | * 调度任务信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysJobMapper 12 | { 13 | /** 14 | * 查询调度任务日志集合 15 | * 16 | * @param job 调度信息 17 | * @return 操作日志集合 18 | */ 19 | public List selectJobList(SysJob job); 20 | 21 | /** 22 | * 查询所有调度任务 23 | * 24 | * @return 调度任务列表 25 | */ 26 | public List selectJobAll(); 27 | 28 | /** 29 | * 通过调度ID查询调度任务信息 30 | * 31 | * @param jobId 调度ID 32 | * @return 角色对象信息 33 | */ 34 | public SysJob selectJobById(Long jobId); 35 | 36 | /** 37 | * 通过调度ID删除调度任务信息 38 | * 39 | * @param jobId 调度ID 40 | * @return 结果 41 | */ 42 | public int deleteJobById(Long jobId); 43 | 44 | /** 45 | * 批量删除调度任务信息 46 | * 47 | * @param ids 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deleteJobByIds(Long[] ids); 51 | 52 | /** 53 | * 修改调度任务信息 54 | * 55 | * @param job 调度任务信息 56 | * @return 结果 57 | */ 58 | public int updateJob(SysJob job); 59 | 60 | /** 61 | * 新增调度任务信息 62 | * 63 | * @param job 调度任务信息 64 | * @return 结果 65 | */ 66 | public int insertJob(SysJob job); 67 | } 68 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/mapper/HouseFeatureMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.HouseFeature; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 房源特色Mapper接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-27 12 | */ 13 | public interface HouseFeatureMapper 14 | { 15 | /** 16 | * 查询房源特色 17 | * 18 | * @param id 房源特色主键 19 | * @return 房源特色 20 | */ 21 | public HouseFeature selectHouseFeatureById(Long id); 22 | 23 | /** 24 | * 查询房源特色列表 25 | * 26 | * @param houseFeature 房源特色 27 | * @return 房源特色集合 28 | */ 29 | public List selectHouseFeatureList(HouseFeature houseFeature); 30 | 31 | /** 32 | * 新增房源特色 33 | * 34 | * @param houseFeature 房源特色 35 | * @return 结果 36 | */ 37 | public int insertHouseFeature(HouseFeature houseFeature); 38 | 39 | /** 40 | * 修改房源特色 41 | * 42 | * @param houseFeature 房源特色 43 | * @return 结果 44 | */ 45 | public int updateHouseFeature(HouseFeature houseFeature); 46 | 47 | /** 48 | * 删除房源特色 49 | * 50 | * @param id 房源特色主键 51 | * @return 结果 52 | */ 53 | public int deleteHouseFeatureById(Long id); 54 | 55 | /** 56 | * 批量删除房源特色 57 | * 58 | * @param ids 需要删除的数据主键集合 59 | * @return 结果 60 | */ 61 | public int deleteHouseFeatureByIds(Long[] ids); 62 | } 63 | -------------------------------------------------------------------------------- /source-quartz/src/main/java/cn/source/quartz/mapper/SysJobLogMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.quartz.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.quartz.domain.SysJobLog; 5 | 6 | /** 7 | * 调度任务日志信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysJobLogMapper 12 | { 13 | /** 14 | * 获取quartz调度器日志的计划任务 15 | * 16 | * @param jobLog 调度日志信息 17 | * @return 调度任务日志集合 18 | */ 19 | public List selectJobLogList(SysJobLog jobLog); 20 | 21 | /** 22 | * 查询所有调度任务日志 23 | * 24 | * @return 调度任务日志列表 25 | */ 26 | public List selectJobLogAll(); 27 | 28 | /** 29 | * 通过调度任务日志ID查询调度信息 30 | * 31 | * @param jobLogId 调度任务日志ID 32 | * @return 调度任务日志对象信息 33 | */ 34 | public SysJobLog selectJobLogById(Long jobLogId); 35 | 36 | /** 37 | * 新增任务日志 38 | * 39 | * @param jobLog 调度日志信息 40 | * @return 结果 41 | */ 42 | public int insertJobLog(SysJobLog jobLog); 43 | 44 | /** 45 | * 批量删除调度日志信息 46 | * 47 | * @param logIds 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deleteJobLogByIds(Long[] logIds); 51 | 52 | /** 53 | * 删除任务日志 54 | * 55 | * @param jobId 调度日志ID 56 | * @return 结果 57 | */ 58 | public int deleteJobLogById(Long jobId); 59 | 60 | /** 61 | * 清空任务日志 62 | */ 63 | public void cleanJobLog(); 64 | } 65 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/security/handle/AuthenticationEntryPointImpl.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.security.handle; 2 | 3 | import java.io.IOException; 4 | import java.io.Serializable; 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | import org.springframework.security.core.AuthenticationException; 8 | import org.springframework.security.web.AuthenticationEntryPoint; 9 | import org.springframework.stereotype.Component; 10 | import com.alibaba.fastjson.JSON; 11 | import cn.source.common.constant.HttpStatus; 12 | import cn.source.common.core.domain.AjaxResult; 13 | import cn.source.common.utils.ServletUtils; 14 | import cn.source.common.utils.StringUtils; 15 | 16 | /** 17 | * 认证失败处理类 返回未授权 18 | * 19 | * @author ruoyi 20 | */ 21 | @Component 22 | public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable 23 | { 24 | private static final long serialVersionUID = -8970718410437077606L; 25 | 26 | @Override 27 | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) 28 | throws IOException 29 | { 30 | int code = HttpStatus.UNAUTHORIZED; 31 | String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI()); 32 | ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg))); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/service/IHouseFeatureService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.HouseFeature; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 房源特色Service接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-27 12 | */ 13 | public interface IHouseFeatureService 14 | { 15 | /** 16 | * 查询房源特色 17 | * 18 | * @param id 房源特色主键 19 | * @return 房源特色 20 | */ 21 | public HouseFeature selectHouseFeatureById(Long id); 22 | 23 | /** 24 | * 查询房源特色列表 25 | * 26 | * @param houseFeature 房源特色 27 | * @return 房源特色集合 28 | */ 29 | public List selectHouseFeatureList(HouseFeature houseFeature); 30 | 31 | /** 32 | * 新增房源特色 33 | * 34 | * @param houseFeature 房源特色 35 | * @return 结果 36 | */ 37 | public int insertHouseFeature(HouseFeature houseFeature); 38 | 39 | /** 40 | * 修改房源特色 41 | * 42 | * @param houseFeature 房源特色 43 | * @return 结果 44 | */ 45 | public int updateHouseFeature(HouseFeature houseFeature); 46 | 47 | /** 48 | * 批量删除房源特色 49 | * 50 | * @param ids 需要删除的房源特色主键集合 51 | * @return 结果 52 | */ 53 | public int deleteHouseFeatureByIds(Long[] ids); 54 | 55 | /** 56 | * 删除房源特色信息 57 | * 58 | * @param id 房源特色主键 59 | * @return 结果 60 | */ 61 | public int deleteHouseFeatureById(Long id); 62 | } 63 | -------------------------------------------------------------------------------- /source-admin/src/main/java/cn/source/web/controller/system/SysRegisterController.java: -------------------------------------------------------------------------------- 1 | package cn.source.web.controller.system; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RequestBody; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import cn.source.common.core.controller.BaseController; 8 | import cn.source.common.core.domain.AjaxResult; 9 | import cn.source.common.core.domain.model.RegisterBody; 10 | import cn.source.common.utils.StringUtils; 11 | import cn.source.framework.web.service.SysRegisterService; 12 | import cn.source.system.service.ISysConfigService; 13 | 14 | /** 15 | * 注册验证 16 | * 17 | * @author ruoyi 18 | */ 19 | @RestController 20 | public class SysRegisterController extends BaseController 21 | { 22 | @Autowired 23 | private SysRegisterService registerService; 24 | 25 | @Autowired 26 | private ISysConfigService configService; 27 | 28 | @PostMapping("/register") 29 | public AjaxResult register(@RequestBody RegisterBody user) 30 | { 31 | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) 32 | { 33 | return error("当前系统没有开启注册功能!"); 34 | } 35 | String msg = registerService.register(user); 36 | return StringUtils.isEmpty(msg) ? success() : error(msg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/mapper/CmsServiceItemMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.CmsServiceItem; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 服务条目Mapper接口 9 | * 10 | * @author 詹Sir 11 | * @date 2022-02-25 12 | */ 13 | public interface CmsServiceItemMapper 14 | { 15 | /** 16 | * 查询服务条目 17 | * 18 | * @param id 服务条目主键 19 | * @return 服务条目 20 | */ 21 | public CmsServiceItem selectCmsServiceItemById(Long id); 22 | 23 | /** 24 | * 查询服务条目列表 25 | * 26 | * @param cmsServiceItem 服务条目 27 | * @return 服务条目集合 28 | */ 29 | public List selectCmsServiceItemList(CmsServiceItem cmsServiceItem); 30 | 31 | /** 32 | * 新增服务条目 33 | * 34 | * @param cmsServiceItem 服务条目 35 | * @return 结果 36 | */ 37 | public int insertCmsServiceItem(CmsServiceItem cmsServiceItem); 38 | 39 | /** 40 | * 修改服务条目 41 | * 42 | * @param cmsServiceItem 服务条目 43 | * @return 结果 44 | */ 45 | public int updateCmsServiceItem(CmsServiceItem cmsServiceItem); 46 | 47 | /** 48 | * 删除服务条目 49 | * 50 | * @param id 服务条目主键 51 | * @return 结果 52 | */ 53 | public int deleteCmsServiceItemById(Long id); 54 | 55 | /** 56 | * 批量删除服务条目 57 | * 58 | * @param ids 需要删除的数据主键集合 59 | * @return 结果 60 | */ 61 | public int deleteCmsServiceItemByIds(Long[] ids); 62 | } 63 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/service/ICmsServiceItemService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.CmsServiceItem; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 服务条目Service接口 9 | * 10 | * @author 詹Sir 11 | * @date 2022-02-25 12 | */ 13 | public interface ICmsServiceItemService 14 | { 15 | /** 16 | * 查询服务条目 17 | * 18 | * @param id 服务条目主键 19 | * @return 服务条目 20 | */ 21 | public CmsServiceItem selectCmsServiceItemById(Long id); 22 | 23 | /** 24 | * 查询服务条目列表 25 | * 26 | * @param cmsServiceItem 服务条目 27 | * @return 服务条目集合 28 | */ 29 | public List selectCmsServiceItemList(CmsServiceItem cmsServiceItem); 30 | 31 | /** 32 | * 新增服务条目 33 | * 34 | * @param cmsServiceItem 服务条目 35 | * @return 结果 36 | */ 37 | public int insertCmsServiceItem(CmsServiceItem cmsServiceItem); 38 | 39 | /** 40 | * 修改服务条目 41 | * 42 | * @param cmsServiceItem 服务条目 43 | * @return 结果 44 | */ 45 | public int updateCmsServiceItem(CmsServiceItem cmsServiceItem); 46 | 47 | /** 48 | * 批量删除服务条目 49 | * 50 | * @param ids 需要删除的服务条目主键集合 51 | * @return 结果 52 | */ 53 | public int deleteCmsServiceItemByIds(Long[] ids); 54 | 55 | /** 56 | * 删除服务条目信息 57 | * 58 | * @param id 服务条目主键 59 | * @return 结果 60 | */ 61 | public int deleteCmsServiceItemById(Long id); 62 | } 63 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/ISysDictDataService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import java.util.List; 4 | import cn.source.common.core.domain.entity.SysDictData; 5 | 6 | /** 7 | * 字典 业务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysDictDataService 12 | { 13 | /** 14 | * 根据条件分页查询字典数据 15 | * 16 | * @param dictData 字典数据信息 17 | * @return 字典数据集合信息 18 | */ 19 | public List selectDictDataList(SysDictData dictData); 20 | 21 | /** 22 | * 根据字典类型和字典键值查询字典数据信息 23 | * 24 | * @param dictType 字典类型 25 | * @param dictValue 字典键值 26 | * @return 字典标签 27 | */ 28 | public String selectDictLabel(String dictType, String dictValue); 29 | 30 | /** 31 | * 根据字典数据ID查询信息 32 | * 33 | * @param dictCode 字典数据ID 34 | * @return 字典数据 35 | */ 36 | public SysDictData selectDictDataById(Long dictCode); 37 | 38 | /** 39 | * 批量删除字典数据信息 40 | * 41 | * @param dictCodes 需要删除的字典数据ID 42 | * @return 结果 43 | */ 44 | public void deleteDictDataByIds(Long[] dictCodes); 45 | 46 | /** 47 | * 新增保存字典数据信息 48 | * 49 | * @param dictData 字典数据信息 50 | * @return 结果 51 | */ 52 | public int insertDictData(SysDictData dictData); 53 | 54 | /** 55 | * 修改保存字典数据信息 56 | * 57 | * @param dictData 字典数据信息 58 | * @return 结果 59 | */ 60 | public int updateDictData(SysDictData dictData); 61 | } 62 | -------------------------------------------------------------------------------- /source-generator/src/main/java/cn/source/generator/mapper/GenTableColumnMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.generator.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.generator.domain.GenTableColumn; 5 | 6 | /** 7 | * 业务字段 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface GenTableColumnMapper 12 | { 13 | /** 14 | * 根据表名称查询列信息 15 | * 16 | * @param tableName 表名称 17 | * @return 列信息 18 | */ 19 | public List selectDbTableColumnsByName(String tableName); 20 | 21 | /** 22 | * 查询业务字段列表 23 | * 24 | * @param tableId 业务字段编号 25 | * @return 业务字段集合 26 | */ 27 | public List selectGenTableColumnListByTableId(Long tableId); 28 | 29 | /** 30 | * 新增业务字段 31 | * 32 | * @param genTableColumn 业务字段信息 33 | * @return 结果 34 | */ 35 | public int insertGenTableColumn(GenTableColumn genTableColumn); 36 | 37 | /** 38 | * 修改业务字段 39 | * 40 | * @param genTableColumn 业务字段信息 41 | * @return 结果 42 | */ 43 | public int updateGenTableColumn(GenTableColumn genTableColumn); 44 | 45 | /** 46 | * 删除业务字段 47 | * 48 | * @param genTableColumns 列数据 49 | * @return 结果 50 | */ 51 | public int deleteGenTableColumns(List genTableColumns); 52 | 53 | /** 54 | * 批量删除业务字段 55 | * 56 | * @param ids 需要删除的数据ID 57 | * @return 结果 58 | */ 59 | public int deleteGenTableColumnByIds(Long[] ids); 60 | } 61 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/sms/DySmsUtil.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.sms; 2 | 3 | import cn.source.common.utils.http.HttpUtils; 4 | import com.alibaba.fastjson.JSONObject; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | /** 9 | * @Description: 云信短信接口 10 | * @author: zy 11 | * @date: 2021年03月30日 11:43 12 | */ 13 | public class DySmsUtil { 14 | 15 | private final static Logger logger= LoggerFactory.getLogger(DySmsUtil.class); 16 | 17 | public static boolean sendSms(String phone, JSONObject paramJson,String accessKeyId 18 | ,String accessKeySecret,String accessKeytemplate){ 19 | boolean result = true; 20 | String url = "http://api.sms.cn/sms"; 21 | try { 22 | String str = HttpUtils.sendPost(url, 23 | "ac=send&uid=" +accessKeyId+ 24 | "&pwd=" +accessKeySecret+ 25 | "&template=" +accessKeytemplate+ 26 | "&mobile="+phone+"&content="+paramJson); 27 | logger.info("短信接口返回的数据----------------"+str); 28 | }catch (Exception e){ 29 | result = true; 30 | logger.info("短信接口返回异常----------------"+e.getMessage()); 31 | } 32 | return result; 33 | } 34 | 35 | public static void main(String[] args) { 36 | JSONObject obj = new JSONObject(); 37 | obj.put("code", "1234"); 38 | sendSms("18720989281", obj,null,null,null); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysUserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import cn.source.system.domain.SysUserRole; 6 | 7 | /** 8 | * 用户与角色关联表 数据层 9 | * 10 | * @author ruoyi 11 | */ 12 | public interface SysUserRoleMapper 13 | { 14 | /** 15 | * 通过用户ID删除用户和角色关联 16 | * 17 | * @param userId 用户ID 18 | * @return 结果 19 | */ 20 | public int deleteUserRoleByUserId(Long userId); 21 | 22 | /** 23 | * 批量删除用户和角色关联 24 | * 25 | * @param ids 需要删除的数据ID 26 | * @return 结果 27 | */ 28 | public int deleteUserRole(Long[] ids); 29 | 30 | /** 31 | * 通过角色ID查询角色使用数量 32 | * 33 | * @param roleId 角色ID 34 | * @return 结果 35 | */ 36 | public int countUserRoleByRoleId(Long roleId); 37 | 38 | /** 39 | * 批量新增用户角色信息 40 | * 41 | * @param userRoleList 用户角色列表 42 | * @return 结果 43 | */ 44 | public int batchUserRole(List userRoleList); 45 | 46 | /** 47 | * 删除用户和角色关联信息 48 | * 49 | * @param userRole 用户和角色关联信息 50 | * @return 结果 51 | */ 52 | public int deleteUserRoleInfo(SysUserRole userRole); 53 | 54 | /** 55 | * 批量取消授权用户角色 56 | * 57 | * @param roleId 角色ID 58 | * @param userIds 需要删除的用户数据ID 59 | * @return 结果 60 | */ 61 | public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); 62 | } 63 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/core/page/TableSupport.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.core.page; 2 | 3 | import cn.source.common.utils.ServletUtils; 4 | 5 | /** 6 | * 表格数据处理 7 | * 8 | * @author ruoyi 9 | */ 10 | public class TableSupport 11 | { 12 | /** 13 | * 当前记录起始索引 14 | */ 15 | public static final String PAGE_NUM = "pageNum"; 16 | 17 | /** 18 | * 每页显示记录数 19 | */ 20 | public static final String PAGE_SIZE = "pageSize"; 21 | 22 | /** 23 | * 排序列 24 | */ 25 | public static final String ORDER_BY_COLUMN = "orderByColumn"; 26 | 27 | /** 28 | * 排序的方向 "desc" 或者 "asc". 29 | */ 30 | public static final String IS_ASC = "isAsc"; 31 | 32 | /** 33 | * 分页参数合理化 34 | */ 35 | public static final String REASONABLE = "reasonable"; 36 | 37 | /** 38 | * 封装分页对象 39 | */ 40 | public static PageDomain getPageDomain() 41 | { 42 | PageDomain pageDomain = new PageDomain(); 43 | pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM)); 44 | pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE)); 45 | pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); 46 | pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); 47 | pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE)); 48 | return pageDomain; 49 | } 50 | 51 | public static PageDomain buildPageRequest() 52 | { 53 | return getPageDomain(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysConfigMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysConfig; 5 | 6 | /** 7 | * 参数配置 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysConfigMapper 12 | { 13 | /** 14 | * 查询参数配置信息 15 | * 16 | * @param config 参数配置信息 17 | * @return 参数配置信息 18 | */ 19 | public SysConfig selectConfig(SysConfig config); 20 | 21 | /** 22 | * 查询参数配置列表 23 | * 24 | * @param config 参数配置信息 25 | * @return 参数配置集合 26 | */ 27 | public List selectConfigList(SysConfig config); 28 | 29 | /** 30 | * 根据键名查询参数配置信息 31 | * 32 | * @param configKey 参数键名 33 | * @return 参数配置信息 34 | */ 35 | public SysConfig checkConfigKeyUnique(String configKey); 36 | 37 | /** 38 | * 新增参数配置 39 | * 40 | * @param config 参数配置信息 41 | * @return 结果 42 | */ 43 | public int insertConfig(SysConfig config); 44 | 45 | /** 46 | * 修改参数配置 47 | * 48 | * @param config 参数配置信息 49 | * @return 结果 50 | */ 51 | public int updateConfig(SysConfig config); 52 | 53 | /** 54 | * 删除参数配置 55 | * 56 | * @param configId 参数ID 57 | * @return 结果 58 | */ 59 | public int deleteConfigById(Long configId); 60 | 61 | /** 62 | * 批量删除参数信息 63 | * 64 | * @param configIds 需要删除的参数ID 65 | * @return 结果 66 | */ 67 | public int deleteConfigByIds(Long[] configIds); 68 | } 69 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/mapper/CmsArticleMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.CmsArticle; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 文章管理Mapper接口 9 | * 10 | * @author 詹Sir 11 | * @date 2022-03-01 12 | */ 13 | public interface CmsArticleMapper 14 | { 15 | /** 16 | * 查询文章管理 17 | * 18 | * @param id 文章管理主键 19 | * @return 文章管理 20 | */ 21 | public CmsArticle selectCmsArticleById(Long id); 22 | 23 | /** 24 | * 查询文章管理列表 25 | * 26 | * @param cmsArticle 文章管理 27 | * @return 文章管理集合 28 | */ 29 | public List selectCmsArticleList(CmsArticle cmsArticle); 30 | 31 | /** 32 | * 新增文章管理 33 | * 34 | * @param cmsArticle 文章管理 35 | * @return 结果 36 | */ 37 | public int insertCmsArticle(CmsArticle cmsArticle); 38 | 39 | /** 40 | * 修改文章管理 41 | * 42 | * @param cmsArticle 文章管理 43 | * @return 结果 44 | */ 45 | public int updateCmsArticle(CmsArticle cmsArticle); 46 | 47 | /** 48 | * 删除文章管理 49 | * 50 | * @param id 文章管理主键 51 | * @return 结果 52 | */ 53 | public int deleteCmsArticleById(Long id); 54 | 55 | /** 56 | * 批量删除文章管理 57 | * 58 | * @param ids 需要删除的数据主键集合 59 | * @return 结果 60 | */ 61 | public int deleteCmsArticleByIds(Long[] ids); 62 | 63 | /** 64 | * 点赞文章 65 | * 66 | * @param cmsArticle 文章管理 67 | * @return 结果 68 | */ 69 | public int starCmsArticle(CmsArticle cmsArticle); 70 | } 71 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/service/ICmsArticleService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.CmsArticle; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 内容管理Service接口 9 | * 10 | * @author 詹Sir 11 | * @date 2022-03-01 12 | */ 13 | public interface ICmsArticleService 14 | { 15 | /** 16 | * 查询内容管理 17 | * 18 | * @param id 内容管理主键 19 | * @return 内容管理 20 | */ 21 | public CmsArticle selectCmsArticleById(Long id); 22 | 23 | /** 24 | * 查询内容管理列表 25 | * 26 | * @param cmsArticle 内容管理 27 | * @return 内容管理集合 28 | */ 29 | public List selectCmsArticleList(CmsArticle cmsArticle); 30 | 31 | /** 32 | * 新增内容管理 33 | * 34 | * @param cmsArticle 内容管理 35 | * @return 结果 36 | */ 37 | public int insertCmsArticle(CmsArticle cmsArticle); 38 | 39 | /** 40 | * 修改内容管理 41 | * 42 | * @param cmsArticle 内容管理 43 | * @return 结果 44 | */ 45 | public int updateCmsArticle(CmsArticle cmsArticle); 46 | 47 | /** 48 | * 批量删除内容管理 49 | * 50 | * @param ids 需要删除的内容管理主键集合 51 | * @return 结果 52 | */ 53 | public int deleteCmsArticleByIds(Long[] ids); 54 | 55 | /** 56 | * 删除内容管理信息 57 | * 58 | * @param id 内容管理主键 59 | * @return 结果 60 | */ 61 | public int deleteCmsArticleById(Long id); 62 | 63 | /** 64 | * 点赞文章 65 | * 66 | * @param cmsArticle 内容管理 67 | * @return 结果 68 | */ 69 | public int starCmsArticle(CmsArticle cmsArticle); 70 | } 71 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/ServiceException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception; 2 | 3 | /** 4 | * 业务异常 5 | * 6 | * @author ruoyi 7 | */ 8 | public final class ServiceException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | /** 13 | * 错误码 14 | */ 15 | private Integer code; 16 | 17 | /** 18 | * 错误提示 19 | */ 20 | private String message; 21 | 22 | /** 23 | * 错误明细,内部调试错误 24 | * 25 | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 26 | */ 27 | private String detailMessage; 28 | 29 | /** 30 | * 空构造方法,避免反序列化问题 31 | */ 32 | public ServiceException() 33 | { 34 | } 35 | 36 | public ServiceException(String message) 37 | { 38 | this.message = message; 39 | } 40 | 41 | public ServiceException(String message, Integer code) 42 | { 43 | this.message = message; 44 | this.code = code; 45 | } 46 | 47 | public String getDetailMessage() 48 | { 49 | return detailMessage; 50 | } 51 | 52 | public String getMessage() 53 | { 54 | return message; 55 | } 56 | 57 | public Integer getCode() 58 | { 59 | return code; 60 | } 61 | 62 | public ServiceException setMessage(String message) 63 | { 64 | this.message = message; 65 | return this; 66 | } 67 | 68 | public ServiceException setDetailMessage(String detailMessage) 69 | { 70 | this.detailMessage = detailMessage; 71 | return this; 72 | } 73 | } -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/mapper/HouseVillageMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.HouseVillage; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 房源小区Mapper接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-27 12 | */ 13 | public interface HouseVillageMapper 14 | { 15 | /** 16 | * 查询房源小区 17 | * 18 | * @param id 房源小区主键 19 | * @return 房源小区 20 | */ 21 | public HouseVillage selectHouseVillageById(Long id); 22 | 23 | /** 24 | * 查询房源小区列表 25 | * 26 | * @param houseVillage 房源小区 27 | * @return 房源小区集合 28 | */ 29 | public List selectHouseVillageList(HouseVillage houseVillage); 30 | 31 | /** 32 | * 新增房源小区 33 | * 34 | * @param houseVillage 房源小区 35 | * @return 结果 36 | */ 37 | public int insertHouseVillage(HouseVillage houseVillage); 38 | 39 | /** 40 | * 修改房源小区 41 | * 42 | * @param houseVillage 房源小区 43 | * @return 结果 44 | */ 45 | public int updateHouseVillage(HouseVillage houseVillage); 46 | 47 | /** 48 | * 删除房源小区 49 | * 50 | * @param id 房源小区主键 51 | * @return 结果 52 | */ 53 | public int deleteHouseVillageById(Long id); 54 | 55 | /** 56 | * 批量删除房源小区 57 | * 58 | * @param ids 需要删除的数据主键集合 59 | * @return 结果 60 | */ 61 | public int deleteHouseVillageByIds(Long[] ids); 62 | 63 | /** 64 | * 查询房源小区 65 | * 66 | * @param houseVillage 房源小区 67 | * @return 房源小区集合 68 | */ 69 | public HouseVillage selectHouseVillage(HouseVillage houseVillage); 70 | } 71 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/filter/RepeatableFilter.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.filter; 2 | 3 | import java.io.IOException; 4 | import javax.servlet.Filter; 5 | import javax.servlet.FilterChain; 6 | import javax.servlet.FilterConfig; 7 | import javax.servlet.ServletException; 8 | import javax.servlet.ServletRequest; 9 | import javax.servlet.ServletResponse; 10 | import javax.servlet.http.HttpServletRequest; 11 | import org.springframework.http.MediaType; 12 | import cn.source.common.utils.StringUtils; 13 | 14 | /** 15 | * Repeatable 过滤器 16 | * 17 | * @author ruoyi 18 | */ 19 | public class RepeatableFilter implements Filter 20 | { 21 | @Override 22 | public void init(FilterConfig filterConfig) throws ServletException 23 | { 24 | 25 | } 26 | 27 | @Override 28 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 29 | throws IOException, ServletException 30 | { 31 | ServletRequest requestWrapper = null; 32 | if (request instanceof HttpServletRequest 33 | && StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) 34 | { 35 | requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response); 36 | } 37 | if (null == requestWrapper) 38 | { 39 | chain.doFilter(request, response); 40 | } 41 | else 42 | { 43 | chain.doFilter(requestWrapper, response); 44 | } 45 | } 46 | 47 | @Override 48 | public void destroy() 49 | { 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/service/IHouseVillageService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.HouseVillage; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 房源小区Service接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-27 12 | */ 13 | public interface IHouseVillageService 14 | { 15 | /** 16 | * 查询房源小区 17 | * 18 | * @param id 房源小区主键 19 | * @return 房源小区 20 | */ 21 | public HouseVillage selectHouseVillageById(Long id); 22 | 23 | /** 24 | * 查询房源小区列表 25 | * 26 | * @param houseVillage 房源小区 27 | * @return 房源小区集合 28 | */ 29 | public List selectHouseVillageList(HouseVillage houseVillage); 30 | 31 | /** 32 | * 新增房源小区 33 | * 34 | * @param houseVillage 房源小区 35 | * @return 结果 36 | */ 37 | public int insertHouseVillage(HouseVillage houseVillage); 38 | 39 | /** 40 | * 修改房源小区 41 | * 42 | * @param houseVillage 房源小区 43 | * @return 结果 44 | */ 45 | public int updateHouseVillage(HouseVillage houseVillage); 46 | 47 | /** 48 | * 批量删除房源小区 49 | * 50 | * @param ids 需要删除的房源小区主键集合 51 | * @return 结果 52 | */ 53 | public int deleteHouseVillageByIds(Long[] ids); 54 | 55 | /** 56 | * 删除房源小区信息 57 | * 58 | * @param id 房源小区主键 59 | * @return 结果 60 | */ 61 | public int deleteHouseVillageById(Long id); 62 | 63 | /** 64 | * 通过小区名称查询房源小区 65 | * 66 | * @param houseVillage 房源小区 67 | * @return 房源小区集合 68 | */ 69 | public HouseVillage selectHouseVillage(HouseVillage houseVillage); 70 | } 71 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/core/page/TableDataInfo.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.core.page; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * 表格分页数据对象 8 | * 9 | * @author ruoyi 10 | */ 11 | public class TableDataInfo implements Serializable 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | /** 总记录数 */ 16 | private long total; 17 | 18 | /** 列表数据 */ 19 | private List rows; 20 | 21 | /** 消息状态码 */ 22 | private int code; 23 | 24 | /** 消息内容 */ 25 | private String msg; 26 | 27 | /** 28 | * 表格数据对象 29 | */ 30 | public TableDataInfo() 31 | { 32 | } 33 | 34 | /** 35 | * 分页 36 | * 37 | * @param list 列表数据 38 | * @param total 总记录数 39 | */ 40 | public TableDataInfo(List list, int total) 41 | { 42 | this.rows = list; 43 | this.total = total; 44 | } 45 | 46 | public long getTotal() 47 | { 48 | return total; 49 | } 50 | 51 | public void setTotal(long total) 52 | { 53 | this.total = total; 54 | } 55 | 56 | public List getRows() 57 | { 58 | return rows; 59 | } 60 | 61 | public void setRows(List rows) 62 | { 63 | this.rows = rows; 64 | } 65 | 66 | public int getCode() 67 | { 68 | return code; 69 | } 70 | 71 | public void setCode(int code) 72 | { 73 | this.code = code; 74 | } 75 | 76 | public String getMsg() 77 | { 78 | return msg; 79 | } 80 | 81 | public void setMsg(String msg) 82 | { 83 | this.msg = msg; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/web/domain/server/Sys.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.web.domain.server; 2 | 3 | /** 4 | * 系统相关信息 5 | * 6 | * @author ruoyi 7 | */ 8 | public class Sys 9 | { 10 | /** 11 | * 服务器名称 12 | */ 13 | private String computerName; 14 | 15 | /** 16 | * 服务器Ip 17 | */ 18 | private String computerIp; 19 | 20 | /** 21 | * 项目路径 22 | */ 23 | private String userDir; 24 | 25 | /** 26 | * 操作系统 27 | */ 28 | private String osName; 29 | 30 | /** 31 | * 系统架构 32 | */ 33 | private String osArch; 34 | 35 | public String getComputerName() 36 | { 37 | return computerName; 38 | } 39 | 40 | public void setComputerName(String computerName) 41 | { 42 | this.computerName = computerName; 43 | } 44 | 45 | public String getComputerIp() 46 | { 47 | return computerIp; 48 | } 49 | 50 | public void setComputerIp(String computerIp) 51 | { 52 | this.computerIp = computerIp; 53 | } 54 | 55 | public String getUserDir() 56 | { 57 | return userDir; 58 | } 59 | 60 | public void setUserDir(String userDir) 61 | { 62 | this.userDir = userDir; 63 | } 64 | 65 | public String getOsName() 66 | { 67 | return osName; 68 | } 69 | 70 | public void setOsName(String osName) 71 | { 72 | this.osName = osName; 73 | } 74 | 75 | public String getOsArch() 76 | { 77 | return osArch; 78 | } 79 | 80 | public void setOsArch(String osArch) 81 | { 82 | this.osArch = osArch; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /source-admin/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | Application Version: ${ruoyi.version} 2 | Spring Boot Version: ${spring-boot.version} 3 | //////////////////////////////////////////////////////////////////// 4 | // _ooOoo_ // 5 | // o8888888o // 6 | // 88" . "88 // 7 | // (| ^_^ |) // 8 | // O\ = /O // 9 | // ____/`---'\____ // 10 | // .' \\| |// `. // 11 | // / \\||| : |||// \ // 12 | // / _||||| -:- |||||- \ // 13 | // | | \\\ - /// | | // 14 | // | \_| ''\---/'' | | // 15 | // \ .-\__ `-` ___/-. / // 16 | // ___`. .' /--.--\ `. . ___ // 17 | // ."" '< `.___\_<|>_/___.' >'"". // 18 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | // 19 | // \ \ `-. \_ __\ /__ _/ .-` / / // 20 | // ========`-.____`-.___\_____/___.-`____.-'======== // 21 | // `=---=' // 22 | // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // 23 | // 佛祖保佑 永不宕机 永无BUG // 24 | //////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /source-quartz/src/main/java/cn/source/quartz/util/CronUtils.java: -------------------------------------------------------------------------------- 1 | package cn.source.quartz.util; 2 | 3 | import java.text.ParseException; 4 | import java.util.Date; 5 | import org.quartz.CronExpression; 6 | 7 | /** 8 | * cron表达式工具类 9 | * 10 | * @author ruoyi 11 | * 12 | */ 13 | public class CronUtils 14 | { 15 | /** 16 | * 返回一个布尔值代表一个给定的Cron表达式的有效性 17 | * 18 | * @param cronExpression Cron表达式 19 | * @return boolean 表达式是否有效 20 | */ 21 | public static boolean isValid(String cronExpression) 22 | { 23 | return CronExpression.isValidExpression(cronExpression); 24 | } 25 | 26 | /** 27 | * 返回一个字符串值,表示该消息无效Cron表达式给出有效性 28 | * 29 | * @param cronExpression Cron表达式 30 | * @return String 无效时返回表达式错误描述,如果有效返回null 31 | */ 32 | public static String getInvalidMessage(String cronExpression) 33 | { 34 | try 35 | { 36 | new CronExpression(cronExpression); 37 | return null; 38 | } 39 | catch (ParseException pe) 40 | { 41 | return pe.getMessage(); 42 | } 43 | } 44 | 45 | /** 46 | * 返回下一个执行时间根据给定的Cron表达式 47 | * 48 | * @param cronExpression Cron表达式 49 | * @return Date 下次Cron表达式执行时间 50 | */ 51 | public static Date getNextExecution(String cronExpression) 52 | { 53 | try 54 | { 55 | CronExpression cron = new CronExpression(cronExpression); 56 | return cron.getNextValidTimeAfter(new Date(System.currentTimeMillis())); 57 | } 58 | catch (ParseException e) 59 | { 60 | throw new IllegalArgumentException(e.getMessage()); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/sql/SqlUtil.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.sql; 2 | 3 | import cn.source.common.exception.UtilException; 4 | import cn.source.common.utils.StringUtils; 5 | 6 | /** 7 | * sql操作工具类 8 | * 9 | * @author ruoyi 10 | */ 11 | public class SqlUtil 12 | { 13 | /** 14 | * 定义常用的 sql关键字 15 | */ 16 | public static String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare "; 17 | 18 | /** 19 | * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) 20 | */ 21 | public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; 22 | 23 | /** 24 | * 检查字符,防止注入绕过 25 | */ 26 | public static String escapeOrderBySql(String value) 27 | { 28 | if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) 29 | { 30 | throw new UtilException("参数不符合规范,不能进行查询"); 31 | } 32 | return value; 33 | } 34 | 35 | /** 36 | * 验证 order by 语法是否符合规范 37 | */ 38 | public static boolean isValidOrderBySql(String value) 39 | { 40 | return value.matches(SQL_PATTERN); 41 | } 42 | 43 | /** 44 | * SQL关键字检查 45 | */ 46 | public static void filterKeyword(String value) 47 | { 48 | if (StringUtils.isEmpty(value)) 49 | { 50 | return; 51 | } 52 | String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|"); 53 | for (int i = 0; i < sqlKeywords.length; i++) 54 | { 55 | if (StringUtils.indexOfIgnoreCase(value, sqlKeywords[i]) > -1) 56 | { 57 | throw new UtilException("参数存在SQL注入风险"); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/core/domain/TreeEntity.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.core.domain; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * Tree基类 8 | * 9 | * @author ruoyi 10 | */ 11 | public class TreeEntity extends BaseEntity 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | /** 父菜单名称 */ 16 | private String parentName; 17 | 18 | /** 父菜单ID */ 19 | private Long parentId; 20 | 21 | /** 显示顺序 */ 22 | private Integer orderNum; 23 | 24 | /** 祖级列表 */ 25 | private String ancestors; 26 | 27 | /** 子部门 */ 28 | private List children = new ArrayList<>(); 29 | 30 | public String getParentName() 31 | { 32 | return parentName; 33 | } 34 | 35 | public void setParentName(String parentName) 36 | { 37 | this.parentName = parentName; 38 | } 39 | 40 | public Long getParentId() 41 | { 42 | return parentId; 43 | } 44 | 45 | public void setParentId(Long parentId) 46 | { 47 | this.parentId = parentId; 48 | } 49 | 50 | public Integer getOrderNum() 51 | { 52 | return orderNum; 53 | } 54 | 55 | public void setOrderNum(Integer orderNum) 56 | { 57 | this.orderNum = orderNum; 58 | } 59 | 60 | public String getAncestors() 61 | { 62 | return ancestors; 63 | } 64 | 65 | public void setAncestors(String ancestors) 66 | { 67 | this.ancestors = ancestors; 68 | } 69 | 70 | public List getChildren() 71 | { 72 | return children; 73 | } 74 | 75 | public void setChildren(List children) 76 | { 77 | this.children = children; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /source-system/src/main/resources/mapper/system/SysUserRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_user_role where user_id=#{userId} 14 | 15 | 16 | 19 | 20 | 21 | delete from sys_user_role where user_id in 22 | 23 | #{userId} 24 | 25 | 26 | 27 | 28 | insert into sys_user_role(user_id, role_id) values 29 | 30 | (#{item.userId},#{item.roleId}) 31 | 32 | 33 | 34 | 35 | delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} 36 | 37 | 38 | 39 | delete from sys_user_role where role_id=#{roleId} and user_id in 40 | 41 | #{userId} 42 | 43 | 44 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/impl/SysLogininforServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service.impl; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import cn.source.system.domain.SysLogininfor; 7 | import cn.source.system.mapper.SysLogininforMapper; 8 | import cn.source.system.service.ISysLogininforService; 9 | 10 | /** 11 | * 系统访问日志情况信息 服务层处理 12 | * 13 | * @author ruoyi 14 | */ 15 | @Service 16 | public class SysLogininforServiceImpl implements ISysLogininforService 17 | { 18 | 19 | @Autowired 20 | private SysLogininforMapper logininforMapper; 21 | 22 | /** 23 | * 新增系统登录日志 24 | * 25 | * @param logininfor 访问日志对象 26 | */ 27 | @Override 28 | public void insertLogininfor(SysLogininfor logininfor) 29 | { 30 | logininforMapper.insertLogininfor(logininfor); 31 | } 32 | 33 | /** 34 | * 查询系统登录日志集合 35 | * 36 | * @param logininfor 访问日志对象 37 | * @return 登录记录集合 38 | */ 39 | @Override 40 | public List selectLogininforList(SysLogininfor logininfor) 41 | { 42 | return logininforMapper.selectLogininforList(logininfor); 43 | } 44 | 45 | /** 46 | * 批量删除系统登录日志 47 | * 48 | * @param infoIds 需要删除的登录日志ID 49 | * @return 50 | */ 51 | @Override 52 | public int deleteLogininforByIds(Long[] infoIds) 53 | { 54 | return logininforMapper.deleteLogininforByIds(infoIds); 55 | } 56 | 57 | /** 58 | * 清空系统登录日志 59 | */ 60 | @Override 61 | public void cleanLogininfor() 62 | { 63 | logininforMapper.cleanLogininfor(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/http/HttpHelper.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.http; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import java.io.InputStreamReader; 7 | import java.nio.charset.Charset; 8 | import javax.servlet.ServletRequest; 9 | import org.apache.commons.lang3.exception.ExceptionUtils; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | 13 | /** 14 | * 通用http工具封装 15 | * 16 | * @author ruoyi 17 | */ 18 | public class HttpHelper 19 | { 20 | private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class); 21 | 22 | public static String getBodyString(ServletRequest request) 23 | { 24 | StringBuilder sb = new StringBuilder(); 25 | BufferedReader reader = null; 26 | try (InputStream inputStream = request.getInputStream()) 27 | { 28 | reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8"))); 29 | String line = ""; 30 | while ((line = reader.readLine()) != null) 31 | { 32 | sb.append(line); 33 | } 34 | } 35 | catch (IOException e) 36 | { 37 | LOGGER.warn("getBodyString出现问题!"); 38 | } 39 | finally 40 | { 41 | if (reader != null) 42 | { 43 | try 44 | { 45 | reader.close(); 46 | } 47 | catch (IOException e) 48 | { 49 | LOGGER.error(ExceptionUtils.getMessage(e)); 50 | } 51 | } 52 | } 53 | return sb.toString(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/service/IHouseRoomService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import cn.source.system.domain.HouseRoom; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 房源详情Service接口 9 | * 10 | * @author ruoyi 11 | * @date 2022-03-27 12 | */ 13 | public interface IHouseRoomService 14 | { 15 | /** 16 | * 查询房源详情 17 | * 18 | * @param id 房源详情主键 19 | * @return 房源详情 20 | */ 21 | public HouseRoom selectHouseRoomById(Long id); 22 | 23 | /** 24 | * 查询房源详情列表 25 | * 26 | * @param houseRoom 房源详情 27 | * @return 房源详情集合 28 | */ 29 | public List selectHouseRoomList(HouseRoom houseRoom); 30 | 31 | /** 32 | * 新增房源详情 33 | * 34 | * @param houseRoom 房源详情 35 | * @return 结果 36 | */ 37 | public int insertHouseRoom(HouseRoom houseRoom); 38 | 39 | /** 40 | * 修改房源详情 41 | * 42 | * @param houseRoom 房源详情 43 | * @return 结果 44 | */ 45 | public int updateHouseRoom(HouseRoom houseRoom); 46 | 47 | /** 48 | * 批量删除房源详情 49 | * 50 | * @param ids 需要删除的房源详情主键集合 51 | * @return 结果 52 | */ 53 | public int deleteHouseRoomByIds(Long[] ids); 54 | 55 | /** 56 | * 删除房源详情信息 57 | * 58 | * @param id 房源详情主键 59 | * @return 结果 60 | */ 61 | public int deleteHouseRoomById(Long id); 62 | 63 | /** 64 | * api新增房源详情 65 | * 66 | * @param houseRoom 房源详情 67 | * @return 结果 68 | */ 69 | public int apiInsertHouseRoom(HouseRoom houseRoom); 70 | 71 | /** 72 | * 查询房源相关详情信息 73 | * 74 | * @param houseRoom 房源 75 | * @return 房源详情 76 | */ 77 | public HouseRoom selectDetailHouseRoom(HouseRoom houseRoom); 78 | } 79 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/domain/HouseFeature.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.domain; 2 | 3 | import cn.source.common.annotation.Excel; 4 | import cn.source.common.core.domain.BaseEntity; 5 | import org.apache.commons.lang3.builder.ToStringBuilder; 6 | import org.apache.commons.lang3.builder.ToStringStyle; 7 | 8 | /** 9 | * 房源特色对象 house_feature 10 | * 11 | * @author ruoyi 12 | * @date 2022-03-27 13 | */ 14 | public class HouseFeature extends BaseEntity 15 | { 16 | private static final long serialVersionUID = 1L; 17 | 18 | /** $column.columnComment */ 19 | private Long id; 20 | 21 | /** $column.columnComment */ 22 | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") 23 | private Long houseId; 24 | 25 | /** $column.columnComment */ 26 | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") 27 | private String feature; 28 | 29 | public void setId(Long id) 30 | { 31 | this.id = id; 32 | } 33 | 34 | public Long getId() 35 | { 36 | return id; 37 | } 38 | public void setHouseId(Long houseId) 39 | { 40 | this.houseId = houseId; 41 | } 42 | 43 | public Long getHouseId() 44 | { 45 | return houseId; 46 | } 47 | public void setFeature(String feature) 48 | { 49 | this.feature = feature; 50 | } 51 | 52 | public String getFeature() 53 | { 54 | return feature; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 60 | .append("id", getId()) 61 | .append("houseId", getHouseId()) 62 | .append("feature", getFeature()) 63 | .toString(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/web/service/SysPermissionService.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.web.service; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Component; 7 | import cn.source.common.core.domain.entity.SysUser; 8 | import cn.source.system.service.ISysMenuService; 9 | import cn.source.system.service.ISysRoleService; 10 | 11 | /** 12 | * 用户权限处理 13 | * 14 | * @author ruoyi 15 | */ 16 | @Component 17 | public class SysPermissionService 18 | { 19 | @Autowired 20 | private ISysRoleService roleService; 21 | 22 | @Autowired 23 | private ISysMenuService menuService; 24 | 25 | /** 26 | * 获取角色数据权限 27 | * 28 | * @param user 用户信息 29 | * @return 角色权限信息 30 | */ 31 | public Set getRolePermission(SysUser user) 32 | { 33 | Set roles = new HashSet(); 34 | // 管理员拥有所有权限 35 | if (user.isAdmin()) 36 | { 37 | roles.add("admin"); 38 | } 39 | else 40 | { 41 | roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); 42 | } 43 | return roles; 44 | } 45 | 46 | /** 47 | * 获取菜单数据权限 48 | * 49 | * @param user 用户信息 50 | * @return 菜单权限信息 51 | */ 52 | public Set getMenuPermission(SysUser user) 53 | { 54 | Set perms = new HashSet(); 55 | // 管理员拥有所有权限 56 | if (user.isAdmin()) 57 | { 58 | perms.add("*:*:*"); 59 | } 60 | else 61 | { 62 | perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); 63 | } 64 | return perms; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /source-generator/src/main/resources/vm/java/service.java.vm: -------------------------------------------------------------------------------- 1 | package ${packageName}.service; 2 | 3 | import java.util.List; 4 | import ${packageName}.domain.${ClassName}; 5 | 6 | /** 7 | * ${functionName}Service接口 8 | * 9 | * @author ${author} 10 | * @date ${datetime} 11 | */ 12 | public interface I${ClassName}Service 13 | { 14 | /** 15 | * 查询${functionName} 16 | * 17 | * @param ${pkColumn.javaField} ${functionName}主键 18 | * @return ${functionName} 19 | */ 20 | public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); 21 | 22 | /** 23 | * 查询${functionName}列表 24 | * 25 | * @param ${className} ${functionName} 26 | * @return ${functionName}集合 27 | */ 28 | public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); 29 | 30 | /** 31 | * 新增${functionName} 32 | * 33 | * @param ${className} ${functionName} 34 | * @return 结果 35 | */ 36 | public int insert${ClassName}(${ClassName} ${className}); 37 | 38 | /** 39 | * 修改${functionName} 40 | * 41 | * @param ${className} ${functionName} 42 | * @return 结果 43 | */ 44 | public int update${ClassName}(${ClassName} ${className}); 45 | 46 | /** 47 | * 批量删除${functionName} 48 | * 49 | * @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合 50 | * @return 结果 51 | */ 52 | public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); 53 | 54 | /** 55 | * 删除${functionName}信息 56 | * 57 | * @param ${pkColumn.javaField} ${functionName}主键 58 | * @return 结果 59 | */ 60 | public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); 61 | } 62 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/constant/HttpStatus.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.constant; 2 | 3 | /** 4 | * 返回状态码 5 | * 6 | * @author ruoyi 7 | */ 8 | public class HttpStatus 9 | { 10 | /** 11 | * 操作成功 12 | */ 13 | public static final int SUCCESS = 200; 14 | 15 | /** 16 | * 对象创建成功 17 | */ 18 | public static final int CREATED = 201; 19 | 20 | /** 21 | * 请求已经被接受 22 | */ 23 | public static final int ACCEPTED = 202; 24 | 25 | /** 26 | * 操作已经执行成功,但是没有返回数据 27 | */ 28 | public static final int NO_CONTENT = 204; 29 | 30 | /** 31 | * 资源已被移除 32 | */ 33 | public static final int MOVED_PERM = 301; 34 | 35 | /** 36 | * 重定向 37 | */ 38 | public static final int SEE_OTHER = 303; 39 | 40 | /** 41 | * 资源没有被修改 42 | */ 43 | public static final int NOT_MODIFIED = 304; 44 | 45 | /** 46 | * 参数列表错误(缺少,格式不匹配) 47 | */ 48 | public static final int BAD_REQUEST = 400; 49 | 50 | /** 51 | * 未授权 52 | */ 53 | public static final int UNAUTHORIZED = 401; 54 | 55 | /** 56 | * 访问受限,授权过期 57 | */ 58 | public static final int FORBIDDEN = 403; 59 | 60 | /** 61 | * 资源,服务未找到 62 | */ 63 | public static final int NOT_FOUND = 404; 64 | 65 | /** 66 | * 不允许的http方法 67 | */ 68 | public static final int BAD_METHOD = 405; 69 | 70 | /** 71 | * 资源冲突,或者资源被锁 72 | */ 73 | public static final int CONFLICT = 409; 74 | 75 | /** 76 | * 不支持的数据,媒体类型 77 | */ 78 | public static final int UNSUPPORTED_TYPE = 415; 79 | 80 | /** 81 | * 系统内部错误 82 | */ 83 | public static final int ERROR = 500; 84 | 85 | /** 86 | * 接口未实现 87 | */ 88 | public static final int NOT_IMPLEMENTED = 501; 89 | } 90 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/sign/Md5Utils.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.sign; 2 | 3 | import java.security.MessageDigest; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | /** 8 | * Md5加密方法 9 | * 10 | * @author ruoyi 11 | */ 12 | public class Md5Utils 13 | { 14 | private static final Logger log = LoggerFactory.getLogger(Md5Utils.class); 15 | 16 | private static byte[] md5(String s) 17 | { 18 | MessageDigest algorithm; 19 | try 20 | { 21 | algorithm = MessageDigest.getInstance("MD5"); 22 | algorithm.reset(); 23 | algorithm.update(s.getBytes("UTF-8")); 24 | byte[] messageDigest = algorithm.digest(); 25 | return messageDigest; 26 | } 27 | catch (Exception e) 28 | { 29 | log.error("MD5 Error...", e); 30 | } 31 | return null; 32 | } 33 | 34 | private static final String toHex(byte hash[]) 35 | { 36 | if (hash == null) 37 | { 38 | return null; 39 | } 40 | StringBuffer buf = new StringBuffer(hash.length * 2); 41 | int i; 42 | 43 | for (i = 0; i < hash.length; i++) 44 | { 45 | if ((hash[i] & 0xff) < 0x10) 46 | { 47 | buf.append("0"); 48 | } 49 | buf.append(Long.toString(hash[i] & 0xff, 16)); 50 | } 51 | return buf.toString(); 52 | } 53 | 54 | public static String hash(String s) 55 | { 56 | try 57 | { 58 | return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8"); 59 | } 60 | catch (Exception e) 61 | { 62 | log.error("not supported charset...{}", e); 63 | return s; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/ip/AddressUtils.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.ip; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import com.alibaba.fastjson.JSONObject; 6 | import cn.source.common.config.RuoYiConfig; 7 | import cn.source.common.constant.Constants; 8 | import cn.source.common.utils.StringUtils; 9 | import cn.source.common.utils.http.HttpUtils; 10 | 11 | /** 12 | * 获取地址类 13 | * 14 | * @author ruoyi 15 | */ 16 | public class AddressUtils 17 | { 18 | private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); 19 | 20 | // IP地址查询 21 | public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp"; 22 | 23 | // 未知地址 24 | public static final String UNKNOWN = "XX XX"; 25 | 26 | public static String getRealAddressByIP(String ip) 27 | { 28 | String address = UNKNOWN; 29 | // 内网不查询 30 | if (IpUtils.internalIp(ip)) 31 | { 32 | return "内网IP"; 33 | } 34 | if (RuoYiConfig.isAddressEnabled()) 35 | { 36 | try 37 | { 38 | String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK); 39 | if (StringUtils.isEmpty(rspStr)) 40 | { 41 | log.error("获取地理位置异常 {}", ip); 42 | return UNKNOWN; 43 | } 44 | JSONObject obj = JSONObject.parseObject(rspStr); 45 | String region = obj.getString("pro"); 46 | String city = obj.getString("city"); 47 | return String.format("%s %s", region, city); 48 | } 49 | catch (Exception e) 50 | { 51 | log.error("获取地理位置异常 {}", ip); 52 | } 53 | } 54 | return address; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /source-generator/src/main/java/cn/source/generator/service/GenTableColumnServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.source.generator.service; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import cn.source.common.core.text.Convert; 7 | import cn.source.generator.domain.GenTableColumn; 8 | import cn.source.generator.mapper.GenTableColumnMapper; 9 | 10 | /** 11 | * 业务字段 服务层实现 12 | * 13 | * @author ruoyi 14 | */ 15 | @Service 16 | public class GenTableColumnServiceImpl implements IGenTableColumnService 17 | { 18 | @Autowired 19 | private GenTableColumnMapper genTableColumnMapper; 20 | 21 | /** 22 | * 查询业务字段列表 23 | * 24 | * @param tableId 业务字段编号 25 | * @return 业务字段集合 26 | */ 27 | @Override 28 | public List selectGenTableColumnListByTableId(Long tableId) 29 | { 30 | return genTableColumnMapper.selectGenTableColumnListByTableId(tableId); 31 | } 32 | 33 | /** 34 | * 新增业务字段 35 | * 36 | * @param genTableColumn 业务字段信息 37 | * @return 结果 38 | */ 39 | @Override 40 | public int insertGenTableColumn(GenTableColumn genTableColumn) 41 | { 42 | return genTableColumnMapper.insertGenTableColumn(genTableColumn); 43 | } 44 | 45 | /** 46 | * 修改业务字段 47 | * 48 | * @param genTableColumn 业务字段信息 49 | * @return 结果 50 | */ 51 | @Override 52 | public int updateGenTableColumn(GenTableColumn genTableColumn) 53 | { 54 | return genTableColumnMapper.updateGenTableColumn(genTableColumn); 55 | } 56 | 57 | /** 58 | * 删除业务字段对象 59 | * 60 | * @param ids 需要删除的数据ID 61 | * @return 结果 62 | */ 63 | @Override 64 | public int deleteGenTableColumnByIds(String ids) 65 | { 66 | return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /source-generator/src/main/java/cn/source/generator/mapper/GenTableMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.generator.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.generator.domain.GenTable; 5 | 6 | /** 7 | * 业务 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface GenTableMapper 12 | { 13 | /** 14 | * 查询业务列表 15 | * 16 | * @param genTable 业务信息 17 | * @return 业务集合 18 | */ 19 | public List selectGenTableList(GenTable genTable); 20 | 21 | /** 22 | * 查询据库列表 23 | * 24 | * @param genTable 业务信息 25 | * @return 数据库表集合 26 | */ 27 | public List selectDbTableList(GenTable genTable); 28 | 29 | /** 30 | * 查询据库列表 31 | * 32 | * @param tableNames 表名称组 33 | * @return 数据库表集合 34 | */ 35 | public List selectDbTableListByNames(String[] tableNames); 36 | 37 | /** 38 | * 查询所有表信息 39 | * 40 | * @return 表信息集合 41 | */ 42 | public List selectGenTableAll(); 43 | 44 | /** 45 | * 查询表ID业务信息 46 | * 47 | * @param id 业务ID 48 | * @return 业务信息 49 | */ 50 | public GenTable selectGenTableById(Long id); 51 | 52 | /** 53 | * 查询表名称业务信息 54 | * 55 | * @param tableName 表名称 56 | * @return 业务信息 57 | */ 58 | public GenTable selectGenTableByName(String tableName); 59 | 60 | /** 61 | * 新增业务 62 | * 63 | * @param genTable 业务信息 64 | * @return 结果 65 | */ 66 | public int insertGenTable(GenTable genTable); 67 | 68 | /** 69 | * 修改业务 70 | * 71 | * @param genTable 业务信息 72 | * @return 结果 73 | */ 74 | public int updateGenTable(GenTable genTable); 75 | 76 | /** 77 | * 批量删除业务 78 | * 79 | * @param ids 需要删除的数据ID 80 | * @return 结果 81 | */ 82 | public int deleteGenTableByIds(Long[] ids); 83 | } 84 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/impl/SysOperLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service.impl; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import cn.source.system.domain.SysOperLog; 7 | import cn.source.system.mapper.SysOperLogMapper; 8 | import cn.source.system.service.ISysOperLogService; 9 | 10 | /** 11 | * 操作日志 服务层处理 12 | * 13 | * @author ruoyi 14 | */ 15 | @Service 16 | public class SysOperLogServiceImpl implements ISysOperLogService 17 | { 18 | @Autowired 19 | private SysOperLogMapper operLogMapper; 20 | 21 | /** 22 | * 新增操作日志 23 | * 24 | * @param operLog 操作日志对象 25 | */ 26 | @Override 27 | public void insertOperlog(SysOperLog operLog) 28 | { 29 | operLogMapper.insertOperlog(operLog); 30 | } 31 | 32 | /** 33 | * 查询系统操作日志集合 34 | * 35 | * @param operLog 操作日志对象 36 | * @return 操作日志集合 37 | */ 38 | @Override 39 | public List selectOperLogList(SysOperLog operLog) 40 | { 41 | return operLogMapper.selectOperLogList(operLog); 42 | } 43 | 44 | /** 45 | * 批量删除系统操作日志 46 | * 47 | * @param operIds 需要删除的操作日志ID 48 | * @return 结果 49 | */ 50 | @Override 51 | public int deleteOperLogByIds(Long[] operIds) 52 | { 53 | return operLogMapper.deleteOperLogByIds(operIds); 54 | } 55 | 56 | /** 57 | * 查询操作日志详细 58 | * 59 | * @param operId 操作ID 60 | * @return 操作日志对象 61 | */ 62 | @Override 63 | public SysOperLog selectOperLogById(Long operId) 64 | { 65 | return operLogMapper.selectOperLogById(operId); 66 | } 67 | 68 | /** 69 | * 清空操作日志 70 | */ 71 | @Override 72 | public void cleanOperLog() 73 | { 74 | operLogMapper.cleanOperLog(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /source-generator/src/main/java/cn/source/generator/config/GenConfig.java: -------------------------------------------------------------------------------- 1 | package cn.source.generator.config; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.PropertySource; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * 读取代码生成相关配置 10 | * 11 | * @author ruoyi 12 | */ 13 | @Component 14 | @ConfigurationProperties(prefix = "gen") 15 | @PropertySource(value = { "classpath:generator.yml" }) 16 | public class GenConfig 17 | { 18 | /** 作者 */ 19 | public static String author; 20 | 21 | /** 生成包路径 */ 22 | public static String packageName; 23 | 24 | /** 自动去除表前缀,默认是false */ 25 | public static boolean autoRemovePre; 26 | 27 | /** 表前缀(类名不会包含表前缀) */ 28 | public static String tablePrefix; 29 | 30 | public static String getAuthor() 31 | { 32 | return author; 33 | } 34 | 35 | @Value("${author}") 36 | public void setAuthor(String author) 37 | { 38 | GenConfig.author = author; 39 | } 40 | 41 | public static String getPackageName() 42 | { 43 | return packageName; 44 | } 45 | 46 | @Value("${packageName}") 47 | public void setPackageName(String packageName) 48 | { 49 | GenConfig.packageName = packageName; 50 | } 51 | 52 | public static boolean getAutoRemovePre() 53 | { 54 | return autoRemovePre; 55 | } 56 | 57 | @Value("${autoRemovePre}") 58 | public void setAutoRemovePre(boolean autoRemovePre) 59 | { 60 | GenConfig.autoRemovePre = autoRemovePre; 61 | } 62 | 63 | public static String getTablePrefix() 64 | { 65 | return tablePrefix; 66 | } 67 | 68 | @Value("${tablePrefix}") 69 | public void setTablePrefix(String tablePrefix) 70 | { 71 | GenConfig.tablePrefix = tablePrefix; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/file/MimeTypeUtils.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.file; 2 | 3 | /** 4 | * 媒体类型工具类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class MimeTypeUtils 9 | { 10 | public static final String IMAGE_PNG = "image/png"; 11 | 12 | public static final String IMAGE_JPG = "image/jpg"; 13 | 14 | public static final String IMAGE_JPEG = "image/jpeg"; 15 | 16 | public static final String IMAGE_BMP = "image/bmp"; 17 | 18 | public static final String IMAGE_GIF = "image/gif"; 19 | 20 | public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" }; 21 | 22 | public static final String[] FLASH_EXTENSION = { "swf", "flv" }; 23 | 24 | public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", 25 | "asf", "rm", "rmvb" }; 26 | 27 | public static final String[] VIDEO_EXTENSION = { "mp4", "avi", "rmvb" }; 28 | 29 | public static final String[] DEFAULT_ALLOWED_EXTENSION = { 30 | // 图片 31 | "bmp", "gif", "jpg", "jpeg", "png", 32 | // word excel powerpoint 33 | "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", 34 | // 压缩文件 35 | "rar", "zip", "gz", "bz2", 36 | // 视频格式 37 | "mp4", "avi", "rmvb", 38 | // pdf 39 | "pdf" }; 40 | 41 | public static String getExtension(String prefix) 42 | { 43 | switch (prefix) 44 | { 45 | case IMAGE_PNG: 46 | return "png"; 47 | case IMAGE_JPG: 48 | return "jpg"; 49 | case IMAGE_JPEG: 50 | return "jpeg"; 51 | case IMAGE_BMP: 52 | return "bmp"; 53 | case IMAGE_GIF: 54 | return "gif"; 55 | default: 56 | return ""; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/core/domain/TreeSelect.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.core.domain; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | import com.fasterxml.jackson.annotation.JsonInclude; 7 | import cn.source.common.core.domain.entity.SysDept; 8 | import cn.source.common.core.domain.entity.SysMenu; 9 | 10 | /** 11 | * Treeselect树结构实体类 12 | * 13 | * @author ruoyi 14 | */ 15 | public class TreeSelect implements Serializable 16 | { 17 | private static final long serialVersionUID = 1L; 18 | 19 | /** 节点ID */ 20 | private Long id; 21 | 22 | /** 节点名称 */ 23 | private String label; 24 | 25 | /** 子节点 */ 26 | @JsonInclude(JsonInclude.Include.NON_EMPTY) 27 | private List children; 28 | 29 | public TreeSelect() 30 | { 31 | 32 | } 33 | 34 | public TreeSelect(SysDept dept) 35 | { 36 | this.id = dept.getDeptId(); 37 | this.label = dept.getDeptName(); 38 | this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); 39 | } 40 | 41 | public TreeSelect(SysMenu menu) 42 | { 43 | this.id = menu.getMenuId(); 44 | this.label = menu.getMenuName(); 45 | this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); 46 | } 47 | 48 | public Long getId() 49 | { 50 | return id; 51 | } 52 | 53 | public void setId(Long id) 54 | { 55 | this.id = id; 56 | } 57 | 58 | public String getLabel() 59 | { 60 | return label; 61 | } 62 | 63 | public void setLabel(String label) 64 | { 65 | this.label = label; 66 | } 67 | 68 | public List getChildren() 69 | { 70 | return children; 71 | } 72 | 73 | public void setChildren(List children) 74 | { 75 | this.children = children; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/ISysConfigService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysConfig; 5 | 6 | /** 7 | * 参数配置 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysConfigService 12 | { 13 | /** 14 | * 查询参数配置信息 15 | * 16 | * @param configId 参数配置ID 17 | * @return 参数配置信息 18 | */ 19 | public SysConfig selectConfigById(Long configId); 20 | 21 | /** 22 | * 根据键名查询参数配置信息 23 | * 24 | * @param configKey 参数键名 25 | * @return 参数键值 26 | */ 27 | public String selectConfigByKey(String configKey); 28 | 29 | /** 30 | * 获取验证码开关 31 | * 32 | * @return true开启,false关闭 33 | */ 34 | public boolean selectCaptchaOnOff(); 35 | 36 | /** 37 | * 查询参数配置列表 38 | * 39 | * @param config 参数配置信息 40 | * @return 参数配置集合 41 | */ 42 | public List selectConfigList(SysConfig config); 43 | 44 | /** 45 | * 新增参数配置 46 | * 47 | * @param config 参数配置信息 48 | * @return 结果 49 | */ 50 | public int insertConfig(SysConfig config); 51 | 52 | /** 53 | * 修改参数配置 54 | * 55 | * @param config 参数配置信息 56 | * @return 结果 57 | */ 58 | public int updateConfig(SysConfig config); 59 | 60 | /** 61 | * 批量删除参数信息 62 | * 63 | * @param configIds 需要删除的参数ID 64 | * @return 结果 65 | */ 66 | public void deleteConfigByIds(Long[] configIds); 67 | 68 | /** 69 | * 加载参数缓存数据 70 | */ 71 | public void loadingConfigCache(); 72 | 73 | /** 74 | * 清空参数缓存数据 75 | */ 76 | public void clearConfigCache(); 77 | 78 | /** 79 | * 重置参数缓存数据 80 | */ 81 | public void resetConfigCache(); 82 | 83 | /** 84 | * 校验参数键名是否唯一 85 | * 86 | * @param config 参数信息 87 | * @return 结果 88 | */ 89 | public String checkConfigKeyUnique(SysConfig config); 90 | } 91 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysDictTypeMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import cn.source.common.core.domain.entity.SysDictType; 6 | 7 | /** 8 | * 字典表 数据层 9 | * 10 | * @author ruoyi 11 | */ 12 | @Mapper 13 | public interface SysDictTypeMapper 14 | { 15 | /** 16 | * 根据条件分页查询字典类型 17 | * 18 | * @param dictType 字典类型信息 19 | * @return 字典类型集合信息 20 | */ 21 | public List selectDictTypeList(SysDictType dictType); 22 | 23 | /** 24 | * 根据所有字典类型 25 | * 26 | * @return 字典类型集合信息 27 | */ 28 | public List selectDictTypeAll(); 29 | 30 | /** 31 | * 根据字典类型ID查询信息 32 | * 33 | * @param dictId 字典类型ID 34 | * @return 字典类型 35 | */ 36 | public SysDictType selectDictTypeById(Long dictId); 37 | 38 | /** 39 | * 根据字典类型查询信息 40 | * 41 | * @param dictType 字典类型 42 | * @return 字典类型 43 | */ 44 | public SysDictType selectDictTypeByType(String dictType); 45 | 46 | /** 47 | * 通过字典ID删除字典信息 48 | * 49 | * @param dictId 字典ID 50 | * @return 结果 51 | */ 52 | public int deleteDictTypeById(Long dictId); 53 | 54 | /** 55 | * 批量删除字典类型信息 56 | * 57 | * @param dictIds 需要删除的字典ID 58 | * @return 结果 59 | */ 60 | public int deleteDictTypeByIds(Long[] dictIds); 61 | 62 | /** 63 | * 新增字典类型信息 64 | * 65 | * @param dictType 字典类型信息 66 | * @return 结果 67 | */ 68 | public int insertDictType(SysDictType dictType); 69 | 70 | /** 71 | * 修改字典类型信息 72 | * 73 | * @param dictType 字典类型信息 74 | * @return 结果 75 | */ 76 | public int updateDictType(SysDictType dictType); 77 | 78 | /** 79 | * 校验字典类型称是否唯一 80 | * 81 | * @param dictType 字典类型 82 | * @return 结果 83 | */ 84 | public SysDictType checkDictTypeUnique(String dictType); 85 | } 86 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/interceptor/RepeatSubmitInterceptor.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.interceptor; 2 | 3 | import java.lang.reflect.Method; 4 | import javax.servlet.http.HttpServletRequest; 5 | import javax.servlet.http.HttpServletResponse; 6 | import org.springframework.stereotype.Component; 7 | import org.springframework.web.method.HandlerMethod; 8 | import org.springframework.web.servlet.HandlerInterceptor; 9 | import com.alibaba.fastjson.JSONObject; 10 | import cn.source.common.annotation.RepeatSubmit; 11 | import cn.source.common.core.domain.AjaxResult; 12 | import cn.source.common.utils.ServletUtils; 13 | 14 | /** 15 | * 防止重复提交拦截器 16 | * 17 | * @author ruoyi 18 | */ 19 | @Component 20 | public abstract class RepeatSubmitInterceptor implements HandlerInterceptor 21 | { 22 | @Override 23 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception 24 | { 25 | if (handler instanceof HandlerMethod) 26 | { 27 | HandlerMethod handlerMethod = (HandlerMethod) handler; 28 | Method method = handlerMethod.getMethod(); 29 | RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class); 30 | if (annotation != null) 31 | { 32 | if (this.isRepeatSubmit(request, annotation)) 33 | { 34 | AjaxResult ajaxResult = AjaxResult.error(annotation.message()); 35 | ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult)); 36 | return false; 37 | } 38 | } 39 | return true; 40 | } 41 | else 42 | { 43 | return true; 44 | } 45 | } 46 | 47 | /** 48 | * 验证是否重复提交由子类实现具体的防重复提交的规则 49 | * 50 | * @param request 51 | * @return 52 | * @throws Exception 53 | */ 54 | public abstract boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation); 55 | } 56 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/constant/UserConstants.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.constant; 2 | 3 | /** 4 | * 用户常量信息 5 | * 6 | * @author ruoyi 7 | */ 8 | public class UserConstants 9 | { 10 | /** 11 | * 平台内系统用户的唯一标志 12 | */ 13 | public static final String SYS_USER = "SYS_USER"; 14 | 15 | /** 正常状态 */ 16 | public static final String NORMAL = "0"; 17 | 18 | /** 异常状态 */ 19 | public static final String EXCEPTION = "1"; 20 | 21 | /** 用户封禁状态 */ 22 | public static final String USER_DISABLE = "1"; 23 | 24 | /** 角色封禁状态 */ 25 | public static final String ROLE_DISABLE = "1"; 26 | 27 | /** 部门正常状态 */ 28 | public static final String DEPT_NORMAL = "0"; 29 | 30 | /** 部门停用状态 */ 31 | public static final String DEPT_DISABLE = "1"; 32 | 33 | /** 字典正常状态 */ 34 | public static final String DICT_NORMAL = "0"; 35 | 36 | /** 是否为系统默认(是) */ 37 | public static final String YES = "Y"; 38 | 39 | /** 是否菜单外链(是) */ 40 | public static final String YES_FRAME = "0"; 41 | 42 | /** 是否菜单外链(否) */ 43 | public static final String NO_FRAME = "1"; 44 | 45 | /** 菜单类型(目录) */ 46 | public static final String TYPE_DIR = "M"; 47 | 48 | /** 菜单类型(菜单) */ 49 | public static final String TYPE_MENU = "C"; 50 | 51 | /** 菜单类型(按钮) */ 52 | public static final String TYPE_BUTTON = "F"; 53 | 54 | /** Layout组件标识 */ 55 | public final static String LAYOUT = "Layout"; 56 | 57 | /** ParentView组件标识 */ 58 | public final static String PARENT_VIEW = "ParentView"; 59 | 60 | /** InnerLink组件标识 */ 61 | public final static String INNER_LINK = "InnerLink"; 62 | 63 | /** 校验返回结果码 */ 64 | public final static String UNIQUE = "0"; 65 | public final static String NOT_UNIQUE = "1"; 66 | 67 | /** 68 | * 用户名长度限制 69 | */ 70 | public static final int USERNAME_MIN_LENGTH = 2; 71 | public static final int USERNAME_MAX_LENGTH = 20; 72 | 73 | /** 74 | * 密码长度限制 75 | */ 76 | public static final int PASSWORD_MIN_LENGTH = 5; 77 | public static final int PASSWORD_MAX_LENGTH = 20; 78 | } 79 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/security/filter/JwtAuthenticationTokenFilter.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.security.filter; 2 | 3 | import java.io.IOException; 4 | import javax.servlet.FilterChain; 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 10 | import org.springframework.security.core.context.SecurityContextHolder; 11 | import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; 12 | import org.springframework.stereotype.Component; 13 | import org.springframework.web.filter.OncePerRequestFilter; 14 | import cn.source.common.core.domain.model.LoginUser; 15 | import cn.source.common.utils.SecurityUtils; 16 | import cn.source.common.utils.StringUtils; 17 | import cn.source.framework.web.service.TokenService; 18 | 19 | /** 20 | * token过滤器 验证token有效性 21 | * 22 | * @author ruoyi 23 | */ 24 | @Component 25 | public class JwtAuthenticationTokenFilter extends OncePerRequestFilter 26 | { 27 | @Autowired 28 | private TokenService tokenService; 29 | 30 | @Override 31 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) 32 | throws ServletException, IOException 33 | { 34 | LoginUser loginUser = tokenService.getLoginUser(request); 35 | if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) 36 | { 37 | tokenService.verifyToken(loginUser); 38 | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); 39 | authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); 40 | SecurityContextHolder.getContext().setAuthentication(authenticationToken); 41 | } 42 | chain.doFilter(request, response); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/web/domain/server/Cpu.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.web.domain.server; 2 | 3 | import cn.source.common.utils.Arith; 4 | 5 | /** 6 | * CPU相关信息 7 | * 8 | * @author ruoyi 9 | */ 10 | public class Cpu 11 | { 12 | /** 13 | * 核心数 14 | */ 15 | private int cpuNum; 16 | 17 | /** 18 | * CPU总的使用率 19 | */ 20 | private double total; 21 | 22 | /** 23 | * CPU系统使用率 24 | */ 25 | private double sys; 26 | 27 | /** 28 | * CPU用户使用率 29 | */ 30 | private double used; 31 | 32 | /** 33 | * CPU当前等待率 34 | */ 35 | private double wait; 36 | 37 | /** 38 | * CPU当前空闲率 39 | */ 40 | private double free; 41 | 42 | public int getCpuNum() 43 | { 44 | return cpuNum; 45 | } 46 | 47 | public void setCpuNum(int cpuNum) 48 | { 49 | this.cpuNum = cpuNum; 50 | } 51 | 52 | public double getTotal() 53 | { 54 | return Arith.round(Arith.mul(total, 100), 2); 55 | } 56 | 57 | public void setTotal(double total) 58 | { 59 | this.total = total; 60 | } 61 | 62 | public double getSys() 63 | { 64 | return Arith.round(Arith.mul(sys / total, 100), 2); 65 | } 66 | 67 | public void setSys(double sys) 68 | { 69 | this.sys = sys; 70 | } 71 | 72 | public double getUsed() 73 | { 74 | return Arith.round(Arith.mul(used / total, 100), 2); 75 | } 76 | 77 | public void setUsed(double used) 78 | { 79 | this.used = used; 80 | } 81 | 82 | public double getWait() 83 | { 84 | return Arith.round(Arith.mul(wait / total, 100), 2); 85 | } 86 | 87 | public void setWait(double wait) 88 | { 89 | this.wait = wait; 90 | } 91 | 92 | public double getFree() 93 | { 94 | return Arith.round(Arith.mul(free / total, 100), 2); 95 | } 96 | 97 | public void setFree(double free) 98 | { 99 | this.free = free; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /source-framework/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | source 7 | cn.source 8 | 3.8.1 9 | 10 | 4.0.0 11 | 12 | source-framework 13 | 14 | 15 | framework框架核心 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-starter-web 24 | 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-aop 30 | 31 | 32 | 33 | 34 | com.alibaba 35 | druid-spring-boot-starter 36 | 37 | 38 | 39 | 40 | com.github.penggle 41 | kaptcha 42 | 43 | 44 | javax.servlet-api 45 | javax.servlet 46 | 47 | 48 | 49 | 50 | 51 | 52 | com.github.oshi 53 | oshi-core 54 | 55 | 56 | 57 | 58 | cn.source 59 | source-system 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /source-quartz/src/main/java/cn/source/quartz/service/impl/SysJobLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.source.quartz.service.impl; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import cn.source.quartz.domain.SysJobLog; 7 | import cn.source.quartz.mapper.SysJobLogMapper; 8 | import cn.source.quartz.service.ISysJobLogService; 9 | 10 | /** 11 | * 定时任务调度日志信息 服务层 12 | * 13 | * @author ruoyi 14 | */ 15 | @Service 16 | public class SysJobLogServiceImpl implements ISysJobLogService 17 | { 18 | @Autowired 19 | private SysJobLogMapper jobLogMapper; 20 | 21 | /** 22 | * 获取quartz调度器日志的计划任务 23 | * 24 | * @param jobLog 调度日志信息 25 | * @return 调度任务日志集合 26 | */ 27 | @Override 28 | public List selectJobLogList(SysJobLog jobLog) 29 | { 30 | return jobLogMapper.selectJobLogList(jobLog); 31 | } 32 | 33 | /** 34 | * 通过调度任务日志ID查询调度信息 35 | * 36 | * @param jobLogId 调度任务日志ID 37 | * @return 调度任务日志对象信息 38 | */ 39 | @Override 40 | public SysJobLog selectJobLogById(Long jobLogId) 41 | { 42 | return jobLogMapper.selectJobLogById(jobLogId); 43 | } 44 | 45 | /** 46 | * 新增任务日志 47 | * 48 | * @param jobLog 调度日志信息 49 | */ 50 | @Override 51 | public void addJobLog(SysJobLog jobLog) 52 | { 53 | jobLogMapper.insertJobLog(jobLog); 54 | } 55 | 56 | /** 57 | * 批量删除调度日志信息 58 | * 59 | * @param logIds 需要删除的数据ID 60 | * @return 结果 61 | */ 62 | @Override 63 | public int deleteJobLogByIds(Long[] logIds) 64 | { 65 | return jobLogMapper.deleteJobLogByIds(logIds); 66 | } 67 | 68 | /** 69 | * 删除任务日志 70 | * 71 | * @param jobId 调度日志ID 72 | */ 73 | @Override 74 | public int deleteJobLogById(Long jobId) 75 | { 76 | return jobLogMapper.deleteJobLogById(jobId); 77 | } 78 | 79 | /** 80 | * 清空任务日志 81 | */ 82 | @Override 83 | public void cleanJobLog() 84 | { 85 | jobLogMapper.cleanJobLog(); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /doc/application-druid.yml: -------------------------------------------------------------------------------- 1 | # 数据源配置 2 | spring: 3 | datasource: 4 | type: com.alibaba.druid.pool.DruidDataSource 5 | driverClassName: com.mysql.cj.jdbc.Driver 6 | druid: 7 | # 主库数据源 8 | master: 9 | url: jdbc:mysql://localhost:3506/source-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 10 | username: root 11 | password: 12 | # 从库数据源 13 | slave: 14 | # 从数据源开关/默认关闭 15 | enabled: false 16 | url: 17 | username: 18 | password: 19 | # 初始连接数 20 | initialSize: 5 21 | # 最小连接池数量 22 | minIdle: 10 23 | # 最大连接池数量 24 | maxActive: 20 25 | # 配置获取连接等待超时的时间 26 | maxWait: 60000 27 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 28 | timeBetweenEvictionRunsMillis: 60000 29 | # 配置一个连接在池中最小生存的时间,单位是毫秒 30 | minEvictableIdleTimeMillis: 300000 31 | # 配置一个连接在池中最大生存的时间,单位是毫秒 32 | maxEvictableIdleTimeMillis: 900000 33 | # 配置检测连接是否有效 34 | validationQuery: SELECT 1 FROM DUAL 35 | testWhileIdle: true 36 | testOnBorrow: false 37 | testOnReturn: false 38 | webStatFilter: 39 | enabled: true 40 | statViewServlet: 41 | enabled: true 42 | # 设置白名单,不填则允许所有访问 43 | allow: 44 | url-pattern: /druid/* 45 | # 控制台管理用户名和密码 46 | login-username: ruoyi 47 | login-password: 123456 48 | filter: 49 | stat: 50 | enabled: true 51 | # 慢SQL记录 52 | log-slow-sql: true 53 | slow-sql-millis: 1000 54 | merge-sql: true 55 | wall: 56 | config: 57 | multi-statement-allow: true 58 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/security/handle/LogoutSuccessHandlerImpl.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.security.handle; 2 | 3 | import java.io.IOException; 4 | import javax.servlet.ServletException; 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.security.core.Authentication; 10 | import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; 11 | import com.alibaba.fastjson.JSON; 12 | import cn.source.common.constant.Constants; 13 | import cn.source.common.constant.HttpStatus; 14 | import cn.source.common.core.domain.AjaxResult; 15 | import cn.source.common.core.domain.model.LoginUser; 16 | import cn.source.common.utils.ServletUtils; 17 | import cn.source.common.utils.StringUtils; 18 | import cn.source.framework.manager.AsyncManager; 19 | import cn.source.framework.manager.factory.AsyncFactory; 20 | import cn.source.framework.web.service.TokenService; 21 | 22 | /** 23 | * 自定义退出处理类 返回成功 24 | * 25 | * @author ruoyi 26 | */ 27 | @Configuration 28 | public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler 29 | { 30 | @Autowired 31 | private TokenService tokenService; 32 | 33 | /** 34 | * 退出处理 35 | * 36 | * @return 37 | */ 38 | @Override 39 | public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) 40 | throws IOException, ServletException 41 | { 42 | LoginUser loginUser = tokenService.getLoginUser(request); 43 | if (StringUtils.isNotNull(loginUser)) 44 | { 45 | String userName = loginUser.getUsername(); 46 | // 删除用户缓存记录 47 | tokenService.delLoginUser(loginUser.getToken()); 48 | // 记录用户退出日志 49 | AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功")); 50 | } 51 | ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功"))); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /source-house/src/main/java/cn/source/system/mapper/HouseRoomMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import cn.source.system.domain.HouseFeature; 4 | import cn.source.system.domain.HouseImage; 5 | import cn.source.system.domain.HouseRoom; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 房源详情Mapper接口 11 | * 12 | * @author ruoyi 13 | * @date 2022-03-27 14 | */ 15 | public interface HouseRoomMapper 16 | { 17 | /** 18 | * 查询房源详情 19 | * 20 | * @param id 房源详情主键 21 | * @return 房源详情 22 | */ 23 | public HouseRoom selectHouseRoomById(Long id); 24 | 25 | /** 26 | * 查询房源详情列表 27 | * 28 | * @param houseRoom 房源详情 29 | * @return 房源详情集合 30 | */ 31 | public List selectHouseRoomList(HouseRoom houseRoom); 32 | 33 | /** 34 | * 新增房源详情 35 | * 36 | * @param houseRoom 房源详情 37 | * @return 结果 38 | */ 39 | public int insertHouseRoom(HouseRoom houseRoom); 40 | 41 | /** 42 | * 修改房源详情 43 | * 44 | * @param houseRoom 房源详情 45 | * @return 结果 46 | */ 47 | public int updateHouseRoom(HouseRoom houseRoom); 48 | 49 | /** 50 | * 删除房源详情 51 | * 52 | * @param id 房源详情主键 53 | * @return 结果 54 | */ 55 | public int deleteHouseRoomById(Long id); 56 | 57 | /** 58 | * 批量删除房源详情 59 | * 60 | * @param ids 需要删除的数据主键集合 61 | * @return 结果 62 | */ 63 | public int deleteHouseRoomByIds(Long[] ids); 64 | 65 | /** 66 | * 新增房源图片 67 | * 68 | * @param houseRoom 房源详情 69 | * @return 结果 70 | */ 71 | public int insertHouseImage(HouseRoom houseRoom); 72 | 73 | /** 74 | * 新增房源特色 75 | * 76 | * @param houseRoom 房源详情 77 | * @return 结果 78 | */ 79 | public int insertHouseFeature(HouseRoom houseRoom); 80 | 81 | /** 82 | * 查询房源图片详情 83 | * 84 | * @param houseRoom 房源详情 85 | * @return 房源详情 86 | */ 87 | public List selectHouseImage(HouseRoom houseRoom); 88 | 89 | /** 90 | * 查询房源亮点详情 91 | * 92 | * @param houseRoom 房源详情 93 | * @return 房源详情 94 | */ 95 | public List selectHouseFeature(HouseRoom houseRoom); 96 | } 97 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/utils/file/FileTypeUtils.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.utils.file; 2 | 3 | import java.io.File; 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | /** 7 | * 文件类型工具类 8 | * 9 | * @author ruoyi 10 | */ 11 | public class FileTypeUtils 12 | { 13 | /** 14 | * 获取文件类型 15 | *

16 | * 例如: ruoyi.txt, 返回: txt 17 | * 18 | * @param file 文件名 19 | * @return 后缀(不含".") 20 | */ 21 | public static String getFileType(File file) 22 | { 23 | if (null == file) 24 | { 25 | return StringUtils.EMPTY; 26 | } 27 | return getFileType(file.getName()); 28 | } 29 | 30 | /** 31 | * 获取文件类型 32 | *

33 | * 例如: ruoyi.txt, 返回: txt 34 | * 35 | * @param fileName 文件名 36 | * @return 后缀(不含".") 37 | */ 38 | public static String getFileType(String fileName) 39 | { 40 | int separatorIndex = fileName.lastIndexOf("."); 41 | if (separatorIndex < 0) 42 | { 43 | return ""; 44 | } 45 | return fileName.substring(separatorIndex + 1).toLowerCase(); 46 | } 47 | 48 | /** 49 | * 获取文件类型 50 | * 51 | * @param photoByte 文件字节码 52 | * @return 后缀(不含".") 53 | */ 54 | public static String getFileExtendName(byte[] photoByte) 55 | { 56 | String strFileExtendName = "JPG"; 57 | if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) 58 | && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) 59 | { 60 | strFileExtendName = "GIF"; 61 | } 62 | else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) 63 | { 64 | strFileExtendName = "JPG"; 65 | } 66 | else if ((photoByte[0] == 66) && (photoByte[1] == 77)) 67 | { 68 | strFileExtendName = "BMP"; 69 | } 70 | else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) 71 | { 72 | strFileExtendName = "PNG"; 73 | } 74 | return strFileExtendName; 75 | } 76 | } -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/config/ThreadPoolConfig.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.config; 2 | 3 | import cn.source.common.utils.Threads; 4 | import org.apache.commons.lang3.concurrent.BasicThreadFactory; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; 8 | import java.util.concurrent.ScheduledExecutorService; 9 | import java.util.concurrent.ScheduledThreadPoolExecutor; 10 | import java.util.concurrent.ThreadPoolExecutor; 11 | 12 | /** 13 | * 线程池配置 14 | * 15 | * @author ruoyi 16 | **/ 17 | @Configuration 18 | public class ThreadPoolConfig 19 | { 20 | // 核心线程池大小 21 | private int corePoolSize = 50; 22 | 23 | // 最大可创建的线程数 24 | private int maxPoolSize = 200; 25 | 26 | // 队列最大长度 27 | private int queueCapacity = 1000; 28 | 29 | // 线程池维护线程所允许的空闲时间 30 | private int keepAliveSeconds = 300; 31 | 32 | @Bean(name = "threadPoolTaskExecutor") 33 | public ThreadPoolTaskExecutor threadPoolTaskExecutor() 34 | { 35 | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); 36 | executor.setMaxPoolSize(maxPoolSize); 37 | executor.setCorePoolSize(corePoolSize); 38 | executor.setQueueCapacity(queueCapacity); 39 | executor.setKeepAliveSeconds(keepAliveSeconds); 40 | // 线程池对拒绝任务(无线程可用)的处理策略 41 | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); 42 | return executor; 43 | } 44 | 45 | /** 46 | * 执行周期性或定时任务 47 | */ 48 | @Bean(name = "scheduledExecutorService") 49 | protected ScheduledExecutorService scheduledExecutorService() 50 | { 51 | return new ScheduledThreadPoolExecutor(corePoolSize, 52 | new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(), 53 | new ThreadPoolExecutor.CallerRunsPolicy()) 54 | { 55 | @Override 56 | protected void afterExecute(Runnable r, Throwable t) 57 | { 58 | super.afterExecute(r, t); 59 | Threads.printException(r, t); 60 | } 61 | }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/mapper/SysPostMapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.mapper; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysPost; 5 | 6 | /** 7 | * 岗位信息 数据层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface SysPostMapper 12 | { 13 | /** 14 | * 查询岗位数据集合 15 | * 16 | * @param post 岗位信息 17 | * @return 岗位数据集合 18 | */ 19 | public List selectPostList(SysPost post); 20 | 21 | /** 22 | * 查询所有岗位 23 | * 24 | * @return 岗位列表 25 | */ 26 | public List selectPostAll(); 27 | 28 | /** 29 | * 通过岗位ID查询岗位信息 30 | * 31 | * @param postId 岗位ID 32 | * @return 角色对象信息 33 | */ 34 | public SysPost selectPostById(Long postId); 35 | 36 | /** 37 | * 根据用户ID获取岗位选择框列表 38 | * 39 | * @param userId 用户ID 40 | * @return 选中岗位ID列表 41 | */ 42 | public List selectPostListByUserId(Long userId); 43 | 44 | /** 45 | * 查询用户所属岗位组 46 | * 47 | * @param userName 用户名 48 | * @return 结果 49 | */ 50 | public List selectPostsByUserName(String userName); 51 | 52 | /** 53 | * 删除岗位信息 54 | * 55 | * @param postId 岗位ID 56 | * @return 结果 57 | */ 58 | public int deletePostById(Long postId); 59 | 60 | /** 61 | * 批量删除岗位信息 62 | * 63 | * @param postIds 需要删除的岗位ID 64 | * @return 结果 65 | */ 66 | public int deletePostByIds(Long[] postIds); 67 | 68 | /** 69 | * 修改岗位信息 70 | * 71 | * @param post 岗位信息 72 | * @return 结果 73 | */ 74 | public int updatePost(SysPost post); 75 | 76 | /** 77 | * 新增岗位信息 78 | * 79 | * @param post 岗位信息 80 | * @return 结果 81 | */ 82 | public int insertPost(SysPost post); 83 | 84 | /** 85 | * 校验岗位名称 86 | * 87 | * @param postName 岗位名称 88 | * @return 结果 89 | */ 90 | public SysPost checkPostNameUnique(String postName); 91 | 92 | /** 93 | * 校验岗位编码 94 | * 95 | * @param postCode 岗位编码 96 | * @return 结果 97 | */ 98 | public SysPost checkPostCodeUnique(String postCode); 99 | } 100 | -------------------------------------------------------------------------------- /source-generator/src/main/resources/vm/sql/sql.vm: -------------------------------------------------------------------------------- 1 | -- 菜单 SQL 2 | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 3 | values('${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, '${functionName}菜单'); 4 | 5 | -- 按钮父菜单ID 6 | SELECT @parentId := LAST_INSERT_ID(); 7 | 8 | -- 按钮 SQL 9 | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 10 | values('${functionName}查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', sysdate(), '', null, ''); 11 | 12 | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 13 | values('${functionName}新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, ''); 14 | 15 | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 16 | values('${functionName}修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, ''); 17 | 18 | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 19 | values('${functionName}删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, ''); 20 | 21 | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 22 | values('${functionName}导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, ''); -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/impl/SysNoticeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service.impl; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import cn.source.system.domain.SysNotice; 7 | import cn.source.system.mapper.SysNoticeMapper; 8 | import cn.source.system.service.ISysNoticeService; 9 | 10 | /** 11 | * 公告 服务层实现 12 | * 13 | * @author ruoyi 14 | */ 15 | @Service 16 | public class SysNoticeServiceImpl implements ISysNoticeService 17 | { 18 | @Autowired 19 | private SysNoticeMapper noticeMapper; 20 | 21 | /** 22 | * 查询公告信息 23 | * 24 | * @param noticeId 公告ID 25 | * @return 公告信息 26 | */ 27 | @Override 28 | public SysNotice selectNoticeById(Long noticeId) 29 | { 30 | return noticeMapper.selectNoticeById(noticeId); 31 | } 32 | 33 | /** 34 | * 查询公告列表 35 | * 36 | * @param notice 公告信息 37 | * @return 公告集合 38 | */ 39 | @Override 40 | public List selectNoticeList(SysNotice notice) 41 | { 42 | return noticeMapper.selectNoticeList(notice); 43 | } 44 | 45 | /** 46 | * 新增公告 47 | * 48 | * @param notice 公告信息 49 | * @return 结果 50 | */ 51 | @Override 52 | public int insertNotice(SysNotice notice) 53 | { 54 | return noticeMapper.insertNotice(notice); 55 | } 56 | 57 | /** 58 | * 修改公告 59 | * 60 | * @param notice 公告信息 61 | * @return 结果 62 | */ 63 | @Override 64 | public int updateNotice(SysNotice notice) 65 | { 66 | return noticeMapper.updateNotice(notice); 67 | } 68 | 69 | /** 70 | * 删除公告对象 71 | * 72 | * @param noticeId 公告ID 73 | * @return 结果 74 | */ 75 | @Override 76 | public int deleteNoticeById(Long noticeId) 77 | { 78 | return noticeMapper.deleteNoticeById(noticeId); 79 | } 80 | 81 | /** 82 | * 批量删除公告信息 83 | * 84 | * @param noticeIds 需要删除的公告ID 85 | * @return 结果 86 | */ 87 | @Override 88 | public int deleteNoticeByIds(Long[] noticeIds) 89 | { 90 | return noticeMapper.deleteNoticeByIds(noticeIds); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /source-framework/src/main/java/cn/source/framework/web/domain/server/SysFile.java: -------------------------------------------------------------------------------- 1 | package cn.source.framework.web.domain.server; 2 | 3 | /** 4 | * 系统文件相关信息 5 | * 6 | * @author ruoyi 7 | */ 8 | public class SysFile 9 | { 10 | /** 11 | * 盘符路径 12 | */ 13 | private String dirName; 14 | 15 | /** 16 | * 盘符类型 17 | */ 18 | private String sysTypeName; 19 | 20 | /** 21 | * 文件类型 22 | */ 23 | private String typeName; 24 | 25 | /** 26 | * 总大小 27 | */ 28 | private String total; 29 | 30 | /** 31 | * 剩余大小 32 | */ 33 | private String free; 34 | 35 | /** 36 | * 已经使用量 37 | */ 38 | private String used; 39 | 40 | /** 41 | * 资源的使用率 42 | */ 43 | private double usage; 44 | 45 | public String getDirName() 46 | { 47 | return dirName; 48 | } 49 | 50 | public void setDirName(String dirName) 51 | { 52 | this.dirName = dirName; 53 | } 54 | 55 | public String getSysTypeName() 56 | { 57 | return sysTypeName; 58 | } 59 | 60 | public void setSysTypeName(String sysTypeName) 61 | { 62 | this.sysTypeName = sysTypeName; 63 | } 64 | 65 | public String getTypeName() 66 | { 67 | return typeName; 68 | } 69 | 70 | public void setTypeName(String typeName) 71 | { 72 | this.typeName = typeName; 73 | } 74 | 75 | public String getTotal() 76 | { 77 | return total; 78 | } 79 | 80 | public void setTotal(String total) 81 | { 82 | this.total = total; 83 | } 84 | 85 | public String getFree() 86 | { 87 | return free; 88 | } 89 | 90 | public void setFree(String free) 91 | { 92 | this.free = free; 93 | } 94 | 95 | public String getUsed() 96 | { 97 | return used; 98 | } 99 | 100 | public void setUsed(String used) 101 | { 102 | this.used = used; 103 | } 104 | 105 | public double getUsage() 106 | { 107 | return usage; 108 | } 109 | 110 | public void setUsage(double usage) 111 | { 112 | this.usage = usage; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /source-system/src/main/java/cn/source/system/service/ISysPostService.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.service; 2 | 3 | import java.util.List; 4 | import cn.source.system.domain.SysPost; 5 | 6 | /** 7 | * 岗位信息 服务层 8 | * 9 | * @author ruoyi 10 | */ 11 | public interface ISysPostService 12 | { 13 | /** 14 | * 查询岗位信息集合 15 | * 16 | * @param post 岗位信息 17 | * @return 岗位列表 18 | */ 19 | public List selectPostList(SysPost post); 20 | 21 | /** 22 | * 查询所有岗位 23 | * 24 | * @return 岗位列表 25 | */ 26 | public List selectPostAll(); 27 | 28 | /** 29 | * 通过岗位ID查询岗位信息 30 | * 31 | * @param postId 岗位ID 32 | * @return 角色对象信息 33 | */ 34 | public SysPost selectPostById(Long postId); 35 | 36 | /** 37 | * 根据用户ID获取岗位选择框列表 38 | * 39 | * @param userId 用户ID 40 | * @return 选中岗位ID列表 41 | */ 42 | public List selectPostListByUserId(Long userId); 43 | 44 | /** 45 | * 校验岗位名称 46 | * 47 | * @param post 岗位信息 48 | * @return 结果 49 | */ 50 | public String checkPostNameUnique(SysPost post); 51 | 52 | /** 53 | * 校验岗位编码 54 | * 55 | * @param post 岗位信息 56 | * @return 结果 57 | */ 58 | public String checkPostCodeUnique(SysPost post); 59 | 60 | /** 61 | * 通过岗位ID查询岗位使用数量 62 | * 63 | * @param postId 岗位ID 64 | * @return 结果 65 | */ 66 | public int countUserPostById(Long postId); 67 | 68 | /** 69 | * 删除岗位信息 70 | * 71 | * @param postId 岗位ID 72 | * @return 结果 73 | */ 74 | public int deletePostById(Long postId); 75 | 76 | /** 77 | * 批量删除岗位信息 78 | * 79 | * @param postIds 需要删除的岗位ID 80 | * @return 结果 81 | * @throws Exception 异常 82 | */ 83 | public int deletePostByIds(Long[] postIds); 84 | 85 | /** 86 | * 新增保存岗位信息 87 | * 88 | * @param post 岗位信息 89 | * @return 结果 90 | */ 91 | public int insertPost(SysPost post); 92 | 93 | /** 94 | * 修改保存岗位信息 95 | * 96 | * @param post 岗位信息 97 | * @return 结果 98 | */ 99 | public int updatePost(SysPost post); 100 | } 101 | -------------------------------------------------------------------------------- /source-cms/src/main/java/cn/source/system/domain/CmsFeedback.java: -------------------------------------------------------------------------------- 1 | package cn.source.system.domain; 2 | 3 | import cn.source.common.annotation.Excel; 4 | import cn.source.common.core.domain.BaseEntity; 5 | import org.apache.commons.lang3.builder.ToStringBuilder; 6 | import org.apache.commons.lang3.builder.ToStringStyle; 7 | 8 | /** 9 | * 意见反馈对象 cms_feedback 10 | * 11 | * @author ruoyi 12 | * @date 2022-03-01 13 | */ 14 | public class CmsFeedback extends BaseEntity 15 | { 16 | private static final long serialVersionUID = 1L; 17 | 18 | /** id */ 19 | private Long id; 20 | 21 | /** 类别 */ 22 | @Excel(name = "类别") 23 | private String feedType; 24 | 25 | /** 标题 */ 26 | @Excel(name = "标题") 27 | private String feedTitle; 28 | 29 | /** 详情 */ 30 | @Excel(name = "详情") 31 | private String feedContent; 32 | 33 | public void setId(Long id) 34 | { 35 | this.id = id; 36 | } 37 | 38 | public Long getId() 39 | { 40 | return id; 41 | } 42 | public void setFeedType(String feedType) 43 | { 44 | this.feedType = feedType; 45 | } 46 | 47 | public String getFeedType() 48 | { 49 | return feedType; 50 | } 51 | public void setFeedTitle(String feedTitle) 52 | { 53 | this.feedTitle = feedTitle; 54 | } 55 | 56 | public String getFeedTitle() 57 | { 58 | return feedTitle; 59 | } 60 | public void setFeedContent(String feedContent) 61 | { 62 | this.feedContent = feedContent; 63 | } 64 | 65 | public String getFeedContent() 66 | { 67 | return feedContent; 68 | } 69 | 70 | @Override 71 | public String toString() { 72 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 73 | .append("id", getId()) 74 | .append("feedType", getFeedType()) 75 | .append("feedTitle", getFeedTitle()) 76 | .append("feedContent", getFeedContent()) 77 | .append("createBy", getCreateBy()) 78 | .append("createTime", getCreateTime()) 79 | .append("updateBy", getUpdateBy()) 80 | .append("updateTime", getUpdateTime()) 81 | .append("remark", getRemark()) 82 | .toString(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/exception/base/BaseException.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.exception.base; 2 | 3 | import cn.source.common.utils.MessageUtils; 4 | import cn.source.common.utils.StringUtils; 5 | 6 | /** 7 | * 基础异常 8 | * 9 | * @author ruoyi 10 | */ 11 | public class BaseException extends RuntimeException 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | /** 16 | * 所属模块 17 | */ 18 | private String module; 19 | 20 | /** 21 | * 错误码 22 | */ 23 | private String code; 24 | 25 | /** 26 | * 错误码对应的参数 27 | */ 28 | private Object[] args; 29 | 30 | /** 31 | * 错误消息 32 | */ 33 | private String defaultMessage; 34 | 35 | public BaseException(String module, String code, Object[] args, String defaultMessage) 36 | { 37 | this.module = module; 38 | this.code = code; 39 | this.args = args; 40 | this.defaultMessage = defaultMessage; 41 | } 42 | 43 | public BaseException(String module, String code, Object[] args) 44 | { 45 | this(module, code, args, null); 46 | } 47 | 48 | public BaseException(String module, String defaultMessage) 49 | { 50 | this(module, null, null, defaultMessage); 51 | } 52 | 53 | public BaseException(String code, Object[] args) 54 | { 55 | this(null, code, args, null); 56 | } 57 | 58 | public BaseException(String defaultMessage) 59 | { 60 | this(null, null, null, defaultMessage); 61 | } 62 | 63 | @Override 64 | public String getMessage() 65 | { 66 | String message = null; 67 | if (!StringUtils.isEmpty(code)) 68 | { 69 | message = MessageUtils.message(code, args); 70 | } 71 | if (message == null) 72 | { 73 | message = defaultMessage; 74 | } 75 | return message; 76 | } 77 | 78 | public String getModule() 79 | { 80 | return module; 81 | } 82 | 83 | public String getCode() 84 | { 85 | return code; 86 | } 87 | 88 | public Object[] getArgs() 89 | { 90 | return args; 91 | } 92 | 93 | public String getDefaultMessage() 94 | { 95 | return defaultMessage; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /source-common/src/main/java/cn/source/common/filter/RepeatedlyRequestWrapper.java: -------------------------------------------------------------------------------- 1 | package cn.source.common.filter; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.ByteArrayInputStream; 5 | import java.io.IOException; 6 | import java.io.InputStreamReader; 7 | import javax.servlet.ReadListener; 8 | import javax.servlet.ServletInputStream; 9 | import javax.servlet.ServletResponse; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletRequestWrapper; 12 | import cn.source.common.utils.http.HttpHelper; 13 | 14 | /** 15 | * 构建可重复读取inputStream的request 16 | * 17 | * @author ruoyi 18 | */ 19 | public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper 20 | { 21 | private final byte[] body; 22 | 23 | public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException 24 | { 25 | super(request); 26 | request.setCharacterEncoding("UTF-8"); 27 | response.setCharacterEncoding("UTF-8"); 28 | 29 | body = HttpHelper.getBodyString(request).getBytes("UTF-8"); 30 | } 31 | 32 | @Override 33 | public BufferedReader getReader() throws IOException 34 | { 35 | return new BufferedReader(new InputStreamReader(getInputStream())); 36 | } 37 | 38 | @Override 39 | public ServletInputStream getInputStream() throws IOException 40 | { 41 | final ByteArrayInputStream bais = new ByteArrayInputStream(body); 42 | return new ServletInputStream() 43 | { 44 | @Override 45 | public int read() throws IOException 46 | { 47 | return bais.read(); 48 | } 49 | 50 | @Override 51 | public int available() throws IOException 52 | { 53 | return body.length; 54 | } 55 | 56 | @Override 57 | public boolean isFinished() 58 | { 59 | return false; 60 | } 61 | 62 | @Override 63 | public boolean isReady() 64 | { 65 | return false; 66 | } 67 | 68 | @Override 69 | public void setReadListener(ReadListener readListener) 70 | { 71 | 72 | } 73 | }; 74 | } 75 | } 76 | --------------------------------------------------------------------------------