├── rainbow-server ├── rainbow-server-admin │ └── src │ │ └── main │ │ ├── resources │ │ ├── static │ │ │ ├── file │ │ │ │ └── rml.txt │ │ │ ├── ruoyi.png │ │ │ ├── favicon.ico │ │ │ ├── img │ │ │ │ ├── blue.png │ │ │ │ ├── pay.png │ │ │ │ ├── user.png │ │ │ │ ├── loading.gif │ │ │ │ ├── locked.png │ │ │ │ ├── profile.jpg │ │ │ │ ├── qr_code.png │ │ │ │ ├── progress.png │ │ │ │ ├── loading-upload.gif │ │ │ │ └── login-background.jpg │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── Simple-Line-Icons.woff2 │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ ├── fontawesome-webfont.woff2 │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── ajax │ │ │ │ └── libs │ │ │ │ │ ├── iCheck │ │ │ │ │ ├── green.png │ │ │ │ │ ├── green@2x.png │ │ │ │ │ └── green-login.png │ │ │ │ │ ├── layer │ │ │ │ │ └── theme │ │ │ │ │ │ ├── default │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ ├── icon-ext.png │ │ │ │ │ │ ├── loading-0.gif │ │ │ │ │ │ ├── loading-1.gif │ │ │ │ │ │ └── loading-2.gif │ │ │ │ │ │ └── moon │ │ │ │ │ │ └── default.png │ │ │ │ │ ├── summernote │ │ │ │ │ └── font │ │ │ │ │ │ ├── summernote.eot │ │ │ │ │ │ ├── summernote.ttf │ │ │ │ │ │ └── summernote.woff │ │ │ │ │ ├── bootstrap-fileinput │ │ │ │ │ ├── loading.gif │ │ │ │ │ └── loading-sm.gif │ │ │ │ │ ├── jquery-ztree │ │ │ │ │ └── 3.5 │ │ │ │ │ │ └── css │ │ │ │ │ │ ├── metro │ │ │ │ │ │ └── img │ │ │ │ │ │ │ ├── metro.gif │ │ │ │ │ │ │ ├── metro.png │ │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ │ └── line_conn.png │ │ │ │ │ │ ├── default │ │ │ │ │ │ └── img │ │ │ │ │ │ │ ├── diy │ │ │ │ │ │ │ ├── 2.png │ │ │ │ │ │ │ ├── 3.png │ │ │ │ │ │ │ ├── 4.png │ │ │ │ │ │ │ ├── 5.png │ │ │ │ │ │ │ ├── 6.png │ │ │ │ │ │ │ ├── 7.png │ │ │ │ │ │ │ ├── 8.png │ │ │ │ │ │ │ ├── 9.png │ │ │ │ │ │ │ ├── 1_open.png │ │ │ │ │ │ │ └── 1_close.png │ │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ │ ├── zTreeStandard.gif │ │ │ │ │ │ │ └── zTreeStandard.png │ │ │ │ │ │ └── simple │ │ │ │ │ │ └── img │ │ │ │ │ │ ├── left_menu.gif │ │ │ │ │ │ ├── left_menu.png │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── zTreeStandard.gif │ │ │ │ │ │ └── zTreeStandard.png │ │ │ │ │ ├── bootstrap-table │ │ │ │ │ ├── extensions │ │ │ │ │ │ └── editable │ │ │ │ │ │ │ ├── clear.png │ │ │ │ │ │ │ └── loading.gif │ │ │ │ │ └── locale │ │ │ │ │ │ ├── bootstrap-table-zh-CN.min.js │ │ │ │ │ │ └── bootstrap-table-zh-CN.js │ │ │ │ │ ├── layui │ │ │ │ │ └── css │ │ │ │ │ │ └── modules │ │ │ │ │ │ └── laydate │ │ │ │ │ │ └── default │ │ │ │ │ │ └── font │ │ │ │ │ │ ├── iconfont.eot │ │ │ │ │ │ ├── iconfont.ttf │ │ │ │ │ │ └── iconfont.woff │ │ │ │ │ ├── validate │ │ │ │ │ └── messages_zh.min.js │ │ │ │ │ ├── jsonview │ │ │ │ │ └── jquery.jsonview.css │ │ │ │ │ └── duallistbox │ │ │ │ │ └── bootstrap-duallistbox.min.css │ │ │ ├── css │ │ │ │ └── patterns │ │ │ │ │ ├── shattered.png │ │ │ │ │ ├── header-profile.png │ │ │ │ │ ├── header-profile-skin-blue.png │ │ │ │ │ └── header-profile-skin-yellow.png │ │ │ └── i18n │ │ │ │ └── messages.properties │ │ ├── templates │ │ │ ├── error │ │ │ │ ├── business.html │ │ │ │ ├── 500.html │ │ │ │ ├── 404.html │ │ │ │ └── unauth.html │ │ │ ├── system │ │ │ │ ├── environment │ │ │ │ │ ├── edit.html │ │ │ │ │ └── add.html │ │ │ │ ├── application │ │ │ │ │ ├── edit.html │ │ │ │ │ └── add.html │ │ │ │ ├── user │ │ │ │ │ └── resetPwd.html │ │ │ │ ├── dict │ │ │ │ │ └── type │ │ │ │ │ │ └── tree.html │ │ │ │ ├── menu │ │ │ │ │ └── tree.html │ │ │ │ └── dept │ │ │ │ │ └── tree.html │ │ │ └── demo │ │ │ │ └── modal │ │ │ │ └── table.html │ │ ├── mybatis │ │ │ └── mybatis-config.xml │ │ ├── banner.txt │ │ └── application-druid.yml │ │ └── java │ │ └── com │ │ └── rainbow │ │ ├── web │ │ ├── netty │ │ │ ├── Constant.java │ │ │ ├── SendConfigType.java │ │ │ ├── ThreadPools.java │ │ │ ├── ConfigCenterStarter.java │ │ │ └── SpringContextUtil.java │ │ └── controller │ │ │ ├── tool │ │ │ ├── SwaggerController.java │ │ │ └── BuildController.java │ │ │ ├── monitor │ │ │ ├── DruidController.java │ │ │ └── ServerController.java │ │ │ ├── demo │ │ │ ├── controller │ │ │ │ ├── DemoIconController.java │ │ │ │ ├── DemoReportController.java │ │ │ │ └── DemoDialogController.java │ │ │ └── domain │ │ │ │ └── GoodsModel.java │ │ │ └── system │ │ │ ├── SysRegisterController.java │ │ │ └── SysIndexController.java │ │ ├── RuoYiServletInitializer.java │ │ └── RuoYiApplication.java ├── images-folder │ ├── env.png │ ├── cells.png │ ├── group.png │ ├── login.png │ └── homepage.png ├── rainbow-server-common │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── rainbow │ │ └── common │ │ ├── enums │ │ ├── BusinessStatus.java │ │ ├── DataSourceType.java │ │ ├── OperatorType.java │ │ ├── OnlineStatus.java │ │ ├── UserStatus.java │ │ └── BusinessType.java │ │ ├── exception │ │ ├── DemoModeException.java │ │ ├── user │ │ │ ├── CaptchaException.java │ │ │ ├── RoleBlockedException.java │ │ │ ├── UserBlockedException.java │ │ │ ├── UserDeleteException.java │ │ │ ├── UserNotExistsException.java │ │ │ ├── UserPasswordNotMatchException.java │ │ │ ├── UserException.java │ │ │ ├── UserPasswordRetryLimitCountException.java │ │ │ └── UserPasswordRetryLimitExceedException.java │ │ ├── file │ │ │ ├── FileException.java │ │ │ ├── FileSizeLimitExceededException.java │ │ │ └── FileNameLengthLimitExceededException.java │ │ ├── BusinessException.java │ │ └── job │ │ │ └── TaskException.java │ │ ├── annotation │ │ ├── Excels.java │ │ ├── RepeatSubmit.java │ │ ├── DataScope.java │ │ ├── DataSource.java │ │ └── Log.java │ │ ├── constant │ │ ├── PermissionConstants.java │ │ ├── ScheduleConstants.java │ │ ├── ShiroConstants.java │ │ └── Constants.java │ │ ├── utils │ │ ├── MessageUtils.java │ │ ├── sql │ │ │ └── SqlUtil.java │ │ ├── ExceptionUtil.java │ │ ├── MapDataUtil.java │ │ ├── file │ │ │ └── MimeTypeUtils.java │ │ ├── AddressUtils.java │ │ └── security │ │ │ └── Md5Utils.java │ │ ├── core │ │ ├── page │ │ │ ├── TableSupport.java │ │ │ ├── PageDomain.java │ │ │ └── TableDataInfo.java │ │ └── domain │ │ │ ├── CxSelect.java │ │ │ └── TreeEntity.java │ │ ├── config │ │ ├── ServerConfig.java │ │ └── datasource │ │ │ └── DynamicDataSourceContextHolder.java │ │ └── xss │ │ └── XssHttpServletRequestWrapper.java ├── rainbow-server-framework │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── rainbow │ │ └── framework │ │ ├── config │ │ ├── ApplicationConfig.java │ │ ├── I18nConfig.java │ │ └── FilterConfig.java │ │ ├── web │ │ ├── service │ │ │ ├── ConfigService.java │ │ │ └── DictService.java │ │ └── domain │ │ │ └── server │ │ │ ├── Mem.java │ │ │ └── Sys.java │ │ ├── datasource │ │ └── DynamicDataSource.java │ │ ├── manager │ │ └── AsyncManager.java │ │ ├── shiro │ │ ├── web │ │ │ └── filter │ │ │ │ └── sync │ │ │ │ └── SyncOnlineSessionFilter.java │ │ └── session │ │ │ └── OnlineSessionFactory.java │ │ └── interceptor │ │ └── RepeatSubmitInterceptor.java ├── rainbow-server-system │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── rainbow │ │ │ │ └── system │ │ │ │ ├── service │ │ │ │ ├── ISysLogininforService.java │ │ │ │ ├── ISysOperLogService.java │ │ │ │ ├── ISysNoticeService.java │ │ │ │ ├── ISysDictDataService.java │ │ │ │ ├── IRainbowEnvironmentService.java │ │ │ │ ├── ISysUserOnlineService.java │ │ │ │ ├── IRainbowApplicationService.java │ │ │ │ ├── ISysConfigService.java │ │ │ │ ├── IRainbowGroupsService.java │ │ │ │ ├── IRainbowCellsService.java │ │ │ │ ├── impl │ │ │ │ │ ├── SysLogininforServiceImpl.java │ │ │ │ │ ├── SysOperLogServiceImpl.java │ │ │ │ │ └── SysNoticeServiceImpl.java │ │ │ │ └── ISysPostService.java │ │ │ │ ├── mapper │ │ │ │ ├── SysLogininforMapper.java │ │ │ │ ├── SysRoleDeptMapper.java │ │ │ │ ├── SysUserPostMapper.java │ │ │ │ ├── SysRoleMenuMapper.java │ │ │ │ ├── SysOperLogMapper.java │ │ │ │ ├── SysNoticeMapper.java │ │ │ │ ├── SysUserOnlineMapper.java │ │ │ │ ├── SysConfigMapper.java │ │ │ │ ├── RainbowEnvironmentMapper.java │ │ │ │ ├── RainbowApplicationMapper.java │ │ │ │ ├── SysUserRoleMapper.java │ │ │ │ ├── RainbowGroupsMapper.java │ │ │ │ ├── SysPostMapper.java │ │ │ │ ├── RainbowCellsMapper.java │ │ │ │ ├── SysRoleMapper.java │ │ │ │ └── SysDictTypeMapper.java │ │ │ │ └── domain │ │ │ │ ├── SysRoleDept.java │ │ │ │ ├── SysRoleMenu.java │ │ │ │ ├── SysUserPost.java │ │ │ │ ├── SysUserRole.java │ │ │ │ ├── RainbowEnvironment.java │ │ │ │ └── RainbowApplication.java │ │ │ └── resources │ │ │ └── mapper │ │ │ └── system │ │ │ ├── SysUserPostMapper.xml │ │ │ ├── SysRoleDeptMapper.xml │ │ │ ├── SysRoleMenuMapper.xml │ │ │ └── SysUserRoleMapper.xml │ └── pom.xml └── LICENSE └── rainbow-client └── src ├── main ├── resources │ └── META-INF │ │ └── spring.factories └── java │ └── com │ └── github │ └── rainbow │ ├── annotations │ └── EnableRainbowConfigCenter.java │ ├── Controller │ ├── UpdateEnvSourceTestController.java │ └── Test.java │ ├── property │ ├── SpringValueRegistry.java │ └── SpringValueDefinition.java │ ├── config │ ├── RainbowConstants.java │ ├── RainbowConfig.java │ └── RainbowServerConfig.java │ ├── util │ ├── SpringInjector.java │ └── BeanRegistraUtil.java │ ├── register │ └── RainbowConfigCenterRegister.java │ └── common │ └── RainbowPropertySourcesProcessor.java └── test └── java └── com └── github └── rainbow └── RainbowClientApplicationTests.java /rainbow-server/rainbow-server-admin/src/main/resources/static/file/rml.txt: -------------------------------------------------------------------------------- 1 | 下载临时目录 -------------------------------------------------------------------------------- /rainbow-server/images-folder/env.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/images-folder/env.png -------------------------------------------------------------------------------- /rainbow-server/images-folder/cells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/images-folder/cells.png -------------------------------------------------------------------------------- /rainbow-server/images-folder/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/images-folder/group.png -------------------------------------------------------------------------------- /rainbow-server/images-folder/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/images-folder/login.png -------------------------------------------------------------------------------- /rainbow-server/images-folder/homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/images-folder/homepage.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ruoyi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ruoyi.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/blue.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/pay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/pay.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/user.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/loading.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/locked.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/profile.jpg -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/qr_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/qr_code.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/progress.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/loading-upload.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/loading-upload.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/netty/Constant.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.netty; 2 | 3 | public class Constant { 4 | 5 | public static final String APP_DEFAULT_NAME = "APP"; 6 | 7 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/img/login-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/img/login-background.jpg -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/iCheck/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/iCheck/green.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/css/patterns/shattered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/css/patterns/shattered.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/iCheck/green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/iCheck/green@2x.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/Simple-Line-Icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/Simple-Line-Icons.woff2 -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/iCheck/green-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/iCheck/green-login.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/css/patterns/header-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/css/patterns/header-profile.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/icon.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/moon/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/moon/default.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.eot -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.ttf -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/loading.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/icon-ext.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.woff -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/css/patterns/header-profile-skin-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/css/patterns/header-profile-skin-blue.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/loading-sm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/loading-sm.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-0.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-1.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-2.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/css/patterns/header-profile-skin-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/css/patterns/header-profile-skin-yellow.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/2.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/3.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/4.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/5.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/6.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/7.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/8.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/9.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/loading.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/clear.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/loading.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/line_conn.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/loading.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/loading.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_open.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/line_conn.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_close.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.gif -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.png -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.eot -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.ttf -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigbigzhan/rainbow/HEAD/rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.woff -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/enums/BusinessStatus.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.enums; 2 | 3 | /** 4 | * 操作状态 5 | * 6 | * 7 | */ 8 | public enum BusinessStatus 9 | { 10 | /** 11 | * 成功 12 | */ 13 | SUCCESS, 14 | 15 | /** 16 | * 失败 17 | */ 18 | FAIL, 19 | } 20 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/enums/DataSourceType.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.enums; 2 | 3 | /** 4 | * 数据源 5 | * 6 | * 7 | */ 8 | public enum DataSourceType 9 | { 10 | /** 11 | * 主库 12 | */ 13 | MASTER, 14 | 15 | /** 16 | * 从库 17 | */ 18 | SLAVE 19 | } 20 | -------------------------------------------------------------------------------- /rainbow-client/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.context.ApplicationContextInitializer=com.github.rainbow.initialization.ClientConfigPropertisInitialization,com.github.rainbow.initialization.RainbowEnvConfigApplicationInitializer 2 | 3 | org.springframework.boot.env.EnvironmentPostProcessor=com.github.rainbow.initialization.RainbowEnvConfigApplicationInitializer 4 | -------------------------------------------------------------------------------- /rainbow-client/src/test/java/com/github/rainbow/RainbowClientApplicationTests.java: -------------------------------------------------------------------------------- 1 | //package com.github.rainbow; 2 | // 3 | //import org.junit.jupiter.api.Test; 4 | //import org.springframework.boot.test.context.SpringBootTest; 5 | // 6 | //@SpringBootTest 7 | //class RainbowClientApplicationTests { 8 | // 9 | // @Test 10 | // void contextLoads() { 11 | // } 12 | // 13 | //} 14 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/DemoModeException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception; 2 | 3 | /** 4 | * 演示模式异常 5 | * 6 | * 7 | */ 8 | public class DemoModeException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public DemoModeException() 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/enums/OperatorType.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.enums; 2 | 3 | /** 4 | * 操作人类别 5 | * 6 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/user/CaptchaException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.user; 2 | 3 | /** 4 | * 验证码错误异常类 5 | * 6 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/user/RoleBlockedException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.user; 2 | 3 | /** 4 | * 角色锁定异常类 5 | * 6 | * 7 | */ 8 | public class RoleBlockedException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public RoleBlockedException() 13 | { 14 | super("role.blocked", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/user/UserBlockedException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.user; 2 | 3 | /** 4 | * 用户锁定异常类 5 | * 6 | * 7 | */ 8 | public class UserBlockedException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserBlockedException() 13 | { 14 | super("user.blocked", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/user/UserDeleteException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.user; 2 | 3 | /** 4 | * 用户账号已被删除 5 | * 6 | * 7 | */ 8 | public class UserDeleteException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserDeleteException() 13 | { 14 | super("user.password.delete", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/user/UserNotExistsException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.user; 2 | 3 | /** 4 | * 用户不存在异常类 5 | * 6 | * 7 | */ 8 | public class UserNotExistsException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserNotExistsException() 13 | { 14 | super("user.not.exists", null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/user/UserPasswordNotMatchException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.user; 2 | 3 | /** 4 | * 用户密码不正确或不符合规范异常类 5 | * 6 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/annotation/Excels.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | * 12 | */ 13 | @Target(ElementType.FIELD) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface Excels 16 | { 17 | Excel[] value(); 18 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/enums/OnlineStatus.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.enums; 2 | 3 | /** 4 | * 用户会话 5 | * 6 | * 7 | */ 8 | public enum OnlineStatus 9 | { 10 | /** 用户状态 */ 11 | on_line("在线"), off_line("离线"); 12 | 13 | private final String info; 14 | 15 | private OnlineStatus(String info) 16 | { 17 | this.info = info; 18 | } 19 | 20 | public String getInfo() 21 | { 22 | return info; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/user/UserException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.user; 2 | 3 | import com.rainbow.common.exception.base.BaseException; 4 | 5 | /** 6 | * 用户信息异常类 7 | * 8 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/file/FileException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.file; 2 | 3 | import com.rainbow.common.exception.base.BaseException; 4 | 5 | /** 6 | * 文件信息异常类 7 | * 8 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/file/FileSizeLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.file; 2 | 3 | /** 4 | * 文件名大小限制异常类 5 | * 6 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/user/UserPasswordRetryLimitCountException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.user; 2 | 3 | /** 4 | * 用户错误记数异常类 5 | * 6 | * 7 | */ 8 | public class UserPasswordRetryLimitCountException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserPasswordRetryLimitCountException(int retryLimitCount) 13 | { 14 | super("user.password.retry.limit.count", new Object[] { retryLimitCount }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/user/UserPasswordRetryLimitExceedException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.user; 2 | 3 | /** 4 | * 用户错误最大次数异常类 5 | * 6 | * 7 | */ 8 | public class UserPasswordRetryLimitExceedException extends UserException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserPasswordRetryLimitExceedException(int retryLimitCount) 13 | { 14 | super("user.password.retry.limit.exceed", new Object[] { retryLimitCount }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/annotation/RepeatSubmit.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | * 13 | * 14 | */ 15 | @Target(ElementType.METHOD) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Documented 18 | public @interface RepeatSubmit 19 | { 20 | 21 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/file/FileNameLengthLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.file; 2 | 3 | /** 4 | * 文件名称超长限制异常类 5 | * 6 | * 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 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/annotations/EnableRainbowConfigCenter.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.annotations; 2 | 3 | import com.github.rainbow.register.RainbowConfigCenterRegister; 4 | import org.springframework.context.annotation.Import; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * @author Gz. 10 | * @description: 11 | * @date 2020-06-28 23:29:13 12 | */ 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Target(ElementType.TYPE) 15 | @Documented 16 | @Import(RainbowConfigCenterRegister.class) 17 | public @interface EnableRainbowConfigCenter { 18 | } 19 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/RuoYiServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.rainbow; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * web容器中进行部署 8 | * 9 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/config/ApplicationConfig.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.config; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 6 | 7 | /** 8 | * 程序注解配置 9 | * 10 | * 11 | */ 12 | @Configuration 13 | // 表示通过aop框架暴露该代理对象,AopContext能够访问 14 | @EnableAspectJAutoProxy(exposeProxy = true) 15 | // 指定要扫描的Mapper类的包的路径 16 | @MapperScan("com.rainbow.**.mapper") 17 | public class ApplicationConfig 18 | { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/Controller/UpdateEnvSourceTestController.java: -------------------------------------------------------------------------------- 1 | //package com.github.rainbow.Controller; 2 | // 3 | //import org.springframework.beans.factory.annotation.Autowired; 4 | //import org.springframework.web.bind.annotation.GetMapping; 5 | //import org.springframework.web.bind.annotation.RestController; 6 | // 7 | //@RestController 8 | //public class UpdateEnvSourceTestController { 9 | // 10 | // @Autowired 11 | // TestUtil testUtil; 12 | // 13 | // @GetMapping("/update") 14 | // public String update(){ 15 | // testUtil.updateConfigurableEnvSource(); 16 | // return "ok"; 17 | // } 18 | //} 19 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/enums/UserStatus.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.enums; 2 | 3 | /** 4 | * 用户状态 5 | * 6 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/netty/SendConfigType.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.netty; 2 | 3 | 4 | 5 | /** 6 | * 配置推送类型 7 | */ 8 | public enum SendConfigType { 9 | 10 | /** 配置推送类型 */ 11 | SCHEDULED(0,"定时推送配置"), 12 | EDIT(1,"配置有修改时推送"), 13 | INITIATIVE(2,"客户端主动获取配置"); 14 | 15 | private int val; 16 | private String des; 17 | 18 | SendConfigType() { 19 | } 20 | 21 | SendConfigType(int val, String des) { 22 | this.val = val; 23 | this.des = des; 24 | } 25 | 26 | public int getVal() { 27 | return val; 28 | } 29 | 30 | public String getDes() { 31 | return des; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/netty/ThreadPools.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.netty; 2 | 3 | import com.google.common.util.concurrent.ThreadFactoryBuilder; 4 | 5 | import java.util.concurrent.*; 6 | 7 | /** 8 | * 线程池 9 | * @author xlizy 10 | * @date 2018/5/11 11 | */ 12 | public class ThreadPools { 13 | 14 | public static final ThreadFactory threadFactory = new ThreadFactoryBuilder() 15 | .setNameFormat("publicUsePool-%d").build(); 16 | 17 | public static ExecutorService publicUsePool = new ThreadPoolExecutor(8, 16, 18 | 1L, TimeUnit.SECONDS, 19 | new LinkedBlockingQueue<>(), threadFactory); 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/property/SpringValueRegistry.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.property; 2 | 3 | import com.google.common.collect.LinkedListMultimap; 4 | import com.google.common.collect.Multimap; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * @author Gz. 10 | * @description: 11 | * @date 2020-06-27 15:18:35 12 | */ 13 | public class SpringValueRegistry { 14 | 15 | private Multimap registry = LinkedListMultimap.create(); 16 | 17 | public void register(String key,SpringValue springValue){ 18 | registry.put(key,springValue); 19 | } 20 | 21 | public Collection get(String key){ 22 | return registry.get(key); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/annotation/DataScope.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/BusinessException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception; 2 | 3 | /** 4 | * 业务异常 5 | * 6 | * 7 | */ 8 | public class BusinessException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | protected final String message; 13 | 14 | public BusinessException(String message) 15 | { 16 | this.message = message; 17 | } 18 | 19 | public BusinessException(String message, Throwable e) 20 | { 21 | super(message, e); 22 | this.message = message; 23 | } 24 | 25 | @Override 26 | public String getMessage() 27 | { 28 | return message; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/error/business.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RuoYi - 403 7 | 8 | 9 | 10 | 11 | 12 |
13 |

操作异常!

14 | 15 |
16 | [[${errorMessage}]] 17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/mybatis/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/constant/PermissionConstants.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.constant; 2 | 3 | /** 4 | * 权限通用常量 5 | * 6 | * 7 | */ 8 | public class PermissionConstants 9 | { 10 | /** 新增权限 */ 11 | public static final String ADD_PERMISSION = "add"; 12 | 13 | /** 修改权限 */ 14 | public static final String EDIT_PERMISSION = "edit"; 15 | 16 | /** 删除权限 */ 17 | public static final String REMOVE_PERMISSION = "remove"; 18 | 19 | /** 导出权限 */ 20 | public static final String EXPORT_PERMISSION = "export"; 21 | 22 | /** 显示权限 */ 23 | public static final String VIEW_PERMISSION = "view"; 24 | 25 | /** 查询权限 */ 26 | public static final String LIST_PERMISSION = "list"; 27 | } 28 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/config/RainbowConstants.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.config; 2 | 3 | public interface RainbowConstants { 4 | 5 | String RAINBOW_CONFIG_PROPERTIES_NAME = "rainbowConfigPropertiesName"; 6 | 7 | String RAINBOW_ADDRESS = "rainbow.address"; 8 | 9 | String RAINBOW_ENV = "rainbow.env"; 10 | 11 | String RAINBOW_APPNAME = "rainbow.appName"; 12 | 13 | String RAINBOW_GROUPSNAME = "rainbow.groupsName"; 14 | 15 | String RAINBOW_CONFIG_LOCAL_PATH = "rainbow.config.local.path"; 16 | 17 | String RAINBOW_SERVER_APP = "app"; 18 | 19 | String RAINBOW_SERVER_ENV = "env"; 20 | 21 | String RAINBOW_SERVER_ROUPSNAME = "groupsName"; 22 | 23 | String RAINBOW_CONFIG_PROPERTIES_CACHE = "rainbow_config_properties_cache"; 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js: -------------------------------------------------------------------------------- 1 | (function($){$.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(pageNumber){return pageNumber+" 条记录每页"},formatShowingRows:function(pageFrom,pageTo,totalRows){return"第 "+pageFrom+" 到 "+pageTo+" 条,共 "+totalRows+" 条记录。"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"},formatExport:function(){return"导出数据"},formatClearFilters:function(){return"清空过滤"}};$.extend($.fn.bootstrapTable.defaults,$.fn.bootstrapTable.locales["zh-CN"])})(jQuery); -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/web/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.web.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.rainbow.system.service.ISysConfigService; 6 | 7 | /** 8 | * 首创 html调用 thymeleaf 实现参数管理 9 | * 10 | * @author 11 | */ 12 | @Service("config") 13 | public class ConfigService 14 | { 15 | @Autowired 16 | private ISysConfigService configService; 17 | 18 | /** 19 | * 根据键名查询参数配置信息 20 | * 21 | * @param configKey 参数键名 22 | * @return 参数键值 23 | */ 24 | public String getKey(String configKey) 25 | { 26 | return configService.selectConfigByKey(configKey); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/Controller/Test.java: -------------------------------------------------------------------------------- 1 | //package com.github.rainbow.Controller; 2 | // 3 | //import org.springframework.beans.factory.annotation.Autowired; 4 | //import org.springframework.beans.factory.annotation.Value; 5 | //import org.springframework.core.env.Environment; 6 | //import org.springframework.web.bind.annotation.GetMapping; 7 | //import org.springframework.web.bind.annotation.RestController; 8 | // 9 | //@RestController 10 | //public class Test { 11 | // 12 | // @Autowired 13 | // private Environment environment; 14 | // @Value("${config.username:gz}") 15 | // private String name; 16 | // 17 | // 18 | // @GetMapping("/test") 19 | // public String test(){ 20 | // return environment.getProperty("config.username") + name; 21 | // } 22 | //} 23 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/tool/SwaggerController.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.tool; 2 | 3 | import org.apache.shiro.authz.annotation.RequiresPermissions; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import com.rainbow.common.core.controller.BaseController; 8 | 9 | /** 10 | * swagger 接口 11 | * 12 | * 13 | */ 14 | @Controller 15 | @RequestMapping("/tool/swagger") 16 | public class SwaggerController extends BaseController 17 | { 18 | @RequiresPermissions("tool:swagger:view") 19 | @GetMapping() 20 | public String index() 21 | { 22 | return redirect("/swagger-ui.html"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/utils/MessageUtils.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.utils; 2 | 3 | import com.rainbow.common.utils.spring.SpringUtils; 4 | import org.springframework.context.MessageSource; 5 | import org.springframework.context.i18n.LocaleContextHolder; 6 | 7 | /** 8 | * 获取i18n资源文件 9 | * 10 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/tool/BuildController.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.tool; 2 | 3 | import org.apache.shiro.authz.annotation.RequiresPermissions; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import com.rainbow.common.core.controller.BaseController; 8 | 9 | /** 10 | * build 表单构建 11 | * 12 | * 13 | */ 14 | @Controller 15 | @RequestMapping("/tool/build") 16 | public class BuildController extends BaseController 17 | { 18 | private String prefix = "tool/build"; 19 | 20 | @RequiresPermissions("tool:build:view") 21 | @GetMapping() 22 | public String build() 23 | { 24 | return prefix + "/build"; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/enums/BusinessType.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.enums; 2 | 3 | /** 4 | * 业务操作类型 5 | * 6 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/monitor/DruidController.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.monitor; 2 | 3 | import org.apache.shiro.authz.annotation.RequiresPermissions; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import com.rainbow.common.core.controller.BaseController; 8 | 9 | /** 10 | * druid 监控 11 | * 12 | * 13 | */ 14 | @Controller 15 | @RequestMapping("/monitor/data") 16 | public class DruidController extends BaseController 17 | { 18 | private String prefix = "/druid"; 19 | 20 | @RequiresPermissions("monitor:data:view") 21 | @GetMapping() 22 | public String index() 23 | { 24 | return redirect(prefix + "/index"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/annotation/DataSource.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | import com.rainbow.common.enums.DataSourceType; 11 | 12 | /** 13 | * 自定义多数据源切换注解 14 | * 15 | * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准 16 | * 17 | * 18 | */ 19 | @Target({ ElementType.METHOD, ElementType.TYPE }) 20 | @Retention(RetentionPolicy.RUNTIME) 21 | @Documented 22 | @Inherited 23 | public @interface DataSource 24 | { 25 | /** 26 | * 切换数据源名称 27 | */ 28 | public DataSourceType value() default DataSourceType.MASTER; 29 | } 30 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/exception/job/TaskException.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.exception.job; 2 | 3 | /** 4 | * 计划策略异常 5 | * 6 | * 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 | } -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/property/SpringValueDefinition.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.property; 2 | 3 | /** 4 | * @author Gz. 5 | * @description: SpringValueDefinition 6 | * @date 2020-06-27 16:17:46 7 | */ 8 | public class SpringValueDefinition { 9 | 10 | private final String key; 11 | 12 | private final String placeholder; 13 | 14 | private final String propertyName; 15 | 16 | 17 | public SpringValueDefinition(String key, String placeholder, String propertyName) { 18 | this.key = key; 19 | this.placeholder = placeholder; 20 | this.propertyName = propertyName; 21 | } 22 | 23 | public String getKey() { 24 | return key; 25 | } 26 | 27 | public String getPlaceholder() { 28 | return placeholder; 29 | } 30 | 31 | public String getPropertyName() { 32 | return propertyName; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/utils/sql/SqlUtil.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.utils.sql; 2 | 3 | import com.rainbow.common.utils.StringUtils; 4 | 5 | /** 6 | * sql操作工具类 7 | * 8 | * 9 | */ 10 | public class SqlUtil 11 | { 12 | /** 13 | * 仅支持字母、数字、下划线、空格、逗号(支持多个字段排序) 14 | */ 15 | public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,]+"; 16 | 17 | /** 18 | * 检查字符,防止注入绕过 19 | */ 20 | public static String escapeOrderBySql(String value) 21 | { 22 | if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) 23 | { 24 | return StringUtils.EMPTY; 25 | } 26 | return value; 27 | } 28 | 29 | /** 30 | * 验证 order by 语法是否符合规范 31 | */ 32 | public static boolean isValidOrderBySql(String value) 33 | { 34 | return value.matches(SQL_PATTERN); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/demo/controller/DemoIconController.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.demo.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | /** 8 | * 图标相关 9 | * 10 | * 11 | */ 12 | @Controller 13 | @RequestMapping("/demo/icon") 14 | public class DemoIconController 15 | { 16 | private String prefix = "demo/icon"; 17 | 18 | /** 19 | * FontAwesome图标 20 | */ 21 | @GetMapping("/fontawesome") 22 | public String fontAwesome() 23 | { 24 | return prefix + "/fontawesome"; 25 | } 26 | 27 | /** 28 | * Glyphicons图标 29 | */ 30 | @GetMapping("/glyphicons") 31 | public String glyphicons() 32 | { 33 | return prefix + "/glyphicons"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/netty/ConfigCenterStarter.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.netty; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | import javax.annotation.PostConstruct; 7 | import javax.annotation.PreDestroy; 8 | 9 | /** 10 | * 配置中心TCP服务启动类 11 | * @author xlizy 12 | * @date 2018/5/28 13 | */ 14 | @Component 15 | public class ConfigCenterStarter { 16 | 17 | @Value("${rainbow.server.netty-port}") 18 | int port; 19 | 20 | @PostConstruct 21 | public void start(){ 22 | new NettyServer(port); 23 | } 24 | 25 | @PreDestroy 26 | public void destroy(){ 27 | NettyServer.allServerSocketChannel.keySet().forEach(k -> { 28 | NettyServer.allServerSocketChannel.get(k).forEach(c -> { 29 | c.close(); 30 | }); 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/datasource/DynamicDataSource.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.datasource; 2 | 3 | import java.util.Map; 4 | import javax.sql.DataSource; 5 | import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; 6 | import com.rainbow.common.config.datasource.DynamicDataSourceContextHolder; 7 | 8 | /** 9 | * 动态数据源 10 | * 11 | * 12 | */ 13 | public class DynamicDataSource extends AbstractRoutingDataSource 14 | { 15 | public DynamicDataSource(DataSource defaultTargetDataSource, Map targetDataSources) 16 | { 17 | super.setDefaultTargetDataSource(defaultTargetDataSource); 18 | super.setTargetDataSources(targetDataSources); 19 | super.afterPropertiesSet(); 20 | } 21 | 22 | @Override 23 | protected Object determineCurrentLookupKey() 24 | { 25 | return DynamicDataSourceContextHolder.getDataSourceType(); 26 | } 27 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/ISysLogininforService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysLogininfor; 5 | 6 | /** 7 | * 系统访问日志情况信息 服务层 8 | * 9 | * 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 ids 需要删除的数据 32 | * @return 33 | */ 34 | public int deleteLogininforByIds(String ids); 35 | 36 | /** 37 | * 清空系统登录日志 38 | */ 39 | public void cleanLogininfor(); 40 | } 41 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/core/page/TableSupport.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.core.page; 2 | 3 | import com.rainbow.common.constant.Constants; 4 | import com.rainbow.common.utils.ServletUtils; 5 | 6 | /** 7 | * 表格数据处理 8 | * 9 | * 10 | */ 11 | public class TableSupport 12 | { 13 | /** 14 | * 封装分页对象 15 | */ 16 | public static PageDomain getPageDomain() 17 | { 18 | PageDomain pageDomain = new PageDomain(); 19 | pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM)); 20 | pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE)); 21 | pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN)); 22 | pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC)); 23 | return pageDomain; 24 | } 25 | 26 | public static PageDomain buildPageRequest() 27 | { 28 | return getPageDomain(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysLogininforMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysLogininfor; 5 | 6 | /** 7 | * 系统访问日志情况信息 数据层 8 | * 9 | * 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 ids 需要删除的数据 32 | * @return 结果 33 | */ 34 | public int deleteLogininforByIds(String[] ids); 35 | 36 | /** 37 | * 清空系统登录日志 38 | * 39 | * @return 结果 40 | */ 41 | public int cleanLogininfor(); 42 | } 43 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/config/ServerConfig.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.config; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import org.springframework.stereotype.Component; 5 | import com.rainbow.common.utils.ServletUtils; 6 | 7 | /** 8 | * 服务相关配置 9 | * 10 | * 11 | * 12 | */ 13 | @Component 14 | public class ServerConfig 15 | { 16 | /** 17 | * 获取完整的请求路径,包括:域名,端口,上下文访问路径 18 | * 19 | * @return 服务地址 20 | */ 21 | public String getUrl() 22 | { 23 | HttpServletRequest request = ServletUtils.getRequest(); 24 | return getDomain(request); 25 | } 26 | 27 | public static String getDomain(HttpServletRequest request) 28 | { 29 | StringBuffer url = request.getRequestURL(); 30 | String contextPath = request.getServletContext().getContextPath(); 31 | return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | com.github.bigbigzhan 7 | rainbow-server 8 | ${rainbow.version} 9 | 10 | 4.0.0 11 | 12 | rainbow-server-system 13 | 14 | 15 | system系统模块 16 | 17 | 18 | 19 | 20 | 21 | 22 | com.github.bigbigzhan 23 | rainbow-server-common 24 | ${rainbow.version} 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysRoleDeptMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.domain.SysRoleDept; 6 | 7 | /** 8 | * 角色与部门关联表 数据层 9 | * 10 | * 11 | */ 12 | public interface SysRoleDeptMapper 13 | { 14 | /** 15 | * 通过角色ID删除角色和部门关联 16 | * 17 | * @param roleId 角色ID 18 | * @return 结果 19 | */ 20 | public int deleteRoleDeptByRoleId(Long roleId); 21 | 22 | /** 23 | * 批量删除角色部门关联信息 24 | * 25 | * @param ids 需要删除的数据ID 26 | * @return 结果 27 | */ 28 | public int deleteRoleDept(Long[] ids); 29 | 30 | /** 31 | * 查询部门使用数量 32 | * 33 | * @param deptId 部门ID 34 | * @return 结果 35 | */ 36 | public int selectCountRoleDeptByDeptId(Long deptId); 37 | 38 | /** 39 | * 批量新增角色部门信息 40 | * 41 | * @param roleDeptList 角色部门列表 42 | * @return 结果 43 | */ 44 | public int batchRoleDept(List roleDeptList); 45 | } 46 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysUserPostMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.domain.SysUserPost; 6 | 7 | /** 8 | * 用户与岗位关联表 数据层 9 | * 10 | * 11 | */ 12 | public interface SysUserPostMapper 13 | { 14 | /** 15 | * 通过用户ID删除用户和岗位关联 16 | * 17 | * @param userId 用户ID 18 | * @return 结果 19 | */ 20 | public int deleteUserPostByUserId(Long userId); 21 | 22 | /** 23 | * 通过岗位ID查询岗位使用数量 24 | * 25 | * @param postId 岗位ID 26 | * @return 结果 27 | */ 28 | public int countUserPostById(Long postId); 29 | 30 | /** 31 | * 批量删除用户和岗位关联 32 | * 33 | * @param ids 需要删除的数据ID 34 | * @return 结果 35 | */ 36 | public int deleteUserPost(Long[] ids); 37 | 38 | /** 39 | * 批量新增用户岗位信息 40 | * 41 | * @param userPostList 用户角色列表 42 | * @return 结果 43 | */ 44 | public int batchUserPost(List userPostList); 45 | } 46 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysRoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysRoleMenu; 5 | 6 | /** 7 | * 角色与菜单关联表 数据层 8 | * 9 | * 10 | */ 11 | public interface SysRoleMenuMapper 12 | { 13 | /** 14 | * 通过角色ID删除角色和菜单关联 15 | * 16 | * @param roleId 角色ID 17 | * @return 结果 18 | */ 19 | public int deleteRoleMenuByRoleId(Long roleId); 20 | 21 | /** 22 | * 批量删除角色菜单关联信息 23 | * 24 | * @param ids 需要删除的数据ID 25 | * @return 结果 26 | */ 27 | public int deleteRoleMenu(Long[] ids); 28 | 29 | /** 30 | * 查询菜单使用数量 31 | * 32 | * @param menuId 菜单ID 33 | * @return 结果 34 | */ 35 | public int selectCountRoleMenuByMenuId(Long menuId); 36 | 37 | /** 38 | * 批量新增角色菜单信息 39 | * 40 | * @param roleMenuList 角色菜单列表 41 | * @return 结果 42 | */ 43 | public int batchRoleMenu(List roleMenuList); 44 | } 45 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/error/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RuoYi - 500 7 | 8 | 9 | 10 | 11 | 12 |
13 |

500

14 |

内部服务器错误!

15 | 16 |
17 | 服务器遇到意外事件,不允许完成请求。我们抱歉。您可以返回主页面。 18 | 主页 19 |
20 |
21 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/monitor/ServerController.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.monitor; 2 | 3 | import org.apache.shiro.authz.annotation.RequiresPermissions; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.ModelMap; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import com.rainbow.common.core.controller.BaseController; 9 | import com.rainbow.framework.web.domain.Server; 10 | 11 | /** 12 | * 服务器监控 13 | * 14 | * 15 | */ 16 | @Controller 17 | @RequestMapping("/monitor/server") 18 | public class ServerController extends BaseController 19 | { 20 | private String prefix = "monitor/server"; 21 | 22 | @RequiresPermissions("monitor:server:view") 23 | @GetMapping() 24 | public String server(ModelMap mmap) throws Exception 25 | { 26 | Server server = new Server(); 27 | server.copyTo(); 28 | mmap.put("server", server); 29 | return prefix + "/server"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/annotation/Log.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | import com.rainbow.common.enums.BusinessType; 10 | import com.rainbow.common.enums.OperatorType; 11 | 12 | /** 13 | * 自定义操作日志记录注解 14 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RuoYi - 404 7 | 8 | 9 | 10 | 11 | 12 |
13 |

404

14 |

找不到网页!

15 |
16 | 对不起,您正在寻找的页面不存在。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。 17 | 主页 18 |
19 |
20 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/error/unauth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RuoYi - 403 7 | 8 | 9 | 10 | 11 | 12 |
13 |

403

14 |

您没有访问权限!

15 | 16 |
17 | 对不起,您没有访问权限,请不要进行非法操作!您可以返回主页面 18 | 返回主页 19 |
20 |
21 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/ISysOperLogService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysOperLog; 5 | 6 | /** 7 | * 操作日志 服务层 8 | * 9 | * 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 ids 需要删除的数据 32 | * @return 结果 33 | */ 34 | public int deleteOperLogByIds(String ids); 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysOperLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.domain.SysOperLog; 6 | 7 | /** 8 | * 操作日志 数据层 9 | * 10 | * 11 | */ 12 | public interface SysOperLogMapper 13 | { 14 | /** 15 | * 新增操作日志 16 | * 17 | * @param operLog 操作日志对象 18 | */ 19 | public void insertOperlog(SysOperLog operLog); 20 | 21 | /** 22 | * 查询系统操作日志集合 23 | * 24 | * @param operLog 操作日志对象 25 | * @return 操作日志集合 26 | */ 27 | public List selectOperLogList(SysOperLog operLog); 28 | 29 | /** 30 | * 批量删除系统操作日志 31 | * 32 | * @param ids 需要删除的数据 33 | * @return 结果 34 | */ 35 | public int deleteOperLogByIds(String[] ids); 36 | 37 | /** 38 | * 查询操作日志详细 39 | * 40 | * @param operId 操作ID 41 | * @return 操作日志对象 42 | */ 43 | public SysOperLog selectOperLogById(Long operId); 44 | 45 | /** 46 | * 清空操作日志 47 | */ 48 | public void cleanOperLog(); 49 | } 50 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/domain/SysRoleDept.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/domain/SysRoleMenu.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/domain/SysUserPost.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/domain/SysUserRole.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/utils/ExceptionUtil.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 | * 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 getRootErrorMseeage(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 | -------------------------------------------------------------------------------- /rainbow-server/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 RuoYi 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. -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/netty/SpringContextUtil.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.netty; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class SpringContextUtil implements ApplicationContextAware { 10 | 11 | /** Spring应用上下文环境 */ 12 | private static ApplicationContext applicationContext; 13 | 14 | @Override 15 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 16 | SpringContextUtil.applicationContext = applicationContext; 17 | } 18 | 19 | public static ApplicationContext getApplicationContext() { 20 | return applicationContext; 21 | } 22 | 23 | public static T getBean(String name) throws BeansException { 24 | return (T) applicationContext.getBean(name); 25 | } 26 | 27 | public static T getBean(Class cla) throws BeansException { 28 | return (T) applicationContext.getBean(cla); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/ISysNoticeService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysNotice; 5 | 6 | /** 7 | * 公告 服务层 8 | * 9 | * 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 ids 需要删除的数据ID 49 | * @return 结果 50 | */ 51 | public int deleteNoticeByIds(String ids); 52 | } 53 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysNoticeMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.domain.SysNotice; 6 | 7 | /** 8 | * 公告 数据层 9 | * 10 | * 11 | */ 12 | public interface SysNoticeMapper 13 | { 14 | /** 15 | * 查询公告信息 16 | * 17 | * @param noticeId 公告ID 18 | * @return 公告信息 19 | */ 20 | public SysNotice selectNoticeById(Long noticeId); 21 | 22 | /** 23 | * 查询公告列表 24 | * 25 | * @param notice 公告信息 26 | * @return 公告集合 27 | */ 28 | public List selectNoticeList(SysNotice notice); 29 | 30 | /** 31 | * 新增公告 32 | * 33 | * @param notice 公告信息 34 | * @return 结果 35 | */ 36 | public int insertNotice(SysNotice notice); 37 | 38 | /** 39 | * 修改公告 40 | * 41 | * @param notice 公告信息 42 | * @return 结果 43 | */ 44 | public int updateNotice(SysNotice notice); 45 | 46 | /** 47 | * 批量删除公告 48 | * 49 | * @param noticeIds 需要删除的数据ID 50 | * @return 结果 51 | */ 52 | public int deleteNoticeByIds(String[] noticeIds); 53 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/config/datasource/DynamicDataSourceContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.config.datasource; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | /** 7 | * 数据源切换处理 8 | * 9 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/xss/XssHttpServletRequestWrapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.xss; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletRequestWrapper; 5 | import com.rainbow.common.utils.html.EscapeUtil; 6 | 7 | /** 8 | * XSS过滤处理 9 | * 10 | * 11 | */ 12 | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper 13 | { 14 | /** 15 | * @param request 16 | */ 17 | public XssHttpServletRequestWrapper(HttpServletRequest request) 18 | { 19 | super(request); 20 | } 21 | 22 | @Override 23 | public String[] getParameterValues(String name) 24 | { 25 | String[] values = super.getParameterValues(name); 26 | if (values != null) 27 | { 28 | int length = values.length; 29 | String[] escapseValues = new String[length]; 30 | for (int i = 0; i < length; i++) 31 | { 32 | // 防xss攻击和过滤前后空格 33 | escapseValues[i] = EscapeUtil.clean(values[i]).trim(); 34 | } 35 | return escapseValues; 36 | } 37 | return super.getParameterValues(name); 38 | } 39 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/constant/ScheduleConstants.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.constant; 2 | 3 | /** 4 | * 任务调度通用常量 5 | * 6 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/demo/controller/DemoReportController.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.demo.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | /** 8 | * 报表 9 | * 10 | * 11 | */ 12 | @Controller 13 | @RequestMapping("/demo/report") 14 | public class DemoReportController 15 | { 16 | private String prefix = "demo/report"; 17 | 18 | /** 19 | * 百度ECharts 20 | */ 21 | @GetMapping("/echarts") 22 | public String echarts() 23 | { 24 | return prefix + "/echarts"; 25 | } 26 | 27 | /** 28 | * 图表插件 29 | */ 30 | @GetMapping("/peity") 31 | public String peity() 32 | { 33 | return prefix + "/peity"; 34 | } 35 | 36 | /** 37 | * 线状图插件 38 | */ 39 | @GetMapping("/sparkline") 40 | public String sparkline() 41 | { 42 | return prefix + "/sparkline"; 43 | } 44 | 45 | /** 46 | * 图表组合 47 | */ 48 | @GetMapping("/metrics") 49 | public String metrics() 50 | { 51 | return prefix + "/metrics"; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysUserOnlineMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.domain.SysUserOnline; 6 | 7 | /** 8 | * 在线用户 数据层 9 | * 10 | * 11 | */ 12 | public interface SysUserOnlineMapper 13 | { 14 | /** 15 | * 通过会话序号查询信息 16 | * 17 | * @param sessionId 会话ID 18 | * @return 在线用户信息 19 | */ 20 | public SysUserOnline selectOnlineById(String sessionId); 21 | 22 | /** 23 | * 通过会话序号删除信息 24 | * 25 | * @param sessionId 会话ID 26 | * @return 在线用户信息 27 | */ 28 | public int deleteOnlineById(String sessionId); 29 | 30 | /** 31 | * 保存会话信息 32 | * 33 | * @param online 会话信息 34 | * @return 结果 35 | */ 36 | public int saveOnline(SysUserOnline online); 37 | 38 | /** 39 | * 查询会话集合 40 | * 41 | * @param userOnline 会话参数 42 | * @return 会话集合 43 | */ 44 | public List selectUserOnlineList(SysUserOnline userOnline); 45 | 46 | /** 47 | * 查询过期会话集合 48 | * 49 | * @param lastAccessTime 过期时间 50 | * @return 会话集合 51 | */ 52 | public List selectOnlineByExpired(String lastAccessTime); 53 | } 54 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | #错误消息 2 | not.null=* 必须填写 3 | user.jcaptcha.error=验证码错误 4 | user.not.exists=用户不存在/密码错误 5 | user.password.not.match=用户不存在/密码错误 6 | user.password.retry.limit.count=密码输入错误{0}次 7 | user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟 8 | user.password.delete=对不起,您的账号已被删除 9 | user.blocked=用户已封禁,请联系管理员 10 | role.blocked=角色已封禁,请联系管理员 11 | user.logout.success=退出成功 12 | 13 | length.not.valid=长度必须在{min}到{max}个字符之间 14 | 15 | user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 16 | user.password.not.valid=* 5-50个字符 17 | 18 | user.email.not.valid=邮箱格式错误 19 | user.mobile.phone.number.not.valid=手机号格式错误 20 | user.login.success=登录成功 21 | user.register.success=注册成功 22 | user.notfound=请重新登录 23 | user.forcelogout=管理员强制退出,请重新登录 24 | user.unknown.error=未知错误,请重新登录 25 | 26 | ##文件上传消息 27 | upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! 28 | upload.filename.exceed.length=上传的文件名最长{0}个字符 29 | 30 | ##权限 31 | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] 32 | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] 33 | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] 34 | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] 35 | no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] 36 | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] 37 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/web/domain/server/Mem.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.web.domain.server; 2 | 3 | import com.rainbow.common.utils.Arith; 4 | 5 | /** 6 | * 內存相关信息 7 | * 8 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/core/domain/CxSelect.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.core.domain; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * CxSelect树结构实体类 8 | * 9 | * 10 | */ 11 | public class CxSelect implements Serializable 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | /** 16 | * 数据值字段名称 17 | */ 18 | private String v; 19 | 20 | /** 21 | * 数据标题字段名称 22 | */ 23 | private String n; 24 | 25 | /** 26 | * 子集数据字段名称 27 | */ 28 | private List s; 29 | 30 | public CxSelect() 31 | { 32 | } 33 | 34 | public CxSelect(String v, String n) 35 | { 36 | this.v = v; 37 | this.n = n; 38 | } 39 | 40 | public List getS() 41 | { 42 | return s; 43 | } 44 | 45 | public void setN(String n) 46 | { 47 | this.n = n; 48 | } 49 | 50 | public String getN() 51 | { 52 | return n; 53 | } 54 | 55 | public void setS(List s) 56 | { 57 | this.s = s; 58 | } 59 | 60 | public String getV() 61 | { 62 | return v; 63 | } 64 | 65 | public void setV(String v) 66 | { 67 | this.v = v; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/RuoYiApplication.java: -------------------------------------------------------------------------------- 1 | package com.rainbow; 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 | * 11 | */ 12 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) 13 | public class RuoYiApplication 14 | { 15 | 16 | public static void main(String[] args) 17 | { 18 | // System.setProperty("spring.devtools.restart.enabled", "false"); 19 | SpringApplication.run(RuoYiApplication.class, args); 20 | System.out.println("(♥◠‿◠)ノ゙ 启动成功 ლ(´ڡ`ლ)゙ \n" + 21 | " .-------. ____ __ \n" + 22 | " | _ _ \\ \\ \\ / / \n" + 23 | " | ( ' ) | \\ _. / ' \n" + 24 | " |(_ o _) / _( )_ .' \n" + 25 | " | (_,_).' __ ___(_ o _)' \n" + 26 | " | |\\ \\ | || |(_,_)' \n" + 27 | " | | \\ `' /| `-' / \n" + 28 | " | | \\ / \\ / \n" + 29 | " ''-' `'-' `-..-' "); 30 | } 31 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_role_menu where role_id=#{roleId} 14 | 15 | 16 | 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/validate/messages_zh.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | ! function (a) { 5 | "function" == typeof define && define.amd ? define(["jquery", "jquery.validate.min"], a) : a(jQuery) 6 | }(function (a) { 7 | var icon = " "; 8 | a.extend(a.validator.messages, { 9 | required: icon + "必填", 10 | remote: icon + "请修正此栏位", 11 | email: icon + "请输入有效的电子邮件", 12 | url: icon + "请输入有效的网址", 13 | date: icon + "请输入有效的日期", 14 | dateISO: icon + "请输入有效的日期 (YYYY-MM-DD)", 15 | number: icon + "请输入正确的数字", 16 | digits: icon + "只能输入数字", 17 | creditcard: icon + "请输入有效的信用卡号码", 18 | equalTo: icon + "你的输入不相同", 19 | extension: icon + "请输入有效的后缀", 20 | maxlength: a.validator.format(icon + "最多 {0} 个字"), 21 | minlength: a.validator.format(icon + "最少 {0} 个字"), 22 | rangelength: a.validator.format(icon + "请输入长度为 {0} 至 {1} 之间的字串"), 23 | range: a.validator.format(icon + "请输入 {0} 至 {1} 之间的数值"), 24 | max: a.validator.format(icon + "请输入不大于 {0} 的数值"), 25 | min: a.validator.format(icon + "请输入不小于 {0} 的数值") 26 | }) 27 | }); 28 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/util/SpringInjector.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.util; 2 | 3 | import com.github.rainbow.property.SpringValueRegistry; 4 | import com.google.inject.AbstractModule; 5 | import com.google.inject.Guice; 6 | import com.google.inject.Injector; 7 | import com.google.inject.Singleton; 8 | 9 | public class SpringInjector { 10 | private static volatile Injector s_injector; 11 | private static final Object lock = new Object(); 12 | 13 | private static Injector getInjector() { 14 | if (s_injector == null) { 15 | synchronized (lock) { 16 | if (s_injector == null) { 17 | try { 18 | s_injector = Guice.createInjector(new SpringModule()); 19 | } catch (Throwable ex) { 20 | throw ex; 21 | } 22 | } 23 | } 24 | } 25 | 26 | return s_injector; 27 | } 28 | 29 | public static T getInstance(Class clazz) { 30 | try { 31 | return getInjector().getInstance(clazz); 32 | } catch (Throwable ex) { 33 | throw ex; 34 | } 35 | } 36 | 37 | private static class SpringModule extends AbstractModule { 38 | @Override 39 | protected void configure() { 40 | bind(PlaceholderHelper.class).in(Singleton.class); 41 | bind(SpringValueRegistry.class).in(Singleton.class); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/web/service/DictService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.web.service; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.rainbow.system.domain.SysDictData; 7 | import com.rainbow.system.service.ISysDictDataService; 8 | import com.rainbow.system.service.ISysDictTypeService; 9 | 10 | /** 11 | * 首创 html调用 thymeleaf 实现字典读取 12 | * 13 | * @author 14 | */ 15 | @Service("dict") 16 | public class DictService 17 | { 18 | @Autowired 19 | private ISysDictTypeService dictTypeService; 20 | 21 | @Autowired 22 | private ISysDictDataService dictDataService; 23 | 24 | /** 25 | * 根据字典类型查询字典数据信息 26 | * 27 | * @param dictType 字典类型 28 | * @return 参数键值 29 | */ 30 | public List getType(String dictType) 31 | { 32 | return dictTypeService.selectDictDataByType(dictType); 33 | } 34 | 35 | /** 36 | * 根据字典类型和字典键值查询字典数据信息 37 | * 38 | * @param dictType 字典类型 39 | * @param dictValue 字典键值 40 | * @return 字典标签 41 | */ 42 | public String getLabel(String dictType, String dictValue) 43 | { 44 | return dictDataService.selectDictLabel(dictType, dictValue); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/util/BeanRegistraUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.util; 2 | 3 | 4 | import org.springframework.beans.factory.config.BeanDefinition; 5 | import org.springframework.beans.factory.support.BeanDefinitionBuilder; 6 | import org.springframework.beans.factory.support.BeanDefinitionRegistry; 7 | 8 | import java.util.Objects; 9 | 10 | /** 11 | * @author Gz. 12 | * @description: 13 | * @date 2020-06-27 15:50:46 14 | */ 15 | public class BeanRegistraUtil { 16 | 17 | public static boolean registerBeanDefinitionIfNotExists(BeanDefinitionRegistry registry, String beanName, Class clazz){ 18 | if(registry.containsBeanDefinition(beanName)){ 19 | return false; 20 | } 21 | 22 | String[] beanDefinitionNames = registry.getBeanDefinitionNames(); 23 | 24 | for (String beanDefinitionName : beanDefinitionNames) { 25 | BeanDefinition beanDefinition = registry.getBeanDefinition(beanDefinitionName); 26 | if(Objects.equals(beanDefinition.getBeanClassName(),clazz.getName())){ 27 | return false; 28 | } 29 | } 30 | BeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(clazz).getBeanDefinition(); 31 | registry.registerBeanDefinition(beanName,beanDefinition); 32 | return true; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/manager/AsyncManager.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.manager; 2 | 3 | import java.util.TimerTask; 4 | import java.util.concurrent.ScheduledExecutorService; 5 | import java.util.concurrent.TimeUnit; 6 | import com.rainbow.common.utils.Threads; 7 | import com.rainbow.common.utils.spring.SpringUtils; 8 | 9 | /** 10 | * 异步任务管理器 11 | * 12 | * @author liuhulu 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 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/register/RainbowConfigCenterRegister.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.register; 2 | 3 | import com.github.rainbow.config.RainbowServerConfig; 4 | import com.github.rainbow.config.SpringValueProcessor; 5 | import com.github.rainbow.util.BeanRegistraUtil; 6 | import org.springframework.beans.factory.support.BeanDefinitionRegistry; 7 | import org.springframework.beans.factory.support.BeanNameGenerator; 8 | import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; 9 | import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; 10 | import org.springframework.core.type.AnnotationMetadata; 11 | 12 | /** 13 | * @author Gz. 14 | * @description: 15 | * @date 2020-06-28 23:25:27 16 | */ 17 | public class RainbowConfigCenterRegister implements ImportBeanDefinitionRegistrar { 18 | 19 | @Override 20 | public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry, BeanNameGenerator importBeanNameGenerator) { 21 | BeanRegistraUtil.registerBeanDefinitionIfNotExists(registry, PropertySourcesPlaceholderConfigurer.class.getName(),PropertySourcesPlaceholderConfigurer.class); 22 | 23 | BeanRegistraUtil.registerBeanDefinitionIfNotExists(registry, SpringValueProcessor.class.getName(),SpringValueProcessor.class); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/core/domain/TreeEntity.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.core.domain; 2 | 3 | /** 4 | * Tree基类 5 | * 6 | * 7 | */ 8 | public class TreeEntity extends BaseEntity 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | /** 父菜单名称 */ 13 | private String parentName; 14 | 15 | /** 父菜单ID */ 16 | private Long parentId; 17 | 18 | /** 显示顺序 */ 19 | private Integer orderNum; 20 | 21 | /** 祖级列表 */ 22 | private String ancestors; 23 | 24 | public String getParentName() 25 | { 26 | return parentName; 27 | } 28 | 29 | public void setParentName(String parentName) 30 | { 31 | this.parentName = parentName; 32 | } 33 | 34 | public Long getParentId() 35 | { 36 | return parentId; 37 | } 38 | 39 | public void setParentId(Long parentId) 40 | { 41 | this.parentId = parentId; 42 | } 43 | 44 | public Integer getOrderNum() 45 | { 46 | return orderNum; 47 | } 48 | 49 | public void setOrderNum(Integer orderNum) 50 | { 51 | this.orderNum = orderNum; 52 | } 53 | 54 | public String getAncestors() 55 | { 56 | return ancestors; 57 | } 58 | 59 | public void setAncestors(String ancestors) 60 | { 61 | this.ancestors = ancestors; 62 | } 63 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysConfigMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.domain.SysConfig; 6 | 7 | /** 8 | * 参数配置 数据层 9 | * 10 | * 11 | */ 12 | public interface SysConfigMapper 13 | { 14 | /** 15 | * 查询参数配置信息 16 | * 17 | * @param config 参数配置信息 18 | * @return 参数配置信息 19 | */ 20 | public SysConfig selectConfig(SysConfig config); 21 | 22 | /** 23 | * 查询参数配置列表 24 | * 25 | * @param config 参数配置信息 26 | * @return 参数配置集合 27 | */ 28 | public List selectConfigList(SysConfig config); 29 | 30 | /** 31 | * 根据键名查询参数配置信息 32 | * 33 | * @param configKey 参数键名 34 | * @return 参数配置信息 35 | */ 36 | public SysConfig checkConfigKeyUnique(String configKey); 37 | 38 | /** 39 | * 新增参数配置 40 | * 41 | * @param config 参数配置信息 42 | * @return 结果 43 | */ 44 | public int insertConfig(SysConfig config); 45 | 46 | /** 47 | * 修改参数配置 48 | * 49 | * @param config 参数配置信息 50 | * @return 结果 51 | */ 52 | public int updateConfig(SysConfig config); 53 | 54 | /** 55 | * 批量删除参数配置 56 | * 57 | * @param configIds 需要删除的数据ID 58 | * @return 结果 59 | */ 60 | public int deleteConfigByIds(String[] configIds); 61 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/system/environment/edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 |
16 |
17 |
18 | 19 | 31 | 32 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/system/application/edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 |
16 |
17 |
18 | 19 | 31 | 32 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/domain/RainbowEnvironment.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | import com.rainbow.common.annotation.Excel; 6 | import com.rainbow.common.core.domain.BaseEntity; 7 | 8 | /** 9 | * 环境信息对象 rainbow_environment 10 | * 11 | * @author Gz 12 | * @date 2020-07-04 13 | */ 14 | public class RainbowEnvironment extends BaseEntity 15 | { 16 | private static final long serialVersionUID = 1L; 17 | 18 | /** 环境名称 */ 19 | private String env; 20 | 21 | /** 环境显示说明 */ 22 | @Excel(name = "环境显示说明") 23 | private String description; 24 | 25 | public void setEnv(String env) 26 | { 27 | this.env = env; 28 | } 29 | 30 | public String getEnv() 31 | { 32 | return env; 33 | } 34 | public void setDescription(String description) 35 | { 36 | this.description = description; 37 | } 38 | 39 | public String getDescription() 40 | { 41 | return description; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 47 | .append("env", getEnv()) 48 | .append("description", getDescription()) 49 | .toString(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/shiro/web/filter/sync/SyncOnlineSessionFilter.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.shiro.web.filter.sync; 2 | 3 | import javax.servlet.ServletRequest; 4 | import javax.servlet.ServletResponse; 5 | import org.apache.shiro.web.filter.PathMatchingFilter; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import com.rainbow.common.constant.ShiroConstants; 8 | import com.rainbow.framework.shiro.session.OnlineSession; 9 | import com.rainbow.framework.shiro.session.OnlineSessionDAO; 10 | 11 | /** 12 | * 同步Session数据到Db 13 | * 14 | * 15 | */ 16 | public class SyncOnlineSessionFilter extends PathMatchingFilter 17 | { 18 | @Autowired 19 | private OnlineSessionDAO onlineSessionDAO; 20 | 21 | /** 22 | * 同步会话数据到DB 一次请求最多同步一次 防止过多处理 需要放到Shiro过滤器之前 23 | */ 24 | @Override 25 | protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception 26 | { 27 | OnlineSession session = (OnlineSession) request.getAttribute(ShiroConstants.ONLINE_SESSION); 28 | // 如果session stop了 也不同步 29 | // session停止时间,如果stopTimestamp不为null,则代表已停止 30 | if (session != null && session.getUserId() != null && session.getStopTimestamp() == null) 31 | { 32 | onlineSessionDAO.syncToDb(session); 33 | } 34 | return true; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | 'use strict'; 3 | 4 | $.fn.bootstrapTable.locales['zh-CN'] = { 5 | formatLoadingMessage: function () { 6 | return '正在努力地加载数据中,请稍候……'; 7 | }, 8 | formatRecordsPerPage: function (pageNumber) { 9 | return pageNumber + ' 条记录每页'; 10 | }, 11 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 12 | return '第 ' + pageFrom + ' 到 ' + pageTo + ' 条,共 ' + totalRows + ' 条记录。'; 13 | }, 14 | formatSearch: function () { 15 | return '搜索'; 16 | }, 17 | formatNoMatches: function () { 18 | return '没有找到匹配的记录'; 19 | }, 20 | formatPaginationSwitch: function () { 21 | return '隐藏/显示分页'; 22 | }, 23 | formatRefresh: function () { 24 | return '刷新'; 25 | }, 26 | formatToggle: function () { 27 | return '切换'; 28 | }, 29 | formatColumns: function () { 30 | return '列'; 31 | }, 32 | formatExport: function () { 33 | return '导出数据'; 34 | }, 35 | formatClearFilters: function () { 36 | return '清空过滤'; 37 | } 38 | }; 39 | 40 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']); 41 | 42 | })(jQuery); 43 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/domain/RainbowApplication.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | import com.rainbow.common.annotation.Excel; 6 | import com.rainbow.common.core.domain.BaseEntity; 7 | 8 | /** 9 | * 应用信息对象 rainbow_application 10 | * 11 | * @author Gz 12 | * @date 2020-07-04 13 | */ 14 | public class RainbowApplication extends BaseEntity 15 | { 16 | private static final long serialVersionUID = 1L; 17 | 18 | /** 应用名称 */ 19 | private String appName; 20 | 21 | /** 应用说明 */ 22 | @Excel(name = "应用说明") 23 | private String description; 24 | 25 | public void setAppName(String appName) 26 | { 27 | this.appName = appName; 28 | } 29 | 30 | public String getAppName() 31 | { 32 | return appName; 33 | } 34 | public void setDescription(String description) 35 | { 36 | this.description = description; 37 | } 38 | 39 | public String getDescription() 40 | { 41 | return description; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 47 | .append("appName", getAppName()) 48 | .append("description", getDescription()) 49 | .toString(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/jsonview/jquery.jsonview.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | .jsonview { 3 | font-family: monospace; 4 | font-size: 1.1em; 5 | white-space: pre-wrap; } 6 | .jsonview .prop { 7 | font-weight: bold; } 8 | .jsonview .null { 9 | color: red; } 10 | .jsonview .bool { 11 | color: blue; } 12 | .jsonview .num { 13 | color: blue; } 14 | .jsonview .string { 15 | color: green; 16 | white-space: pre-wrap; } 17 | .jsonview .string.multiline { 18 | display: inline-block; 19 | vertical-align: text-top; } 20 | .jsonview .collapser { 21 | position: absolute; 22 | left: -1em; 23 | cursor: pointer; } 24 | .jsonview .collapsible { 25 | transition: height 1.2s; 26 | transition: width 1.2s; } 27 | .jsonview .collapsible.collapsed { 28 | height: .8em; 29 | width: 1em; 30 | display: inline-block; 31 | overflow: hidden; 32 | margin: 0; } 33 | .jsonview .collapsible.collapsed:before { 34 | content: "…"; 35 | width: 1em; 36 | margin-left: .2em; } 37 | .jsonview .collapser.collapsed { 38 | transform: rotate(0deg); } 39 | .jsonview .q { 40 | display: inline-block; 41 | width: 0px; 42 | color: transparent; } 43 | .jsonview li { 44 | position: relative; } 45 | .jsonview ul { 46 | list-style: none; 47 | margin: 0 0 0 2em; 48 | padding: 0; } 49 | .jsonview h1 { 50 | font-size: 1.2em; } 51 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/config/I18nConfig.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.config; 2 | 3 | import java.util.Locale; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.LocaleResolver; 7 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 9 | import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; 10 | import org.springframework.web.servlet.i18n.SessionLocaleResolver; 11 | 12 | /** 13 | * 资源文件配置加载 14 | * 15 | * 16 | */ 17 | @Configuration 18 | public class I18nConfig implements WebMvcConfigurer 19 | { 20 | @Bean 21 | public LocaleResolver localeResolver() 22 | { 23 | SessionLocaleResolver slr = new SessionLocaleResolver(); 24 | // 默认语言 25 | slr.setDefaultLocale(Locale.SIMPLIFIED_CHINESE); 26 | return slr; 27 | } 28 | 29 | @Bean 30 | public LocaleChangeInterceptor localeChangeInterceptor() 31 | { 32 | LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); 33 | // 参数名 34 | lci.setParamName("lang"); 35 | return lci; 36 | } 37 | 38 | @Override 39 | public void addInterceptors(InterceptorRegistry registry) 40 | { 41 | registry.addInterceptor(localeChangeInterceptor()); 42 | } 43 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/ISysDictDataService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysDictData; 5 | 6 | /** 7 | * 字典 业务层 8 | * 9 | * 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 ids 需要删除的数据 42 | * @return 结果 43 | */ 44 | public int deleteDictDataByIds(String ids); 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 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/config/RainbowConfig.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | 5 | import java.util.HashSet; 6 | import java.util.Properties; 7 | import java.util.Set; 8 | 9 | /** 10 | * @author Gz. 11 | * @description: 12 | * @date 2020-06-28 22:53:56 13 | */ 14 | public class RainbowConfig { 15 | 16 | //配置信息 17 | private volatile static Properties properties = new Properties(); 18 | 19 | private volatile static Set need_set_null_prop = new HashSet<>(); 20 | 21 | public static Set getNeedSetNullProp() { 22 | Set set = need_set_null_prop; 23 | return set; 24 | } 25 | 26 | 27 | public static Properties getProperties(){ 28 | Properties prop = properties; 29 | return prop; 30 | } 31 | 32 | public static void setProperties(String key,String value){ 33 | properties.setProperty(key, value); 34 | } 35 | 36 | /** 37 | * 此处没有直接调用 而是通过反射调用此方法 38 | * 加载配置文件到Properties中 39 | */ 40 | private static void reloadProperties(Properties props) { 41 | properties.clear(); 42 | for (Object s : props.keySet()) { 43 | properties.put(s, props.get(s)); 44 | } 45 | } 46 | private static void reloadProperties(JSONObject jsonObject) { 47 | jsonObject.keySet().forEach(key->{ 48 | need_set_null_prop.add(key); 49 | properties.put(key,jsonObject.get(key)); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/static/ajax/libs/duallistbox/bootstrap-duallistbox.min.css: -------------------------------------------------------------------------------- 1 | .bootstrap-duallistbox-container .buttons{width:100%;margin-bottom:-1px}.bootstrap-duallistbox-container label{display:block}.bootstrap-duallistbox-container .info{display:inline-block;margin-bottom:5px;font-size:11px}.bootstrap-duallistbox-container .clear1,.bootstrap-duallistbox-container .clear2{display:none;font-size:10px}.bootstrap-duallistbox-container .box1.filtered .clear1,.bootstrap-duallistbox-container .box2.filtered .clear2{display:inline-block}.bootstrap-duallistbox-container .move,.bootstrap-duallistbox-container .remove{width:60%}.bootstrap-duallistbox-container .btn-group .btn{border-bottom-left-radius:0;border-bottom-right-radius:0}.bootstrap-duallistbox-container select{border-top-left-radius:0;border-top-right-radius:0}.bootstrap-duallistbox-container .moveall,.bootstrap-duallistbox-container .removeall{width:40%}.bootstrap-duallistbox-container.bs2compatible .btn-group>.btn+.btn{margin-left:0}.bootstrap-duallistbox-container select{width:100%;height:300px;padding:0}.bootstrap-duallistbox-container .filter{display:inline-block;width:100%;height:31px;margin:0 0 5px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-duallistbox-container .filter.placeholder{color:#aaa}.bootstrap-duallistbox-container.moveonselect .move,.bootstrap-duallistbox-container.moveonselect .remove{display:none}.bootstrap-duallistbox-container.moveonselect .moveall,.bootstrap-duallistbox-container.moveonselect .removeall{width:100%} -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/system/environment/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 | 11 |
12 | 13 |
14 |
15 |
16 | 17 |
18 | 19 |
20 |
21 |
22 |
23 | 24 | 36 | 37 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/system/application/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 | 11 |
12 | 13 |
14 |
15 |
16 | 17 |
18 | 19 |
20 |
21 |
22 |
23 | 24 | 36 | 37 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/RainbowEnvironmentMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.RainbowEnvironment; 5 | 6 | /** 7 | * 环境信息Mapper接口 8 | * 9 | * @author Gz 10 | * @date 2020-07-04 11 | */ 12 | public interface RainbowEnvironmentMapper 13 | { 14 | /** 15 | * 查询环境信息 16 | * 17 | * @param env 环境信息ID 18 | * @return 环境信息 19 | */ 20 | public RainbowEnvironment selectRainbowEnvironmentById(String env); 21 | 22 | /** 23 | * 查询环境信息列表 24 | * 25 | * @param rainbowEnvironment 环境信息 26 | * @return 环境信息集合 27 | */ 28 | public List selectRainbowEnvironmentList(RainbowEnvironment rainbowEnvironment); 29 | 30 | /** 31 | * 新增环境信息 32 | * 33 | * @param rainbowEnvironment 环境信息 34 | * @return 结果 35 | */ 36 | public int insertRainbowEnvironment(RainbowEnvironment rainbowEnvironment); 37 | 38 | /** 39 | * 修改环境信息 40 | * 41 | * @param rainbowEnvironment 环境信息 42 | * @return 结果 43 | */ 44 | public int updateRainbowEnvironment(RainbowEnvironment rainbowEnvironment); 45 | 46 | /** 47 | * 删除环境信息 48 | * 49 | * @param env 环境信息ID 50 | * @return 结果 51 | */ 52 | public int deleteRainbowEnvironmentById(String env); 53 | 54 | /** 55 | * 批量删除环境信息 56 | * 57 | * @param envs 需要删除的数据ID 58 | * @return 结果 59 | */ 60 | public int deleteRainbowEnvironmentByIds(String[] envs); 61 | } 62 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/IRainbowEnvironmentService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.RainbowEnvironment; 5 | 6 | /** 7 | * 环境信息Service接口 8 | * 9 | * @author Gz 10 | * @date 2020-07-04 11 | */ 12 | public interface IRainbowEnvironmentService 13 | { 14 | /** 15 | * 查询环境信息 16 | * 17 | * @param env 环境信息ID 18 | * @return 环境信息 19 | */ 20 | public RainbowEnvironment selectRainbowEnvironmentById(String env); 21 | 22 | /** 23 | * 查询环境信息列表 24 | * 25 | * @param rainbowEnvironment 环境信息 26 | * @return 环境信息集合 27 | */ 28 | public List selectRainbowEnvironmentList(RainbowEnvironment rainbowEnvironment); 29 | 30 | /** 31 | * 新增环境信息 32 | * 33 | * @param rainbowEnvironment 环境信息 34 | * @return 结果 35 | */ 36 | public int insertRainbowEnvironment(RainbowEnvironment rainbowEnvironment); 37 | 38 | /** 39 | * 修改环境信息 40 | * 41 | * @param rainbowEnvironment 环境信息 42 | * @return 结果 43 | */ 44 | public int updateRainbowEnvironment(RainbowEnvironment rainbowEnvironment); 45 | 46 | /** 47 | * 批量删除环境信息 48 | * 49 | * @param ids 需要删除的数据ID 50 | * @return 结果 51 | */ 52 | public int deleteRainbowEnvironmentByIds(String ids); 53 | 54 | /** 55 | * 删除环境信息信息 56 | * 57 | * @param env 环境信息ID 58 | * @return 结果 59 | */ 60 | public int deleteRainbowEnvironmentById(String env); 61 | } 62 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/system/user/resetPwd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 |
16 |
17 | 18 |
19 | 20 |
21 |
22 |
23 |
24 | 25 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/core/page/PageDomain.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.core.page; 2 | 3 | import com.rainbow.common.utils.StringUtils; 4 | 5 | /** 6 | * 分页数据 7 | * 8 | * 9 | */ 10 | public class PageDomain 11 | { 12 | /** 当前记录起始索引 */ 13 | private Integer pageNum; 14 | /** 每页显示记录数 */ 15 | private Integer pageSize; 16 | /** 排序列 */ 17 | private String orderByColumn; 18 | /** 排序的方向 "desc" 或者 "asc". */ 19 | private String isAsc; 20 | 21 | public String getOrderBy() 22 | { 23 | if (StringUtils.isEmpty(orderByColumn)) 24 | { 25 | return ""; 26 | } 27 | return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; 28 | } 29 | 30 | public Integer getPageNum() 31 | { 32 | return pageNum; 33 | } 34 | 35 | public void setPageNum(Integer pageNum) 36 | { 37 | this.pageNum = pageNum; 38 | } 39 | 40 | public Integer getPageSize() 41 | { 42 | return pageSize; 43 | } 44 | 45 | public void setPageSize(Integer pageSize) 46 | { 47 | this.pageSize = pageSize; 48 | } 49 | 50 | public String getOrderByColumn() 51 | { 52 | return orderByColumn; 53 | } 54 | 55 | public void setOrderByColumn(String orderByColumn) 56 | { 57 | this.orderByColumn = orderByColumn; 58 | } 59 | 60 | public String getIsAsc() 61 | { 62 | return isAsc; 63 | } 64 | 65 | public void setIsAsc(String isAsc) 66 | { 67 | this.isAsc = isAsc; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/ISysUserOnlineService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | import com.rainbow.system.domain.SysUserOnline; 6 | 7 | /** 8 | * 在线用户 服务层 9 | * 10 | * 11 | */ 12 | public interface ISysUserOnlineService 13 | { 14 | /** 15 | * 通过会话序号查询信息 16 | * 17 | * @param sessionId 会话ID 18 | * @return 在线用户信息 19 | */ 20 | public SysUserOnline selectOnlineById(String sessionId); 21 | 22 | /** 23 | * 通过会话序号删除信息 24 | * 25 | * @param sessionId 会话ID 26 | * @return 在线用户信息 27 | */ 28 | public void deleteOnlineById(String sessionId); 29 | 30 | /** 31 | * 通过会话序号删除信息 32 | * 33 | * @param sessions 会话ID集合 34 | * @return 在线用户信息 35 | */ 36 | public void batchDeleteOnline(List sessions); 37 | 38 | /** 39 | * 保存会话信息 40 | * 41 | * @param online 会话信息 42 | */ 43 | public void saveOnline(SysUserOnline online); 44 | 45 | /** 46 | * 查询会话集合 47 | * 48 | * @param userOnline 分页参数 49 | * @return 会话集合 50 | */ 51 | public List selectUserOnlineList(SysUserOnline userOnline); 52 | 53 | /** 54 | * 强退用户 55 | * 56 | * @param sessionId 会话ID 57 | */ 58 | public void forceLogout(String sessionId); 59 | 60 | /** 61 | * 查询会话集合 62 | * 63 | * @param expiredDate 有效期 64 | * @return 会话集合 65 | */ 66 | public List selectOnlineByExpired(Date expiredDate); 67 | } 68 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/RainbowApplicationMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.RainbowApplication; 5 | 6 | /** 7 | * 应用信息Mapper接口 8 | * 9 | * @author Gz 10 | * @date 2020-07-04 11 | */ 12 | public interface RainbowApplicationMapper 13 | { 14 | /** 15 | * 查询应用信息 16 | * 17 | * @param appName 应用信息ID 18 | * @return 应用信息 19 | */ 20 | public RainbowApplication selectRainbowApplicationById(String appName); 21 | 22 | /** 23 | * 查询应用信息列表 24 | * 25 | * @param rainbowApplication 应用信息 26 | * @return 应用信息集合 27 | */ 28 | public List selectRainbowApplicationList(RainbowApplication rainbowApplication); 29 | 30 | /** 31 | * 新增应用信息 32 | * 33 | * @param rainbowApplication 应用信息 34 | * @return 结果 35 | */ 36 | public int insertRainbowApplication(RainbowApplication rainbowApplication); 37 | 38 | /** 39 | * 修改应用信息 40 | * 41 | * @param rainbowApplication 应用信息 42 | * @return 结果 43 | */ 44 | public int updateRainbowApplication(RainbowApplication rainbowApplication); 45 | 46 | /** 47 | * 删除应用信息 48 | * 49 | * @param appName 应用信息ID 50 | * @return 结果 51 | */ 52 | public int deleteRainbowApplicationById(String appName); 53 | 54 | /** 55 | * 批量删除应用信息 56 | * 57 | * @param appNames 需要删除的数据ID 58 | * @return 结果 59 | */ 60 | public int deleteRainbowApplicationByIds(String[] appNames); 61 | } 62 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/IRainbowApplicationService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.RainbowApplication; 5 | 6 | /** 7 | * 应用信息Service接口 8 | * 9 | * @author Gz 10 | * @date 2020-07-04 11 | */ 12 | public interface IRainbowApplicationService 13 | { 14 | /** 15 | * 查询应用信息 16 | * 17 | * @param appName 应用信息ID 18 | * @return 应用信息 19 | */ 20 | public RainbowApplication selectRainbowApplicationById(String appName); 21 | 22 | /** 23 | * 查询应用信息列表 24 | * 25 | * @param rainbowApplication 应用信息 26 | * @return 应用信息集合 27 | */ 28 | public List selectRainbowApplicationList(RainbowApplication rainbowApplication); 29 | 30 | /** 31 | * 新增应用信息 32 | * 33 | * @param rainbowApplication 应用信息 34 | * @return 结果 35 | */ 36 | public int insertRainbowApplication(RainbowApplication rainbowApplication); 37 | 38 | /** 39 | * 修改应用信息 40 | * 41 | * @param rainbowApplication 应用信息 42 | * @return 结果 43 | */ 44 | public int updateRainbowApplication(RainbowApplication rainbowApplication); 45 | 46 | /** 47 | * 批量删除应用信息 48 | * 49 | * @param ids 需要删除的数据ID 50 | * @return 结果 51 | */ 52 | public int deleteRainbowApplicationByIds(String ids); 53 | 54 | /** 55 | * 删除应用信息信息 56 | * 57 | * @param appName 应用信息ID 58 | * @return 结果 59 | */ 60 | public int deleteRainbowApplicationById(String appName); 61 | } 62 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/system/SysRegisterController.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.system; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.util.StringUtils; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.ResponseBody; 9 | import com.rainbow.common.core.controller.BaseController; 10 | import com.rainbow.common.core.domain.AjaxResult; 11 | import com.rainbow.framework.shiro.service.SysRegisterService; 12 | import com.rainbow.system.domain.SysUser; 13 | import com.rainbow.system.service.ISysConfigService; 14 | 15 | /** 16 | * 注册验证 17 | * 18 | * 19 | */ 20 | @Controller 21 | public class SysRegisterController extends BaseController 22 | { 23 | @Autowired 24 | private SysRegisterService registerService; 25 | 26 | @Autowired 27 | private ISysConfigService configService; 28 | 29 | @GetMapping("/register") 30 | public String register() 31 | { 32 | return "register"; 33 | } 34 | 35 | @PostMapping("/register") 36 | @ResponseBody 37 | public AjaxResult ajaxRegister(SysUser user) 38 | { 39 | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) 40 | { 41 | return error("当前系统没有开启注册功能!"); 42 | } 43 | String msg = registerService.register(user); 44 | return StringUtils.isEmpty(msg) ? success() : error(msg); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/ISysConfigService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysConfig; 5 | 6 | /** 7 | * 参数配置 服务层 8 | * 9 | * 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 | * @param config 参数配置信息 33 | * @return 参数配置集合 34 | */ 35 | public List selectConfigList(SysConfig config); 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 ids 需要删除的数据ID 57 | * @return 结果 58 | */ 59 | public int deleteConfigByIds(String ids); 60 | 61 | /** 62 | * 清空缓存数据 63 | */ 64 | public void clearCache(); 65 | 66 | /** 67 | * 校验参数键名是否唯一 68 | * 69 | * @param config 参数信息 70 | * @return 结果 71 | */ 72 | public String checkConfigKeyUnique(SysConfig config); 73 | } 74 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/IRainbowGroupsService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.RainbowGroups; 5 | 6 | /** 7 | * rainbow配置组Service接口 8 | * 9 | * @author Gz 10 | * @date 2020-07-04 11 | */ 12 | public interface IRainbowGroupsService 13 | { 14 | /** 15 | * 查询rainbow配置组 16 | * 17 | * @param id rainbow配置组ID 18 | * @return rainbow配置组 19 | */ 20 | public RainbowGroups selectRainbowGroupsById(Long id); 21 | 22 | /** 23 | * 查询rainbow配置组列表 24 | * 25 | * @param rainbowGroups rainbow配置组 26 | * @return rainbow配置组集合 27 | */ 28 | public List selectRainbowGroupsList(RainbowGroups rainbowGroups); 29 | 30 | /** 31 | * 新增rainbow配置组 32 | * 33 | * @param rainbowGroups rainbow配置组 34 | * @return 结果 35 | */ 36 | public int insertRainbowGroups(RainbowGroups rainbowGroups); 37 | 38 | /** 39 | * 修改rainbow配置组 40 | * 41 | * @param rainbowGroups rainbow配置组 42 | * @return 结果 43 | */ 44 | public int updateRainbowGroups(RainbowGroups rainbowGroups); 45 | 46 | /** 47 | * 批量删除rainbow配置组 48 | * 49 | * @param ids 需要删除的数据ID 50 | * @return 结果 51 | */ 52 | public int deleteRainbowGroupsByIds(String ids); 53 | 54 | /** 55 | * 删除rainbow配置组信息 56 | * 57 | * @param id rainbow配置组ID 58 | * @return 结果 59 | */ 60 | public int deleteRainbowGroupsById(Long id); 61 | 62 | List queryGrpupIds(String appName,String envName,List groupNames); 63 | } 64 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/core/page/TableDataInfo.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.core.page; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * 表格分页数据对象 8 | * 9 | * 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 | } -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/web/domain/server/Sys.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.web.domain.server; 2 | 3 | /** 4 | * 系统相关信息 5 | * 6 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/utils/MapDataUtil.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.utils; 2 | 3 | import java.util.HashMap; 4 | import java.util.Iterator; 5 | import java.util.Map; 6 | import java.util.Map.Entry; 7 | import javax.servlet.http.HttpServletRequest; 8 | 9 | /** 10 | * Map通用处理方法 11 | * 12 | * 13 | */ 14 | public class MapDataUtil 15 | { 16 | public static Map convertDataMap(HttpServletRequest request) 17 | { 18 | Map properties = request.getParameterMap(); 19 | Map returnMap = new HashMap(); 20 | Iterator entries = properties.entrySet().iterator(); 21 | Map.Entry entry; 22 | String name = ""; 23 | String value = ""; 24 | while (entries.hasNext()) 25 | { 26 | entry = (Entry) entries.next(); 27 | name = (String) entry.getKey(); 28 | Object valueObj = entry.getValue(); 29 | if (null == valueObj) 30 | { 31 | value = ""; 32 | } 33 | else if (valueObj instanceof String[]) 34 | { 35 | String[] values = (String[]) valueObj; 36 | for (int i = 0; i < values.length; i++) 37 | { 38 | value = values[i] + ","; 39 | } 40 | value = value.substring(0, value.length() - 1); 41 | } 42 | else 43 | { 44 | value = valueObj.toString(); 45 | } 46 | returnMap.put(name, value); 47 | } 48 | return returnMap; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/constant/ShiroConstants.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.constant; 2 | 3 | /** 4 | * Shiro通用常量 5 | * 6 | * 7 | */ 8 | public class ShiroConstants 9 | { 10 | /** 11 | * 当前登录的用户 12 | */ 13 | public static final String CURRENT_USER = "currentUser"; 14 | 15 | /** 16 | * 用户名 17 | */ 18 | public static final String CURRENT_USERNAME = "username"; 19 | 20 | /** 21 | * 消息key 22 | */ 23 | public static final String MESSAGE = "message"; 24 | 25 | /** 26 | * 错误key 27 | */ 28 | public static final String ERROR = "errorMsg"; 29 | 30 | /** 31 | * 编码格式 32 | */ 33 | public static final String ENCODING = "UTF-8"; 34 | 35 | /** 36 | * 当前在线会话 37 | */ 38 | public static final String ONLINE_SESSION = "online_session"; 39 | 40 | /** 41 | * 验证码key 42 | */ 43 | public static final String CURRENT_CAPTCHA = "captcha"; 44 | 45 | /** 46 | * 验证码开关 47 | */ 48 | public static final String CURRENT_ENABLED = "captchaEnabled"; 49 | 50 | /** 51 | * 验证码类型 52 | */ 53 | public static final String CURRENT_TYPE = "captchaType"; 54 | 55 | /** 56 | * 验证码 57 | */ 58 | public static final String CURRENT_VALIDATECODE = "validateCode"; 59 | 60 | /** 61 | * 验证码错误 62 | */ 63 | public static final String CAPTCHA_ERROR = "captchaError"; 64 | 65 | /** 66 | * 登录记录缓存 67 | */ 68 | public static final String LOGINRECORDCACHE = "loginRecordCache"; 69 | 70 | /** 71 | * 系统活跃用户缓存 72 | */ 73 | public static final String SYS_USERCACHE = "sys-userCache"; 74 | } 75 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/system/dict/type/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 23 |
24 |
25 | 26 | 27 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/IRainbowCellsService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.RainbowCells; 5 | 6 | /** 7 | * 配置项目Service接口 8 | * 9 | * @author Gz 10 | * @date 2020-07-04 11 | */ 12 | public interface IRainbowCellsService 13 | { 14 | /** 15 | * 查询配置项目 16 | * 17 | * @param id 配置项目ID 18 | * @return 配置项目 19 | */ 20 | public RainbowCells selectRainbowCellsById(Long id); 21 | 22 | public Integer selectLineMaxNoBygroupId(Long groupId); 23 | 24 | /** 25 | * 查询配置项目列表 26 | * 27 | * @param rainbowCells 配置项目 28 | * @return 配置项目集合 29 | */ 30 | public List selectRainbowCellsList(RainbowCells rainbowCells); 31 | 32 | /** 33 | * 新增配置项目 34 | * 35 | * @param rainbowCells 配置项目 36 | * @return 结果 37 | */ 38 | public int insertRainbowCells(RainbowCells rainbowCells); 39 | 40 | /** 41 | * 修改配置项目 42 | * 43 | * @param rainbowCells 配置项目 44 | * @return 结果 45 | */ 46 | public int updateRainbowCells(RainbowCells rainbowCells); 47 | 48 | /** 49 | * 批量删除配置项目 50 | * 51 | * @param ids 需要删除的数据ID 52 | * @return 结果 53 | */ 54 | public int deleteRainbowCellsByIds(String ids); 55 | 56 | /** 57 | * 删除配置项目信息 58 | * 59 | * @param id 配置项目ID 60 | * @return 结果 61 | */ 62 | public int deleteRainbowCellsById(Long id); 63 | 64 | List queryCellsByGroups(String envName,String appName,List groupNames); 65 | 66 | List queryCellsByGroupId(Long groupId); 67 | 68 | } 69 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-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 | //////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/config/FilterConfig.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.config; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import javax.servlet.DispatcherType; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | import com.rainbow.common.utils.StringUtils; 11 | import com.rainbow.common.xss.XssFilter; 12 | 13 | /** 14 | * Filter配置 15 | * 16 | * 17 | */ 18 | @Configuration 19 | public class FilterConfig 20 | { 21 | @Value("${xss.enabled}") 22 | private String enabled; 23 | 24 | @Value("${xss.excludes}") 25 | private String excludes; 26 | 27 | @Value("${xss.urlPatterns}") 28 | private String urlPatterns; 29 | 30 | @SuppressWarnings({ "rawtypes", "unchecked" }) 31 | @Bean 32 | public FilterRegistrationBean xssFilterRegistration() 33 | { 34 | FilterRegistrationBean registration = new FilterRegistrationBean(); 35 | registration.setDispatcherTypes(DispatcherType.REQUEST); 36 | registration.setFilter(new XssFilter()); 37 | registration.addUrlPatterns(StringUtils.split(urlPatterns, ",")); 38 | registration.setName("xssFilter"); 39 | registration.setOrder(Integer.MAX_VALUE); 40 | Map initParameters = new HashMap(); 41 | initParameters.put("excludes", excludes); 42 | initParameters.put("enabled", enabled); 43 | registration.setInitParameters(initParameters); 44 | return registration; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysUserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.domain.SysUserRole; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | /** 9 | * 用户与角色关联表 数据层 10 | * 11 | * 12 | */ 13 | public interface SysUserRoleMapper 14 | { 15 | /** 16 | * 通过用户ID查询用户和角色关联 17 | * 18 | * @param userId 用户ID 19 | * @return 用户和角色关联列表 20 | */ 21 | public List selectUserRoleByUserId(Long userId); 22 | 23 | /** 24 | * 通过用户ID删除用户和角色关联 25 | * 26 | * @param userId 用户ID 27 | * @return 结果 28 | */ 29 | public int deleteUserRoleByUserId(Long userId); 30 | 31 | /** 32 | * 批量删除用户和角色关联 33 | * 34 | * @param ids 需要删除的数据ID 35 | * @return 结果 36 | */ 37 | public int deleteUserRole(Long[] ids); 38 | 39 | /** 40 | * 通过角色ID查询角色使用数量 41 | * 42 | * @param roleId 角色ID 43 | * @return 结果 44 | */ 45 | public int countUserRoleByRoleId(Long roleId); 46 | 47 | /** 48 | * 批量新增用户角色信息 49 | * 50 | * @param userRoleList 用户角色列表 51 | * @return 结果 52 | */ 53 | public int batchUserRole(List userRoleList); 54 | 55 | /** 56 | * 删除用户和角色关联信息 57 | * 58 | * @param userRole 用户和角色关联信息 59 | * @return 结果 60 | */ 61 | public int deleteUserRoleInfo(SysUserRole userRole); 62 | 63 | /** 64 | * 批量取消授权用户角色 65 | * 66 | * @param roleId 角色ID 67 | * @param userIds 需要删除的用户数据ID 68 | * @return 结果 69 | */ 70 | public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); 71 | } 72 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/demo/controller/DemoDialogController.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.demo.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | /** 8 | * 模态窗口 9 | * 10 | * 11 | */ 12 | @Controller 13 | @RequestMapping("/demo/modal") 14 | public class DemoDialogController 15 | { 16 | private String prefix = "demo/modal"; 17 | 18 | /** 19 | * 模态窗口 20 | */ 21 | @GetMapping("/dialog") 22 | public String dialog() 23 | { 24 | return prefix + "/dialog"; 25 | } 26 | 27 | /** 28 | * 弹层组件 29 | */ 30 | @GetMapping("/layer") 31 | public String layer() 32 | { 33 | return prefix + "/layer"; 34 | } 35 | 36 | /** 37 | * 表单 38 | */ 39 | @GetMapping("/form") 40 | public String form() 41 | { 42 | return prefix + "/form"; 43 | } 44 | 45 | /** 46 | * 表格 47 | */ 48 | @GetMapping("/table") 49 | public String table() 50 | { 51 | return prefix + "/table"; 52 | } 53 | 54 | /** 55 | * 表格check 56 | */ 57 | @GetMapping("/check") 58 | public String check() 59 | { 60 | return prefix + "/table/check"; 61 | } 62 | 63 | /** 64 | * 表格radio 65 | */ 66 | @GetMapping("/radio") 67 | public String radio() 68 | { 69 | return prefix + "/table/radio"; 70 | } 71 | 72 | /** 73 | * 表格回传父窗体 74 | */ 75 | @GetMapping("/parent") 76 | public String parent() 77 | { 78 | return prefix + "/table/parent"; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/RainbowGroupsMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.domain.RainbowGroups; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | /** 9 | * rainbow配置组Mapper接口 10 | * 11 | * @author Gz 12 | * @date 2020-07-04 13 | */ 14 | public interface RainbowGroupsMapper 15 | { 16 | /** 17 | * 查询rainbow配置组 18 | * 19 | * @param id rainbow配置组ID 20 | * @return rainbow配置组 21 | */ 22 | public RainbowGroups selectRainbowGroupsById(Long id); 23 | 24 | /** 25 | * 查询rainbow配置组列表 26 | * 27 | * @param rainbowGroups rainbow配置组 28 | * @return rainbow配置组集合 29 | */ 30 | public List selectRainbowGroupsList(RainbowGroups rainbowGroups); 31 | 32 | /** 33 | * 新增rainbow配置组 34 | * 35 | * @param rainbowGroups rainbow配置组 36 | * @return 结果 37 | */ 38 | public int insertRainbowGroups(RainbowGroups rainbowGroups); 39 | 40 | /** 41 | * 修改rainbow配置组 42 | * 43 | * @param rainbowGroups rainbow配置组 44 | * @return 结果 45 | */ 46 | public int updateRainbowGroups(RainbowGroups rainbowGroups); 47 | 48 | /** 49 | * 删除rainbow配置组 50 | * 51 | * @param id rainbow配置组ID 52 | * @return 结果 53 | */ 54 | public int deleteRainbowGroupsById(Long id); 55 | 56 | /** 57 | * 批量删除rainbow配置组 58 | * 59 | * @param ids 需要删除的数据ID 60 | * @return 结果 61 | */ 62 | public int deleteRainbowGroupsByIds(String[] ids); 63 | 64 | List queryGrpupIds(@Param("appName") String appName,@Param("envName") String envName, @Param("groupNames") List groupNames); 65 | } 66 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/common/RainbowPropertySourcesProcessor.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.common; 2 | 3 | import com.github.rainbow.config.SpringValueProcessor; 4 | import com.github.rainbow.property.SpringValueDefinitionProcessor; 5 | import com.github.rainbow.util.BeanRegistraUtil; 6 | import org.springframework.beans.BeansException; 7 | import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; 8 | import org.springframework.beans.factory.support.BeanDefinitionRegistry; 9 | import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; 10 | import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; 11 | 12 | /** 13 | * @author Gz. 14 | * @description: 15 | * @date 2020-06-27 15:48:18 16 | */ 17 | public class RainbowPropertySourcesProcessor implements BeanDefinitionRegistryPostProcessor { 18 | @Override 19 | public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry beanDefinitionRegistry) throws BeansException { 20 | 21 | BeanRegistraUtil.registerBeanDefinitionIfNotExists(beanDefinitionRegistry, PropertySourcesPlaceholderConfigurer.class.getName(),PropertySourcesPlaceholderConfigurer.class); 22 | 23 | BeanRegistraUtil.registerBeanDefinitionIfNotExists(beanDefinitionRegistry, SpringValueProcessor.class.getName(),SpringValueProcessor.class); 24 | 25 | SpringValueDefinitionProcessor springValueDefinitionProcessor = new SpringValueDefinitionProcessor(); 26 | springValueDefinitionProcessor.postProcessBeanDefinitionRegistry(beanDefinitionRegistry); 27 | } 28 | 29 | @Override 30 | public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/demo/domain/GoodsModel.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.demo.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 商品测试信息 8 | * 9 | * 10 | */ 11 | public class GoodsModel 12 | { 13 | /** 14 | * 商品名称 15 | */ 16 | private String name; 17 | 18 | /** 19 | * 商品重量 20 | */ 21 | private Integer weight; 22 | 23 | /** 24 | * 商品价格 25 | */ 26 | private Double price; 27 | 28 | /** 29 | * 商品种类 30 | */ 31 | private String type; 32 | 33 | public String getName() 34 | { 35 | return name; 36 | } 37 | 38 | public void setName(String name) 39 | { 40 | this.name = name; 41 | } 42 | 43 | public Integer getWeight() 44 | { 45 | return weight; 46 | } 47 | 48 | public void setWeight(Integer weight) 49 | { 50 | this.weight = weight; 51 | } 52 | 53 | public Double getPrice() 54 | { 55 | return price; 56 | } 57 | 58 | public void setPrice(Double price) 59 | { 60 | this.price = price; 61 | } 62 | 63 | public String getType() 64 | { 65 | return type; 66 | } 67 | 68 | public void setType(String type) 69 | { 70 | this.type = type; 71 | } 72 | 73 | @Override 74 | public String toString() { 75 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 76 | .append("name", getName()) 77 | .append("weight", getWeight()) 78 | .append("price", getPrice()) 79 | .append("type", getType()) 80 | .toString(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /rainbow-client/src/main/java/com/github/rainbow/config/RainbowServerConfig.java: -------------------------------------------------------------------------------- 1 | package com.github.rainbow.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * @author Gz. 8 | * @description: 服务器配置信息类 9 | * @date 2020-07-07 22:21:39 10 | */ 11 | public class RainbowServerConfig { 12 | 13 | 14 | 15 | private String address; 16 | private String env; 17 | private String appName; 18 | private String groupsName; 19 | 20 | public RainbowServerConfig() { 21 | System.out.println("1" +address + "#" + "#" + env + "#" + appName + "#" + groupsName); 22 | } 23 | public RainbowServerConfig(String address, String env, String appName, String groupsName) { 24 | this.address = address; 25 | this.env = env; 26 | this.appName = appName; 27 | this.groupsName = groupsName; 28 | 29 | System.out.println( "2" +address + "#" + "#" + env + "#" + appName + "#" + groupsName); 30 | } 31 | 32 | public String getAddress() { 33 | return address; 34 | } 35 | 36 | public void setAddress(String address) { 37 | this.address = address; 38 | } 39 | 40 | public String getEnv() { 41 | return env; 42 | } 43 | 44 | public void setEnv(String env) { 45 | this.env = env; 46 | } 47 | 48 | public String getAppName() { 49 | return appName; 50 | } 51 | 52 | public void setAppName(String appName) { 53 | this.appName = appName; 54 | } 55 | 56 | public String getGroupsName() { 57 | return groupsName; 58 | } 59 | 60 | public void setGroupsName(String groupsName) { 61 | this.groupsName = groupsName; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/shiro/session/OnlineSessionFactory.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.framework.shiro.session; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import org.apache.shiro.session.Session; 5 | import org.apache.shiro.session.mgt.SessionContext; 6 | import org.apache.shiro.session.mgt.SessionFactory; 7 | import org.apache.shiro.web.session.mgt.WebSessionContext; 8 | import org.springframework.stereotype.Component; 9 | import com.rainbow.common.utils.IpUtils; 10 | import com.rainbow.common.utils.ServletUtils; 11 | import eu.bitwalker.useragentutils.UserAgent; 12 | 13 | /** 14 | * 自定义sessionFactory会话 15 | * 16 | * 17 | */ 18 | @Component 19 | public class OnlineSessionFactory implements SessionFactory 20 | { 21 | @Override 22 | public Session createSession(SessionContext initData) 23 | { 24 | OnlineSession session = new OnlineSession(); 25 | if (initData != null && initData instanceof WebSessionContext) 26 | { 27 | WebSessionContext sessionContext = (WebSessionContext) initData; 28 | HttpServletRequest request = (HttpServletRequest) sessionContext.getServletRequest(); 29 | if (request != null) 30 | { 31 | UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); 32 | // 获取客户端操作系统 33 | String os = userAgent.getOperatingSystem().getName(); 34 | // 获取客户端浏览器 35 | String browser = userAgent.getBrowser().getName(); 36 | session.setHost(IpUtils.getIpAddr(request)); 37 | session.setBrowser(browser); 38 | session.setOs(os); 39 | } 40 | } 41 | return session; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/utils/file/MimeTypeUtils.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.utils.file; 2 | 3 | /** 4 | * 媒体类型工具类 5 | * 6 | * 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[] DEFAULT_ALLOWED_EXTENSION = { 28 | // 图片 29 | "bmp", "gif", "jpg", "jpeg", "png", 30 | // word excel powerpoint 31 | "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", 32 | // 压缩文件 33 | "rar", "zip", "gz", "bz2", 34 | // pdf 35 | "pdf" }; 36 | 37 | public static String getExtension(String prefix) 38 | { 39 | switch (prefix) 40 | { 41 | case IMAGE_PNG: 42 | return "png"; 43 | case IMAGE_JPG: 44 | return "jpg"; 45 | case IMAGE_JPEG: 46 | return "jpeg"; 47 | case IMAGE_BMP: 48 | return "bmp"; 49 | case IMAGE_GIF: 50 | return "gif"; 51 | default: 52 | return ""; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysPostMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.domain.SysPost; 6 | 7 | /** 8 | * 岗位信息 数据层 9 | * 10 | * 11 | */ 12 | public interface SysPostMapper 13 | { 14 | /** 15 | * 查询岗位数据集合 16 | * 17 | * @param post 岗位信息 18 | * @return 岗位数据集合 19 | */ 20 | public List selectPostList(SysPost post); 21 | 22 | /** 23 | * 查询所有岗位 24 | * 25 | * @return 岗位列表 26 | */ 27 | public List selectPostAll(); 28 | 29 | /** 30 | * 根据用户ID查询岗位 31 | * 32 | * @param userId 用户ID 33 | * @return 岗位列表 34 | */ 35 | public List selectPostsByUserId(Long userId); 36 | 37 | /** 38 | * 通过岗位ID查询岗位信息 39 | * 40 | * @param postId 岗位ID 41 | * @return 角色对象信息 42 | */ 43 | public SysPost selectPostById(Long postId); 44 | 45 | /** 46 | * 批量删除岗位信息 47 | * 48 | * @param ids 需要删除的数据ID 49 | * @return 结果 50 | */ 51 | public int deletePostByIds(Long[] ids); 52 | 53 | /** 54 | * 修改岗位信息 55 | * 56 | * @param post 岗位信息 57 | * @return 结果 58 | */ 59 | public int updatePost(SysPost post); 60 | 61 | /** 62 | * 新增岗位信息 63 | * 64 | * @param post 岗位信息 65 | * @return 结果 66 | */ 67 | public int insertPost(SysPost post); 68 | 69 | /** 70 | * 校验岗位名称 71 | * 72 | * @param postName 岗位名称 73 | * @return 结果 74 | */ 75 | public SysPost checkPostNameUnique(String postName); 76 | 77 | /** 78 | * 校验岗位编码 79 | * 80 | * @param postCode 岗位编码 81 | * @return 结果 82 | */ 83 | public SysPost checkPostCodeUnique(String postCode); 84 | } 85 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/impl/SysLogininforServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.service.ISysLogininforService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import com.rainbow.common.core.text.Convert; 9 | import com.rainbow.system.domain.SysLogininfor; 10 | import com.rainbow.system.mapper.SysLogininforMapper; 11 | 12 | /** 13 | * 系统访问日志情况信息 服务层处理 14 | * 15 | * 16 | */ 17 | @Service 18 | public class SysLogininforServiceImpl implements ISysLogininforService 19 | { 20 | 21 | @Autowired 22 | private SysLogininforMapper logininforMapper; 23 | 24 | /** 25 | * 新增系统登录日志 26 | * 27 | * @param logininfor 访问日志对象 28 | */ 29 | @Override 30 | public void insertLogininfor(SysLogininfor logininfor) 31 | { 32 | logininforMapper.insertLogininfor(logininfor); 33 | } 34 | 35 | /** 36 | * 查询系统登录日志集合 37 | * 38 | * @param logininfor 访问日志对象 39 | * @return 登录记录集合 40 | */ 41 | @Override 42 | public List selectLogininforList(SysLogininfor logininfor) 43 | { 44 | return logininforMapper.selectLogininforList(logininfor); 45 | } 46 | 47 | /** 48 | * 批量删除系统登录日志 49 | * 50 | * @param ids 需要删除的数据 51 | * @return 52 | */ 53 | @Override 54 | public int deleteLogininforByIds(String ids) 55 | { 56 | return logininforMapper.deleteLogininforByIds(Convert.toStrArray(ids)); 57 | } 58 | 59 | /** 60 | * 清空系统登录日志 61 | */ 62 | @Override 63 | public void cleanLogininfor() 64 | { 65 | logininforMapper.cleanLogininfor(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/utils/AddressUtils.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.utils; 2 | 3 | import com.rainbow.common.config.Global; 4 | import com.rainbow.common.constant.Constants; 5 | import com.rainbow.common.utils.http.HttpUtils; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import com.alibaba.fastjson.JSONObject; 9 | 10 | /** 11 | * 获取地址类 12 | * 13 | * 14 | */ 15 | public class AddressUtils 16 | { 17 | private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); 18 | 19 | // IP地址查询 20 | public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp"; 21 | 22 | // 未知地址 23 | public static final String UNKNOWN = "XX XX"; 24 | 25 | public static String getRealAddressByIP(String ip) 26 | { 27 | String address = UNKNOWN; 28 | // 内网不查询 29 | if (IpUtils.internalIp(ip)) 30 | { 31 | return "内网IP"; 32 | } 33 | if (Global.isAddressEnabled()) 34 | { 35 | try 36 | { 37 | String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK); 38 | if (StringUtils.isEmpty(rspStr)) 39 | { 40 | log.error("获取地理位置异常 {}", ip); 41 | return UNKNOWN; 42 | } 43 | JSONObject obj = JSONObject.parseObject(rspStr); 44 | String region = obj.getString("pro"); 45 | String city = obj.getString("city"); 46 | return String.format("%s %s", region, city); 47 | } 48 | catch (Exception e) 49 | { 50 | log.error("获取地理位置异常 {}", e); 51 | } 52 | } 53 | return address; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/RainbowCellsMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.RainbowCells; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | /** 8 | * 配置项目Mapper接口 9 | * 10 | * @author Gz 11 | * @date 2020-07-04 12 | */ 13 | public interface RainbowCellsMapper 14 | { 15 | /** 16 | * 查询配置项目 17 | * 18 | * @param id 配置项目ID 19 | * @return 配置项目 20 | */ 21 | public RainbowCells selectRainbowCellsById(Long id); 22 | 23 | public Integer selectLineMaxNoBygroupId(Long groupId); 24 | 25 | 26 | /** 27 | * 查询配置项目列表 28 | * 29 | * @param rainbowCells 配置项目 30 | * @return 配置项目集合 31 | */ 32 | public List selectRainbowCellsList(RainbowCells rainbowCells); 33 | 34 | /** 35 | * 新增配置项目 36 | * 37 | * @param rainbowCells 配置项目 38 | * @return 结果 39 | */ 40 | public int insertRainbowCells(RainbowCells rainbowCells); 41 | 42 | /** 43 | * 修改配置项目 44 | * 45 | * @param rainbowCells 配置项目 46 | * @return 结果 47 | */ 48 | public int updateRainbowCells(RainbowCells rainbowCells); 49 | 50 | /** 51 | * 删除配置项目 52 | * 53 | * @param id 配置项目ID 54 | * @return 结果 55 | */ 56 | public int deleteRainbowCellsById(Long id); 57 | 58 | /** 59 | * 批量删除配置项目 60 | * 61 | * @param ids 需要删除的数据ID 62 | * @return 结果 63 | */ 64 | public int deleteRainbowCellsByIds(String[] ids); 65 | 66 | List queryCellsByGroups(@Param("envName")String envName, @Param("appName")String appName, @Param("groupName") List groupName); 67 | 68 | List queryCellsByGroupId(@Param("groupId") Long groupId); 69 | } 70 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/utils/security/Md5Utils.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.utils.security; 2 | 3 | import java.security.MessageDigest; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | /** 8 | * Md5加密方法 9 | * 10 | * 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 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysRole; 5 | 6 | /** 7 | * 角色表 数据层 8 | * 9 | * 10 | */ 11 | public interface SysRoleMapper 12 | { 13 | /** 14 | * 根据条件分页查询角色数据 15 | * 16 | * @param role 角色信息 17 | * @return 角色数据集合信息 18 | */ 19 | public List selectRoleList(SysRole role); 20 | 21 | /** 22 | * 根据用户ID查询角色 23 | * 24 | * @param userId 用户ID 25 | * @return 角色列表 26 | */ 27 | public List selectRolesByUserId(Long userId); 28 | 29 | /** 30 | * 通过角色ID查询角色 31 | * 32 | * @param roleId 角色ID 33 | * @return 角色对象信息 34 | */ 35 | public SysRole selectRoleById(Long roleId); 36 | 37 | /** 38 | * 通过角色ID删除角色 39 | * 40 | * @param roleId 角色ID 41 | * @return 结果 42 | */ 43 | public int deleteRoleById(Long roleId); 44 | 45 | /** 46 | * 批量角色用户信息 47 | * 48 | * @param ids 需要删除的数据ID 49 | * @return 结果 50 | */ 51 | public int deleteRoleByIds(Long[] ids); 52 | 53 | /** 54 | * 修改角色信息 55 | * 56 | * @param role 角色信息 57 | * @return 结果 58 | */ 59 | public int updateRole(SysRole role); 60 | 61 | /** 62 | * 新增角色信息 63 | * 64 | * @param role 角色信息 65 | * @return 结果 66 | */ 67 | public int insertRole(SysRole role); 68 | 69 | /** 70 | * 校验角色名称是否唯一 71 | * 72 | * @param roleName 角色名称 73 | * @return 角色信息 74 | */ 75 | public SysRole checkRoleNameUnique(String roleName); 76 | 77 | /** 78 | * 校验角色权限是否唯一 79 | * 80 | * @param roleKey 角色权限 81 | * @return 角色信息 82 | */ 83 | public SysRole checkRoleKeyUnique(String roleKey); 84 | } 85 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/mapper/SysDictTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.mapper; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysDictType; 5 | 6 | /** 7 | * 字典表 数据层 8 | * 9 | * 10 | */ 11 | public interface SysDictTypeMapper 12 | { 13 | /** 14 | * 根据条件分页查询字典类型 15 | * 16 | * @param dictType 字典类型信息 17 | * @return 字典类型集合信息 18 | */ 19 | public List selectDictTypeList(SysDictType dictType); 20 | 21 | /** 22 | * 根据所有字典类型 23 | * 24 | * @return 字典类型集合信息 25 | */ 26 | public List selectDictTypeAll(); 27 | 28 | /** 29 | * 根据字典类型ID查询信息 30 | * 31 | * @param dictId 字典类型ID 32 | * @return 字典类型 33 | */ 34 | public SysDictType selectDictTypeById(Long dictId); 35 | 36 | /** 37 | * 根据字典类型查询信息 38 | * 39 | * @param dictType 字典类型 40 | * @return 字典类型 41 | */ 42 | public SysDictType selectDictTypeByType(String dictType); 43 | 44 | /** 45 | * 通过字典ID删除字典信息 46 | * 47 | * @param dictId 字典ID 48 | * @return 结果 49 | */ 50 | public int deleteDictTypeById(Long dictId); 51 | 52 | /** 53 | * 批量删除字典类型 54 | * 55 | * @param ids 需要删除的数据 56 | * @return 结果 57 | */ 58 | public int deleteDictTypeByIds(Long[] ids); 59 | 60 | /** 61 | * 新增字典类型信息 62 | * 63 | * @param dictType 字典类型信息 64 | * @return 结果 65 | */ 66 | public int insertDictType(SysDictType dictType); 67 | 68 | /** 69 | * 修改字典类型信息 70 | * 71 | * @param dictType 字典类型信息 72 | * @return 结果 73 | */ 74 | public int updateDictType(SysDictType dictType); 75 | 76 | /** 77 | * 校验字典类型称是否唯一 78 | * 79 | * @param dictType 字典类型 80 | * @return 结果 81 | */ 82 | public SysDictType checkDictTypeUnique(String dictType); 83 | } 84 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/resources/mapper/system/SysUserRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | delete from sys_user_role where user_id = #{userId} 18 | 19 | 20 | 23 | 24 | 25 | delete from sys_user_role where user_id in 26 | 27 | #{userId} 28 | 29 | 30 | 31 | 32 | insert into sys_user_role(user_id, role_id) values 33 | 34 | (#{item.userId},#{item.roleId}) 35 | 36 | 37 | 38 | 39 | delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} 40 | 41 | 42 | 43 | delete from sys_user_role where role_id=#{roleId} and user_id in 44 | 45 | #{userId} 46 | 47 | 48 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/system/menu/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 22 |
23 | 展开 / 24 | 折叠 25 |
26 |
27 |
28 | 29 | 30 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/impl/SysOperLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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 com.rainbow.common.core.text.Convert; 7 | import com.rainbow.system.domain.SysOperLog; 8 | import com.rainbow.system.mapper.SysOperLogMapper; 9 | import com.rainbow.system.service.ISysOperLogService; 10 | 11 | /** 12 | * 操作日志 服务层处理 13 | * 14 | * 15 | */ 16 | @Service 17 | public class SysOperLogServiceImpl implements ISysOperLogService 18 | { 19 | @Autowired 20 | private SysOperLogMapper operLogMapper; 21 | 22 | /** 23 | * 新增操作日志 24 | * 25 | * @param operLog 操作日志对象 26 | */ 27 | @Override 28 | public void insertOperlog(SysOperLog operLog) 29 | { 30 | operLogMapper.insertOperlog(operLog); 31 | } 32 | 33 | /** 34 | * 查询系统操作日志集合 35 | * 36 | * @param operLog 操作日志对象 37 | * @return 操作日志集合 38 | */ 39 | @Override 40 | public List selectOperLogList(SysOperLog operLog) 41 | { 42 | return operLogMapper.selectOperLogList(operLog); 43 | } 44 | 45 | /** 46 | * 批量删除系统操作日志 47 | * 48 | * @param ids 需要删除的数据 49 | * @return 50 | */ 51 | @Override 52 | public int deleteOperLogByIds(String ids) 53 | { 54 | return operLogMapper.deleteOperLogByIds(Convert.toStrArray(ids)); 55 | } 56 | 57 | /** 58 | * 查询操作日志详细 59 | * 60 | * @param operId 操作ID 61 | * @return 操作日志对象 62 | */ 63 | @Override 64 | public SysOperLog selectOperLogById(Long operId) 65 | { 66 | return operLogMapper.selectOperLogById(operId); 67 | } 68 | 69 | /** 70 | * 清空操作日志 71 | */ 72 | @Override 73 | public void cleanOperLog() 74 | { 75 | operLogMapper.cleanOperLog(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/ISysPostService.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service; 2 | 3 | import java.util.List; 4 | import com.rainbow.system.domain.SysPost; 5 | 6 | /** 7 | * 岗位信息 服务层 8 | * 9 | * 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 userId 用户ID 32 | * @return 岗位列表 33 | */ 34 | public List selectPostsByUserId(Long userId); 35 | 36 | /** 37 | * 通过岗位ID查询岗位信息 38 | * 39 | * @param postId 岗位ID 40 | * @return 角色对象信息 41 | */ 42 | public SysPost selectPostById(Long postId); 43 | 44 | /** 45 | * 批量删除岗位信息 46 | * 47 | * @param ids 需要删除的数据ID 48 | * @return 结果 49 | * @throws Exception 异常 50 | */ 51 | public int deletePostByIds(String ids) throws Exception; 52 | 53 | /** 54 | * 新增保存岗位信息 55 | * 56 | * @param post 岗位信息 57 | * @return 结果 58 | */ 59 | public int insertPost(SysPost post); 60 | 61 | /** 62 | * 修改保存岗位信息 63 | * 64 | * @param post 岗位信息 65 | * @return 结果 66 | */ 67 | public int updatePost(SysPost post); 68 | 69 | /** 70 | * 通过岗位ID查询岗位使用数量 71 | * 72 | * @param postId 岗位ID 73 | * @return 结果 74 | */ 75 | public int countUserPostById(Long postId); 76 | 77 | /** 78 | * 校验岗位名称 79 | * 80 | * @param post 岗位信息 81 | * @return 结果 82 | */ 83 | public String checkPostNameUnique(SysPost post); 84 | 85 | /** 86 | * 校验岗位编码 87 | * 88 | * @param post 岗位信息 89 | * @return 结果 90 | */ 91 | public String checkPostCodeUnique(SysPost post); 92 | } 93 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/demo/modal/table.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
12 |
弹层框
13 |
14 |
15 |

弹出复选框表格及单选框表格(点击提交后得到数据)。

16 | 17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 |
弹层框
25 |
26 |
27 |

弹出复选框表格及单选框表格(点击提交后得到数据并回显到父窗体)。

28 | 29 |

30 |
31 |
32 |
33 |
34 |
35 | 36 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-framework/src/main/java/com/rainbow/framework/interceptor/RepeatSubmitInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.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.handler.HandlerInterceptorAdapter; 9 | import com.rainbow.common.annotation.RepeatSubmit; 10 | import com.rainbow.common.core.domain.AjaxResult; 11 | import com.rainbow.common.json.JSON; 12 | import com.rainbow.common.utils.ServletUtils; 13 | 14 | /** 15 | * 防止重复提交拦截器 16 | * 17 | * 18 | */ 19 | @Component 20 | public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter 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)) 33 | { 34 | AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试"); 35 | ServletUtils.renderString(response, JSON.marshal(ajaxResult)); 36 | return false; 37 | } 38 | } 39 | return true; 40 | } 41 | else 42 | { 43 | return super.preHandle(request, response, handler); 44 | } 45 | } 46 | 47 | /** 48 | * 验证是否重复提交由子类实现具体的防重复提交的规则 49 | * 50 | * @param request 51 | * @return 52 | * @throws Exception 53 | */ 54 | public abstract boolean isRepeatSubmit(HttpServletRequest request) throws Exception; 55 | } 56 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-common/src/main/java/com/rainbow/common/constant/Constants.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.common.constant; 2 | 3 | /** 4 | * 通用常量信息 5 | * 6 | * 7 | */ 8 | public class Constants 9 | { 10 | /** 11 | * UTF-8 字符集 12 | */ 13 | public static final String UTF8 = "UTF-8"; 14 | 15 | /** 16 | * GBK 字符集 17 | */ 18 | public static final String GBK = "GBK"; 19 | 20 | /** 21 | * 通用成功标识 22 | */ 23 | public static final String SUCCESS = "0"; 24 | 25 | /** 26 | * 通用失败标识 27 | */ 28 | public static final String FAIL = "1"; 29 | 30 | /** 31 | * 登录成功 32 | */ 33 | public static final String LOGIN_SUCCESS = "Success"; 34 | 35 | /** 36 | * 注销 37 | */ 38 | public static final String LOGOUT = "Logout"; 39 | 40 | /** 41 | * 注册 42 | */ 43 | public static final String REGISTER = "Register"; 44 | 45 | /** 46 | * 登录失败 47 | */ 48 | public static final String LOGIN_FAIL = "Error"; 49 | 50 | /** 51 | * 当前记录起始索引 52 | */ 53 | public static final String PAGE_NUM = "pageNum"; 54 | 55 | /** 56 | * 每页显示记录数 57 | */ 58 | public static final String PAGE_SIZE = "pageSize"; 59 | 60 | /** 61 | * 排序列 62 | */ 63 | public static final String ORDER_BY_COLUMN = "orderByColumn"; 64 | 65 | /** 66 | * 排序的方向 "desc" 或者 "asc". 67 | */ 68 | public static final String IS_ASC = "isAsc"; 69 | 70 | /** 71 | * 参数管理 cache name 72 | */ 73 | public static final String SYS_CONFIG_CACHE = "sys-config"; 74 | 75 | /** 76 | * 参数管理 cache key 77 | */ 78 | public static final String SYS_CONFIG_KEY = "sys_config:"; 79 | 80 | /** 81 | * 字典管理 cache name 82 | */ 83 | public static final String SYS_DICT_CACHE = "sys-dict"; 84 | 85 | /** 86 | * 字典管理 cache key 87 | */ 88 | public static final String SYS_DICT_KEY = "sys_dict:"; 89 | 90 | /** 91 | * 资源映射路径 前缀 92 | */ 93 | public static final String RESOURCE_PREFIX = "/profile"; 94 | } 95 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-system/src/main/java/com/rainbow/system/service/impl/SysNoticeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.system.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import com.rainbow.system.service.ISysNoticeService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import com.rainbow.common.core.text.Convert; 9 | import com.rainbow.system.domain.SysNotice; 10 | import com.rainbow.system.mapper.SysNoticeMapper; 11 | 12 | /** 13 | * 公告 服务层实现 14 | * 15 | * 16 | * @date 2018-06-25 17 | */ 18 | @Service 19 | public class SysNoticeServiceImpl implements ISysNoticeService 20 | { 21 | @Autowired 22 | private SysNoticeMapper noticeMapper; 23 | 24 | /** 25 | * 查询公告信息 26 | * 27 | * @param noticeId 公告ID 28 | * @return 公告信息 29 | */ 30 | @Override 31 | public SysNotice selectNoticeById(Long noticeId) 32 | { 33 | return noticeMapper.selectNoticeById(noticeId); 34 | } 35 | 36 | /** 37 | * 查询公告列表 38 | * 39 | * @param notice 公告信息 40 | * @return 公告集合 41 | */ 42 | @Override 43 | public List selectNoticeList(SysNotice notice) 44 | { 45 | return noticeMapper.selectNoticeList(notice); 46 | } 47 | 48 | /** 49 | * 新增公告 50 | * 51 | * @param notice 公告信息 52 | * @return 结果 53 | */ 54 | @Override 55 | public int insertNotice(SysNotice notice) 56 | { 57 | return noticeMapper.insertNotice(notice); 58 | } 59 | 60 | /** 61 | * 修改公告 62 | * 63 | * @param notice 公告信息 64 | * @return 结果 65 | */ 66 | @Override 67 | public int updateNotice(SysNotice notice) 68 | { 69 | return noticeMapper.updateNotice(notice); 70 | } 71 | 72 | /** 73 | * 删除公告对象 74 | * 75 | * @param ids 需要删除的数据ID 76 | * @return 结果 77 | */ 78 | @Override 79 | public int deleteNoticeByIds(String ids) 80 | { 81 | return noticeMapper.deleteNoticeByIds(Convert.toStrArray(ids)); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/java/com/rainbow/web/controller/system/SysIndexController.java: -------------------------------------------------------------------------------- 1 | package com.rainbow.web.controller.system; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.ui.ModelMap; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import com.rainbow.common.config.Global; 9 | import com.rainbow.common.core.controller.BaseController; 10 | import com.rainbow.framework.util.ShiroUtils; 11 | import com.rainbow.system.domain.SysMenu; 12 | import com.rainbow.system.domain.SysUser; 13 | import com.rainbow.system.service.ISysConfigService; 14 | import com.rainbow.system.service.ISysMenuService; 15 | 16 | /** 17 | * 首页 业务处理 18 | * 19 | * 20 | */ 21 | @Controller 22 | public class SysIndexController extends BaseController 23 | { 24 | @Autowired 25 | private ISysMenuService menuService; 26 | 27 | @Autowired 28 | private ISysConfigService configService; 29 | 30 | // 系统首页 31 | @GetMapping("/index") 32 | public String index(ModelMap mmap) 33 | { 34 | // 取身份信息 35 | SysUser user = ShiroUtils.getSysUser(); 36 | // 根据用户id取出菜单 37 | List menus = menuService.selectMenusByUser(user); 38 | mmap.put("menus", menus); 39 | mmap.put("user", user); 40 | mmap.put("sideTheme", configService.selectConfigByKey("sys.index.sideTheme")); 41 | mmap.put("skinName", configService.selectConfigByKey("sys.index.skinName")); 42 | mmap.put("copyrightYear", Global.getCopyrightYear()); 43 | mmap.put("demoEnabled", Global.isDemoEnabled()); 44 | return "index"; 45 | } 46 | 47 | // 切换主题 48 | @GetMapping("/system/switchSkin") 49 | public String switchSkin(ModelMap mmap) 50 | { 51 | return "skin"; 52 | } 53 | 54 | // 系统介绍 55 | @GetMapping("/system/main") 56 | public String main(ModelMap mmap) 57 | { 58 | mmap.put("version", Global.getVersion()); 59 | return "main"; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/templates/system/dept/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 22 |
23 | 展开 / 24 | 折叠 25 |
26 |
27 |
28 | 29 | 30 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /rainbow-server/rainbow-server-admin/src/main/resources/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://114.67.168.xxx:3306/rainbow?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 10 | username: root 11 | password: 123456 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: 47 | login-password: 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 --------------------------------------------------------------------------------