├── .gitignore ├── LICENSE ├── README.md ├── bin ├── clean.bat ├── package.bat └── run.bat ├── doc ├── screenshot │ ├── entity.png │ ├── login-new.png │ ├── login.png │ ├── wechat-new.png │ └── wechat.png └── 若依环境使用手册.docx ├── pom.xml ├── ry.sh ├── silence-admin ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── silence │ │ ├── SilenceApplication.java │ │ ├── SilenceServletInitializer.java │ │ └── web │ │ ├── controller │ │ ├── business │ │ │ └── BusinessContoller.java │ │ ├── common │ │ │ └── CommonController.java │ │ ├── demo │ │ │ ├── controller │ │ │ │ ├── DemoDialogController.java │ │ │ │ ├── DemoFormController.java │ │ │ │ ├── DemoIconController.java │ │ │ │ ├── DemoOperateController.java │ │ │ │ ├── DemoReportController.java │ │ │ │ └── DemoTableController.java │ │ │ └── domain │ │ │ │ └── UserOperateModel.java │ │ ├── monitor │ │ │ ├── DruidController.java │ │ │ ├── ServerController.java │ │ │ ├── SysLogininforController.java │ │ │ ├── SysOperlogController.java │ │ │ └── SysUserOnlineController.java │ │ ├── system │ │ │ ├── SysCaptchaController.java │ │ │ ├── SysConfigController.java │ │ │ ├── SysDeptController.java │ │ │ ├── SysDictDataController.java │ │ │ ├── SysDictTypeController.java │ │ │ ├── SysIndexController.java │ │ │ ├── SysLoginController.java │ │ │ ├── SysMenuController.java │ │ │ ├── SysNoticeController.java │ │ │ ├── SysPostController.java │ │ │ ├── SysProfileController.java │ │ │ ├── SysRoleController.java │ │ │ ├── SysUserController.java │ │ │ └── TestLoginController.java │ │ └── tool │ │ │ ├── BuildController.java │ │ │ ├── SwaggerController.java │ │ │ └── TestController.java │ │ └── core │ │ └── config │ │ └── SwaggerConfig.java │ └── resources │ ├── application-druid.yml │ ├── application.yml │ ├── banner.txt │ ├── ehcache │ └── ehcache-shiro.xml │ ├── favicon.ico │ ├── logback.xml │ ├── mybatis │ └── mybatis-config.xml │ ├── static │ ├── ajax │ │ └── libs │ │ │ ├── beautifyhtml │ │ │ └── beautifyhtml.js │ │ │ ├── blockUI │ │ │ └── jquery.blockUI.js │ │ │ ├── bootstrap-fileinput │ │ │ ├── fileinput.css │ │ │ ├── fileinput.js │ │ │ ├── fileinput.min.css │ │ │ └── fileinput.min.js │ │ │ ├── bootstrap-select │ │ │ ├── bootstrap-select.css │ │ │ ├── bootstrap-select.js │ │ │ ├── bootstrap-select.min.css │ │ │ └── bootstrap-select.min.js │ │ │ ├── bootstrap-table │ │ │ ├── bootstrap-table.min.css │ │ │ ├── bootstrap-table.min.js │ │ │ ├── extensions │ │ │ │ ├── columns │ │ │ │ │ └── bootstrap-table-fixed-columns.js │ │ │ │ ├── editable │ │ │ │ │ ├── bootstrap-table-editable.js │ │ │ │ │ └── bootstrap-table-editable.min.js │ │ │ │ ├── export │ │ │ │ │ ├── bootstrap-table-export.js │ │ │ │ │ └── tableExport.js │ │ │ │ ├── mobile │ │ │ │ │ └── bootstrap-table-mobile.js │ │ │ │ └── toolbar │ │ │ │ │ ├── bootstrap-table-toolbar.js │ │ │ │ │ └── bootstrap-table-toolbar.min.js │ │ │ └── locale │ │ │ │ ├── bootstrap-table-zh-CN.js │ │ │ │ └── bootstrap-table-zh-CN.min.js │ │ │ ├── bootstrap-treetable │ │ │ └── bootstrap-treetable.js │ │ │ ├── cropbox │ │ │ ├── cropbox.css │ │ │ └── cropbox.js │ │ │ ├── datapicker │ │ │ ├── bootstrap-datetimepicker.css │ │ │ ├── bootstrap-datetimepicker.js │ │ │ ├── bootstrap-datetimepicker.min.css │ │ │ └── bootstrap-datetimepicker.min.js │ │ │ ├── duallistbox │ │ │ ├── bootstrap-duallistbox.css │ │ │ ├── bootstrap-duallistbox.js │ │ │ ├── bootstrap-duallistbox.min.css │ │ │ └── bootstrap-duallistbox.min.js │ │ │ ├── fullscreen │ │ │ └── jquery.fullscreen.js │ │ │ ├── iCheck │ │ │ ├── custom.css │ │ │ ├── green-login.png │ │ │ ├── green.png │ │ │ ├── green@2x.png │ │ │ └── icheck.min.js │ │ │ ├── jasny │ │ │ ├── jasny-bootstrap.css │ │ │ ├── jasny-bootstrap.js │ │ │ ├── jasny-bootstrap.min.css │ │ │ └── jasny-bootstrap.min.js │ │ │ ├── jquery-layout │ │ │ ├── jquery.layout-latest.css │ │ │ └── jquery.layout-latest.js │ │ │ ├── jquery-ztree │ │ │ └── 3.5 │ │ │ │ ├── css │ │ │ │ ├── default │ │ │ │ │ ├── img │ │ │ │ │ │ ├── diy │ │ │ │ │ │ │ ├── 1_close.png │ │ │ │ │ │ │ ├── 1_open.png │ │ │ │ │ │ │ ├── 2.png │ │ │ │ │ │ │ ├── 3.png │ │ │ │ │ │ │ ├── 4.png │ │ │ │ │ │ │ ├── 5.png │ │ │ │ │ │ │ ├── 6.png │ │ │ │ │ │ │ ├── 7.png │ │ │ │ │ │ │ ├── 8.png │ │ │ │ │ │ │ └── 9.png │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── zTreeStandard.gif │ │ │ │ │ │ └── zTreeStandard.png │ │ │ │ │ └── zTreeStyle.css │ │ │ │ ├── metro │ │ │ │ │ ├── img │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ ├── line_conn.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── metro.gif │ │ │ │ │ │ └── metro.png │ │ │ │ │ └── zTreeStyle.css │ │ │ │ └── simple │ │ │ │ │ ├── img │ │ │ │ │ ├── left_menu.gif │ │ │ │ │ ├── left_menu.png │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ ├── loading.gif │ │ │ │ │ ├── zTreeStandard.gif │ │ │ │ │ └── zTreeStandard.png │ │ │ │ │ └── zTreeStyle.css │ │ │ │ ├── js │ │ │ │ ├── jquery.ztree.all-3.5.js │ │ │ │ ├── jquery.ztree.core-3.5.js │ │ │ │ ├── jquery.ztree.excheck-3.5.js │ │ │ │ ├── jquery.ztree.exedit-3.5.js │ │ │ │ └── jquery.ztree.exhide-3.5.js │ │ │ │ └── log v3.x.txt │ │ │ ├── jsonview │ │ │ ├── jquery.jsonview.css │ │ │ └── jquery.jsonview.js │ │ │ ├── layer │ │ │ ├── layer.min.js │ │ │ └── theme │ │ │ │ ├── default │ │ │ │ ├── icon-ext.png │ │ │ │ ├── icon.png │ │ │ │ ├── layer.css │ │ │ │ ├── loading-0.gif │ │ │ │ ├── loading-1.gif │ │ │ │ └── loading-2.gif │ │ │ │ └── moon │ │ │ │ ├── default.png │ │ │ │ └── style.css │ │ │ ├── layui │ │ │ ├── css │ │ │ │ └── modules │ │ │ │ │ └── laydate │ │ │ │ │ └── default │ │ │ │ │ ├── font │ │ │ │ │ ├── iconfont.eot │ │ │ │ │ ├── iconfont.svg │ │ │ │ │ ├── iconfont.ttf │ │ │ │ │ └── iconfont.woff │ │ │ │ │ └── laydate.css │ │ │ ├── lay │ │ │ │ └── modules │ │ │ │ │ └── laydate.js │ │ │ └── layui.js │ │ │ ├── report │ │ │ ├── echarts │ │ │ │ └── echarts-all.js │ │ │ ├── peity │ │ │ │ └── jquery.peity.min.js │ │ │ └── sparkline │ │ │ │ └── jquery.sparkline.min.js │ │ │ ├── select2 │ │ │ ├── select2-bootstrap.css │ │ │ ├── select2.css │ │ │ ├── select2.js │ │ │ ├── select2.min.css │ │ │ └── select2.min.js │ │ │ ├── staps │ │ │ ├── jquery.steps.css │ │ │ ├── jquery.steps.js │ │ │ └── jquery.steps.min.js │ │ │ ├── suggest │ │ │ ├── bootstrap-suggest.js │ │ │ └── bootstrap-suggest.min.js │ │ │ ├── summernote │ │ │ ├── font │ │ │ │ ├── summernote.eot │ │ │ │ ├── summernote.ttf │ │ │ │ └── summernote.woff │ │ │ ├── summernote-bs3.css │ │ │ ├── summernote-zh-CN.js │ │ │ ├── summernote-zh-CN.min.js │ │ │ ├── summernote.css │ │ │ ├── summernote.js │ │ │ └── summernote.min.js │ │ │ ├── typeahead │ │ │ ├── bootstrap3-typeahead.js │ │ │ └── bootstrap3-typeahead.min.js │ │ │ └── validate │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.extend.js │ │ │ ├── jquery.validate.min.js │ │ │ └── messages_zh.min.js │ ├── css │ │ ├── animate.css │ │ ├── bootstrap.min.css │ │ ├── font-awesome.min.css │ │ ├── jquery.contextMenu.min.css │ │ ├── login.css │ │ ├── login.min.css │ │ ├── main │ │ │ ├── animate.min.css │ │ │ ├── bootstrap.min14ed.css │ │ │ ├── font-awesome.min93e3.css │ │ │ └── style.min862f.css │ │ ├── patterns │ │ │ ├── header-profile-skin-blue.png │ │ │ ├── header-profile-skin-yellow.png │ │ │ ├── header-profile.png │ │ │ └── shattered.png │ │ ├── skins.css │ │ └── style.css │ ├── file │ │ └── rml.txt │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── Simple-Line-Icons.woff2 │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── i18n │ │ └── messages.properties │ ├── img │ │ ├── background-login.jpg │ │ ├── blue.png │ │ ├── loading-upload.gif │ │ ├── loading.gif │ │ ├── locked.png │ │ ├── login-background.jpg │ │ ├── login.png │ │ ├── pay.png │ │ ├── profile.jpg │ │ ├── progress.png │ │ ├── qr_code.png │ │ ├── silence-login.png │ │ └── user.png │ ├── js │ │ ├── bootstrap.min.js │ │ ├── jquery-ui-1.10.4.min.js │ │ ├── jquery.contextMenu.min.js │ │ ├── jquery.i18n.properties.min.js │ │ ├── jquery.min.js │ │ └── plugins │ │ │ ├── metisMenu │ │ │ └── jquery.metisMenu.js │ │ │ └── slimscroll │ │ │ └── jquery.slimscroll.min.js │ ├── ruoyi.png │ ├── silence.png │ └── silence │ │ ├── css │ │ └── ry-ui.css │ │ ├── favicon.ico │ │ ├── index.js │ │ ├── js │ │ ├── common.js │ │ └── ry-ui.js │ │ ├── login.js │ │ └── meinv.jpeg │ └── templates │ ├── demo │ ├── form │ │ ├── autocomplete.html │ │ ├── basic.html │ │ ├── button.html │ │ ├── datetime.html │ │ ├── duallistbox.html │ │ ├── grid.html │ │ ├── jasny.html │ │ ├── select.html │ │ ├── sortable.html │ │ ├── tabs_panels.html │ │ ├── upload.html │ │ ├── validate.html │ │ └── wizard.html │ ├── icon │ │ ├── fontawesome.html │ │ └── glyphicons.html │ ├── modal │ │ ├── dialog.html │ │ ├── form.html │ │ ├── layer.html │ │ ├── table.html │ │ └── table │ │ │ ├── check.html │ │ │ ├── parent.html │ │ │ └── radio.html │ ├── operate │ │ ├── add.html │ │ ├── detail.html │ │ ├── edit.html │ │ ├── other.html │ │ └── table.html │ ├── report │ │ ├── echarts.html │ │ ├── metrics.html │ │ ├── peity.html │ │ └── sparkline.html │ └── table │ │ ├── button.html │ │ ├── detail.html │ │ ├── event.html │ │ ├── export.html │ │ ├── fixedColumns.html │ │ ├── footer.html │ │ ├── groupHeader.html │ │ ├── image.html │ │ ├── multi.html │ │ ├── other.html │ │ ├── pageGo.html │ │ ├── params.html │ │ ├── remember.html │ │ └── search.html │ ├── error │ ├── 404.html │ ├── 500.html │ ├── business.html │ └── unauth.html │ ├── include.html │ ├── index.html │ ├── login.html │ ├── main.html │ ├── monitor │ ├── logininfor │ │ └── logininfor.html │ ├── online │ │ └── online.html │ ├── operlog │ │ ├── detail.html │ │ └── operlog.html │ └── server │ │ └── server.html │ ├── system │ ├── aaa.css │ ├── config │ │ ├── add.html │ │ ├── config.html │ │ └── edit.html │ ├── dept │ │ ├── add.html │ │ ├── dept.html │ │ ├── edit.html │ │ └── tree.html │ ├── dict │ │ ├── data │ │ │ ├── add.html │ │ │ ├── data.html │ │ │ └── edit.html │ │ └── type │ │ │ ├── add.html │ │ │ ├── edit.html │ │ │ └── type.html │ ├── menu │ │ ├── add.html │ │ ├── edit.html │ │ ├── icon.html │ │ ├── menu.html │ │ └── tree.html │ ├── notice │ │ ├── add.html │ │ ├── edit.html │ │ └── notice.html │ ├── post │ │ ├── add.html │ │ ├── edit.html │ │ └── post.html │ ├── role │ │ ├── add.html │ │ ├── authUser.html │ │ ├── dataScope.html │ │ ├── edit.html │ │ ├── role.html │ │ └── selectUser.html │ └── user │ │ ├── add.html │ │ ├── edit.html │ │ ├── profile │ │ ├── avatar.html │ │ ├── profile.html │ │ └── resetPwd.html │ │ ├── resetPwd.html │ │ └── user.html │ ├── test.html │ └── tool │ └── build │ └── build.html ├── silence-common ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── silence │ └── common │ ├── annotation │ ├── DataScope.java │ ├── DataSource.java │ ├── Excel.java │ └── Log.java │ ├── config │ ├── Global.java │ ├── ServerConfig.java │ ├── datasource │ │ └── DynamicDataSourceContextHolder.java │ └── thread │ │ └── ThreadPoolConfig.java │ ├── constant │ ├── Constants.java │ ├── PermissionConstants.java │ ├── ScheduleConstants.java │ ├── ShiroConstants.java │ └── UserConstants.java │ ├── core │ ├── controller │ │ └── BaseController.java │ ├── domain │ │ ├── AjaxResult.java │ │ ├── BaseEntity.java │ │ └── Ztree.java │ ├── page │ │ ├── PageDomain.java │ │ ├── TableDataInfo.java │ │ └── TableSupport.java │ └── text │ │ ├── CharsetKit.java │ │ ├── Convert.java │ │ └── StrFormatter.java │ ├── enums │ ├── BusinessStatus.java │ ├── BusinessType.java │ ├── DataSourceType.java │ ├── OnlineStatus.java │ ├── OperatorType.java │ └── UserStatus.java │ ├── exception │ ├── BusinessException.java │ ├── DemoModeException.java │ ├── base │ │ └── BaseException.java │ ├── file │ │ ├── FileException.java │ │ ├── FileNameLengthLimitExceededException.java │ │ ├── FileSizeLimitExceededException.java │ │ └── InvalidExtensionException.java │ ├── job │ │ └── TaskException.java │ └── user │ │ ├── CaptchaException.java │ │ ├── RoleBlockedException.java │ │ ├── UserBlockedException.java │ │ ├── UserDeleteException.java │ │ ├── UserException.java │ │ ├── UserNotExistsException.java │ │ ├── UserPasswordNotMatchException.java │ │ ├── UserPasswordRetryLimitCountException.java │ │ └── UserPasswordRetryLimitExceedException.java │ ├── json │ ├── JSON.java │ └── JSONObject.java │ ├── utils │ ├── AddressUtils.java │ ├── Arith.java │ ├── DateUtils.java │ ├── ExceptionUtil.java │ ├── HttpTools.java │ ├── IpUtils.java │ ├── MapDataUtil.java │ ├── MessageUtils.java │ ├── ServletUtils.java │ ├── StringUtils.java │ ├── Threads.java │ ├── YamlUtil.java │ ├── bean │ │ └── BeanUtils.java │ ├── file │ │ ├── FileUploadUtils.java │ │ ├── FileUtils.java │ │ └── MimeTypeUtils.java │ ├── http │ │ └── HttpUtils.java │ ├── poi │ │ └── ExcelUtil.java │ ├── reflect │ │ └── ReflectUtils.java │ ├── security │ │ ├── Md5Utils.java │ │ └── PermissionUtils.java │ ├── spring │ │ └── SpringUtils.java │ └── sql │ │ └── SqlUtil.java │ └── xss │ ├── XssFilter.java │ └── XssHttpServletRequestWrapper.java ├── silence-framework ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── silence │ └── framework │ ├── aspectj │ ├── DataScopeAspect.java │ ├── DataSourceAspect.java │ └── LogAspect.java │ ├── config │ ├── ApplicationConfig.java │ ├── CaptchaConfig.java │ ├── DruidConfig.java │ ├── FilterConfig.java │ ├── I18nConfig.java │ ├── KaptchaTextCreator.java │ ├── ResourcesConfig.java │ ├── ShiroConfig.java │ └── properties │ │ └── DruidProperties.java │ ├── datasource │ └── DynamicDataSource.java │ ├── manager │ ├── AsyncManager.java │ ├── ShutdownManager.java │ └── factory │ │ └── AsyncFactory.java │ ├── shiro │ ├── realm │ │ └── UserRealm.java │ ├── service │ │ ├── SysLoginService.java │ │ ├── SysPasswordService.java │ │ └── SysShiroService.java │ ├── session │ │ ├── OnlineSession.java │ │ ├── OnlineSessionDAO.java │ │ └── OnlineSessionFactory.java │ └── web │ │ ├── filter │ │ ├── LogoutFilter.java │ │ ├── captcha │ │ │ └── CaptchaValidateFilter.java │ │ ├── kickout │ │ │ └── KickoutSessionFilter.java │ │ ├── online │ │ │ └── OnlineSessionFilter.java │ │ └── sync │ │ │ └── SyncOnlineSessionFilter.java │ │ └── session │ │ ├── OnlineWebSessionManager.java │ │ └── SpringSessionValidationScheduler.java │ ├── util │ ├── LogUtils.java │ └── ShiroUtils.java │ └── web │ ├── domain │ ├── Server.java │ └── server │ │ ├── Cpu.java │ │ ├── Jvm.java │ │ ├── Mem.java │ │ ├── Sys.java │ │ └── SysFile.java │ ├── exception │ └── GlobalExceptionHandler.java │ └── service │ ├── ConfigService.java │ ├── DictService.java │ └── PermissionService.java ├── silence-generator ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── silence │ │ └── generator │ │ ├── config │ │ └── GenConfig.java │ │ ├── controller │ │ ├── FansController.java │ │ └── GenController.java │ │ ├── domain │ │ ├── ColumnConfigInfo.java │ │ ├── ColumnInfo.java │ │ ├── Fans.java │ │ └── TableInfo.java │ │ ├── mapper │ │ ├── FansMapper.java │ │ └── GenMapper.java │ │ ├── service │ │ ├── IFansService.java │ │ ├── IGenService.java │ │ └── impl │ │ │ ├── FansServiceImpl.java │ │ │ └── GenServiceImpl.java │ │ └── util │ │ ├── GenUtils.java │ │ └── VelocityInitializer.java │ └── resources │ ├── generator.yml │ ├── mapper │ ├── generator │ │ └── GenMapper.xml │ └── system │ │ └── FansMapper.xml │ ├── templates │ ├── system │ │ └── fans │ │ │ ├── add.html │ │ │ ├── edit.html │ │ │ └── fans.html │ └── tool │ │ └── gen │ │ └── gen.html │ └── vm │ ├── html │ ├── add.html.vm │ ├── edit.html.vm │ └── list.html.vm │ ├── java │ ├── Controller.java.vm │ ├── Mapper.java.vm │ ├── Service.java.vm │ ├── ServiceImpl.java.vm │ └── domain.java.vm │ ├── sql │ └── sql.vm │ └── xml │ └── Mapper.xml.vm ├── silence-quartz ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── silence │ │ └── quartz │ │ ├── config │ │ └── ScheduleConfig.java │ │ ├── controller │ │ ├── SysJobController.java │ │ └── SysJobLogController.java │ │ ├── domain │ │ ├── SysJob.java │ │ └── SysJobLog.java │ │ ├── mapper │ │ ├── SysJobLogMapper.java │ │ └── SysJobMapper.java │ │ ├── service │ │ ├── ISysJobLogService.java │ │ ├── ISysJobService.java │ │ └── impl │ │ │ ├── SysJobLogServiceImpl.java │ │ │ └── SysJobServiceImpl.java │ │ ├── task │ │ └── RyTask.java │ │ └── util │ │ ├── AbstractQuartzJob.java │ │ ├── CronUtils.java │ │ ├── JobInvokeUtil.java │ │ ├── QuartzDisallowConcurrentExecution.java │ │ ├── QuartzJobExecution.java │ │ └── ScheduleUtils.java │ └── resources │ ├── mapper │ └── quartz │ │ ├── SysJobLogMapper.xml │ │ └── SysJobMapper.xml │ └── templates │ └── monitor │ └── job │ ├── add.html │ ├── detail.html │ ├── edit.html │ ├── job.html │ └── jobLog.html ├── silence-system ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── silence │ │ └── system │ │ ├── domain │ │ ├── SysConfig.java │ │ ├── SysDept.java │ │ ├── SysDictData.java │ │ ├── SysDictType.java │ │ ├── SysLogininfor.java │ │ ├── SysMenu.java │ │ ├── SysNotice.java │ │ ├── SysOperLog.java │ │ ├── SysPost.java │ │ ├── SysRole.java │ │ ├── SysRoleDept.java │ │ ├── SysRoleMenu.java │ │ ├── SysUser.java │ │ ├── SysUserOnline.java │ │ ├── SysUserPost.java │ │ └── SysUserRole.java │ │ ├── mapper │ │ ├── SysConfigMapper.java │ │ ├── SysDeptMapper.java │ │ ├── SysDictDataMapper.java │ │ ├── SysDictTypeMapper.java │ │ ├── SysLogininforMapper.java │ │ ├── SysMenuMapper.java │ │ ├── SysNoticeMapper.java │ │ ├── SysOperLogMapper.java │ │ ├── SysPostMapper.java │ │ ├── SysRoleDeptMapper.java │ │ ├── SysRoleMapper.java │ │ ├── SysRoleMenuMapper.java │ │ ├── SysUserMapper.java │ │ ├── SysUserOnlineMapper.java │ │ ├── SysUserPostMapper.java │ │ └── SysUserRoleMapper.java │ │ └── service │ │ ├── ISysConfigService.java │ │ ├── ISysDeptService.java │ │ ├── ISysDictDataService.java │ │ ├── ISysDictTypeService.java │ │ ├── ISysLogininforService.java │ │ ├── ISysMenuService.java │ │ ├── ISysNoticeService.java │ │ ├── ISysOperLogService.java │ │ ├── ISysPostService.java │ │ ├── ISysRoleService.java │ │ ├── ISysUserOnlineService.java │ │ ├── ISysUserService.java │ │ └── impl │ │ ├── SysConfigServiceImpl.java │ │ ├── SysDeptServiceImpl.java │ │ ├── SysDictDataServiceImpl.java │ │ ├── SysDictTypeServiceImpl.java │ │ ├── SysLogininforServiceImpl.java │ │ ├── SysMenuServiceImpl.java │ │ ├── SysNoticeServiceImpl.java │ │ ├── SysOperLogServiceImpl.java │ │ ├── SysPostServiceImpl.java │ │ ├── SysRoleServiceImpl.java │ │ ├── SysUserOnlineServiceImpl.java │ │ └── SysUserServiceImpl.java │ └── resources │ └── mapper │ └── system │ ├── SysConfigMapper.xml │ ├── SysDeptMapper.xml │ ├── SysDictDataMapper.xml │ ├── SysDictTypeMapper.xml │ ├── SysLogininforMapper.xml │ ├── SysMenuMapper.xml │ ├── SysNoticeMapper.xml │ ├── SysOperLogMapper.xml │ ├── SysPostMapper.xml │ ├── SysRoleDeptMapper.xml │ ├── SysRoleMapper.xml │ ├── SysRoleMenuMapper.xml │ ├── SysUserMapper.xml │ ├── SysUserOnlineMapper.xml │ ├── SysUserPostMapper.xml │ └── SysUserRoleMapper.xml ├── silence-weixin ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── silence │ │ └── weixin │ │ ├── builder │ │ ├── AbstractBuilder.java │ │ ├── ImageBuilder.java │ │ └── TextBuilder.java │ │ ├── config │ │ ├── WxMpConfiguration.java │ │ └── WxMpProperties.java │ │ ├── controller │ │ ├── WxMenuController.java │ │ ├── WxMpOAuthController.java │ │ ├── WxMpWeChatController.java │ │ └── WxPortalController.java │ │ ├── handler │ │ ├── AbstractHandler.java │ │ ├── KfSessionHandler.java │ │ ├── LocationHandler.java │ │ ├── LogHandler.java │ │ ├── MenuHandler.java │ │ ├── MsgHandler.java │ │ ├── NullHandler.java │ │ ├── ScanHandler.java │ │ ├── StoreCheckNotifyHandler.java │ │ ├── SubscribeHandler.java │ │ └── UnsubscribeHandler.java │ │ ├── inter │ │ └── PushMessageService.java │ │ ├── service │ │ └── WXJSAPiService.java │ │ └── utils │ │ ├── JsonUtils.java │ │ ├── WeChatTemplateMsgUtils.java │ │ └── WeChatUtils.java │ └── resources │ └── application.yml └── sql ├── quartz.sql ├── ruoyi.html ├── ruoyi.pdm ├── ry_20190601.sql └── silence-new.sql /.gitignore: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Build Tools 3 | 4 | .gradle 5 | /build/ 6 | !gradle/wrapper/gradle-wrapper.jar 7 | 8 | target/ 9 | !.mvn/wrapper/maven-wrapper.jar 10 | 11 | ###################################################################### 12 | # IDE 13 | 14 | ### STS ### 15 | .apt_generated 16 | .classpath 17 | .factorypath 18 | .project 19 | .settings 20 | .springBeans 21 | 22 | ### IntelliJ IDEA ### 23 | .idea 24 | *.iws 25 | *.iml 26 | *.ipr 27 | 28 | ### NetBeans ### 29 | nbproject/private/ 30 | build/* 31 | nbbuild/ 32 | dist/ 33 | nbdist/ 34 | .nb-gradle/ 35 | 36 | ###################################################################### 37 | # Others 38 | *.log 39 | *.xml.versionsBackup 40 | 41 | !*/build/*.java 42 | !*/build/*.html 43 | !*/build/*.xml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 silence 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. -------------------------------------------------------------------------------- /bin/clean.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/bin/clean.bat -------------------------------------------------------------------------------- /bin/package.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/bin/package.bat -------------------------------------------------------------------------------- /bin/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo. 3 | echo [��Ϣ] ����Web���̡� 4 | echo. 5 | 6 | cd %~dp0 7 | cd ../silence-admin/target 8 | 9 | set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m 10 | 11 | java -jar %JAVA_OPTS% silence-admin.jar 12 | 13 | cd bin 14 | pause -------------------------------------------------------------------------------- /doc/screenshot/entity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/doc/screenshot/entity.png -------------------------------------------------------------------------------- /doc/screenshot/login-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/doc/screenshot/login-new.png -------------------------------------------------------------------------------- /doc/screenshot/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/doc/screenshot/login.png -------------------------------------------------------------------------------- /doc/screenshot/wechat-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/doc/screenshot/wechat-new.png -------------------------------------------------------------------------------- /doc/screenshot/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/doc/screenshot/wechat.png -------------------------------------------------------------------------------- /doc/若依环境使用手册.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/doc/若依环境使用手册.docx -------------------------------------------------------------------------------- /ry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AppName=silence.jar 4 | 5 | #JVM参数 6 | JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" 7 | APP_HOME=`pwd` 8 | LOG_PATH=$APP_HOME/logs/$AppName.log 9 | 10 | if [ "$1" = "" ]; 11 | then 12 | echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status} \033[0m" 13 | exit 1 14 | fi 15 | 16 | if [ "$AppName" = "" ]; 17 | then 18 | echo -e "\033[0;31m 未输入应用名 \033[0m" 19 | exit 1 20 | fi 21 | 22 | function start() 23 | { 24 | PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` 25 | 26 | if [ x"$PID" != x"" ]; then 27 | echo "$AppName is running..." 28 | else 29 | nohup java -jar $JVM_OPTS target/$AppName > /dev/null 2>&1 & 30 | echo "Start $AppName success..." 31 | fi 32 | } 33 | 34 | function stop() 35 | { 36 | echo "Stop $AppName" 37 | 38 | PID="" 39 | query(){ 40 | PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` 41 | } 42 | 43 | query 44 | if [ x"$PID" != x"" ]; then 45 | kill -TERM $PID 46 | echo "$AppName (pid:$PID) exiting..." 47 | while [ x"$PID" != x"" ] 48 | do 49 | sleep 1 50 | query 51 | done 52 | echo "$AppName exited." 53 | else 54 | echo "$AppName already stopped." 55 | fi 56 | } 57 | 58 | function restart() 59 | { 60 | stop 61 | sleep 2 62 | start 63 | } 64 | 65 | function status() 66 | { 67 | PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l` 68 | if [ $PID != 0 ];then 69 | echo "$AppName is running..." 70 | else 71 | echo "$AppName is not running..." 72 | fi 73 | } 74 | 75 | case $1 in 76 | start) 77 | start;; 78 | stop) 79 | stop;; 80 | restart) 81 | restart;; 82 | status) 83 | status;; 84 | *) 85 | 86 | esac 87 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/SilenceServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.silence; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * web容器中进行部署 8 | * 9 | * @author silence 10 | */ 11 | public class SilenceServletInitializer extends SpringBootServletInitializer 12 | { 13 | @Override 14 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) 15 | { 16 | return application.sources(SilenceApplication.class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/web/controller/demo/controller/DemoDialogController.java: -------------------------------------------------------------------------------- 1 | package com.silence.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 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/web/controller/demo/controller/DemoIconController.java: -------------------------------------------------------------------------------- 1 | package com.silence.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 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/web/controller/demo/controller/DemoReportController.java: -------------------------------------------------------------------------------- 1 | package com.silence.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 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/web/controller/monitor/DruidController.java: -------------------------------------------------------------------------------- 1 | package com.silence.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.silence.common.core.controller.BaseController; 8 | 9 | /** 10 | * druid 监控 11 | * 12 | * @author silence 13 | */ 14 | @Controller 15 | @RequestMapping("/monitor/data") 16 | public class DruidController extends BaseController 17 | { 18 | private String prefix = "/monitor/druid"; 19 | 20 | @RequiresPermissions("monitor:data:view") 21 | @GetMapping() 22 | public String index() 23 | { 24 | return redirect(prefix + "/index"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/web/controller/monitor/ServerController.java: -------------------------------------------------------------------------------- 1 | package com.silence.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.silence.common.core.controller.BaseController; 9 | import com.silence.framework.web.domain.Server; 10 | 11 | /** 12 | * 服务器监控 13 | * 14 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/web/controller/system/SysIndexController.java: -------------------------------------------------------------------------------- 1 | package com.silence.web.controller.system; 2 | 3 | import com.silence.common.config.Global; 4 | import com.silence.common.core.controller.BaseController; 5 | import com.silence.framework.util.ShiroUtils; 6 | import com.silence.system.domain.SysMenu; 7 | import com.silence.system.domain.SysUser; 8 | import com.silence.system.service.ISysMenuService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.ModelMap; 12 | import org.springframework.web.bind.annotation.GetMapping; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * 首页 业务处理 18 | * 19 | * @author silence 20 | */ 21 | @Controller 22 | public class SysIndexController extends BaseController 23 | { 24 | @Autowired 25 | private ISysMenuService menuService; 26 | 27 | // 系统首页 28 | @GetMapping("/index") 29 | public String index(ModelMap mmap) 30 | { 31 | // 取身份信息 32 | SysUser user = ShiroUtils.getSysUser(); 33 | // 根据用户id取出菜单 34 | List menus = menuService.selectMenusByUser(user); 35 | mmap.put("menus", menus); 36 | mmap.put("user", user); 37 | mmap.put("name", Global.getName()); 38 | mmap.put("copyrightYear", Global.getCopyrightYear()); 39 | mmap.put("demoEnabled", Global.isDemoEnabled()); 40 | return "index"; 41 | } 42 | 43 | // 系统介绍 44 | @GetMapping("/system/main") 45 | public String main(ModelMap mmap) 46 | { 47 | mmap.put("version", Global.getVersion()); 48 | return "main"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/web/controller/system/TestLoginController.java: -------------------------------------------------------------------------------- 1 | package com.silence.web.controller.system; 2 | 3 | import com.silence.common.core.controller.BaseController; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | /** 11 | *
12 |  * @desc:
13 |  * @title: TestController
14 |  * @author: cao_wencao
15 |  * @date: 2019-06-12 16:25
16 |  * @version: 1.0
17 |  * 
18 | */ 19 | @Controller 20 | public class TestLoginController extends BaseController { 21 | @GetMapping("/test") 22 | public String login(HttpServletRequest request, HttpServletResponse response) 23 | { 24 | 25 | return "test"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/web/controller/tool/BuildController.java: -------------------------------------------------------------------------------- 1 | package com.silence.web.controller.tool; 2 | 3 | import com.silence.common.core.controller.BaseController; 4 | import org.apache.shiro.authz.annotation.RequiresPermissions; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * build 表单构建 11 | * 12 | * @author silence 13 | */ 14 | @Controller 15 | @RequestMapping("/tool/build") 16 | public class BuildController extends BaseController { 17 | private String prefix = "tool/build"; 18 | 19 | @RequiresPermissions("tool:build:view") 20 | @GetMapping() 21 | public String build() { 22 | return prefix + "/build"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /silence-admin/src/main/java/com/silence/web/controller/tool/SwaggerController.java: -------------------------------------------------------------------------------- 1 | package com.silence.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.silence.common.core.controller.BaseController; 8 | 9 | /** 10 | * swagger 接口 11 | * 12 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-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://localhost:3306/ry?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: /monitor/druid/* 45 | filter: 46 | stat: 47 | enabled: true 48 | # 慢SQL记录 49 | log-slow-sql: true 50 | slow-sql-millis: 1000 51 | merge-sql: true 52 | wall: 53 | config: 54 | multi-statement-allow: true -------------------------------------------------------------------------------- /silence-admin/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ♥♥♥♥♥♥♥♥♥♥♥♥♥ SpringBoot项目开始启动.................♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ 2 | //////////////////////////////////////////////////////////////////// 3 | // _ooOoo_ // 4 | // o8888888o // 5 | // 88" . "88 // 6 | // (| ^_^ |) // 7 | // O\ = /O // 8 | // ____/`---'\____ // 9 | // .' \\| |// `. // 10 | // / \\||| : |||// \ // 11 | // / _||||| -:- |||||- \ // 12 | // | | \\\ - /// | | // 13 | // | \_| ''\---/'' | | // 14 | // \ .-\__ `-` ___/-. / // 15 | // ___`. .' /--.--\ `. . ___ // 16 | // ."" '< `.___\_<|>_/___.' >'"". // 17 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | // 18 | // \ \ `-. \_ __\ /__ _/ .-` / / // 19 | // ========`-.____`-.___\_____/___.-`____.-'======== // 20 | // `=---=' // 21 | // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // 22 | // 佛祖保佑 永不宕机 永无BUG // 23 | //////////////////////////////////////////////////////////////////// 24 | 25 | ${AnsiColor.GREEN} :: Spring Boot :: (v${spring-boot.version}) 26 | ${AnsiColor.GREEN} :: Silence Boot :: (v${silence.version}.RELEASE) 27 | 28 | 29 | ${AnsiColor.BLACK} -------------------------------------------------------------------------------- /silence-admin/src/main/resources/ehcache/ehcache-shiro.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 24 | 25 | 26 | 27 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /silence-admin/src/main/resources/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/favicon.ico -------------------------------------------------------------------------------- /silence-admin/src/main/resources/mybatis/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /silence-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 | -------------------------------------------------------------------------------- /silence-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); -------------------------------------------------------------------------------- /silence-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%} -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/iCheck/green-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/iCheck/green-login.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/iCheck/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/iCheck/green.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/iCheck/green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/iCheck/green@2x.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_close.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/1_open.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/2.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/3.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/4.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/5.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/6.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/7.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/8.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/diy/9.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/line_conn.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/loading.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/default/img/zTreeStandard.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/line_conn.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/loading.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/metro/img/metro.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/left_menu.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/line_conn.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/loading.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/css/simple/img/zTreeStandard.png -------------------------------------------------------------------------------- /silence-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 | -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/icon-ext.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/icon.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-0.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-1.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/layer/theme/default/loading-2.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/layer/theme/moon/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/layer/theme/moon/default.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.eot -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.ttf -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/font/iconfont.woff -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.eot -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.ttf -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ajax/libs/summernote/font/summernote.woff -------------------------------------------------------------------------------- /silence-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 | -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/css/patterns/header-profile-skin-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/css/patterns/header-profile-skin-blue.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/css/patterns/header-profile-skin-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/css/patterns/header-profile-skin-yellow.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/css/patterns/header-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/css/patterns/header-profile.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/css/patterns/shattered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/css/patterns/shattered.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/file/rml.txt: -------------------------------------------------------------------------------- 1 | 下载临时目录 -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/Simple-Line-Icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/Simple-Line-Icons.woff2 -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /silence-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.notfound=请重新登录 22 | user.forcelogout=管理员强制退出,请重新登录 23 | user.unknown.error=未知错误,请重新登录 24 | 25 | ##文件上传消息 26 | upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! 27 | upload.filename.exceed.length=上传的文件名最长{0}个字符 28 | 29 | ##权限 30 | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] 31 | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] 32 | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] 33 | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] 34 | no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] 35 | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] 36 | -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/background-login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/background-login.jpg -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/blue.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/loading-upload.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/loading-upload.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/loading.gif -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/locked.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/login-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/login-background.jpg -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/login.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/pay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/pay.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/profile.jpg -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/progress.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/qr_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/qr_code.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/silence-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/silence-login.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/img/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/img/user.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/ruoyi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/ruoyi.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/silence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/silence.png -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/silence/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/silence/favicon.ico -------------------------------------------------------------------------------- /silence-admin/src/main/resources/static/silence/meinv.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Thinkingcao/silence-boot/ef56ff673171a6a04e8d9d138e662975ceb74a09/silence-admin/src/main/resources/static/silence/meinv.jpeg -------------------------------------------------------------------------------- /silence-admin/src/main/resources/templates/demo/operate/other.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /silence-admin/src/main/resources/templates/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | silence - 404 7 | 8 | 9 | 10 | 11 | 12 |
13 |

404

14 |

找不到网页!

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

500

14 |

内部服务器错误!

15 | 16 |
17 | 服务器遇到意外事件,不允许完成请求。我们抱歉。您可以返回主页面。 18 | 主页 19 |
20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /silence-admin/src/main/resources/templates/error/business.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | silence - 403 7 | 8 | 9 | 10 | 11 | 12 |
13 |

操作异常!

14 | 15 |
16 | [[${errorMessage}]] 17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /silence-admin/src/main/resources/templates/error/unauth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | silence - 403 7 | 8 | 9 | 10 | 11 | 12 |
13 |

403

14 |

您没有访问权限!

15 | 16 |
17 | 对不起,您没有访问权限,请不要进行非法操作!您可以返回主页面 18 | 返回主页 19 |
20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /silence-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 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /silence-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 | -------------------------------------------------------------------------------- /silence-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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/annotation/DataScope.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 数据权限过滤注解 11 | * 12 | * @author silence 13 | */ 14 | @Target(ElementType.METHOD) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Documented 17 | public @interface DataScope 18 | { 19 | /** 20 | * 表的别名 21 | */ 22 | public String tableAlias() default ""; 23 | } 24 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/annotation/DataSource.java: -------------------------------------------------------------------------------- 1 | package com.silence.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 | import com.silence.common.enums.DataSourceType; 8 | 9 | /** 10 | * 自定义多数据源切换注解 11 | * 12 | * @author silence 13 | */ 14 | @Target(ElementType.METHOD) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | public @interface DataSource 17 | { 18 | /** 19 | * 切换数据源名称 20 | */ 21 | public DataSourceType value() default DataSourceType.MASTER; 22 | } 23 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/annotation/Log.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | import com.silence.common.enums.BusinessType; 9 | import com.silence.common.enums.OperatorType; 10 | 11 | /** 12 | * 自定义操作日志记录注解 13 | * 14 | * @author silence 15 | */ 16 | @Target({ ElementType.PARAMETER, ElementType.METHOD }) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | @Documented 19 | public @interface Log 20 | { 21 | /** 22 | * 模块 23 | */ 24 | public String title() default ""; 25 | 26 | /** 27 | * 功能 28 | */ 29 | public BusinessType businessType() default BusinessType.OTHER; 30 | 31 | /** 32 | * 操作人类别 33 | */ 34 | public OperatorType operatorType() default OperatorType.MANAGE; 35 | 36 | /** 37 | * 是否保存请求的参数 38 | */ 39 | public boolean isSaveRequestData() default true; 40 | } 41 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/config/ServerConfig.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.config; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import org.springframework.stereotype.Component; 5 | import com.silence.common.utils.ServletUtils; 6 | 7 | /** 8 | * 服务相关配置 9 | * 10 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/config/datasource/DynamicDataSourceContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.config.datasource; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | /** 7 | * 数据源切换处理 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/constant/Constants.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.constant; 2 | 3 | /** 4 | * 通用常量信息 5 | * 6 | * @author silence 7 | */ 8 | public class Constants 9 | { 10 | /** 11 | * UTF-8 字符集 12 | */ 13 | public static final String UTF8 = "UTF-8"; 14 | 15 | /** 16 | * 通用成功标识 17 | */ 18 | public static final String SUCCESS = "0"; 19 | 20 | /** 21 | * 通用失败标识 22 | */ 23 | public static final String FAIL = "1"; 24 | 25 | /** 26 | * 登录成功 27 | */ 28 | public static final String LOGIN_SUCCESS = "Success"; 29 | 30 | /** 31 | * 注销 32 | */ 33 | public static final String LOGOUT = "Logout"; 34 | 35 | /** 36 | * 登录失败 37 | */ 38 | public static final String LOGIN_FAIL = "Error"; 39 | 40 | /** 41 | * 自动去除表前缀 42 | */ 43 | public static final String AUTO_REOMVE_PRE = "true"; 44 | 45 | /** 46 | * 当前记录起始索引 47 | */ 48 | public static final String PAGE_NUM = "pageNum"; 49 | 50 | /** 51 | * 每页显示记录数 52 | */ 53 | public static final String PAGE_SIZE = "pageSize"; 54 | 55 | /** 56 | * 排序列 57 | */ 58 | public static final String ORDER_BY_COLUMN = "orderByColumn"; 59 | 60 | /** 61 | * 排序的方向 "desc" 或者 "asc". 62 | */ 63 | public static final String IS_ASC = "isAsc"; 64 | } 65 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/constant/PermissionConstants.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.constant; 2 | 3 | /** 4 | * 权限通用常量 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/constant/ScheduleConstants.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.constant; 2 | 3 | /** 4 | * 任务调度通用常量 5 | * 6 | * @author silence 7 | */ 8 | public interface 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/constant/ShiroConstants.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.constant; 2 | 3 | /** 4 | * Shiro通用常量 5 | * 6 | * @author silence 7 | */ 8 | public interface 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 String MESSAGE = "message"; 24 | 25 | /** 26 | * 错误key 27 | */ 28 | public static String ERROR = "errorMsg"; 29 | 30 | /** 31 | * 编码格式 32 | */ 33 | public static String ENCODING = "UTF-8"; 34 | 35 | /** 36 | * 当前在线会话 37 | */ 38 | public 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/core/page/PageDomain.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.core.page; 2 | 3 | import com.silence.common.utils.StringUtils; 4 | 5 | /** 6 | * 分页数据 7 | * 8 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/core/page/TableDataInfo.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.core.page; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * 表格分页数据对象 8 | * 9 | * @author silence 10 | */ 11 | public class TableDataInfo implements Serializable 12 | { 13 | private static final long serialVersionUID = 1L; 14 | /** 总记录数 */ 15 | private long total; 16 | /** 列表数据 */ 17 | private List rows; 18 | /** 消息状态码 */ 19 | private int code; 20 | 21 | /** 22 | * 表格数据对象 23 | */ 24 | public TableDataInfo() 25 | { 26 | } 27 | 28 | /** 29 | * 分页 30 | * 31 | * @param list 列表数据 32 | * @param total 总记录数 33 | */ 34 | public TableDataInfo(List list, int total) 35 | { 36 | this.rows = list; 37 | this.total = total; 38 | } 39 | 40 | public long getTotal() 41 | { 42 | return total; 43 | } 44 | 45 | public void setTotal(long total) 46 | { 47 | this.total = total; 48 | } 49 | 50 | public List getRows() 51 | { 52 | return rows; 53 | } 54 | 55 | public void setRows(List rows) 56 | { 57 | this.rows = rows; 58 | } 59 | 60 | public int getCode() 61 | { 62 | return code; 63 | } 64 | 65 | public void setCode(int code) 66 | { 67 | this.code = code; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/core/page/TableSupport.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.core.page; 2 | 3 | import com.silence.common.constant.Constants; 4 | import com.silence.common.utils.ServletUtils; 5 | 6 | /** 7 | * 表格数据处理 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/enums/BusinessStatus.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.enums; 2 | 3 | /** 4 | * 操作状态 5 | * 6 | * @author silence 7 | */ 8 | public enum BusinessStatus 9 | { 10 | /** 11 | * 成功 12 | */ 13 | SUCCESS, 14 | 15 | /** 16 | * 失败 17 | */ 18 | FAIL, 19 | } 20 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/enums/BusinessType.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.enums; 2 | 3 | /** 4 | * 业务操作类型 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/enums/DataSourceType.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.enums; 2 | 3 | /** 4 | * 数据源 5 | * 6 | * @author silence 7 | */ 8 | public enum DataSourceType 9 | { 10 | /** 11 | * 主库 12 | */ 13 | MASTER, 14 | 15 | /** 16 | * 从库 17 | */ 18 | SLAVE 19 | } 20 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/enums/OnlineStatus.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.enums; 2 | 3 | /** 4 | * 用户会话 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/enums/OperatorType.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.enums; 2 | 3 | /** 4 | * 操作人类别 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/enums/UserStatus.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.enums; 2 | 3 | /** 4 | * 用户状态 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/BusinessException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception; 2 | 3 | /** 4 | * 业务异常 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/DemoModeException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception; 2 | 3 | /** 4 | * 演示模式异常 5 | * 6 | * @author silence 7 | */ 8 | public class DemoModeException extends RuntimeException 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public DemoModeException() 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/file/FileException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.file; 2 | 3 | import com.silence.common.exception.base.BaseException; 4 | 5 | /** 6 | * 文件信息异常类 7 | * 8 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/file/FileNameLengthLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.file; 2 | 3 | /** 4 | * 文件名称超长限制异常类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/file/FileSizeLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.file; 2 | 3 | /** 4 | * 文件名大小限制异常类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/job/TaskException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.job; 2 | 3 | /** 4 | * 计划策略异常 5 | * 6 | * @author silence 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 | } -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/user/CaptchaException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.user; 2 | 3 | /** 4 | * 验证码错误异常类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/user/RoleBlockedException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.user; 2 | 3 | /** 4 | * 角色锁定异常类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/user/UserBlockedException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.user; 2 | 3 | /** 4 | * 用户锁定异常类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/user/UserDeleteException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.user; 2 | 3 | /** 4 | * 用户账号已被删除 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/user/UserException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.user; 2 | 3 | import com.silence.common.exception.base.BaseException; 4 | 5 | /** 6 | * 用户信息异常类 7 | * 8 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/user/UserNotExistsException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.user; 2 | 3 | /** 4 | * 用户不存在异常类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/user/UserPasswordNotMatchException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.user; 2 | 3 | /** 4 | * 用户密码不正确或不符合规范异常类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/user/UserPasswordRetryLimitCountException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.user; 2 | 3 | /** 4 | * 用户错误记数异常类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/exception/user/UserPasswordRetryLimitExceedException.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.exception.user; 2 | 3 | /** 4 | * 用户错误最大次数异常类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/utils/AddressUtils.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.utils; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import com.silence.common.config.Global; 6 | import com.silence.common.json.JSON; 7 | import com.silence.common.json.JSONObject; 8 | import com.silence.common.utils.http.HttpUtils; 9 | 10 | /** 11 | * 获取地址类 12 | * 13 | * @author silence 14 | */ 15 | public class AddressUtils 16 | { 17 | private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); 18 | 19 | public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php"; 20 | 21 | public static String getRealAddressByIP(String ip) 22 | { 23 | String address = "XX XX"; 24 | 25 | // 内网不查询 26 | if (IpUtils.internalIp(ip)) 27 | { 28 | return "内网IP"; 29 | } 30 | if (Global.isAddressEnabled()) 31 | { 32 | String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip); 33 | if (StringUtils.isEmpty(rspStr)) 34 | { 35 | log.error("获取地理位置异常 {}", ip); 36 | return address; 37 | } 38 | JSONObject obj; 39 | try 40 | { 41 | obj = JSON.unmarshal(rspStr, JSONObject.class); 42 | JSONObject data = obj.getObj("data"); 43 | String region = data.getStr("region"); 44 | String city = data.getStr("city"); 45 | address = region + " " + city; 46 | } 47 | catch (Exception e) 48 | { 49 | log.error("获取地理位置异常 {}", ip); 50 | } 51 | } 52 | return address; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/utils/ExceptionUtil.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.utils; 2 | 3 | import java.io.PrintWriter; 4 | import java.io.StringWriter; 5 | import org.apache.commons.lang3.exception.ExceptionUtils; 6 | 7 | /** 8 | * 错误信息处理类。 9 | * 10 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/utils/MapDataUtil.java: -------------------------------------------------------------------------------- 1 | package com.silence.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 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/utils/MessageUtils.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.utils; 2 | 3 | import org.springframework.context.MessageSource; 4 | import org.springframework.context.i18n.LocaleContextHolder; 5 | import com.silence.common.utils.spring.SpringUtils; 6 | 7 | /** 8 | * 获取i18n资源文件 9 | * 10 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/utils/file/MimeTypeUtils.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.utils.file; 2 | 3 | /** 4 | * 媒体类型工具类 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/utils/security/Md5Utils.java: -------------------------------------------------------------------------------- 1 | package com.silence.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 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/utils/sql/SqlUtil.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.utils.sql; 2 | 3 | import com.silence.common.utils.StringUtils; 4 | 5 | /** 6 | * sql操作工具类 7 | * 8 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-common/src/main/java/com/silence/common/xss/XssHttpServletRequestWrapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.common.xss; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletRequestWrapper; 5 | import org.jsoup.Jsoup; 6 | import org.jsoup.safety.Whitelist; 7 | 8 | /** 9 | * XSS过滤处理 10 | * 11 | * @author silence 12 | */ 13 | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper 14 | { 15 | /** 16 | * @param request 17 | */ 18 | public XssHttpServletRequestWrapper(HttpServletRequest request) 19 | { 20 | super(request); 21 | } 22 | 23 | @Override 24 | public String[] getParameterValues(String name) 25 | { 26 | String[] values = super.getParameterValues(name); 27 | if (values != null) 28 | { 29 | int length = values.length; 30 | String[] escapseValues = new String[length]; 31 | for (int i = 0; i < length; i++) 32 | { 33 | // 防xss攻击和过滤前后空格 34 | escapseValues[i] = Jsoup.clean(values[i], Whitelist.relaxed()).trim(); 35 | } 36 | return escapseValues; 37 | } 38 | return super.getParameterValues(name); 39 | } 40 | } -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/aspectj/DataSourceAspect.java: -------------------------------------------------------------------------------- 1 | package com.silence.framework.aspectj; 2 | 3 | import java.lang.reflect.Method; 4 | import org.aspectj.lang.ProceedingJoinPoint; 5 | import org.aspectj.lang.annotation.Around; 6 | import org.aspectj.lang.annotation.Aspect; 7 | import org.aspectj.lang.annotation.Pointcut; 8 | import org.aspectj.lang.reflect.MethodSignature; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | import org.springframework.core.annotation.Order; 12 | import org.springframework.stereotype.Component; 13 | import com.silence.common.annotation.DataSource; 14 | import com.silence.common.config.datasource.DynamicDataSourceContextHolder; 15 | import com.silence.common.utils.StringUtils; 16 | 17 | /** 18 | * 多数据源处理 19 | * 20 | * @author silence 21 | */ 22 | @Aspect 23 | @Order(1) 24 | @Component 25 | public class DataSourceAspect 26 | { 27 | protected Logger logger = LoggerFactory.getLogger(getClass()); 28 | 29 | @Pointcut("@annotation(com.silence.common.annotation.DataSource)") 30 | public void dsPointCut() 31 | { 32 | 33 | } 34 | 35 | @Around("dsPointCut()") 36 | public Object around(ProceedingJoinPoint point) throws Throwable 37 | { 38 | MethodSignature signature = (MethodSignature) point.getSignature(); 39 | 40 | Method method = signature.getMethod(); 41 | 42 | DataSource dataSource = method.getAnnotation(DataSource.class); 43 | 44 | if (StringUtils.isNotNull(dataSource)) 45 | { 46 | DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name()); 47 | } 48 | 49 | try 50 | { 51 | return point.proceed(); 52 | } 53 | finally 54 | { 55 | // 销毁数据源 在执行方法之后 56 | DynamicDataSourceContextHolder.clearDataSourceType(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/config/ApplicationConfig.java: -------------------------------------------------------------------------------- 1 | package com.silence.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 | * @author silence 11 | */ 12 | @Configuration 13 | // 表示通过aop框架暴露该代理对象,AopContext能够访问 14 | @EnableAspectJAutoProxy(exposeProxy = true) 15 | // 指定要扫描的Mapper类的包的路径 16 | @MapperScan("com.silence.*.mapper") 17 | public class ApplicationConfig 18 | { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/config/FilterConfig.java: -------------------------------------------------------------------------------- 1 | package com.silence.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.silence.common.utils.StringUtils; 11 | import com.silence.common.xss.XssFilter; 12 | 13 | /** 14 | * Filter配置 15 | * 16 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/config/I18nConfig.java: -------------------------------------------------------------------------------- 1 | package com.silence.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 | * @author silence 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 | } -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/config/ResourcesConfig.java: -------------------------------------------------------------------------------- 1 | package com.silence.framework.config; 2 | 3 | import com.silence.common.config.Global; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 7 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 9 | 10 | /** 11 | * 通用配置 12 | * 13 | * @author silence 14 | */ 15 | @Configuration 16 | public class ResourcesConfig implements WebMvcConfigurer { 17 | /** 18 | * 首页地址 19 | */ 20 | @Value("${shiro.user.indexUrl}") 21 | private String indexUrl; 22 | 23 | /** 24 | * 默认首页的设置,当输入域名是可以自动跳转到默认指定的网页 25 | */ 26 | @Override 27 | public void addViewControllers(ViewControllerRegistry registry) { 28 | registry.addViewController("/").setViewName("forward:" + indexUrl); 29 | } 30 | 31 | @Override 32 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 33 | /** 文件上传路径 */ 34 | registry.addResourceHandler("/profile/**").addResourceLocations("file:" + Global.getProfile()); 35 | 36 | /** swagger配置 */ 37 | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); 38 | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); 39 | } 40 | } -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/datasource/DynamicDataSource.java: -------------------------------------------------------------------------------- 1 | package com.silence.framework.datasource; 2 | 3 | import java.util.Map; 4 | import javax.sql.DataSource; 5 | import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; 6 | import com.silence.common.config.datasource.DynamicDataSourceContextHolder; 7 | 8 | /** 9 | * 动态数据源 10 | * 11 | * @author silence 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 | } -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/manager/AsyncManager.java: -------------------------------------------------------------------------------- 1 | package com.silence.framework.manager; 2 | 3 | import java.util.TimerTask; 4 | import java.util.concurrent.ScheduledExecutorService; 5 | import java.util.concurrent.TimeUnit; 6 | import com.silence.common.utils.Threads; 7 | import com.silence.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 static AsyncManager me = new AsyncManager(); 30 | 31 | public static AsyncManager me() 32 | { 33 | return me; 34 | } 35 | 36 | /** 37 | * 执行任务 38 | * 39 | * @param task 任务 40 | */ 41 | public void execute(TimerTask task) 42 | { 43 | executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); 44 | } 45 | 46 | /** 47 | * 停止任务线程池 48 | */ 49 | public void shutdown() 50 | { 51 | Threads.shutdownAndAwaitTermination(executor); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/manager/ShutdownManager.java: -------------------------------------------------------------------------------- 1 | package com.silence.framework.manager; 2 | 3 | import com.silence.framework.shiro.web.session.SpringSessionValidationScheduler; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | import javax.annotation.PreDestroy; 9 | 10 | /** 11 | * 确保应用退出时能关闭后台线程 12 | * 13 | * @author cj 14 | */ 15 | @Component 16 | public class ShutdownManager 17 | { 18 | private static final Logger logger = LoggerFactory.getLogger("sys-user"); 19 | 20 | @Autowired(required = false) 21 | private SpringSessionValidationScheduler springSessionValidationScheduler; 22 | 23 | @PreDestroy 24 | public void destroy() 25 | { 26 | shutdownSpringSessionValidationScheduler(); 27 | shutdownAsyncManager(); 28 | } 29 | 30 | /** 31 | * 停止Seesion会话检查 32 | */ 33 | private void shutdownSpringSessionValidationScheduler() 34 | { 35 | if (springSessionValidationScheduler != null && springSessionValidationScheduler.isEnabled()) 36 | { 37 | try 38 | { 39 | logger.info("====关闭会话验证任务===="); 40 | springSessionValidationScheduler.disableSessionValidation(); 41 | } 42 | catch (Exception e) 43 | { 44 | logger.error(e.getMessage(), e); 45 | } 46 | } 47 | } 48 | 49 | /** 50 | * 停止异步执行任务 51 | */ 52 | private void shutdownAsyncManager() 53 | { 54 | try 55 | { 56 | logger.info("====关闭后台任务任务线程池===="); 57 | AsyncManager.me().shutdown(); 58 | } 59 | catch (Exception e) 60 | { 61 | logger.error(e.getMessage(), e); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/shiro/session/OnlineSessionFactory.java: -------------------------------------------------------------------------------- 1 | package com.silence.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.silence.common.utils.IpUtils; 10 | import com.silence.common.utils.ServletUtils; 11 | 12 | import eu.bitwalker.useragentutils.UserAgent; 13 | 14 | /** 15 | * 自定义sessionFactory会话 16 | * 17 | * @author silence 18 | */ 19 | @Component 20 | public class OnlineSessionFactory implements SessionFactory 21 | { 22 | @Override 23 | public Session createSession(SessionContext initData) 24 | { 25 | OnlineSession session = new OnlineSession(); 26 | if (initData != null && initData instanceof WebSessionContext) 27 | { 28 | WebSessionContext sessionContext = (WebSessionContext) initData; 29 | HttpServletRequest request = (HttpServletRequest) sessionContext.getServletRequest(); 30 | if (request != null) 31 | { 32 | UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); 33 | // 获取客户端操作系统 34 | String os = userAgent.getOperatingSystem().getName(); 35 | // 获取客户端浏览器 36 | String browser = userAgent.getBrowser().getName(); 37 | session.setHost(IpUtils.getIpAddr(request)); 38 | session.setBrowser(browser); 39 | session.setOs(os); 40 | } 41 | } 42 | return session; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/shiro/web/filter/sync/SyncOnlineSessionFilter.java: -------------------------------------------------------------------------------- 1 | package com.silence.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.silence.common.constant.ShiroConstants; 8 | import com.silence.framework.shiro.session.OnlineSession; 9 | import com.silence.framework.shiro.session.OnlineSessionDAO; 10 | 11 | /** 12 | * 同步Session数据到Db 13 | * 14 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/web/domain/server/Mem.java: -------------------------------------------------------------------------------- 1 | package com.silence.framework.web.domain.server; 2 | 3 | import com.silence.common.utils.Arith; 4 | 5 | /** 6 | * 內存相关信息 7 | * 8 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/web/domain/server/Sys.java: -------------------------------------------------------------------------------- 1 | package com.silence.framework.web.domain.server; 2 | 3 | /** 4 | * 系统相关信息 5 | * 6 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/web/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | package com.silence.framework.web.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.silence.system.service.ISysConfigService; 6 | 7 | /** 8 | * silence首创 html调用 thymeleaf 实现参数管理 9 | * 10 | * @author silence 11 | */ 12 | @Service("config") 13 | public class ConfigService 14 | { 15 | @Autowired 16 | private ISysConfigService configService; 17 | 18 | /** 19 | * 根据键名查询参数配置信息 20 | * 21 | * @param configName 参数名称 22 | * @return 参数键值 23 | */ 24 | public String getKey(String configKey) 25 | { 26 | return configService.selectConfigByKey(configKey); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/web/service/DictService.java: -------------------------------------------------------------------------------- 1 | package com.silence.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.silence.system.domain.SysDictData; 7 | import com.silence.system.service.ISysDictDataService; 8 | 9 | /** 10 | * silence首创 html调用 thymeleaf 实现字典读取 11 | * 12 | * @author silence 13 | */ 14 | @Service("dict") 15 | public class DictService 16 | { 17 | @Autowired 18 | private ISysDictDataService dictDataService; 19 | 20 | /** 21 | * 根据字典类型查询字典数据信息 22 | * 23 | * @param dictType 字典类型 24 | * @return 参数键值 25 | */ 26 | public List getType(String dictType) 27 | { 28 | return dictDataService.selectDictDataByType(dictType); 29 | } 30 | 31 | /** 32 | * 根据字典类型和字典键值查询字典数据信息 33 | * 34 | * @param dictType 字典类型 35 | * @param dictValue 字典键值 36 | * @return 字典标签 37 | */ 38 | public String getLabel(String dictType, String dictValue) 39 | { 40 | return dictDataService.selectDictLabel(dictType, dictValue); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /silence-framework/src/main/java/com/silence/framework/web/service/PermissionService.java: -------------------------------------------------------------------------------- 1 | package com.silence.framework.web.service; 2 | 3 | import org.apache.shiro.SecurityUtils; 4 | import org.springframework.stereotype.Service; 5 | import com.silence.common.utils.security.PermissionUtils; 6 | 7 | /** 8 | * silence首创 js调用 thymeleaf 实现按钮权限可见性 9 | * 10 | * @author silence 11 | */ 12 | @Service("permission") 13 | public class PermissionService 14 | { 15 | public String hasPermi(String permission) 16 | { 17 | return isPermittedOperator(permission) ? "" : "hidden"; 18 | } 19 | 20 | public String hasRole(String role) 21 | { 22 | return hasRoleOperator(role) ? "" : "hidden"; 23 | } 24 | 25 | /** 26 | * 判断用户是否拥有某个权限 27 | * 28 | * @param permission 权限字符串 29 | * @return 结果 30 | */ 31 | private boolean isPermittedOperator(String permission) 32 | { 33 | return SecurityUtils.getSubject().isPermitted(permission); 34 | } 35 | 36 | /** 37 | * 判断用户是否拥有某个角色 38 | * 39 | * @param role 角色字符串 40 | * @return 结果 41 | */ 42 | private boolean hasRoleOperator(String role) 43 | { 44 | return SecurityUtils.getSubject().hasRole(role); 45 | } 46 | 47 | /** 48 | * 返回用户属性值 49 | * 50 | * @param property 属性名称 51 | * @return 用户属性值 52 | */ 53 | public Object getPrincipalProperty(String property) 54 | { 55 | return PermissionUtils.getPrincipalProperty(property); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /silence-generator/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | silence 7 | com.silence 8 | 3.4 9 | 10 | 4.0.0 11 | 12 | silence-generator 13 | 14 | 15 | generator代码生成 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.apache.velocity 23 | velocity 24 | 25 | 26 | 27 | 28 | com.silence 29 | silence-common 30 | 31 | 32 | 33 | 34 | org.projectlombok 35 | lombok 36 | provided 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /silence-generator/src/main/java/com/silence/generator/config/GenConfig.java: -------------------------------------------------------------------------------- 1 | package com.silence.generator.config; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.PropertySource; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * 读取代码生成相关配置 10 | * 11 | * @author silence 12 | */ 13 | @Component 14 | @ConfigurationProperties(prefix = "gen") 15 | @PropertySource(value = { "classpath:generator.yml" }) 16 | public class GenConfig 17 | { 18 | /** 作者 */ 19 | public static String author; 20 | 21 | /** 生成包路径 */ 22 | public static String packageName; 23 | 24 | /** 自动去除表前缀,默认是true */ 25 | public static String autoRemovePre; 26 | 27 | /** 表前缀(类名不会包含表前缀) */ 28 | public static String tablePrefix; 29 | 30 | public static String getAuthor() 31 | { 32 | return author; 33 | } 34 | 35 | @Value("${author}") 36 | public void setAuthor(String author) 37 | { 38 | GenConfig.author = author; 39 | } 40 | 41 | public static String getPackageName() 42 | { 43 | return packageName; 44 | } 45 | 46 | @Value("${packageName}") 47 | public void setPackageName(String packageName) 48 | { 49 | GenConfig.packageName = packageName; 50 | } 51 | 52 | public static String getAutoRemovePre() 53 | { 54 | return autoRemovePre; 55 | } 56 | 57 | @Value("${autoRemovePre}") 58 | public void setAutoRemovePre(String autoRemovePre) 59 | { 60 | GenConfig.autoRemovePre = autoRemovePre; 61 | } 62 | 63 | public static String getTablePrefix() 64 | { 65 | return tablePrefix; 66 | } 67 | 68 | @Value("${tablePrefix}") 69 | public void setTablePrefix(String tablePrefix) 70 | { 71 | GenConfig.tablePrefix = tablePrefix; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /silence-generator/src/main/java/com/silence/generator/domain/ColumnConfigInfo.java: -------------------------------------------------------------------------------- 1 | package com.silence.generator.domain; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | /** 6 | * 字段类型配置 由数据库字段的注释解析而来 7 | * 注释结构示例:{"title": "状态", "type": "dict", "value": "sys_common_status"} {"title": "登录时间", "type": "date"} 8 | * 9 | * @author silence 10 | * 11 | */ 12 | @JsonIgnoreProperties(ignoreUnknown = true) 13 | public class ColumnConfigInfo 14 | { 15 | /** 16 | * 属性标题 17 | */ 18 | private String title; 19 | 20 | /** 21 | * 属性类型 dict(字典,value对应字典管理的字典类型), date(包括date) 22 | */ 23 | private String type; 24 | 25 | /** 26 | * 属性值,参考数据类型,可为空 27 | */ 28 | private String value; 29 | 30 | public ColumnConfigInfo() 31 | { 32 | super(); 33 | } 34 | 35 | public ColumnConfigInfo(String title, String type, String value) 36 | { 37 | super(); 38 | this.title = title; 39 | this.type = type; 40 | this.value = value; 41 | } 42 | 43 | public String getTitle() 44 | { 45 | return title; 46 | } 47 | 48 | public void setTitle(String title) 49 | { 50 | this.title = title; 51 | } 52 | 53 | public String getType() 54 | { 55 | return type; 56 | } 57 | 58 | public void setType(String type) 59 | { 60 | this.type = type; 61 | } 62 | 63 | public String getValue() 64 | { 65 | return value; 66 | } 67 | 68 | public void setValue(String value) 69 | { 70 | this.value = value; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /silence-generator/src/main/java/com/silence/generator/mapper/FansMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.generator.mapper; 2 | 3 | import com.silence.generator.domain.Fans; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 粉丝 数据层 9 | * 10 | * @author silence 11 | * @date 2019-09-18 12 | */ 13 | public interface FansMapper 14 | { 15 | /** 16 | * 查询粉丝信息 17 | * 18 | * @param id 粉丝ID 19 | * @return 粉丝信息 20 | */ 21 | public Fans selectFansById(String id); 22 | 23 | /** 24 | * 查询粉丝列表 25 | * 26 | * @param fans 粉丝信息 27 | * @return 粉丝集合 28 | */ 29 | public List selectFansList(Fans fans); 30 | 31 | /** 32 | * 新增粉丝 33 | * 34 | * @param fans 粉丝信息 35 | * @return 结果 36 | */ 37 | public int insertFans(Fans fans); 38 | 39 | /** 40 | * 修改粉丝 41 | * 42 | * @param fans 粉丝信息 43 | * @return 结果 44 | */ 45 | public int updateFans(Fans fans); 46 | 47 | /** 48 | * 删除粉丝 49 | * 50 | * @param id 粉丝ID 51 | * @return 结果 52 | */ 53 | public int deleteFansById(String id); 54 | 55 | /** 56 | * 批量删除粉丝 57 | * 58 | * @param ids 需要删除的数据ID 59 | * @return 结果 60 | */ 61 | public int deleteFansByIds(String[] ids); 62 | 63 | } -------------------------------------------------------------------------------- /silence-generator/src/main/java/com/silence/generator/mapper/GenMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.generator.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.generator.domain.ColumnInfo; 5 | import com.silence.generator.domain.TableInfo; 6 | 7 | /** 8 | * 代码生成 数据层 9 | * 10 | * @author silence 11 | */ 12 | public interface GenMapper 13 | { 14 | /** 15 | * 查询ry数据库表信息 16 | * 17 | * @param tableInfo 表信息 18 | * @return 数据库表列表 19 | */ 20 | public List selectTableList(TableInfo tableInfo); 21 | 22 | /** 23 | * 根据表名称查询信息 24 | * 25 | * @param tableName 表名称 26 | * @return 表信息 27 | */ 28 | public TableInfo selectTableByName(String tableName); 29 | 30 | /** 31 | * 根据表名称查询列信息 32 | * 33 | * @param tableName 表名称 34 | * @return 列信息 35 | */ 36 | public List selectTableColumnsByName(String tableName); 37 | } 38 | -------------------------------------------------------------------------------- /silence-generator/src/main/java/com/silence/generator/service/IFansService.java: -------------------------------------------------------------------------------- 1 | package com.silence.generator.service; 2 | 3 | import com.silence.generator.domain.Fans; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 粉丝 服务层 9 | * 10 | * @author silence 11 | * @date 2019-09-18 12 | */ 13 | public interface IFansService 14 | { 15 | /** 16 | * 查询粉丝信息 17 | * 18 | * @param id 粉丝ID 19 | * @return 粉丝信息 20 | */ 21 | public Fans selectFansById(String id); 22 | 23 | /** 24 | * 查询粉丝列表 25 | * 26 | * @param fans 粉丝信息 27 | * @return 粉丝集合 28 | */ 29 | public List selectFansList(Fans fans); 30 | 31 | /** 32 | * 新增粉丝 33 | * 34 | * @param fans 粉丝信息 35 | * @return 结果 36 | */ 37 | public int insertFans(Fans fans); 38 | 39 | /** 40 | * 修改粉丝 41 | * 42 | * @param fans 粉丝信息 43 | * @return 结果 44 | */ 45 | public int updateFans(Fans fans); 46 | 47 | /** 48 | * 删除粉丝信息 49 | * 50 | * @param ids 需要删除的数据ID 51 | * @return 结果 52 | */ 53 | public int deleteFansByIds(String ids); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /silence-generator/src/main/java/com/silence/generator/service/IGenService.java: -------------------------------------------------------------------------------- 1 | package com.silence.generator.service; 2 | 3 | import java.util.List; 4 | import com.silence.generator.domain.TableInfo; 5 | 6 | /** 7 | * 代码生成 服务层 8 | * 9 | * @author silence 10 | */ 11 | public interface IGenService 12 | { 13 | /** 14 | * 查询ry数据库表信息 15 | * 16 | * @param tableInfo 表信息 17 | * @return 数据库表列表 18 | */ 19 | public List selectTableList(TableInfo tableInfo); 20 | 21 | /** 22 | * 生成代码 23 | * 24 | * @param tableName 表名称 25 | * @return 数据 26 | */ 27 | public byte[] generatorCode(String tableName); 28 | 29 | /** 30 | * 批量生成代码 31 | * 32 | * @param tableNames 表数组 33 | * @return 数据 34 | */ 35 | public byte[] generatorCode(String[] tableNames); 36 | } 37 | -------------------------------------------------------------------------------- /silence-generator/src/main/java/com/silence/generator/service/impl/FansServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.silence.generator.service.impl; 2 | 3 | import com.silence.common.core.text.Convert; 4 | import com.silence.generator.domain.Fans; 5 | import com.silence.generator.mapper.FansMapper; 6 | import com.silence.generator.service.IFansService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 粉丝 服务层实现 14 | * 15 | * @author silence 16 | * @date 2019-09-18 17 | */ 18 | @Service 19 | public class FansServiceImpl implements IFansService 20 | { 21 | @Autowired 22 | private FansMapper fansMapper; 23 | 24 | /** 25 | * 查询粉丝信息 26 | * 27 | * @param id 粉丝ID 28 | * @return 粉丝信息 29 | */ 30 | @Override 31 | public Fans selectFansById(String id) 32 | { 33 | return fansMapper.selectFansById(id); 34 | } 35 | 36 | /** 37 | * 查询粉丝列表 38 | * 39 | * @param fans 粉丝信息 40 | * @return 粉丝集合 41 | */ 42 | @Override 43 | public List selectFansList(Fans fans) 44 | { 45 | return fansMapper.selectFansList(fans); 46 | } 47 | 48 | /** 49 | * 新增粉丝 50 | * 51 | * @param fans 粉丝信息 52 | * @return 结果 53 | */ 54 | @Override 55 | public int insertFans(Fans fans) 56 | { 57 | return fansMapper.insertFans(fans); 58 | } 59 | 60 | /** 61 | * 修改粉丝 62 | * 63 | * @param fans 粉丝信息 64 | * @return 结果 65 | */ 66 | @Override 67 | public int updateFans(Fans fans) 68 | { 69 | return fansMapper.updateFans(fans); 70 | } 71 | 72 | /** 73 | * 删除粉丝对象 74 | * 75 | * @param ids 需要删除的数据ID 76 | * @return 结果 77 | */ 78 | @Override 79 | public int deleteFansByIds(String ids) 80 | { 81 | return fansMapper.deleteFansByIds(Convert.toStrArray(ids)); 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /silence-generator/src/main/java/com/silence/generator/util/VelocityInitializer.java: -------------------------------------------------------------------------------- 1 | package com.silence.generator.util; 2 | 3 | import java.util.Properties; 4 | import org.apache.velocity.app.Velocity; 5 | import com.silence.common.constant.Constants; 6 | 7 | /** 8 | * VelocityEngine工厂 9 | * 10 | * @author silence 11 | */ 12 | public class VelocityInitializer 13 | { 14 | /** 15 | * 初始化vm方法 16 | */ 17 | public static void initVelocity() 18 | { 19 | Properties p = new Properties(); 20 | try 21 | { 22 | // 加载classpath目录下的vm文件 23 | p.setProperty("file.resource.loader.class", 24 | "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); 25 | // 定义字符集 26 | p.setProperty(Velocity.ENCODING_DEFAULT, Constants.UTF8); 27 | p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8); 28 | // 初始化Velocity引擎,指定配置Properties 29 | Velocity.init(p); 30 | } 31 | catch (Exception e) 32 | { 33 | throw new RuntimeException(e); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /silence-generator/src/main/resources/generator.yml: -------------------------------------------------------------------------------- 1 | 2 | # 代码生成 3 | gen: 4 | # 作者 5 | author: silence 6 | # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool 7 | packageName: com.silence.system 8 | # 自动去除表前缀,默认是true 9 | autoRemovePre: true 10 | # 表前缀(类名不会包含表前缀) 11 | tablePrefix: sys_ -------------------------------------------------------------------------------- /silence-generator/src/main/resources/vm/java/Mapper.java.vm: -------------------------------------------------------------------------------- 1 | package ${package}.mapper; 2 | 3 | import ${package}.domain.${className}; 4 | import java.util.List; 5 | 6 | /** 7 | * ${tableComment} 数据层 8 | * 9 | * @author ${author} 10 | * @date ${datetime} 11 | */ 12 | public interface ${className}Mapper 13 | { 14 | /** 15 | * 查询${tableComment}信息 16 | * 17 | * @param ${primaryKey.attrname} ${tableComment}ID 18 | * @return ${tableComment}信息 19 | */ 20 | public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); 21 | 22 | /** 23 | * 查询${tableComment}列表 24 | * 25 | * @param ${classname} ${tableComment}信息 26 | * @return ${tableComment}集合 27 | */ 28 | public List<${className}> select${className}List(${className} ${classname}); 29 | 30 | /** 31 | * 新增${tableComment} 32 | * 33 | * @param ${classname} ${tableComment}信息 34 | * @return 结果 35 | */ 36 | public int insert${className}(${className} ${classname}); 37 | 38 | /** 39 | * 修改${tableComment} 40 | * 41 | * @param ${classname} ${tableComment}信息 42 | * @return 结果 43 | */ 44 | public int update${className}(${className} ${classname}); 45 | 46 | /** 47 | * 删除${tableComment} 48 | * 49 | * @param ${primaryKey.attrname} ${tableComment}ID 50 | * @return 结果 51 | */ 52 | public int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); 53 | 54 | /** 55 | * 批量删除${tableComment} 56 | * 57 | * @param ${primaryKey.attrname}s 需要删除的数据ID 58 | * @return 结果 59 | */ 60 | public int delete${className}ByIds(String[] ${primaryKey.attrname}s); 61 | 62 | } -------------------------------------------------------------------------------- /silence-generator/src/main/resources/vm/java/Service.java.vm: -------------------------------------------------------------------------------- 1 | package ${package}.service; 2 | 3 | import ${package}.domain.${className}; 4 | import java.util.List; 5 | 6 | /** 7 | * ${tableComment} 服务层 8 | * 9 | * @author ${author} 10 | * @date ${datetime} 11 | */ 12 | public interface I${className}Service 13 | { 14 | /** 15 | * 查询${tableComment}信息 16 | * 17 | * @param ${primaryKey.attrname} ${tableComment}ID 18 | * @return ${tableComment}信息 19 | */ 20 | public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); 21 | 22 | /** 23 | * 查询${tableComment}列表 24 | * 25 | * @param ${classname} ${tableComment}信息 26 | * @return ${tableComment}集合 27 | */ 28 | public List<${className}> select${className}List(${className} ${classname}); 29 | 30 | /** 31 | * 新增${tableComment} 32 | * 33 | * @param ${classname} ${tableComment}信息 34 | * @return 结果 35 | */ 36 | public int insert${className}(${className} ${classname}); 37 | 38 | /** 39 | * 修改${tableComment} 40 | * 41 | * @param ${classname} ${tableComment}信息 42 | * @return 结果 43 | */ 44 | public int update${className}(${className} ${classname}); 45 | 46 | /** 47 | * 删除${tableComment}信息 48 | * 49 | * @param ids 需要删除的数据ID 50 | * @return 结果 51 | */ 52 | public int delete${className}ByIds(String ids); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /silence-generator/src/main/resources/vm/java/domain.java.vm: -------------------------------------------------------------------------------- 1 | package ${package}.domain; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | #foreach ($column in $columns) 7 | #if($column.attrType == 'Date' && ($column.attrname != 'createBy' && $column.attrname != 'createTime' && $column.attrname != 'updateBy' && $column.attrname != 'updateTime' && $column.attrname != 'remark')) 8 | #break 9 | #end 10 | #end 11 | #foreach ($column in $columns) 12 | #if($column.attrType == 'BigDecimal') 13 | #break 14 | #end 15 | #end 16 | /** 17 | * @desc: ${tableComment}表 ${tableName} 18 | * @author: ${author} 19 | * @date: ${datetime} 20 | */ 21 | @Data 22 | @ToString 23 | public class ${className} extends BaseEntity 24 | { 25 | private static final long serialVersionUID = 1L; 26 | 27 | #foreach ($column in $columns) 28 | #if($column.attrname != 'createBy' && $column.attrname != 'createTime' && $column.attrname != 'updateBy' && $column.attrname != 'updateTime' && $column.attrname != 'remark') 29 | 30 | private $column.attrType $column.attrname; //$column.columnComment 31 | #end 32 | #end 33 | 34 | #foreach ($column in $columns) 35 | #if($column.attrname != 'createBy' && $column.attrname != 'createTime' && $column.attrname != 'updateBy' && $column.attrname != 'updateTime' && $column.attrname != 'remark') 36 | ## public void set${column.attrName}($column.attrType $column.attrname) 37 | ## { 38 | ## this.$column.attrname = $column.attrname; 39 | ## } 40 | ## 41 | ## public $column.attrType get${column.attrName}() 42 | ## { 43 | ## return $column.attrname; 44 | ## } 45 | #end 46 | #end 47 | 48 | ## public String toString() { 49 | ## return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 50 | ## #foreach ($column in $columns) 51 | ## .append("${column.attrname}", get${column.attrName}()) 52 | ## #end 53 | ## .toString(); 54 | ## } 55 | } 56 | -------------------------------------------------------------------------------- /silence-generator/src/main/resources/vm/sql/sql.vm: -------------------------------------------------------------------------------- 1 | -- 菜单 SQL 2 | insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 3 | values('${tableComment}', '3', '1', '/${moduleName}/${classname}', 'C', '0', '${moduleName}:${classname}:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '${tableComment}菜单'); 4 | 5 | -- 按钮父菜单ID 6 | SELECT @parentId := LAST_INSERT_ID(); 7 | 8 | -- 按钮 SQL 9 | insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 10 | values('${tableComment}查询', @parentId, '1', '#', 'F', '0', '${moduleName}:${classname}:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); 11 | 12 | insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 13 | values('${tableComment}新增', @parentId, '2', '#', 'F', '0', '${moduleName}:${classname}:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); 14 | 15 | insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 16 | values('${tableComment}修改', @parentId, '3', '#', 'F', '0', '${moduleName}:${classname}:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); 17 | 18 | insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) 19 | values('${tableComment}删除', @parentId, '4', '#', 'F', '0', '${moduleName}:${classname}:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); 20 | -------------------------------------------------------------------------------- /silence-quartz/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | silence 7 | com.silence 8 | 3.4 9 | 10 | 4.0.0 11 | 12 | silence-quartz 13 | 14 | 15 | quartz定时任务 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.quartz-scheduler 23 | quartz 24 | 25 | 26 | com.mchange 27 | c3p0 28 | 29 | 30 | 31 | 32 | 33 | 34 | com.silence 35 | silence-common 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /silence-quartz/src/main/java/com/silence/quartz/mapper/SysJobLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.quartz.mapper; 2 | 3 | import com.silence.quartz.domain.SysJobLog; 4 | import java.util.List; 5 | 6 | /** 7 | * 调度任务日志信息 数据层 8 | * 9 | * @author silence 10 | */ 11 | public interface SysJobLogMapper 12 | { 13 | /** 14 | * 获取quartz调度器日志的计划任务 15 | * 16 | * @param jobLog 调度日志信息 17 | * @return 调度任务日志集合 18 | */ 19 | public List selectJobLogList(SysJobLog jobLog); 20 | 21 | /** 22 | * 查询所有调度任务日志 23 | * 24 | * @return 调度任务日志列表 25 | */ 26 | public List selectJobLogAll(); 27 | 28 | /** 29 | * 通过调度任务日志ID查询调度信息 30 | * 31 | * @param jobLogId 调度任务日志ID 32 | * @return 调度任务日志对象信息 33 | */ 34 | public SysJobLog selectJobLogById(Long jobLogId); 35 | 36 | /** 37 | * 新增任务日志 38 | * 39 | * @param jobLog 调度日志信息 40 | * @return 结果 41 | */ 42 | public int insertJobLog(SysJobLog jobLog); 43 | 44 | /** 45 | * 批量删除调度日志信息 46 | * 47 | * @param ids 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deleteJobLogByIds(String[] ids); 51 | 52 | /** 53 | * 删除任务日志 54 | * 55 | * @param jobId 调度日志ID 56 | * @return 结果 57 | */ 58 | public int deleteJobLogById(Long jobId); 59 | 60 | /** 61 | * 清空任务日志 62 | */ 63 | public void cleanJobLog(); 64 | } 65 | -------------------------------------------------------------------------------- /silence-quartz/src/main/java/com/silence/quartz/mapper/SysJobMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.quartz.mapper; 2 | 3 | import com.silence.quartz.domain.SysJob; 4 | import java.util.List; 5 | 6 | /** 7 | * 调度任务信息 数据层 8 | * 9 | * @author silence 10 | */ 11 | public interface SysJobMapper 12 | { 13 | /** 14 | * 查询调度任务日志集合 15 | * 16 | * @param job 调度信息 17 | * @return 操作日志集合 18 | */ 19 | public List selectJobList(SysJob job); 20 | 21 | /** 22 | * 查询所有调度任务 23 | * 24 | * @return 调度任务列表 25 | */ 26 | public List selectJobAll(); 27 | 28 | /** 29 | * 通过调度ID查询调度任务信息 30 | * 31 | * @param jobId 调度ID 32 | * @return 角色对象信息 33 | */ 34 | public SysJob selectJobById(Long jobId); 35 | 36 | /** 37 | * 通过调度ID删除调度任务信息 38 | * 39 | * @param jobId 调度ID 40 | * @return 结果 41 | */ 42 | public int deleteJobById(Long jobId); 43 | 44 | /** 45 | * 批量删除调度任务信息 46 | * 47 | * @param ids 需要删除的数据ID 48 | * @return 结果 49 | */ 50 | public int deleteJobByIds(Long[] ids); 51 | 52 | /** 53 | * 修改调度任务信息 54 | * 55 | * @param job 调度任务信息 56 | * @return 结果 57 | */ 58 | public int updateJob(SysJob job); 59 | 60 | /** 61 | * 新增调度任务信息 62 | * 63 | * @param job 调度任务信息 64 | * @return 结果 65 | */ 66 | public int insertJob(SysJob job); 67 | } 68 | -------------------------------------------------------------------------------- /silence-quartz/src/main/java/com/silence/quartz/service/ISysJobLogService.java: -------------------------------------------------------------------------------- 1 | package com.silence.quartz.service; 2 | 3 | import java.util.List; 4 | import com.silence.quartz.domain.SysJobLog; 5 | 6 | /** 7 | * 定时任务调度日志信息信息 服务层 8 | * 9 | * @author silence 10 | */ 11 | public interface ISysJobLogService 12 | { 13 | /** 14 | * 获取quartz调度器日志的计划任务 15 | * 16 | * @param jobLog 调度日志信息 17 | * @return 调度任务日志集合 18 | */ 19 | public List selectJobLogList(SysJobLog jobLog); 20 | 21 | /** 22 | * 通过调度任务日志ID查询调度信息 23 | * 24 | * @param jobLogId 调度任务日志ID 25 | * @return 调度任务日志对象信息 26 | */ 27 | public SysJobLog selectJobLogById(Long jobLogId); 28 | 29 | /** 30 | * 新增任务日志 31 | * 32 | * @param jobLog 调度日志信息 33 | */ 34 | public void addJobLog(SysJobLog jobLog); 35 | 36 | /** 37 | * 批量删除调度日志信息 38 | * 39 | * @param ids 需要删除的数据ID 40 | * @return 结果 41 | */ 42 | public int deleteJobLogByIds(String ids); 43 | 44 | /** 45 | * 删除任务日志 46 | * 47 | * @param jobId 调度日志ID 48 | * @return 结果 49 | */ 50 | public int deleteJobLogById(Long jobId); 51 | 52 | /** 53 | * 清空任务日志 54 | */ 55 | public void cleanJobLog(); 56 | } 57 | -------------------------------------------------------------------------------- /silence-quartz/src/main/java/com/silence/quartz/task/RyTask.java: -------------------------------------------------------------------------------- 1 | package com.silence.quartz.task; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * 定时任务调度测试 7 | * 8 | * @author silence 9 | */ 10 | @Component("ryTask") 11 | public class RyTask 12 | { 13 | public void ryParams(String params) 14 | { 15 | System.out.println("执行有参方法:" + params); 16 | } 17 | 18 | public void ryNoParams() 19 | { 20 | System.out.println("执行无参方法"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /silence-quartz/src/main/java/com/silence/quartz/util/CronUtils.java: -------------------------------------------------------------------------------- 1 | package com.silence.quartz.util; 2 | 3 | import java.text.ParseException; 4 | import java.util.Date; 5 | import org.quartz.CronExpression; 6 | 7 | /** 8 | * cron表达式工具类 9 | * 10 | * @author silence 11 | * 12 | */ 13 | public class CronUtils 14 | { 15 | /** 16 | * 返回一个布尔值代表一个给定的Cron表达式的有效性 17 | * 18 | * @param cronExpression Cron表达式 19 | * @return boolean 表达式是否有效 20 | */ 21 | public static boolean isValid(String cronExpression) 22 | { 23 | return CronExpression.isValidExpression(cronExpression); 24 | } 25 | 26 | /** 27 | * 返回一个字符串值,表示该消息无效Cron表达式给出有效性 28 | * 29 | * @param cronExpression Cron表达式 30 | * @return String 无效时返回表达式错误描述,如果有效返回null 31 | */ 32 | public static String getInvalidMessage(String cronExpression) 33 | { 34 | try 35 | { 36 | new CronExpression(cronExpression); 37 | return null; 38 | } 39 | catch (ParseException pe) 40 | { 41 | return pe.getMessage(); 42 | } 43 | } 44 | 45 | /** 46 | * 返回下一个执行时间根据给定的Cron表达式 47 | * 48 | * @param cronExpression Cron表达式 49 | * @return Date 下次Cron表达式执行时间 50 | */ 51 | public static Date getNextExecution(String cronExpression) 52 | { 53 | try 54 | { 55 | CronExpression cron = new CronExpression(cronExpression); 56 | return cron.getNextValidTimeAfter(new Date(System.currentTimeMillis())); 57 | } 58 | catch (ParseException e) 59 | { 60 | throw new IllegalArgumentException(e.getMessage()); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /silence-quartz/src/main/java/com/silence/quartz/util/JobInvokeUtil.java: -------------------------------------------------------------------------------- 1 | package com.silence.quartz.util; 2 | 3 | import java.lang.reflect.InvocationTargetException; 4 | import java.lang.reflect.Method; 5 | import com.silence.common.utils.StringUtils; 6 | import com.silence.common.utils.spring.SpringUtils; 7 | import com.silence.quartz.domain.SysJob; 8 | 9 | /** 10 | * 任务执行工具 11 | * 12 | * @author silence 13 | */ 14 | public class JobInvokeUtil 15 | { 16 | /** 17 | * 执行方法 18 | * 19 | * @param sysJob 系统任务 20 | */ 21 | public static void invokeMethod(SysJob sysJob) throws Exception 22 | { 23 | Object bean = SpringUtils.getBean(sysJob.getJobName()); 24 | String methodName = sysJob.getMethodName(); 25 | String methodParams = sysJob.getMethodParams(); 26 | 27 | invokeSpringBean(bean, methodName, methodParams); 28 | } 29 | 30 | /** 31 | * 调用任务方法 32 | * 33 | * @param bean 目标对象 34 | * @param methodName 方法名称 35 | * @param methodParams 方法参数 36 | */ 37 | private static void invokeSpringBean(Object bean, String methodName, String methodParams) 38 | throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, 39 | InvocationTargetException 40 | { 41 | if (StringUtils.isNotEmpty(methodParams)) 42 | { 43 | Method method = bean.getClass().getDeclaredMethod(methodName, String.class); 44 | method.invoke(bean, methodParams); 45 | } 46 | else 47 | { 48 | Method method = bean.getClass().getDeclaredMethod(methodName); 49 | method.invoke(bean); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /silence-quartz/src/main/java/com/silence/quartz/util/QuartzDisallowConcurrentExecution.java: -------------------------------------------------------------------------------- 1 | package com.silence.quartz.util; 2 | 3 | import org.quartz.DisallowConcurrentExecution; 4 | import org.quartz.JobExecutionContext; 5 | import com.silence.quartz.domain.SysJob; 6 | 7 | /** 8 | * 定时任务处理(禁止并发执行) 9 | * 10 | * @author silence 11 | * 12 | */ 13 | @DisallowConcurrentExecution 14 | public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob 15 | { 16 | @Override 17 | protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception 18 | { 19 | JobInvokeUtil.invokeMethod(sysJob); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /silence-quartz/src/main/java/com/silence/quartz/util/QuartzJobExecution.java: -------------------------------------------------------------------------------- 1 | package com.silence.quartz.util; 2 | 3 | import org.quartz.JobExecutionContext; 4 | import com.silence.quartz.domain.SysJob; 5 | 6 | /** 7 | * 定时任务处理(允许并发执行) 8 | * 9 | * @author silence 10 | * 11 | */ 12 | public class QuartzJobExecution extends AbstractQuartzJob 13 | { 14 | @Override 15 | protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception 16 | { 17 | JobInvokeUtil.invokeMethod(sysJob); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /silence-system/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | silence 7 | com.silence 8 | 3.4 9 | 10 | 4.0.0 11 | 12 | silence-system 13 | 14 | 15 | system系统模块 16 | 17 | 18 | 19 | 20 | 21 | 22 | mysql 23 | mysql-connector-java 24 | 25 | 26 | 27 | 28 | com.silence 29 | silence-common 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/domain/SysRoleDept.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 角色和部门关联 sys_role_dept 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/domain/SysRoleMenu.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 角色和菜单关联 sys_role_menu 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/domain/SysUserPost.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 用户和岗位关联 sys_user_post 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/domain/SysUserRole.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.domain; 2 | 3 | import org.apache.commons.lang3.builder.ToStringBuilder; 4 | import org.apache.commons.lang3.builder.ToStringStyle; 5 | 6 | /** 7 | * 用户和角色关联 sys_user_role 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysConfigMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysConfig; 5 | 6 | /** 7 | * 参数配置 数据层 8 | * 9 | * @author silence 10 | */ 11 | public interface SysConfigMapper 12 | { 13 | /** 14 | * 查询参数配置信息 15 | * 16 | * @param config 参数配置信息 17 | * @return 参数配置信息 18 | */ 19 | public SysConfig selectConfig(SysConfig config); 20 | 21 | /** 22 | * 查询参数配置列表 23 | * 24 | * @param config 参数配置信息 25 | * @return 参数配置集合 26 | */ 27 | public List selectConfigList(SysConfig config); 28 | 29 | /** 30 | * 根据键名查询参数配置信息 31 | * 32 | * @param configKey 参数键名 33 | * @return 参数配置信息 34 | */ 35 | public SysConfig checkConfigKeyUnique(String configKey); 36 | 37 | /** 38 | * 新增参数配置 39 | * 40 | * @param config 参数配置信息 41 | * @return 结果 42 | */ 43 | public int insertConfig(SysConfig config); 44 | 45 | /** 46 | * 修改参数配置 47 | * 48 | * @param config 参数配置信息 49 | * @return 结果 50 | */ 51 | public int updateConfig(SysConfig config); 52 | 53 | /** 54 | * 批量删除参数配置 55 | * 56 | * @param configIds 需要删除的数据ID 57 | * @return 结果 58 | */ 59 | public int deleteConfigByIds(String[] configIds); 60 | } -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysDictTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import com.silence.system.domain.SysDictType; 6 | 7 | /** 8 | * 字典表 数据层 9 | * 10 | * @author silence 11 | */ 12 | @Mapper 13 | public interface SysDictTypeMapper 14 | { 15 | /** 16 | * 根据条件分页查询字典类型 17 | * 18 | * @param dictType 字典类型信息 19 | * @return 字典类型集合信息 20 | */ 21 | public List selectDictTypeList(SysDictType dictType); 22 | 23 | /** 24 | * 根据所有字典类型 25 | * 26 | * @return 字典类型集合信息 27 | */ 28 | public List selectDictTypeAll(); 29 | 30 | /** 31 | * 根据字典类型ID查询信息 32 | * 33 | * @param dictId 字典类型ID 34 | * @return 字典类型 35 | */ 36 | public SysDictType selectDictTypeById(Long dictId); 37 | 38 | /** 39 | * 通过字典ID删除字典信息 40 | * 41 | * @param dictId 字典ID 42 | * @return 结果 43 | */ 44 | public int deleteDictTypeById(Long dictId); 45 | 46 | /** 47 | * 批量删除字典类型 48 | * 49 | * @param ids 需要删除的数据 50 | * @return 结果 51 | */ 52 | public int deleteDictTypeByIds(Long[] ids); 53 | 54 | /** 55 | * 新增字典类型信息 56 | * 57 | * @param dictType 字典类型信息 58 | * @return 结果 59 | */ 60 | public int insertDictType(SysDictType dictType); 61 | 62 | /** 63 | * 修改字典类型信息 64 | * 65 | * @param dictType 字典类型信息 66 | * @return 结果 67 | */ 68 | public int updateDictType(SysDictType dictType); 69 | 70 | /** 71 | * 校验字典类型称是否唯一 72 | * 73 | * @param dictType 字典类型 74 | * @return 结果 75 | */ 76 | public SysDictType checkDictTypeUnique(String dictType); 77 | } 78 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysLogininforMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysLogininfor; 5 | 6 | /** 7 | * 系统访问日志情况信息 数据层 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysNoticeMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysNotice; 5 | 6 | /** 7 | * 公告 数据层 8 | * 9 | * @author silence 10 | */ 11 | public interface SysNoticeMapper 12 | { 13 | /** 14 | * 查询公告信息 15 | * 16 | * @param noticeId 公告ID 17 | * @return 公告信息 18 | */ 19 | public SysNotice selectNoticeById(Long noticeId); 20 | 21 | /** 22 | * 查询公告列表 23 | * 24 | * @param notice 公告信息 25 | * @return 公告集合 26 | */ 27 | public List selectNoticeList(SysNotice notice); 28 | 29 | /** 30 | * 新增公告 31 | * 32 | * @param notice 公告信息 33 | * @return 结果 34 | */ 35 | public int insertNotice(SysNotice notice); 36 | 37 | /** 38 | * 修改公告 39 | * 40 | * @param notice 公告信息 41 | * @return 结果 42 | */ 43 | public int updateNotice(SysNotice notice); 44 | 45 | /** 46 | * 批量删除公告 47 | * 48 | * @param noticeIds 需要删除的数据ID 49 | * @return 结果 50 | */ 51 | public int deleteNoticeByIds(String[] noticeIds); 52 | } -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysOperLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysOperLog; 5 | 6 | /** 7 | * 操作日志 数据层 8 | * 9 | * @author silence 10 | */ 11 | public interface SysOperLogMapper 12 | { 13 | /** 14 | * 新增操作日志 15 | * 16 | * @param operLog 操作日志对象 17 | */ 18 | public void insertOperlog(SysOperLog operLog); 19 | 20 | /** 21 | * 查询系统操作日志集合 22 | * 23 | * @param operLog 操作日志对象 24 | * @return 操作日志集合 25 | */ 26 | public List selectOperLogList(SysOperLog operLog); 27 | 28 | /** 29 | * 批量删除系统操作日志 30 | * 31 | * @param 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysPostMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysPost; 5 | 6 | /** 7 | * 岗位信息 数据层 8 | * 9 | * @author silence 10 | */ 11 | public interface SysPostMapper 12 | { 13 | /** 14 | * 查询岗位数据集合 15 | * 16 | * @param post 岗位信息 17 | * @return 岗位数据集合 18 | */ 19 | public List selectPostList(SysPost post); 20 | 21 | /** 22 | * 查询所有岗位 23 | * 24 | * @return 岗位列表 25 | */ 26 | public List selectPostAll(); 27 | 28 | /** 29 | * 根据用户ID查询岗位 30 | * 31 | * @param 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 | */ 50 | public int deletePostByIds(Long[] ids); 51 | 52 | /** 53 | * 修改岗位信息 54 | * 55 | * @param post 岗位信息 56 | * @return 结果 57 | */ 58 | public int updatePost(SysPost post); 59 | 60 | /** 61 | * 新增岗位信息 62 | * 63 | * @param post 岗位信息 64 | * @return 结果 65 | */ 66 | public int insertPost(SysPost post); 67 | 68 | /** 69 | * 校验岗位名称 70 | * 71 | * @param postName 岗位名称 72 | * @return 结果 73 | */ 74 | public SysPost checkPostNameUnique(String postName); 75 | 76 | /** 77 | * 校验岗位编码 78 | * 79 | * @param postCode 岗位编码 80 | * @return 结果 81 | */ 82 | public SysPost checkPostCodeUnique(String postCode); 83 | } 84 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysRoleDeptMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysRoleDept; 5 | 6 | /** 7 | * 角色与部门关联表 数据层 8 | * 9 | * @author silence 10 | */ 11 | public interface SysRoleDeptMapper 12 | { 13 | /** 14 | * 通过角色ID删除角色和部门关联 15 | * 16 | * @param roleId 角色ID 17 | * @return 结果 18 | */ 19 | public int deleteRoleDeptByRoleId(Long roleId); 20 | 21 | /** 22 | * 批量删除角色部门关联信息 23 | * 24 | * @param ids 需要删除的数据ID 25 | * @return 结果 26 | */ 27 | public int deleteRoleDept(Long[] ids); 28 | 29 | /** 30 | * 查询部门使用数量 31 | * 32 | * @param deptId 部门ID 33 | * @return 结果 34 | */ 35 | public int selectCountRoleDeptByDeptId(Long deptId); 36 | 37 | /** 38 | * 批量新增角色部门信息 39 | * 40 | * @param roleDeptList 角色部门列表 41 | * @return 结果 42 | */ 43 | public int batchRoleDept(List roleDeptList); 44 | } 45 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysRole; 5 | 6 | /** 7 | * 角色表 数据层 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysRoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysRoleMenu; 5 | 6 | /** 7 | * 角色与菜单关联表 数据层 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysUserOnlineMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysUserOnline; 5 | 6 | /** 7 | * 在线用户 数据层 8 | * 9 | * @author silence 10 | */ 11 | public interface SysUserOnlineMapper 12 | { 13 | /** 14 | * 通过会话序号查询信息 15 | * 16 | * @param sessionId 会话ID 17 | * @return 在线用户信息 18 | */ 19 | public SysUserOnline selectOnlineById(String sessionId); 20 | 21 | /** 22 | * 通过会话序号删除信息 23 | * 24 | * @param sessionId 会话ID 25 | * @return 在线用户信息 26 | */ 27 | public int deleteOnlineById(String sessionId); 28 | 29 | /** 30 | * 保存会话信息 31 | * 32 | * @param online 会话信息 33 | * @return 结果 34 | */ 35 | public int saveOnline(SysUserOnline online); 36 | 37 | /** 38 | * 查询会话集合 39 | * 40 | * @param userOnline 会话参数 41 | * @return 会话集合 42 | */ 43 | public List selectUserOnlineList(SysUserOnline userOnline); 44 | 45 | /** 46 | * 查询过期会话集合 47 | * 48 | * @param lastAccessTime 过期时间 49 | * @return 会话集合 50 | */ 51 | public List selectOnlineByExpired(String lastAccessTime); 52 | } 53 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysUserPostMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysUserPost; 5 | 6 | /** 7 | * 用户与岗位 表 数据层 8 | * 9 | * @author silence 10 | */ 11 | public interface SysUserPostMapper 12 | { 13 | /** 14 | * 通过用户ID删除用户和岗位关联 15 | * 16 | * @param userId 用户ID 17 | * @return 结果 18 | */ 19 | public int deleteUserPostByUserId(Long userId); 20 | 21 | /** 22 | * 通过岗位ID查询岗位使用数量 23 | * 24 | * @param postId 岗位ID 25 | * @return 结果 26 | */ 27 | public int countUserPostById(Long postId); 28 | 29 | /** 30 | * 批量删除用户和岗位关联 31 | * 32 | * @param ids 需要删除的数据ID 33 | * @return 结果 34 | */ 35 | public int deleteUserPost(Long[] ids); 36 | 37 | /** 38 | * 批量新增用户岗位信息 39 | * 40 | * @param userPostList 用户角色列表 41 | * @return 结果 42 | */ 43 | public int batchUserPost(List userPostList); 44 | } 45 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/mapper/SysUserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.silence.system.domain.SysUserRole; 6 | 7 | /** 8 | * 用户表 数据层 9 | * 10 | * @author silence 11 | */ 12 | public interface SysUserRoleMapper 13 | { 14 | /** 15 | * 通过用户ID删除用户和角色关联 16 | * 17 | * @param userId 用户ID 18 | * @return 结果 19 | */ 20 | public int deleteUserRoleByUserId(Long userId); 21 | 22 | /** 23 | * 批量删除用户和角色关联 24 | * 25 | * @param ids 需要删除的数据ID 26 | * @return 结果 27 | */ 28 | public int deleteUserRole(Long[] ids); 29 | 30 | /** 31 | * 通过角色ID查询角色使用数量 32 | * 33 | * @param roleId 角色ID 34 | * @return 结果 35 | */ 36 | public int countUserRoleByRoleId(Long roleId); 37 | 38 | /** 39 | * 批量新增用户角色信息 40 | * 41 | * @param userRoleList 用户角色列表 42 | * @return 结果 43 | */ 44 | public int batchUserRole(List userRoleList); 45 | 46 | /** 47 | * 删除用户和角色关联信息 48 | * 49 | * @param userRole 用户和角色关联信息 50 | * @return 结果 51 | */ 52 | public int deleteUserRoleInfo(SysUserRole userRole); 53 | 54 | /** 55 | * 批量取消授权用户角色 56 | * 57 | * @param roleId 角色ID 58 | * @param userIds 需要删除的用户数据ID 59 | * @return 结果 60 | */ 61 | public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); 62 | } 63 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/service/ISysConfigService.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.service; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysConfig; 5 | 6 | /** 7 | * 参数配置 服务层 8 | * 9 | * @author silence 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 | * @param config 参数信息 65 | * @return 结果 66 | */ 67 | public String checkConfigKeyUnique(SysConfig config); 68 | } 69 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/service/ISysDictDataService.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.service; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysDictData; 5 | 6 | /** 7 | * 字典 业务层 8 | * 9 | * @author silence 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 | * @return 字典数据集合信息 26 | */ 27 | public List selectDictDataByType(String dictType); 28 | 29 | /** 30 | * 根据字典类型和字典键值查询字典数据信息 31 | * 32 | * @param dictType 字典类型 33 | * @param dictValue 字典键值 34 | * @return 字典标签 35 | */ 36 | public String selectDictLabel(String dictType, String dictValue); 37 | 38 | /** 39 | * 根据字典数据ID查询信息 40 | * 41 | * @param dictCode 字典数据ID 42 | * @return 字典数据 43 | */ 44 | public SysDictData selectDictDataById(Long dictCode); 45 | 46 | /** 47 | * 通过字典ID删除字典数据信息 48 | * 49 | * @param dictCode 字典数据ID 50 | * @return 结果 51 | */ 52 | public int deleteDictDataById(Long dictCode); 53 | 54 | /** 55 | * 批量删除字典数据 56 | * 57 | * @param ids 需要删除的数据 58 | * @return 结果 59 | */ 60 | public int deleteDictDataByIds(String ids); 61 | 62 | /** 63 | * 新增保存字典数据信息 64 | * 65 | * @param dictData 字典数据信息 66 | * @return 结果 67 | */ 68 | public int insertDictData(SysDictData dictData); 69 | 70 | /** 71 | * 修改保存字典数据信息 72 | * 73 | * @param dictData 字典数据信息 74 | * @return 结果 75 | */ 76 | public int updateDictData(SysDictData dictData); 77 | } 78 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/service/ISysDictTypeService.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.service; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysDictType; 5 | 6 | /** 7 | * 字典 业务层 8 | * 9 | * @author silence 10 | */ 11 | public interface ISysDictTypeService 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 | * 通过字典ID删除字典信息 38 | * 39 | * @param dictId 字典ID 40 | * @return 结果 41 | */ 42 | public int deleteDictTypeById(Long dictId); 43 | 44 | /** 45 | * 批量删除字典类型 46 | * 47 | * @param ids 需要删除的数据 48 | * @return 结果 49 | * @throws Exception 异常 50 | */ 51 | public int deleteDictTypeByIds(String ids) throws Exception; 52 | 53 | /** 54 | * 新增保存字典类型信息 55 | * 56 | * @param dictType 字典类型信息 57 | * @return 结果 58 | */ 59 | public int insertDictType(SysDictType dictType); 60 | 61 | /** 62 | * 修改保存字典类型信息 63 | * 64 | * @param dictType 字典类型信息 65 | * @return 结果 66 | */ 67 | public int updateDictType(SysDictType dictType); 68 | 69 | /** 70 | * 校验字典类型称是否唯一 71 | * 72 | * @param dictType 字典类型 73 | * @return 结果 74 | */ 75 | public String checkDictTypeUnique(SysDictType dictType); 76 | } 77 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/service/ISysLogininforService.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.service; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysLogininfor; 5 | 6 | /** 7 | * 系统访问日志情况信息 服务层 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/service/ISysNoticeService.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.service; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysNotice; 5 | 6 | /** 7 | * 公告 服务层 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/service/ISysOperLogService.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.service; 2 | 3 | import java.util.List; 4 | import com.silence.system.domain.SysOperLog; 5 | 6 | /** 7 | * 操作日志 服务层 8 | * 9 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/service/ISysUserOnlineService.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.service; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | import com.silence.system.domain.SysUserOnline; 6 | 7 | /** 8 | * 在线用户 服务层 9 | * 10 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/service/impl/SysLogininforServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.silence.system.service.impl; 2 | 3 | import com.silence.common.core.text.Convert; 4 | import com.silence.system.domain.SysLogininfor; 5 | import com.silence.system.mapper.SysLogininforMapper; 6 | import com.silence.system.service.ISysLogininforService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 系统访问日志情况信息 服务层处理 14 | * 15 | * @author silence 16 | */ 17 | @Service 18 | public class SysLogininforServiceImpl implements ISysLogininforService { 19 | 20 | @Autowired 21 | private SysLogininforMapper logininforMapper; 22 | 23 | /** 24 | * 新增系统登录日志 25 | * 26 | * @param logininfor 访问日志对象 27 | */ 28 | @Override 29 | public void insertLogininfor(SysLogininfor logininfor) { 30 | logininforMapper.insertLogininfor(logininfor); 31 | } 32 | 33 | /** 34 | * 查询系统登录日志集合 35 | * 36 | * @param logininfor 访问日志对象 37 | * @return 登录记录集合 38 | */ 39 | @Override 40 | public List selectLogininforList(SysLogininfor logininfor) { 41 | return logininforMapper.selectLogininforList(logininfor); 42 | } 43 | 44 | /** 45 | * 批量删除系统登录日志 46 | * 47 | * @param ids 需要删除的数据 48 | * @return 49 | */ 50 | @Override 51 | public int deleteLogininforByIds(String ids) { 52 | return logininforMapper.deleteLogininforByIds(Convert.toStrArray(ids)); 53 | } 54 | 55 | /** 56 | * 清空系统登录日志 57 | */ 58 | @Override 59 | public void cleanLogininfor() { 60 | logininforMapper.cleanLogininfor(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /silence-system/src/main/java/com/silence/system/service/impl/SysOperLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.silence.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.silence.common.core.text.Convert; 7 | import com.silence.system.domain.SysOperLog; 8 | import com.silence.system.mapper.SysOperLogMapper; 9 | import com.silence.system.service.ISysOperLogService; 10 | 11 | /** 12 | * 操作日志 服务层处理 13 | * 14 | * @author silence 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 | -------------------------------------------------------------------------------- /silence-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 | -------------------------------------------------------------------------------- /silence-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 | -------------------------------------------------------------------------------- /silence-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 | -------------------------------------------------------------------------------- /silence-system/src/main/resources/mapper/system/SysUserRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | delete from sys_user_role where user_id=#{userId} 14 | 15 | 16 | 19 | 20 | 21 | delete from sys_user_role where user_id in 22 | 23 | #{userId} 24 | 25 | 26 | 27 | 28 | insert into sys_user_role(user_id, role_id) values 29 | 30 | (#{item.userId},#{item.roleId}) 31 | 32 | 33 | 34 | 35 | delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} 36 | 37 | 38 | 39 | delete from sys_user_role where role_id=#{roleId} and user_id in 40 | 41 | #{userId} 42 | 43 | 44 | -------------------------------------------------------------------------------- /silence-weixin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | silence 7 | com.silence 8 | 3.4 9 | 10 | 4.0.0 11 | 12 | silence-weixin 13 | 14 | weixin模块 15 | 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-configuration-processor 20 | true 21 | 22 | 23 | 24 | 25 | com.silence 26 | silence-common 27 | 28 | 29 | 30 | 31 | com.github.binarywang 32 | weixin-java-mp 33 | 3.5.0 34 | 35 | 36 | 37 | 38 | org.projectlombok 39 | lombok 40 | provided 41 | 42 | 43 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/builder/AbstractBuilder.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.builder; 2 | 3 | import me.chanjar.weixin.mp.api.WxMpService; 4 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 5 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | /** 10 | * @desc: 11 | * @author: cao_wencao 12 | * @date: 2019-09-02 17:06 13 | */ 14 | public abstract class AbstractBuilder { 15 | protected final Logger logger = LoggerFactory.getLogger(getClass()); 16 | 17 | public abstract WxMpXmlOutMessage build(String content, 18 | WxMpXmlMessage wxMessage, WxMpService service); 19 | } 20 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/builder/ImageBuilder.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.builder; 2 | 3 | import me.chanjar.weixin.mp.api.WxMpService; 4 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 5 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage; 6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 7 | 8 | /** 9 | * @desc: 图片消息 10 | * @author: cao_wencao 11 | * @date: 2019-09-02 17:06 12 | */ 13 | public class ImageBuilder extends AbstractBuilder { 14 | 15 | @Override 16 | public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage, 17 | WxMpService service) { 18 | 19 | WxMpXmlOutImageMessage m = WxMpXmlOutMessage.IMAGE().mediaId(content) 20 | .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser()) 21 | .build(); 22 | 23 | return m; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/builder/TextBuilder.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.builder; 2 | 3 | import me.chanjar.weixin.mp.api.WxMpService; 4 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 5 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutTextMessage; 7 | 8 | /** 9 | * @desc: 文本消息 10 | * @author: cao_wencao 11 | * @date: 2019-09-02 17:06 12 | */ 13 | public class TextBuilder extends AbstractBuilder { 14 | 15 | @Override 16 | public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage, 17 | WxMpService service) { 18 | WxMpXmlOutTextMessage m = WxMpXmlOutMessage.TEXT().content(content) 19 | .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser()) 20 | .build(); 21 | return m; 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/config/WxMpProperties.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.config; 2 | 3 | import com.silence.weixin.utils.JsonUtils; 4 | import lombok.Data; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @desc: yml配置映射成实体类 11 | * @author: cao_wencao 12 | * @date: 2019-09-02 17:08 13 | */ 14 | @Data 15 | @ConfigurationProperties(prefix = "wx.mp") 16 | public class WxMpProperties { 17 | private List configs; 18 | 19 | @Data 20 | public static class MpConfig { 21 | /** 22 | * 设置微信公众号的appid 23 | */ 24 | private String appId; 25 | 26 | /** 27 | * 设置微信公众号的app secret 28 | */ 29 | private String secret; 30 | 31 | /** 32 | * 设置微信公众号的token 33 | */ 34 | private String token; 35 | 36 | /** 37 | * 设置微信公众号的EncodingAESKey 38 | */ 39 | private String aesKey; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return JsonUtils.toJson(this); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/handler/AbstractHandler.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.handler; 2 | 3 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | /** 8 | * @desc: 9 | * @author: cao_wencao 10 | * @date: 2019-09-02 17:13 11 | */ 12 | public abstract class AbstractHandler implements WxMpMessageHandler { 13 | protected Logger logger = LoggerFactory.getLogger(getClass()); 14 | } 15 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/handler/KfSessionHandler.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.handler; 2 | 3 | import me.chanjar.weixin.common.session.WxSessionManager; 4 | import me.chanjar.weixin.mp.api.WxMpService; 5 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.util.Map; 10 | 11 | /** 12 | * @desc: 13 | * @author: cao_wencao 14 | * @date: 2019-09-02 17:14 15 | */ 16 | @Component 17 | public class KfSessionHandler extends AbstractHandler { 18 | 19 | @Override 20 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, 21 | Map context, WxMpService wxMpService, 22 | WxSessionManager sessionManager) { 23 | //TODO 对会话做处理 24 | return null; 25 | } 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/handler/LocationHandler.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.handler; 2 | 3 | import com.silence.weixin.builder.TextBuilder; 4 | import me.chanjar.weixin.common.api.WxConsts; 5 | import me.chanjar.weixin.common.session.WxSessionManager; 6 | import me.chanjar.weixin.mp.api.WxMpService; 7 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 8 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 9 | import org.springframework.stereotype.Component; 10 | 11 | import java.util.Map; 12 | 13 | /** 14 | * @desc: 15 | * @author: cao_wencao 16 | * @date: 2019-09-02 17:14 17 | */ 18 | @Component 19 | public class LocationHandler extends AbstractHandler { 20 | 21 | @Override 22 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, 23 | Map context, WxMpService wxMpService, 24 | WxSessionManager sessionManager) { 25 | if (wxMessage.getMsgType().equals(WxConsts.XmlMsgType.LOCATION)) { 26 | //TODO 接收处理用户发送的地理位置消息 27 | try { 28 | String content = "感谢反馈,您的的地理位置已收到!"; 29 | return new TextBuilder().build(content, wxMessage, null); 30 | } catch (Exception e) { 31 | this.logger.error("位置消息接收处理失败", e); 32 | return null; 33 | } 34 | } 35 | 36 | //上报地理位置事件 37 | this.logger.info("上报地理位置,纬度 : {},经度 : {},精度 : {}", 38 | wxMessage.getLatitude(), wxMessage.getLongitude(), String.valueOf(wxMessage.getPrecision())); 39 | 40 | //TODO 可以将用户地理位置信息保存到本地数据库,以便以后使用 41 | 42 | return null; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/handler/LogHandler.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.handler; 2 | 3 | import com.silence.weixin.utils.JsonUtils; 4 | import me.chanjar.weixin.common.session.WxSessionManager; 5 | import me.chanjar.weixin.mp.api.WxMpService; 6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 7 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 8 | import org.springframework.stereotype.Component; 9 | 10 | import java.util.Map; 11 | 12 | /** 13 | * @desc: 14 | * @author: cao_wencao 15 | * @date: 2019-09-02 17:14 16 | */ 17 | @Component 18 | public class LogHandler extends AbstractHandler { 19 | @Override 20 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, 21 | Map context, WxMpService wxMpService, 22 | WxSessionManager sessionManager) { 23 | this.logger.info("\n接收到请求消息,内容:{}", JsonUtils.toJson(wxMessage)); 24 | return null; 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/handler/MenuHandler.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.handler; 2 | 3 | import me.chanjar.weixin.common.api.WxConsts; 4 | import me.chanjar.weixin.common.session.WxSessionManager; 5 | import me.chanjar.weixin.mp.api.WxMpService; 6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 7 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 8 | import org.springframework.stereotype.Component; 9 | 10 | import java.util.Map; 11 | 12 | /** 13 | * @desc: 14 | * @author: cao_wencao 15 | * @date: 2019-09-02 17:15 16 | */ 17 | @Component 18 | public class MenuHandler extends AbstractHandler { 19 | 20 | @Override 21 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, 22 | Map context, WxMpService weixinService, 23 | WxSessionManager sessionManager) { 24 | 25 | String msg = String.format("type:%s, event:%s, key:%s", 26 | wxMessage.getMsgType(), wxMessage.getEvent(), 27 | wxMessage.getEventKey()); 28 | if (WxConsts.MenuButtonType.VIEW.equals(wxMessage.getEvent())) { 29 | return null; 30 | } 31 | 32 | return WxMpXmlOutMessage.TEXT().content(msg) 33 | .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser()) 34 | .build(); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/handler/NullHandler.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.handler; 2 | 3 | import me.chanjar.weixin.common.session.WxSessionManager; 4 | import me.chanjar.weixin.mp.api.WxMpService; 5 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.util.Map; 10 | 11 | /** 12 | * @desc: 13 | * @author: cao_wencao 14 | * @date: 2019-09-02 17:15 15 | */ 16 | @Component 17 | public class NullHandler extends AbstractHandler { 18 | 19 | @Override 20 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, 21 | Map context, WxMpService wxMpService, 22 | WxSessionManager sessionManager) { 23 | return null; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/handler/ScanHandler.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.handler; 2 | 3 | import me.chanjar.weixin.common.error.WxErrorException; 4 | import me.chanjar.weixin.common.session.WxSessionManager; 5 | import me.chanjar.weixin.mp.api.WxMpService; 6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 7 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 8 | import org.springframework.stereotype.Component; 9 | 10 | import java.util.Map; 11 | 12 | /** 13 | * @desc: 14 | * @author: cao_wencao 15 | * @date: 2019-09-02 17:16 16 | */ 17 | @Component 18 | public class ScanHandler extends AbstractHandler { 19 | 20 | @Override 21 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMpXmlMessage, Map map, 22 | WxMpService wxMpService, WxSessionManager wxSessionManager) throws WxErrorException { 23 | // 扫码事件处理 24 | return null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/handler/StoreCheckNotifyHandler.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.handler; 2 | 3 | import me.chanjar.weixin.common.session.WxSessionManager; 4 | import me.chanjar.weixin.mp.api.WxMpService; 5 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.util.Map; 10 | 11 | /** 12 | * @desc: 门店审核事件 13 | * @author: cao_wencao 14 | * @date: 2019-09-02 17:16 15 | */ 16 | @Component 17 | public class StoreCheckNotifyHandler extends AbstractHandler { 18 | 19 | @Override 20 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, 21 | Map context, WxMpService wxMpService, 22 | WxSessionManager sessionManager) { 23 | // TODO 处理门店审核事件 24 | return null; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/handler/UnsubscribeHandler.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.handler; 2 | 3 | import me.chanjar.weixin.common.session.WxSessionManager; 4 | import me.chanjar.weixin.mp.api.WxMpService; 5 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; 6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.util.Map; 10 | 11 | /** 12 | * @desc: 取消关注事件 13 | * @author: cao_wencao 14 | * @date: 2019-09-02 17:17 15 | */ 16 | @Component 17 | public class UnsubscribeHandler extends AbstractHandler { 18 | 19 | @Override 20 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, 21 | Map context, WxMpService wxMpService, 22 | WxSessionManager sessionManager) { 23 | String openId = wxMessage.getFromUser(); 24 | this.logger.info("取消关注用户 OPENID: " + openId); 25 | // TODO 可以更新本地数据库为取消关注状态 26 | return null; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/inter/PushMessageService.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.inter; 2 | 3 | /** 4 | *
 5 |  * @Description:模板消息推送服务接口
 6 |  * @Aouth: cao_wencao
 7 |  * @Date: 2019-02-15 10:39
 8 |  * 
9 | */ 10 | public interface PushMessageService { 11 | 12 | 13 | /** 14 | *
15 |      * 订单结算通知
16 |      * @auther: cao_wencao
17 |      * @date: 2019/2/15 10:40
18 |      * 
19 | */ 20 | public String orderPay(String openId, Object object); 21 | } 22 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/service/WXJSAPiService.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.service; 2 | 3 | import com.google.common.collect.Maps; 4 | import me.chanjar.weixin.common.bean.WxJsapiSignature; 5 | import me.chanjar.weixin.common.error.WxErrorException; 6 | import me.chanjar.weixin.mp.api.WxMpService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.Map; 11 | 12 | /** 13 | * @desc: 获取微信jsapi签名 14 | * @auth: cao_wencao 15 | * @date: 2019/10/28 17:18 16 | */ 17 | @Service 18 | public class WXJSAPiService { 19 | 20 | @Autowired 21 | private WxMpService wxMpService; 22 | 23 | public Map getJSApiData(String url) throws WxErrorException { 24 | Map paramMap = Maps.newHashMap(); 25 | WxJsapiSignature createJsapiSignature = this.wxMpService.createJsapiSignature(url); 26 | if (null != createJsapiSignature) { 27 | paramMap.put("appId", createJsapiSignature.getAppId()); 28 | paramMap.put("nonceStr", createJsapiSignature.getNonceStr()); 29 | paramMap.put("timestamp", String.valueOf(createJsapiSignature.getTimestamp())); 30 | paramMap.put("signature", createJsapiSignature.getSignature()); 31 | paramMap.put("url", createJsapiSignature.getUrl()); 32 | } 33 | return paramMap; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /silence-weixin/src/main/java/com/silence/weixin/utils/JsonUtils.java: -------------------------------------------------------------------------------- 1 | package com.silence.weixin.utils; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.GsonBuilder; 5 | 6 | /** 7 | * @desc: 8 | * @author: cao_wencao 9 | * @date: 2019-09-02 17:13 10 | */ 11 | public class JsonUtils { 12 | public static String toJson(Object obj) { 13 | Gson gson = new GsonBuilder() 14 | .setPrettyPrinting() 15 | .create(); 16 | return gson.toJson(obj); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /silence-weixin/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | level: 3 | org.springframework.web: INFO 4 | com.github.binarywang.demo.wx.mp: DEBUG 5 | me.chanjar.weixin: DEBUG 6 | wx: 7 | mp: 8 | configs: 9 | - appId: 1111 (一个公众号的appid) 10 | secret: 1111(公众号的appsecret) 11 | token: 111 (接口配置里的Token值) 12 | aesKey: 111 (接口配置里的EncodingAESKey值) 13 | - appId: 2222 (另一个公众号的appid,以下同上) 14 | secret: 1111 15 | token: 111 16 | aesKey: 111 17 | --------------------------------------------------------------------------------