├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── copy_packages.sh ├── doc ├── 123214.json ├── Guns 技术文档 v1.0.pdf ├── Hystrix文档.txt ├── Zipkin文档.txt ├── db │ ├── guns.sql │ ├── guns_rest.sql │ └── guns_rest2.sql ├── 影片模块-建表语句.txt ├── 影片模块-影片演员映射表.txt ├── 影片模块-接口文档.docx ├── 影院模块-建表语句.txt ├── 影院模块-接口分析.txt ├── 影院模块-接口分析2.txt ├── 影院模块-接口文档.docx ├── 支付模块-接口文档.docx ├── 支付模块-支付宝依赖包.txt ├── 用户模块-建表语句.txt ├── 用户模块-接口文档.docx ├── 订单模块-seats_123214.json ├── 订单模块-建表语句.txt └── 订单模块-接口文档.docx ├── guns-admin ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ ├── GunsApplication.java │ │ │ ├── GunsServletInitializer.java │ │ │ ├── config │ │ │ ├── EhCacheConfig.java │ │ │ ├── SpringSessionConfig.java │ │ │ ├── SwaggerConfig.java │ │ │ ├── properties │ │ │ │ ├── BeetlProperties.java │ │ │ │ └── GunsProperties.java │ │ │ └── web │ │ │ │ ├── BeetlConfig.java │ │ │ │ ├── ShiroConfig.java │ │ │ │ └── WebConfig.java │ │ │ ├── core │ │ │ ├── aop │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ ├── LogAop.java │ │ │ │ └── PermissionAop.java │ │ │ ├── beetl │ │ │ │ ├── BeetlConfiguration.java │ │ │ │ └── ShiroExt.java │ │ │ ├── common │ │ │ │ ├── annotion │ │ │ │ │ ├── BussinessLog.java │ │ │ │ │ └── Permission.java │ │ │ │ ├── constant │ │ │ │ │ ├── Const.java │ │ │ │ │ ├── DatasourceEnum.java │ │ │ │ │ ├── cache │ │ │ │ │ │ ├── Cache.java │ │ │ │ │ │ └── CacheKey.java │ │ │ │ │ ├── dictmap │ │ │ │ │ │ ├── DeleteDict.java │ │ │ │ │ │ ├── DeptDict.java │ │ │ │ │ │ ├── DictMap.java │ │ │ │ │ │ ├── LogDict.java │ │ │ │ │ │ ├── MenuDict.java │ │ │ │ │ │ ├── NoticeMap.java │ │ │ │ │ │ ├── RoleDict.java │ │ │ │ │ │ ├── UserDict.java │ │ │ │ │ │ ├── base │ │ │ │ │ │ │ ├── AbstractDictMap.java │ │ │ │ │ │ │ └── SystemDict.java │ │ │ │ │ │ └── factory │ │ │ │ │ │ │ └── DictFieldWarpperFactory.java │ │ │ │ │ ├── factory │ │ │ │ │ │ ├── ConstantFactory.java │ │ │ │ │ │ ├── IConstantFactory.java │ │ │ │ │ │ ├── MutiStrFactory.java │ │ │ │ │ │ └── PageFactory.java │ │ │ │ │ └── state │ │ │ │ │ │ ├── BizLogType.java │ │ │ │ │ │ ├── ExpenseState.java │ │ │ │ │ │ ├── LogSucceed.java │ │ │ │ │ │ ├── LogType.java │ │ │ │ │ │ ├── ManagerStatus.java │ │ │ │ │ │ ├── MenuOpenStatus.java │ │ │ │ │ │ ├── MenuStatus.java │ │ │ │ │ │ └── Order.java │ │ │ │ └── exception │ │ │ │ │ ├── BizExceptionEnum.java │ │ │ │ │ └── InvalidKaptchaException.java │ │ │ ├── intercept │ │ │ │ ├── GunsUserFilter.java │ │ │ │ └── SessionHolderInterceptor.java │ │ │ ├── listener │ │ │ │ └── ConfigListener.java │ │ │ ├── log │ │ │ │ ├── LogManager.java │ │ │ │ ├── LogObjectHolder.java │ │ │ │ └── factory │ │ │ │ │ ├── LogFactory.java │ │ │ │ │ └── LogTaskFactory.java │ │ │ ├── shiro │ │ │ │ ├── ShiroDbRealm.java │ │ │ │ ├── ShiroKit.java │ │ │ │ ├── ShiroUser.java │ │ │ │ ├── check │ │ │ │ │ ├── ICheck.java │ │ │ │ │ ├── PermissionCheckFactory.java │ │ │ │ │ └── PermissionCheckManager.java │ │ │ │ └── factory │ │ │ │ │ ├── IShiro.java │ │ │ │ │ └── ShiroFactroy.java │ │ │ ├── tag │ │ │ │ └── DictSelectorTag.java │ │ │ └── util │ │ │ │ ├── ApiMenuFilter.java │ │ │ │ ├── Contrast.java │ │ │ │ └── KaptchaUtil.java │ │ │ └── modular │ │ │ ├── code │ │ │ ├── controller │ │ │ │ └── CodeController.java │ │ │ ├── factory │ │ │ │ └── DefaultTemplateFactory.java │ │ │ └── service │ │ │ │ └── TableService.java │ │ │ └── system │ │ │ ├── controller │ │ │ ├── BlackboardController.java │ │ │ ├── DeptController.java │ │ │ ├── DictController.java │ │ │ ├── KaptchaController.java │ │ │ ├── LogController.java │ │ │ ├── LoginController.java │ │ │ ├── LoginLogController.java │ │ │ ├── MenuController.java │ │ │ ├── NoticeController.java │ │ │ ├── RoleController.java │ │ │ └── UserMgrController.java │ │ │ ├── dao │ │ │ ├── DeptMapper.java │ │ │ ├── DictMapper.java │ │ │ ├── ExpenseMapper.java │ │ │ ├── LoginLogMapper.java │ │ │ ├── MenuMapper.java │ │ │ ├── NoticeMapper.java │ │ │ ├── OperationLogMapper.java │ │ │ ├── RelationMapper.java │ │ │ ├── RoleMapper.java │ │ │ ├── UserMapper.java │ │ │ └── mapping │ │ │ │ ├── DeptMapper.xml │ │ │ │ ├── DictMapper.xml │ │ │ │ ├── ExpenseMapper.xml │ │ │ │ ├── LoginLogMapper.xml │ │ │ │ ├── MenuMapper.xml │ │ │ │ ├── NoticeMapper.xml │ │ │ │ ├── OperationLogMapper.xml │ │ │ │ ├── RelationMapper.xml │ │ │ │ ├── RoleMapper.xml │ │ │ │ └── UserMapper.xml │ │ │ ├── factory │ │ │ └── UserFactory.java │ │ │ ├── model │ │ │ ├── Dept.java │ │ │ ├── Dict.java │ │ │ ├── Expense.java │ │ │ ├── LoginLog.java │ │ │ ├── Menu.java │ │ │ ├── Notice.java │ │ │ ├── OperationLog.java │ │ │ ├── Relation.java │ │ │ ├── Role.java │ │ │ └── User.java │ │ │ ├── service │ │ │ ├── IDeptService.java │ │ │ ├── IDictService.java │ │ │ ├── ILoginLogService.java │ │ │ ├── IMenuService.java │ │ │ ├── INoticeService.java │ │ │ ├── IOperationLogService.java │ │ │ ├── IRelationService.java │ │ │ ├── IRoleService.java │ │ │ ├── IUserService.java │ │ │ └── impl │ │ │ │ ├── DeptServiceImpl.java │ │ │ │ ├── DictServiceImpl.java │ │ │ │ ├── LoginLogServiceImpl.java │ │ │ │ ├── MenuServiceImpl.java │ │ │ │ ├── NoticeServiceImpl.java │ │ │ │ ├── OperationLogServiceImpl.java │ │ │ │ ├── RelationServiceImpl.java │ │ │ │ ├── RoleServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ │ ├── transfer │ │ │ ├── ManagerUser.java │ │ │ ├── ReqAddManager.java │ │ │ ├── ReqEditManager.java │ │ │ └── UserDto.java │ │ │ └── warpper │ │ │ ├── DeptWarpper.java │ │ │ ├── DictWarpper.java │ │ │ ├── LogWarpper.java │ │ │ ├── MenuWarpper.java │ │ │ ├── NoticeWrapper.java │ │ │ ├── RoleWarpper.java │ │ │ └── UserWarpper.java │ ├── resources │ │ ├── META-INF │ │ │ └── spring-devtools.properties │ │ ├── application.yml │ │ ├── ehcache.xml │ │ └── logback-spring.xml │ └── webapp │ │ ├── WEB-INF │ │ └── view │ │ │ ├── 404.html │ │ │ ├── blackboard.html │ │ │ ├── code │ │ │ └── code.html │ │ │ ├── common │ │ │ ├── _container.html │ │ │ ├── _right.html │ │ │ ├── _tab.html │ │ │ ├── _theme.html │ │ │ └── tags │ │ │ │ ├── NameCon.tag │ │ │ │ ├── SelectCon.tag │ │ │ │ ├── TimeCon.tag │ │ │ │ ├── avatar.tag │ │ │ │ ├── button.tag │ │ │ │ ├── input.tag │ │ │ │ ├── select.tag │ │ │ │ ├── table.tag │ │ │ │ └── tag_tips │ │ │ ├── index.html │ │ │ ├── login.html │ │ │ └── system │ │ │ ├── code │ │ │ └── code.html │ │ │ ├── dept │ │ │ ├── dept.html │ │ │ ├── dept_add.html │ │ │ └── dept_edit.html │ │ │ ├── dict │ │ │ ├── dict.html │ │ │ ├── dict_add.html │ │ │ └── dict_edit.html │ │ │ ├── log │ │ │ ├── log.html │ │ │ └── login_log.html │ │ │ ├── menu │ │ │ ├── menu.html │ │ │ ├── menu_add.html │ │ │ └── menu_edit.html │ │ │ ├── notice │ │ │ ├── notice.html │ │ │ ├── notice_add.html │ │ │ └── notice_edit.html │ │ │ ├── role │ │ │ ├── role.html │ │ │ ├── role_add.html │ │ │ ├── role_assign.html │ │ │ └── role_edit.html │ │ │ └── user │ │ │ ├── user.html │ │ │ ├── user_add.html │ │ │ ├── user_chpwd.html │ │ │ ├── user_edit.html │ │ │ ├── user_roleassign.html │ │ │ └── user_view.html │ │ └── static │ │ ├── css │ │ ├── _fstyle.css │ │ ├── bootstrap-rtl.css │ │ ├── bootstrap.min.css │ │ ├── font-awesome.css │ │ ├── font-awesome.min.css │ │ ├── login.css │ │ ├── patterns │ │ │ ├── header-profile-skin-1.png │ │ │ ├── header-profile-skin-3.png │ │ │ ├── header-profile.png │ │ │ └── shattered.png │ │ ├── plugins │ │ │ ├── bootstrap-table │ │ │ │ └── bootstrap-table.min.css │ │ │ ├── bootstrap-treetable │ │ │ │ └── bootstrap-treetable.css │ │ │ ├── chosen │ │ │ │ ├── chosen-sprite.png │ │ │ │ ├── chosen-sprite@2x.png │ │ │ │ └── chosen.css │ │ │ ├── iCheck │ │ │ │ ├── custom.css │ │ │ │ ├── green.png │ │ │ │ └── green@2x.png │ │ │ ├── images │ │ │ │ └── sprite-skin-flat.png │ │ │ ├── validate │ │ │ │ └── bootstrapValidator.min.css │ │ │ ├── webuploader │ │ │ │ └── webuploader.css │ │ │ └── ztree │ │ │ │ ├── demo.css │ │ │ │ ├── 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 │ │ └── style.css │ │ ├── favicon.ico │ │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── 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 │ │ ├── img │ │ ├── bg.png │ │ ├── boy.gif │ │ ├── girl.gif │ │ ├── icons.png │ │ ├── loading-upload.gif │ │ ├── locked.png │ │ └── user.png │ │ ├── js │ │ ├── bootstrap.min.js │ │ ├── common │ │ │ ├── DateUtils.js │ │ │ ├── Feng.js │ │ │ ├── ajax-object.js │ │ │ ├── bootstrap-table-object.js │ │ │ ├── select-list-object.js │ │ │ ├── tree-table-object.js │ │ │ ├── web-upload-object.js │ │ │ └── ztree-object.js │ │ ├── contabs.js │ │ ├── content.js │ │ ├── hplus.js │ │ ├── jquery.min.js │ │ ├── jquery.min.map │ │ └── plugins │ │ │ ├── bootstrap-table │ │ │ ├── bootstrap-table-mobile.min.js │ │ │ ├── bootstrap-table.min.js │ │ │ └── locale │ │ │ │ ├── bootstrap-table-zh-CN.js │ │ │ │ └── bootstrap-table-zh-CN.min.js │ │ │ ├── bootstrap-treetable │ │ │ └── bootstrap-treetable.js │ │ │ ├── chosen │ │ │ └── chosen.jquery.js │ │ │ ├── iCheck │ │ │ └── icheck.min.js │ │ │ ├── laydate │ │ │ ├── laydate.js │ │ │ └── theme │ │ │ │ └── default │ │ │ │ ├── font │ │ │ │ ├── iconfont.eot │ │ │ │ ├── iconfont.svg │ │ │ │ ├── iconfont.ttf │ │ │ │ └── iconfont.woff │ │ │ │ └── laydate.css │ │ │ ├── layer │ │ │ ├── layer.js │ │ │ ├── mobile │ │ │ │ ├── layer.js │ │ │ │ └── need │ │ │ │ │ └── layer.css │ │ │ └── theme │ │ │ │ └── default │ │ │ │ ├── icon-ext.png │ │ │ │ ├── icon.png │ │ │ │ ├── layer.css │ │ │ │ ├── loading-0.gif │ │ │ │ ├── loading-1.gif │ │ │ │ └── loading-2.gif │ │ │ ├── metisMenu │ │ │ └── jquery.metisMenu.js │ │ │ ├── pace │ │ │ └── pace.min.js │ │ │ ├── slimscroll │ │ │ └── jquery.slimscroll.min.js │ │ │ ├── validate │ │ │ ├── additional-methods.min.js │ │ │ ├── bootstrapValidator.min.js │ │ │ └── zh_CN.js │ │ │ ├── wangEditor │ │ │ └── wangEditor.js │ │ │ ├── webuploader │ │ │ ├── Uploader.swf │ │ │ ├── webuploader.css │ │ │ ├── webuploader.custom.js │ │ │ ├── webuploader.custom.min.js │ │ │ ├── webuploader.fis.js │ │ │ ├── webuploader.flashonly.js │ │ │ ├── webuploader.flashonly.min.js │ │ │ ├── webuploader.html5only.js │ │ │ ├── webuploader.html5only.min.js │ │ │ ├── webuploader.js │ │ │ ├── webuploader.min.js │ │ │ ├── webuploader.noimage.js │ │ │ ├── webuploader.noimage.min.js │ │ │ ├── webuploader.nolog.js │ │ │ ├── webuploader.nolog.min.js │ │ │ ├── webuploader.withoutimage.js │ │ │ └── webuploader.withoutimage.min.js │ │ │ └── ztree │ │ │ └── jquery.ztree.all.min.js │ │ └── modular │ │ ├── code │ │ └── gen.js │ │ ├── flowable │ │ ├── expense │ │ │ ├── expense.js │ │ │ └── expense_info.js │ │ └── process │ │ │ ├── process.js │ │ │ └── process_info.js │ │ └── system │ │ ├── code │ │ └── code.js │ │ ├── dept │ │ ├── dept.js │ │ └── dept_info.js │ │ ├── dict │ │ ├── dict.js │ │ └── dict_info.js │ │ ├── log │ │ ├── log.js │ │ └── login_log.js │ │ ├── menu │ │ ├── menu.js │ │ └── menu_info.js │ │ ├── notice │ │ ├── notice.js │ │ └── notice_info.js │ │ ├── role │ │ ├── role.js │ │ └── role_info.js │ │ └── user │ │ ├── user.js │ │ └── user_info.js │ └── test │ └── java │ └── com │ └── stylefeng │ └── guns │ ├── CommonTest.java │ ├── base │ └── BaseJunit.java │ ├── shiro │ └── Base64Test.java │ └── system │ ├── BlackBoardTest.java │ ├── DeptTest.java │ ├── DictTest.java │ ├── MenuTest.java │ └── UserTest.java ├── guns-alipay ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ └── rest │ │ │ ├── AlipayApplication.java │ │ │ ├── GunsRestServletInitializer.java │ │ │ ├── common │ │ │ ├── SimpleObject.java │ │ │ ├── aop │ │ │ │ └── GlobalExceptionHandler.java │ │ │ ├── exception │ │ │ │ └── BizExceptionEnum.java │ │ │ └── util │ │ │ │ └── FtpUtil.java │ │ │ ├── config │ │ │ ├── MessageConverConfig.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── TraceConfig.java │ │ │ ├── WebConfig.java │ │ │ └── properties │ │ │ │ ├── JwtProperties.java │ │ │ │ └── RestProperties.java │ │ │ └── modular │ │ │ ├── alipay │ │ │ ├── config │ │ │ │ ├── Configs.java │ │ │ │ └── Constants.java │ │ │ ├── model │ │ │ │ ├── ExtendParams.java │ │ │ │ ├── GoodsDetail.java │ │ │ │ ├── TradeStatus.java │ │ │ │ ├── builder │ │ │ │ │ ├── AlipayHeartbeatSynRequestBuilder.java │ │ │ │ │ ├── AlipayTradeCancelRequestBuilder.java │ │ │ │ │ ├── AlipayTradePayRequestBuilder.java │ │ │ │ │ ├── AlipayTradePrecreateRequestBuilder.java │ │ │ │ │ ├── AlipayTradeQueryRequestBuilder.java │ │ │ │ │ ├── AlipayTradeRefundRequestBuilder.java │ │ │ │ │ └── RequestBuilder.java │ │ │ │ ├── hb │ │ │ │ │ ├── EquipStatus.java │ │ │ │ │ ├── EquipStatusAdapter.java │ │ │ │ │ ├── ExceptionInfo.java │ │ │ │ │ ├── ExceptionInfoAdapter.java │ │ │ │ │ ├── HbStatus.java │ │ │ │ │ ├── PosTradeInfo.java │ │ │ │ │ ├── Product.java │ │ │ │ │ ├── SysTradeInfo.java │ │ │ │ │ ├── TradeInfo.java │ │ │ │ │ ├── TradeInfoAdapter.java │ │ │ │ │ └── Type.java │ │ │ │ └── result │ │ │ │ │ ├── AlipayF2FPayResult.java │ │ │ │ │ ├── AlipayF2FPrecreateResult.java │ │ │ │ │ ├── AlipayF2FQueryResult.java │ │ │ │ │ ├── AlipayF2FRefundResult.java │ │ │ │ │ └── Result.java │ │ │ ├── service │ │ │ │ ├── AlipayMonitorService.java │ │ │ │ ├── AlipayTradeService.java │ │ │ │ └── impl │ │ │ │ │ ├── AbsAlipayService.java │ │ │ │ │ ├── AbsAlipayTradeService.java │ │ │ │ │ ├── AlipayMonitorServiceImpl.java │ │ │ │ │ ├── AlipayTradeServiceImpl.java │ │ │ │ │ ├── AlipayTradeWithHBServiceImpl.java │ │ │ │ │ └── hb │ │ │ │ │ ├── AbsHbRunner.java │ │ │ │ │ ├── HbListener.java │ │ │ │ │ ├── HbQueue.java │ │ │ │ │ └── TradeListener.java │ │ │ └── utils │ │ │ │ ├── GsonFactory.java │ │ │ │ ├── Utils.java │ │ │ │ └── ZxingUtils.java │ │ │ ├── auth │ │ │ ├── controller │ │ │ │ ├── AuthController.java │ │ │ │ └── dto │ │ │ │ │ ├── AuthRequest.java │ │ │ │ │ └── AuthResponse.java │ │ │ ├── converter │ │ │ │ ├── BaseTransferEntity.java │ │ │ │ └── WithSignMessageConverter.java │ │ │ ├── filter │ │ │ │ └── AuthFilter.java │ │ │ ├── security │ │ │ │ ├── DataSecurityAction.java │ │ │ │ └── impl │ │ │ │ │ └── Base64SecurityAction.java │ │ │ ├── util │ │ │ │ └── JwtTokenUtil.java │ │ │ └── validator │ │ │ │ ├── IReqValidator.java │ │ │ │ ├── dto │ │ │ │ └── Credence.java │ │ │ │ └── impl │ │ │ │ └── SimpleValidator.java │ │ │ ├── service │ │ │ └── DefaultAliPayServiceImpl.java │ │ │ └── test │ │ │ ├── DemoHbRunner.java │ │ │ └── Main.java │ └── resources │ │ ├── application.yml │ │ ├── log4j.properties │ │ └── zfbinfo.properties │ └── test │ └── java │ └── com │ └── stylefeng │ └── guns │ ├── GunsRestApplicationTests.java │ ├── fastjson │ └── JsonTest.java │ ├── generator │ └── EntityGenerator.java │ └── jwt │ ├── DecryptTest.java │ └── JWTTest.java ├── guns-api ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── stylefeng │ │ └── guns │ │ └── api │ │ ├── alipay │ │ ├── AliPayServiceAPI.java │ │ ├── AliPayServiceMock.java │ │ └── vo │ │ │ ├── AliPayInfoVO.java │ │ │ └── AliPayResultVO.java │ │ ├── cinema │ │ ├── CinemaServiceApi.java │ │ └── vo │ │ │ ├── AreaVO.java │ │ │ ├── BrandVO.java │ │ │ ├── CinemaInfoVO.java │ │ │ ├── CinemaQueryVO.java │ │ │ ├── CinemaVO.java │ │ │ ├── FilmFieldVO.java │ │ │ ├── FilmInfoVO.java │ │ │ ├── HallInfoVO.java │ │ │ ├── HallTypeVO.java │ │ │ └── OrderQueryVO.java │ │ ├── film │ │ ├── FilmAsyncServiceApi.java │ │ ├── FilmServiceApi.java │ │ └── vo │ │ │ ├── ActorRequestVO.java │ │ │ ├── ActorVO.java │ │ │ ├── BannerVO.java │ │ │ ├── CatVO.java │ │ │ ├── FilmDescVO.java │ │ │ ├── FilmDetailVO.java │ │ │ ├── FilmIndexVO.java │ │ │ ├── FilmInfo.java │ │ │ ├── FilmVO.java │ │ │ ├── ImgVO.java │ │ │ ├── InfoRequestVO.java │ │ │ ├── SourceVO.java │ │ │ └── YearVO.java │ │ ├── order │ │ ├── OrderServiceAPI.java │ │ └── vo │ │ │ └── OrderVO.java │ │ └── user │ │ ├── UserAPI.java │ │ └── vo │ │ ├── UserInfoModel.java │ │ └── UserModel.java │ └── resources │ ├── META-INF │ └── spring.factories │ └── default-config.properties ├── guns-cinema ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ └── rest │ │ │ ├── CinemaApplication.java │ │ │ ├── GunsRestServletInitializer.java │ │ │ ├── common │ │ │ ├── SimpleObject.java │ │ │ ├── aop │ │ │ │ └── GlobalExceptionHandler.java │ │ │ ├── exception │ │ │ │ └── BizExceptionEnum.java │ │ │ └── persistence │ │ │ │ ├── dao │ │ │ │ ├── MoocAreaDictTMapper.java │ │ │ │ ├── MoocBrandDictTMapper.java │ │ │ │ ├── MoocCinemaTMapper.java │ │ │ │ ├── MoocFieldTMapper.java │ │ │ │ ├── MoocHallDictTMapper.java │ │ │ │ ├── MoocHallFilmInfoTMapper.java │ │ │ │ └── mapping │ │ │ │ │ ├── MoocAreaDictTMapper.xml │ │ │ │ │ ├── MoocBrandDictTMapper.xml │ │ │ │ │ ├── MoocCinemaTMapper.xml │ │ │ │ │ ├── MoocFieldTMapper.xml │ │ │ │ │ ├── MoocHallDictTMapper.xml │ │ │ │ │ └── MoocHallFilmInfoTMapper.xml │ │ │ │ └── model │ │ │ │ ├── MoocAreaDictT.java │ │ │ │ ├── MoocBrandDictT.java │ │ │ │ ├── MoocCinemaT.java │ │ │ │ ├── MoocFieldT.java │ │ │ │ ├── MoocHallDictT.java │ │ │ │ └── MoocHallFilmInfoT.java │ │ │ ├── config │ │ │ ├── MessageConverConfig.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── TraceConfig.java │ │ │ ├── WebConfig.java │ │ │ └── properties │ │ │ │ ├── JwtProperties.java │ │ │ │ └── RestProperties.java │ │ │ └── modular │ │ │ ├── auth │ │ │ ├── controller │ │ │ │ ├── AuthController.java │ │ │ │ └── dto │ │ │ │ │ ├── AuthRequest.java │ │ │ │ │ └── AuthResponse.java │ │ │ ├── converter │ │ │ │ ├── BaseTransferEntity.java │ │ │ │ └── WithSignMessageConverter.java │ │ │ ├── filter │ │ │ │ └── AuthFilter.java │ │ │ ├── security │ │ │ │ ├── DataSecurityAction.java │ │ │ │ └── impl │ │ │ │ │ └── Base64SecurityAction.java │ │ │ ├── util │ │ │ │ └── JwtTokenUtil.java │ │ │ └── validator │ │ │ │ ├── IReqValidator.java │ │ │ │ ├── dto │ │ │ │ └── Credence.java │ │ │ │ └── impl │ │ │ │ └── SimpleValidator.java │ │ │ └── cinema │ │ │ └── serivce │ │ │ └── DefaultCinemaServiceImpl.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── stylefeng │ └── guns │ ├── GunsRestApplicationTests.java │ ├── fastjson │ └── JsonTest.java │ ├── generator │ └── EntityGenerator.java │ └── jwt │ ├── DecryptTest.java │ └── JWTTest.java ├── guns-core ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── stylefeng │ │ └── guns │ │ └── core │ │ ├── CoreFlag.java │ │ ├── aop │ │ └── BaseControllerExceptionHandler.java │ │ ├── base │ │ ├── controller │ │ │ ├── BaseController.java │ │ │ ├── GlobalController.java │ │ │ └── GunsErrorView.java │ │ ├── tips │ │ │ ├── ErrorTip.java │ │ │ ├── SuccessTip.java │ │ │ └── Tip.java │ │ └── warpper │ │ │ └── BaseControllerWarpper.java │ │ ├── cache │ │ ├── BaseCacheFactory.java │ │ ├── CacheKit.java │ │ ├── EhcacheFactory.java │ │ ├── ICache.java │ │ └── ILoader.java │ │ ├── config │ │ ├── DefaultFastjsonConfig.java │ │ ├── DefaultMultiConfig.java │ │ ├── DefaultProperties.java │ │ ├── DefaultWebConfig.java │ │ ├── MultiDataSourceConfig.java │ │ ├── SingleDataSourceConfig.java │ │ └── properties │ │ │ ├── DruidProperties.java │ │ │ └── MutiDataSourceProperties.java │ │ ├── constant │ │ └── IsMenu.java │ │ ├── datascope │ │ ├── DataScope.java │ │ └── DataScopeInterceptor.java │ │ ├── db │ │ └── Db.java │ │ ├── exception │ │ ├── GunsException.java │ │ ├── GunsExceptionEnum.java │ │ └── ServiceExceptionEnum.java │ │ ├── mutidatasource │ │ ├── DataSourceContextHolder.java │ │ ├── DynamicDataSource.java │ │ ├── annotion │ │ │ └── DataSource.java │ │ └── aop │ │ │ └── MultiSourceExAop.java │ │ ├── node │ │ ├── MenuNode.java │ │ └── ZTreeNode.java │ │ ├── page │ │ ├── PageBT.java │ │ └── PageInfoBT.java │ │ ├── qr │ │ ├── ImgQrTool.java │ │ ├── MatrixToImageConfig.java │ │ ├── MatrixToImageWriter.java │ │ └── QrImage.java │ │ ├── support │ │ ├── BasicType.java │ │ ├── BeanKit.java │ │ ├── ClassKit.java │ │ ├── CollectionKit.java │ │ ├── DateTime.java │ │ ├── DateTimeKit.java │ │ ├── HexKit.java │ │ ├── HttpKit.java │ │ ├── ObjectKit.java │ │ ├── PageKit.java │ │ ├── StrKit.java │ │ ├── WafKit.java │ │ ├── WafRequestWrapper.java │ │ └── exception │ │ │ └── ToolBoxException.java │ │ ├── util │ │ ├── Convert.java │ │ ├── DateUtil.java │ │ ├── FileUtil.java │ │ ├── HttpSessionHolder.java │ │ ├── IdGenerator.java │ │ ├── MD5Util.java │ │ ├── NumUtil.java │ │ ├── PingYinUtil.java │ │ ├── RenderUtil.java │ │ ├── ResKit.java │ │ ├── SimpleContrast.java │ │ ├── SpringContextHolder.java │ │ ├── SqlUtil.java │ │ ├── TokenBucket.java │ │ ├── ToolUtil.java │ │ └── UUIDUtil.java │ │ └── xss │ │ ├── XssFilter.java │ │ └── XssHttpServletRequestWrapper.java │ └── resources │ ├── META-INF │ └── spring.factories │ └── default-config.properties ├── guns-example-client ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── stylefeng │ │ └── sso │ │ └── client │ │ ├── SsoClientExampleApplication.java │ │ ├── auth │ │ └── AuthApiFactory.java │ │ ├── cache │ │ └── DefaultClientCache.java │ │ ├── config │ │ ├── BeetlConfig.java │ │ ├── RestConfig.java │ │ ├── WebConfig.java │ │ └── properties │ │ │ └── BeetlProperties.java │ │ └── controller │ │ └── ClientController.java │ ├── resources │ ├── application.yml │ └── logback-spring.xml │ └── webapp │ ├── WEB-INF │ └── view │ │ ├── 404.html │ │ └── index.html │ └── static │ ├── css │ ├── bootstrap.min.css │ ├── font-awesome.css │ ├── font-awesome.min.css │ └── style.css │ ├── favicon.ico │ ├── fonts │ ├── FontAwesome.otf │ ├── 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 │ └── js │ ├── bootstrap.min.js │ ├── content.js │ ├── jquery.min.js │ └── jquery.min.map ├── guns-film ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ └── rest │ │ │ ├── FilmApplication.java │ │ │ ├── FilmServletInitializer.java │ │ │ ├── common │ │ │ ├── SimpleObject.java │ │ │ ├── aop │ │ │ │ └── GlobalExceptionHandler.java │ │ │ ├── exception │ │ │ │ └── BizExceptionEnum.java │ │ │ └── persistence │ │ │ │ ├── dao │ │ │ │ ├── MoocActorTMapper.java │ │ │ │ ├── MoocBannerTMapper.java │ │ │ │ ├── MoocCatDictTMapper.java │ │ │ │ ├── MoocFilmInfoTMapper.java │ │ │ │ ├── MoocFilmTMapper.java │ │ │ │ ├── MoocSourceDictTMapper.java │ │ │ │ ├── MoocYearDictTMapper.java │ │ │ │ └── mapping │ │ │ │ │ ├── MoocActorTMapper.xml │ │ │ │ │ ├── MoocBannerTMapper.xml │ │ │ │ │ ├── MoocCatDictTMapper.xml │ │ │ │ │ ├── MoocFilmInfoTMapper.xml │ │ │ │ │ ├── MoocFilmTMapper.xml │ │ │ │ │ ├── MoocSourceDictTMapper.xml │ │ │ │ │ └── MoocYearDictTMapper.xml │ │ │ │ └── model │ │ │ │ ├── MoocActorT.java │ │ │ │ ├── MoocBannerT.java │ │ │ │ ├── MoocCatDictT.java │ │ │ │ ├── MoocFilmInfoT.java │ │ │ │ ├── MoocFilmT.java │ │ │ │ ├── MoocSourceDictT.java │ │ │ │ └── MoocYearDictT.java │ │ │ ├── config │ │ │ ├── MessageConverConfig.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── WebConfig.java │ │ │ └── properties │ │ │ │ ├── JwtProperties.java │ │ │ │ └── RestProperties.java │ │ │ └── modular │ │ │ ├── auth │ │ │ ├── controller │ │ │ │ ├── AuthController.java │ │ │ │ └── dto │ │ │ │ │ ├── AuthRequest.java │ │ │ │ │ └── AuthResponse.java │ │ │ ├── converter │ │ │ │ ├── BaseTransferEntity.java │ │ │ │ └── WithSignMessageConverter.java │ │ │ ├── filter │ │ │ │ └── AuthFilter.java │ │ │ ├── security │ │ │ │ ├── DataSecurityAction.java │ │ │ │ └── impl │ │ │ │ │ └── Base64SecurityAction.java │ │ │ ├── util │ │ │ │ └── JwtTokenUtil.java │ │ │ └── validator │ │ │ │ ├── IReqValidator.java │ │ │ │ ├── dto │ │ │ │ └── Credence.java │ │ │ │ └── impl │ │ │ │ └── SimpleValidator.java │ │ │ ├── example │ │ │ └── ExampleController.java │ │ │ └── film │ │ │ └── service │ │ │ ├── DefaultFilmAsyncServiceImpl.java │ │ │ └── DefaultFilmServiceImpl.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── stylefeng │ └── guns │ ├── GunsRestApplicationTests.java │ ├── fastjson │ └── JsonTest.java │ ├── generator │ └── EntityGenerator.java │ └── jwt │ ├── DecryptTest.java │ └── JWTTest.java ├── guns-gateway ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ └── rest │ │ │ ├── GunsGatewayApplication.java │ │ │ ├── GunsGatewayServletInitializer.java │ │ │ ├── common │ │ │ ├── CurrentUser.java │ │ │ ├── SimpleObject.java │ │ │ ├── aop │ │ │ │ └── GlobalExceptionHandler.java │ │ │ ├── exception │ │ │ │ └── BizExceptionEnum.java │ │ │ └── persistence │ │ │ │ ├── dao │ │ │ │ ├── UserMapper.java │ │ │ │ └── mapping │ │ │ │ │ └── UserMapper.xml │ │ │ │ └── model │ │ │ │ └── User.java │ │ │ ├── config │ │ │ ├── MessageConverConfig.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── TraceConfig.java │ │ │ ├── WebConfig.java │ │ │ └── properties │ │ │ │ ├── JwtProperties.java │ │ │ │ └── RestProperties.java │ │ │ └── modular │ │ │ ├── Client.java │ │ │ ├── auth │ │ │ ├── controller │ │ │ │ ├── AuthController.java │ │ │ │ └── dto │ │ │ │ │ ├── AuthRequest.java │ │ │ │ │ └── AuthResponse.java │ │ │ ├── converter │ │ │ │ ├── BaseTransferEntity.java │ │ │ │ └── WithSignMessageConverter.java │ │ │ ├── filter │ │ │ │ └── AuthFilter.java │ │ │ ├── security │ │ │ │ ├── DataSecurityAction.java │ │ │ │ └── impl │ │ │ │ │ └── Base64SecurityAction.java │ │ │ ├── util │ │ │ │ └── JwtTokenUtil.java │ │ │ └── validator │ │ │ │ ├── IReqValidator.java │ │ │ │ ├── dto │ │ │ │ └── Credence.java │ │ │ │ └── impl │ │ │ │ ├── DbValidator.java │ │ │ │ └── SimpleValidator.java │ │ │ ├── cinema │ │ │ ├── CinemaController.java │ │ │ └── vo │ │ │ │ ├── CinemaConditionResponseVO.java │ │ │ │ ├── CinemaFieldResponseVO.java │ │ │ │ ├── CinemaFieldsResponseVO.java │ │ │ │ └── CinemaListResponseVO.java │ │ │ ├── example │ │ │ └── ExampleController.java │ │ │ ├── film │ │ │ ├── FilmController.java │ │ │ └── vo │ │ │ │ ├── FilmConditionVO.java │ │ │ │ ├── FilmIndexVO.java │ │ │ │ └── FilmRequestVO.java │ │ │ ├── order │ │ │ └── OrderController.java │ │ │ ├── user │ │ │ └── UserController.java │ │ │ └── vo │ │ │ └── ResponseVO.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── stylefeng │ └── guns │ ├── GunsRestApplicationTests.java │ ├── fastjson │ └── JsonTest.java │ ├── generator │ └── EntityGenerator.java │ └── jwt │ ├── DecryptTest.java │ └── JWTTest.java ├── guns-generator ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── stylefeng │ │ └── guns │ │ └── generator │ │ ├── action │ │ ├── GunsCodeGenerator.java │ │ ├── config │ │ │ ├── AbstractGeneratorConfig.java │ │ │ ├── GunsGeneratorConfig.java │ │ │ └── WebGeneratorConfig.java │ │ └── model │ │ │ └── GenQo.java │ │ └── engine │ │ ├── SimpleTemplateEngine.java │ │ ├── base │ │ ├── AbstractTemplateEngine.java │ │ └── GunsTemplateEngine.java │ │ └── config │ │ ├── ContextConfig.java │ │ ├── ControllerConfig.java │ │ ├── DaoConfig.java │ │ ├── Menu.java │ │ ├── PageConfig.java │ │ ├── ServiceConfig.java │ │ └── SqlConfig.java │ └── resources │ └── gunsTemplate │ └── advanced │ ├── Controller.java.btl │ ├── menu_sql.sql.btl │ ├── page.html.btl │ ├── page.js.btl │ ├── page_add.html.btl │ ├── page_edit.html.btl │ └── page_info.js.btl ├── guns-order ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ └── rest │ │ │ ├── GunsRestServletInitializer.java │ │ │ ├── OrderApplication.java │ │ │ ├── common │ │ │ ├── SimpleObject.java │ │ │ ├── aop │ │ │ │ └── GlobalExceptionHandler.java │ │ │ ├── exception │ │ │ │ └── BizExceptionEnum.java │ │ │ ├── persistence │ │ │ │ ├── dao │ │ │ │ │ ├── MoocOrder2017TMapper.java │ │ │ │ │ ├── MoocOrder2018TMapper.java │ │ │ │ │ ├── MoocOrderTMapper.java │ │ │ │ │ └── mapping │ │ │ │ │ │ ├── MoocOrder2017TMapper.xml │ │ │ │ │ │ ├── MoocOrder2018TMapper.xml │ │ │ │ │ │ └── MoocOrderTMapper.xml │ │ │ │ └── model │ │ │ │ │ ├── MoocOrder2017T.java │ │ │ │ │ ├── MoocOrder2018T.java │ │ │ │ │ └── MoocOrderT.java │ │ │ └── util │ │ │ │ └── FTPUtil.java │ │ │ ├── config │ │ │ ├── MessageConverConfig.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── TraceConfig.java │ │ │ ├── WebConfig.java │ │ │ └── properties │ │ │ │ ├── JwtProperties.java │ │ │ │ └── RestProperties.java │ │ │ └── modular │ │ │ ├── auth │ │ │ ├── controller │ │ │ │ ├── AuthController.java │ │ │ │ └── dto │ │ │ │ │ ├── AuthRequest.java │ │ │ │ │ └── AuthResponse.java │ │ │ ├── converter │ │ │ │ ├── BaseTransferEntity.java │ │ │ │ └── WithSignMessageConverter.java │ │ │ ├── filter │ │ │ │ └── AuthFilter.java │ │ │ ├── security │ │ │ │ ├── DataSecurityAction.java │ │ │ │ └── impl │ │ │ │ │ └── Base64SecurityAction.java │ │ │ ├── util │ │ │ │ └── JwtTokenUtil.java │ │ │ └── validator │ │ │ │ ├── IReqValidator.java │ │ │ │ ├── dto │ │ │ │ └── Credence.java │ │ │ │ └── impl │ │ │ │ └── SimpleValidator.java │ │ │ └── order │ │ │ ├── DefaultOrderServiceImpl.java │ │ │ ├── OrderServiceImpl2017.java │ │ │ └── OrderServiceImpl2018.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── stylefeng │ └── guns │ ├── GunsRestApplicationTests.java │ ├── fastjson │ └── JsonTest.java │ ├── generator │ └── EntityGenerator.java │ └── jwt │ ├── DecryptTest.java │ └── JWTTest.java ├── guns-rest ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ └── rest │ │ │ ├── GunsRestApplication.java │ │ │ ├── GunsRestServletInitializer.java │ │ │ ├── common │ │ │ ├── SimpleObject.java │ │ │ ├── aop │ │ │ │ └── GlobalExceptionHandler.java │ │ │ ├── exception │ │ │ │ └── BizExceptionEnum.java │ │ │ └── persistence │ │ │ │ ├── dao │ │ │ │ ├── UserMapper.java │ │ │ │ └── mapping │ │ │ │ │ └── UserMapper.xml │ │ │ │ └── model │ │ │ │ └── User.java │ │ │ ├── config │ │ │ ├── MessageConverConfig.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── WebConfig.java │ │ │ └── properties │ │ │ │ ├── JwtProperties.java │ │ │ │ └── RestProperties.java │ │ │ └── modular │ │ │ ├── auth │ │ │ ├── controller │ │ │ │ ├── AuthController.java │ │ │ │ └── dto │ │ │ │ │ ├── AuthRequest.java │ │ │ │ │ └── AuthResponse.java │ │ │ ├── converter │ │ │ │ ├── BaseTransferEntity.java │ │ │ │ └── WithSignMessageConverter.java │ │ │ ├── filter │ │ │ │ └── AuthFilter.java │ │ │ ├── security │ │ │ │ ├── DataSecurityAction.java │ │ │ │ └── impl │ │ │ │ │ └── Base64SecurityAction.java │ │ │ ├── util │ │ │ │ └── JwtTokenUtil.java │ │ │ └── validator │ │ │ │ ├── IReqValidator.java │ │ │ │ ├── dto │ │ │ │ └── Credence.java │ │ │ │ └── impl │ │ │ │ ├── DbValidator.java │ │ │ │ └── SimpleValidator.java │ │ │ └── example │ │ │ └── ExampleController.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── stylefeng │ └── guns │ ├── GunsRestApplicationTests.java │ ├── fastjson │ └── JsonTest.java │ ├── generator │ └── EntityGenerator.java │ └── jwt │ ├── DecryptTest.java │ └── JWTTest.java ├── guns-sso-plugin ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── stylefeng │ │ └── sso │ │ └── plugin │ │ ├── api │ │ ├── AuthApi.java │ │ └── SsoApi.java │ │ ├── cache │ │ └── ClientCache.java │ │ ├── config │ │ └── SsoAutoConfiguration.java │ │ ├── constants │ │ └── SsoConstants.java │ │ ├── interceptor │ │ ├── SsoClientInterceptor.java │ │ └── SsoServerInterceptor.java │ │ ├── model │ │ ├── LoginUser.java │ │ ├── SsoResponse.java │ │ └── enums │ │ │ └── ResponseStatus.java │ │ ├── properties │ │ └── SsoProperties.java │ │ ├── remote │ │ └── RemoteService.java │ │ ├── service │ │ └── AuthService.java │ │ └── util │ │ ├── HttpUtil.java │ │ └── SsoSpringContextHolder.java │ └── resources │ └── META-INF │ └── spring.factories ├── guns-sso-server ├── pom.xml ├── sql │ └── sso_server.sql └── src │ └── main │ ├── java │ └── com │ │ └── stylefeng │ │ └── sso │ │ └── server │ │ ├── SsoServerApplication.java │ │ ├── config │ │ ├── BeetlConfig.java │ │ ├── DataSourceConfig.java │ │ ├── WebConfig.java │ │ └── properties │ │ │ └── BeetlProperties.java │ │ └── modular │ │ ├── controller │ │ └── AuthController.java │ │ ├── entity │ │ └── SysUser.java │ │ ├── mapper │ │ ├── SysUserMapper.java │ │ └── mapping │ │ │ └── SysUserMapper.xml │ │ └── service │ │ ├── SimpleAuthServiceImpl.java │ │ └── SysUserService.java │ ├── resources │ ├── application.yml │ └── logback-spring.xml │ └── webapp │ ├── WEB-INF │ └── view │ │ ├── 404.html │ │ └── login.html │ └── static │ ├── css │ ├── animate.css │ ├── bootstrap.min.css │ ├── font-awesome.css │ ├── font-awesome.min.css │ └── style.css │ ├── favicon.ico │ ├── fonts │ ├── FontAwesome.otf │ ├── 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 │ └── js │ ├── bootstrap.min.js │ ├── jquery.min.js │ └── jquery.min.map ├── guns-user ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ └── rest │ │ │ ├── UserApplication.java │ │ │ ├── UserServletInitializer.java │ │ │ ├── common │ │ │ ├── SimpleObject.java │ │ │ ├── aop │ │ │ │ └── GlobalExceptionHandler.java │ │ │ ├── exception │ │ │ │ └── BizExceptionEnum.java │ │ │ └── persistence │ │ │ │ ├── dao │ │ │ │ ├── MoocUserTMapper.java │ │ │ │ ├── UserMapper.java │ │ │ │ └── mapping │ │ │ │ │ ├── MoocUserTMapper.xml │ │ │ │ │ └── UserMapper.xml │ │ │ │ └── model │ │ │ │ ├── MoocUserT.java │ │ │ │ └── User.java │ │ │ ├── config │ │ │ ├── MessageConverConfig.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── WebConfig.java │ │ │ └── properties │ │ │ │ ├── JwtProperties.java │ │ │ │ └── RestProperties.java │ │ │ └── modular │ │ │ ├── auth │ │ │ ├── controller │ │ │ │ ├── AuthController.java │ │ │ │ └── dto │ │ │ │ │ ├── AuthRequest.java │ │ │ │ │ └── AuthResponse.java │ │ │ ├── converter │ │ │ │ ├── BaseTransferEntity.java │ │ │ │ └── WithSignMessageConverter.java │ │ │ ├── filter │ │ │ │ └── AuthFilter.java │ │ │ ├── security │ │ │ │ ├── DataSecurityAction.java │ │ │ │ └── impl │ │ │ │ │ └── Base64SecurityAction.java │ │ │ ├── util │ │ │ │ └── JwtTokenUtil.java │ │ │ └── validator │ │ │ │ ├── IReqValidator.java │ │ │ │ ├── dto │ │ │ │ └── Credence.java │ │ │ │ └── impl │ │ │ │ ├── DbValidator.java │ │ │ │ └── SimpleValidator.java │ │ │ ├── example │ │ │ └── ExampleController.java │ │ │ └── user │ │ │ └── UserServiceImpl.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── stylefeng │ └── guns │ ├── GunsRestApplicationTests.java │ ├── fastjson │ └── JsonTest.java │ ├── generator │ └── EntityGenerator.java │ └── jwt │ ├── DecryptTest.java │ └── JWTTest.java └── pom.xml /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=java 2 | *.css linguist-language=java 3 | *.html linguist-language=java 4 | *.btl linguist-language=java -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | *.iml 4 | *.idea 5 | target/ 6 | logs/ 7 | 8 | # Log file 9 | *.log 10 | 11 | # BlueJ files 12 | *.ctxt 13 | 14 | # Mobile Tools for Java (J2ME) 15 | .mtj.tmp/ 16 | 17 | # Package Files # 18 | *.jar 19 | *.war 20 | *.ear 21 | *.zip 22 | *.tar.gz 23 | *.rar 24 | 25 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 26 | hs_err_pid* 27 | 28 | *velocity.log* 29 | 30 | # Eclipse # 31 | .classpath 32 | .project 33 | .settings/ 34 | 35 | # log 36 | *.gz 37 | -------------------------------------------------------------------------------- /copy_packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p ./jars/ 4 | 5 | cp ./guns-gateway/target/guns-gateway-0.0.1.jar ./jars/ 6 | cp ./guns-user/target/guns-user-0.0.1.jar ./jars/ 7 | cp ./guns-film/target/guns-film-0.0.1.jar ./jars/ 8 | cp ./guns-cinema/target/guns-cinema-0.0.1.jar ./jars/ 9 | cp ./guns-order/target/guns-order-0.0.1.jar ./jars/ 10 | 11 | tar czf ./jars/project.tar.gz ./jars/ 12 | -------------------------------------------------------------------------------- /doc/Guns 技术文档 v1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/doc/Guns 技术文档 v1.0.pdf -------------------------------------------------------------------------------- /doc/影片模块-接口文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/doc/影片模块-接口文档.docx -------------------------------------------------------------------------------- /doc/影院模块-接口分析2.txt: -------------------------------------------------------------------------------- 1 | 1、根据CinemaQueryVO,查询影院列表 2 | 2、根据条件获取品牌列表 3 | 3、获取行政区域列表 4 | 4、获取影厅类型列表 5 | 5、根据影院编号获取影院信息 6 | 6、获取所有电影的信息和对应的放映场次信息,根据影院编号 7 | 7、根据放映场次ID获取放映信息 8 | 8、根据放映场次查询播放的电影编号,然后根据电影编号获取对应的电影信息 9 | -------------------------------------------------------------------------------- /doc/影院模块-接口文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/doc/影院模块-接口文档.docx -------------------------------------------------------------------------------- /doc/支付模块-接口文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/doc/支付模块-接口文档.docx -------------------------------------------------------------------------------- /doc/用户模块-接口文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/doc/用户模块-接口文档.docx -------------------------------------------------------------------------------- /doc/订单模块-接口文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/doc/订单模块-接口文档.docx -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/GunsApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | 8 | /** 9 | * SpringBoot方式启动类 10 | * 11 | * @author stylefeng 12 | * @Date 2017/5/21 12:06 13 | */ 14 | @SpringBootApplication 15 | public class GunsApplication { 16 | 17 | private final static Logger logger = LoggerFactory.getLogger(GunsApplication.class); 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(GunsApplication.class, args); 21 | logger.info("GunsApplication is success!"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/GunsServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017-05-21 9:43 11 | */ 12 | public class GunsServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(GunsApplication.class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/config/SpringSessionConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.config; 2 | 3 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 4 | 5 | /** 6 | * spring session配置 7 | * 8 | * @author fengshuonan 9 | * @date 2017-07-13 21:05 10 | */ 11 | //@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 1800) //session过期时间 如果部署多机环境,需要打开注释 12 | @ConditionalOnProperty(prefix = "guns", name = "spring-session-open", havingValue = "true") 13 | public class SpringSessionConfig { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/annotion/BussinessLog.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.annotion; 2 | 3 | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; 4 | import com.stylefeng.guns.core.common.constant.dictmap.base.SystemDict; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * 标记需要做业务日志的方法 10 | * 11 | * @author fengshuonan 12 | * @date 2017-03-31 12:46 13 | */ 14 | @Inherited 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target({ElementType.METHOD}) 17 | public @interface BussinessLog { 18 | 19 | /** 20 | * 业务的名称,例如:"修改菜单" 21 | */ 22 | String value() default ""; 23 | 24 | /** 25 | * 被修改的实体的唯一标识,例如:菜单实体的唯一标识为"id" 26 | */ 27 | String key() default "id"; 28 | 29 | /** 30 | * 字典(用于查找key的中文名称和字段的中文名称) 31 | */ 32 | Class dict() default SystemDict.class; 33 | } 34 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/annotion/Permission.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.annotion; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 权限注解 用于检查权限 规定访问权限 7 | * 8 | * @example @Permission({role1,role2}) 9 | * @example @Permission 10 | */ 11 | @Inherited 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target({ElementType.METHOD}) 14 | public @interface Permission { 15 | 16 | /** 17 | *

角色英文名称

18 | *

使用注解时加上这个值表示限制只有某个角色的才可以访问对应的资源

19 | *

常用在某些资源限制只有超级管理员角色才可访问

20 | */ 21 | String[] value() default {}; 22 | } 23 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/Const.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant; 2 | 3 | /** 4 | * 系统常量 5 | * 6 | * @author fengshuonan 7 | * @date 2017年2月12日 下午9:42:53 8 | */ 9 | public interface Const { 10 | 11 | /** 12 | * 系统默认的管理员密码 13 | */ 14 | String DEFAULT_PWD = "111111"; 15 | 16 | /** 17 | * 管理员角色的名字 18 | */ 19 | String ADMIN_NAME = "administrator"; 20 | 21 | /** 22 | * 管理员id 23 | */ 24 | Integer ADMIN_ID = 1; 25 | 26 | /** 27 | * 超级管理员角色id 28 | */ 29 | Integer ADMIN_ROLE_ID = 1; 30 | 31 | /** 32 | * 接口文档的菜单名 33 | */ 34 | String API_MENU_NAME = "接口文档"; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/DatasourceEnum.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant; 2 | 3 | /** 4 | * 5 | * 多数据源的枚举 6 | * 7 | * @author fengshuonan 8 | * @date 2017年3月5日 上午10:15:02 9 | */ 10 | public interface DatasourceEnum { 11 | 12 | String DATA_SOURCE_GUNS = "dataSourceGuns"; //guns数据源 13 | 14 | String DATA_SOURCE_BIZ = "dataSourceBiz"; //其他业务的数据源 15 | } 16 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/cache/Cache.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.cache; 2 | 3 | /** 4 | * 所有缓存名称的集合 5 | * 6 | * @author fengshuonan 7 | * @date 2017-04-24 21:56 8 | */ 9 | public interface Cache { 10 | 11 | /** 12 | * 常量缓存 13 | */ 14 | String CONSTANT = "CONSTANT"; 15 | } 16 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/cache/CacheKey.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.cache; 2 | 3 | /** 4 | * 缓存标识前缀集合,常用在ConstantFactory类中 5 | * 6 | * @author fengshuonan 7 | * @date 2017-04-25 9:37 8 | */ 9 | public interface CacheKey { 10 | 11 | /** 12 | * 角色名称(多个) 13 | */ 14 | String ROLES_NAME = "roles_name_"; 15 | 16 | /** 17 | * 角色名称(单个) 18 | */ 19 | String SINGLE_ROLE_NAME = "single_role_name_"; 20 | 21 | /** 22 | * 角色英文名称 23 | */ 24 | String SINGLE_ROLE_TIP = "single_role_tip_"; 25 | 26 | /** 27 | * 部门名称 28 | */ 29 | String DEPT_NAME = "dept_name_"; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/dictmap/DeptDict.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.dictmap; 2 | 3 | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; 4 | 5 | /** 6 | * 部门的映射 7 | * 8 | * @author fengshuonan 9 | * @date 2017-05-06 15:01 10 | */ 11 | public class DeptDict extends AbstractDictMap { 12 | 13 | @Override 14 | public void init() { 15 | put("deptId", "部门名称"); 16 | put("num", "部门排序"); 17 | put("pid", "上级名称"); 18 | put("simplename", "部门简称"); 19 | put("fullname", "部门全称"); 20 | put("tips", "备注"); 21 | } 22 | 23 | @Override 24 | protected void initBeWrapped() { 25 | putFieldWrapperMethodName("deptId", "getDeptName"); 26 | putFieldWrapperMethodName("pid", "getDeptName"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/dictmap/DictMap.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.dictmap; 2 | 3 | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; 4 | 5 | /** 6 | * 字典map 7 | * 8 | * @author fengshuonan 9 | * @date 2017-05-06 15:43 10 | */ 11 | public class DictMap extends AbstractDictMap { 12 | 13 | @Override 14 | public void init() { 15 | put("dictId","字典名称"); 16 | put("dictName","字典名称"); 17 | put("dictValues","字典内容"); 18 | } 19 | 20 | @Override 21 | protected void initBeWrapped() { 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/dictmap/LogDict.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.dictmap; 2 | 3 | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; 4 | 5 | /** 6 | * 日志的字典 7 | * 8 | * @author fengshuonan 9 | * @date 2017-05-06 15:01 10 | */ 11 | public class LogDict extends AbstractDictMap { 12 | 13 | @Override 14 | public void init() { 15 | put("tips","备注"); 16 | } 17 | 18 | @Override 19 | protected void initBeWrapped() { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/dictmap/MenuDict.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.dictmap; 2 | 3 | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; 4 | 5 | /** 6 | * 菜单的字典 7 | * 8 | * @author fengshuonan 9 | * @date 2017-05-06 15:01 10 | */ 11 | public class MenuDict extends AbstractDictMap { 12 | 13 | @Override 14 | public void init() { 15 | put("menuId","菜单id"); 16 | put("id","菜单id"); 17 | put("code","菜单编号"); 18 | put("pcode","菜单父编号"); 19 | put("name","菜单名称"); 20 | put("icon","菜单图标"); 21 | put("url","url地址"); 22 | put("num","菜单排序号"); 23 | put("levels","菜单层级"); 24 | put("tips","备注"); 25 | put("status","菜单状态"); 26 | put("isopen","是否打开"); 27 | put("",""); 28 | } 29 | 30 | @Override 31 | protected void initBeWrapped() { 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/dictmap/NoticeMap.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.dictmap; 2 | 3 | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; 4 | 5 | /** 6 | * 通知的映射 7 | * 8 | * @author fengshuonan 9 | * @date 2017-05-06 15:01 10 | */ 11 | public class NoticeMap extends AbstractDictMap { 12 | 13 | @Override 14 | public void init() { 15 | put("title", "标题"); 16 | put("content", "内容"); 17 | } 18 | 19 | @Override 20 | protected void initBeWrapped() { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/dictmap/RoleDict.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.dictmap; 2 | 3 | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; 4 | 5 | /** 6 | * 角色的字典 7 | * 8 | * @author fengshuonan 9 | * @date 2017-05-06 15:01 10 | */ 11 | public class RoleDict extends AbstractDictMap { 12 | 13 | @Override 14 | public void init() { 15 | put("roleId","角色名称"); 16 | put("num","角色排序"); 17 | put("pid","角色的父级"); 18 | put("name","角色名称"); 19 | put("deptid","部门名称"); 20 | put("tips","备注"); 21 | put("ids","资源名称"); 22 | } 23 | 24 | @Override 25 | protected void initBeWrapped() { 26 | putFieldWrapperMethodName("pid","getSingleRoleName"); 27 | putFieldWrapperMethodName("deptid","getDeptName"); 28 | putFieldWrapperMethodName("roleId","getSingleRoleName"); 29 | putFieldWrapperMethodName("ids","getMenuNames"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/dictmap/base/SystemDict.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.dictmap.base; 2 | 3 | /** 4 | * 系统相关的字典 5 | * 6 | * @author fengshuonan 7 | * @date 2017-05-06 15:48 8 | */ 9 | public class SystemDict extends AbstractDictMap { 10 | 11 | @Override 12 | public void init() { 13 | 14 | } 15 | 16 | @Override 17 | protected void initBeWrapped() { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/state/LogSucceed.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.state; 2 | 3 | /** 4 | * 业务是否成功的日志记录 5 | * 6 | * @author fengshuonan 7 | * @Date 2017年1月22日 下午12:14:59 8 | */ 9 | public enum LogSucceed { 10 | 11 | SUCCESS("成功"), 12 | FAIL("失败"); 13 | 14 | String message; 15 | 16 | LogSucceed(String message) { 17 | this.message = message; 18 | } 19 | 20 | public String getMessage() { 21 | return message; 22 | } 23 | 24 | public void setMessage(String message) { 25 | this.message = message; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/state/LogType.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.state; 2 | 3 | /** 4 | * 日志类型 5 | * 6 | * @author fengshuonan 7 | * @Date 2017年1月22日 下午12:14:59 8 | */ 9 | public enum LogType { 10 | 11 | LOGIN("登录日志"), 12 | LOGIN_FAIL("登录失败日志"), 13 | EXIT("退出日志"), 14 | EXCEPTION("异常日志"), 15 | BUSSINESS("业务日志"); 16 | 17 | String message; 18 | 19 | LogType(String message) { 20 | this.message = message; 21 | } 22 | 23 | public String getMessage() { 24 | return message; 25 | } 26 | 27 | public void setMessage(String message) { 28 | this.message = message; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/state/Order.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.constant.state; 2 | 3 | /** 4 | * 数据库排序 5 | * 6 | * @author fengshuonan 7 | * @Date 2017年5月31日20:48:41 8 | */ 9 | public enum Order { 10 | 11 | ASC("asc"), DESC("desc"); 12 | 13 | private String des; 14 | 15 | Order(String des) { 16 | this.des = des; 17 | } 18 | 19 | public String getDes() { 20 | return des; 21 | } 22 | 23 | public void setDes(String des) { 24 | this.des = des; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/common/exception/InvalidKaptchaException.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.common.exception; 2 | 3 | /** 4 | * 验证码错误异常 5 | * 6 | * @author fengshuonan 7 | * @date 2017-05-05 23:52 8 | */ 9 | public class InvalidKaptchaException extends RuntimeException { 10 | } 11 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/log/LogManager.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.log; 2 | 3 | import java.util.TimerTask; 4 | import java.util.concurrent.ScheduledThreadPoolExecutor; 5 | import java.util.concurrent.TimeUnit; 6 | 7 | /** 8 | * 日志管理器 9 | * 10 | * @author fengshuonan 11 | * @date 2017-03-30 16:29 12 | */ 13 | public class LogManager { 14 | 15 | //日志记录操作延时 16 | private final int OPERATE_DELAY_TIME = 10; 17 | 18 | //异步操作记录日志的线程池 19 | private ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(10); 20 | 21 | private LogManager() { 22 | } 23 | 24 | public static LogManager logManager = new LogManager(); 25 | 26 | public static LogManager me() { 27 | return logManager; 28 | } 29 | 30 | public void executeLog(TimerTask task) { 31 | executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/core/util/KaptchaUtil.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import com.stylefeng.guns.config.properties.GunsProperties; 4 | 5 | /** 6 | * 验证码工具类 7 | */ 8 | public class KaptchaUtil { 9 | 10 | /** 11 | * 获取验证码开关 12 | */ 13 | public static Boolean getKaptchaOnOff() { 14 | return SpringContextHolder.getBean(GunsProperties.class).getKaptchaOpen(); 15 | } 16 | } -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/code/service/TableService.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.code.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.SqlRunner; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | * 获取数据库所有的表 12 | * 13 | * @author fengshuonan 14 | * @date 2017-12-04-下午1:37 15 | */ 16 | @Service 17 | public class TableService { 18 | 19 | @Value("${spring.datasource.db-name}") 20 | private String dbName; 21 | 22 | /** 23 | * 获取当前数据库所有的表信息 24 | */ 25 | public List> getAllTables() { 26 | String sql = "select TABLE_NAME as tableName,TABLE_COMMENT as tableComment from information_schema.`TABLES` where TABLE_SCHEMA = '" + dbName + "'"; 27 | return SqlRunner.db().selectList(sql); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DeptMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.stylefeng.guns.core.node.ZTreeNode; 5 | import com.stylefeng.guns.modular.system.model.Dept; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | *

13 | * 部门表 Mapper 接口 14 | *

15 | * 16 | * @author stylefeng 17 | * @since 2017-07-11 18 | */ 19 | public interface DeptMapper extends BaseMapper { 20 | 21 | /** 22 | * 获取ztree的节点列表 23 | */ 24 | List tree(); 25 | 26 | /** 27 | * 获取所有部门列表 28 | */ 29 | List> list(@Param("condition") String condition); 30 | 31 | } -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DictMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.stylefeng.guns.modular.system.model.Dict; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | *

12 | * 字典表 Mapper 接口 13 | *

14 | * 15 | * @author stylefeng 16 | * @since 2017-07-11 17 | */ 18 | public interface DictMapper extends BaseMapper { 19 | 20 | /** 21 | * 根据编码获取词典列表 22 | */ 23 | List selectByCode(@Param("code") String code); 24 | 25 | /** 26 | * 查询字典列表 27 | */ 28 | List> list(@Param("condition") String conditiion); 29 | 30 | /** 31 | * 根据父类编码获取词典列表 32 | */ 33 | List selectByParentCode(@Param("code") String code); 34 | } -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/ExpenseMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.stylefeng.guns.modular.system.model.Expense; 5 | 6 | /** 7 | *

8 | * 报销表 Mapper 接口 9 | *

10 | * 11 | * @author stylefeng 12 | * @since 2017-12-04 13 | */ 14 | public interface ExpenseMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/LoginLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.plugins.Page; 5 | import com.stylefeng.guns.modular.system.model.LoginLog; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | *

13 | * 登录记录 Mapper 接口 14 | *

15 | * 16 | * @author stylefeng 17 | * @since 2017-07-11 18 | */ 19 | public interface LoginLogMapper extends BaseMapper { 20 | 21 | /** 22 | * 获取登录日志 23 | */ 24 | List> getLoginLogs(@Param("page") Page page, @Param("beginTime") String beginTime, 25 | @Param("endTime") String endTime, @Param("logName") String logName, @Param("orderByField") String orderByField, @Param("isAsc") boolean isAsc); 26 | 27 | } -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/NoticeMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.stylefeng.guns.modular.system.model.Notice; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | *

12 | * 通知表 Mapper 接口 13 | *

14 | * 15 | * @author stylefeng 16 | * @since 2017-07-11 17 | */ 18 | public interface NoticeMapper extends BaseMapper { 19 | 20 | /** 21 | * 获取通知列表 22 | */ 23 | List> list(@Param("condition") String condition); 24 | 25 | } -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/OperationLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.plugins.Page; 5 | import com.stylefeng.guns.modular.system.model.OperationLog; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | *

13 | * 操作日志 Mapper 接口 14 | *

15 | * 16 | * @author stylefeng 17 | * @since 2017-07-11 18 | */ 19 | public interface OperationLogMapper extends BaseMapper { 20 | 21 | /** 22 | * 获取操作日志 23 | */ 24 | List> getOperationLogs(@Param("page") Page page, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("logName") String logName, @Param("logType") String logType, @Param("orderByField") String orderByField, @Param("isAsc") boolean isAsc); 25 | 26 | } -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/RelationMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.stylefeng.guns.modular.system.model.Relation; 5 | 6 | /** 7 | *

8 | * 角色和菜单关联表 Mapper 接口 9 | *

10 | * 11 | * @author stylefeng 12 | * @since 2017-07-11 13 | */ 14 | public interface RelationMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/ExpenseMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | id, money, desc, createtime, state, userid 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/RelationMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDeptService.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.stylefeng.guns.core.node.ZTreeNode; 5 | import com.stylefeng.guns.modular.system.model.Dept; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * 部门服务 13 | * 14 | * @author fengshuonan 15 | * @date 2017-04-27 17:00 16 | */ 17 | public interface IDeptService extends IService { 18 | 19 | /** 20 | * 删除部门 21 | */ 22 | void deleteDept(Integer deptId); 23 | 24 | /** 25 | * 获取ztree的节点列表 26 | */ 27 | List tree(); 28 | 29 | /** 30 | * 获取所有部门列表 31 | */ 32 | List> list(@Param("condition") String condition); 33 | } 34 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ILoginLogService.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.service; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.stylefeng.guns.modular.system.model.LoginLog; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | *

12 | * 登录记录 服务类 13 | *

14 | * 15 | * @author stylefeng123 16 | * @since 2018-02-22 17 | */ 18 | public interface ILoginLogService extends IService { 19 | 20 | /** 21 | * 获取登录日志列表 22 | */ 23 | List> getLoginLogs(Page page, String beginTime, String endTime, String logName, String orderByField, boolean asc); 24 | } 25 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/INoticeService.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.stylefeng.guns.modular.system.model.Notice; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | /** 10 | *

11 | * 通知表 服务类 12 | *

13 | * 14 | * @author stylefeng123 15 | * @since 2018-02-22 16 | */ 17 | public interface INoticeService extends IService { 18 | 19 | /** 20 | * 获取通知列表 21 | */ 22 | List> list(String condition); 23 | } 24 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOperationLogService.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.service; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.stylefeng.guns.modular.system.model.OperationLog; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | *

12 | * 操作日志 服务类 13 | *

14 | * 15 | * @author stylefeng123 16 | * @since 2018-02-22 17 | */ 18 | public interface IOperationLogService extends IService { 19 | 20 | /** 21 | * 获取操作日志列表 22 | */ 23 | List> getOperationLogs(Page page, String beginTime, String endTime, String logName, String s, String orderByField, boolean asc); 24 | } 25 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IRelationService.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.stylefeng.guns.modular.system.model.Relation; 5 | 6 | /** 7 | *

8 | * 角色和菜单关联表 服务类 9 | *

10 | * 11 | * @author stylefeng123 12 | * @since 2018-02-22 13 | */ 14 | public interface IRelationService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/NoticeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.service.impl; 2 | 3 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 4 | import com.stylefeng.guns.modular.system.dao.NoticeMapper; 5 | import com.stylefeng.guns.modular.system.model.Notice; 6 | import com.stylefeng.guns.modular.system.service.INoticeService; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | /** 13 | *

14 | * 通知表 服务实现类 15 | *

16 | * 17 | * @author stylefeng123 18 | * @since 2018-02-22 19 | */ 20 | @Service 21 | public class NoticeServiceImpl extends ServiceImpl implements INoticeService { 22 | 23 | @Override 24 | public List> list(String condition) { 25 | return this.baseMapper.list(condition); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RelationServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.service.impl; 2 | 3 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 4 | import com.stylefeng.guns.modular.system.dao.RelationMapper; 5 | import com.stylefeng.guns.modular.system.model.Relation; 6 | import com.stylefeng.guns.modular.system.service.IRelationService; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 角色和菜单关联表 服务实现类 12 | *

13 | * 14 | * @author stylefeng123 15 | * @since 2018-02-22 16 | */ 17 | @Service 18 | public class RelationServiceImpl extends ServiceImpl implements IRelationService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/DeptWarpper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.warpper; 2 | 3 | import com.stylefeng.guns.core.common.constant.factory.ConstantFactory; 4 | import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper; 5 | import com.stylefeng.guns.core.util.ToolUtil; 6 | 7 | import java.util.Map; 8 | 9 | /** 10 | * 部门列表的包装 11 | * 12 | * @author fengshuonan 13 | * @date 2017年4月25日 18:10:31 14 | */ 15 | public class DeptWarpper extends BaseControllerWarpper { 16 | 17 | public DeptWarpper(Object list) { 18 | super(list); 19 | } 20 | 21 | @Override 22 | public void warpTheMap(Map map) { 23 | 24 | Integer pid = (Integer) map.get("pid"); 25 | 26 | if (ToolUtil.isEmpty(pid) || pid.equals(0)) { 27 | map.put("pName", "--"); 28 | } else { 29 | map.put("pName", ConstantFactory.me().getDeptName(pid)); 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MenuWarpper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.warpper; 2 | 3 | import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper; 4 | import com.stylefeng.guns.core.common.constant.factory.ConstantFactory; 5 | import com.stylefeng.guns.core.constant.IsMenu; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | * 菜单列表的包装类 12 | * 13 | * @author fengshuonan 14 | * @date 2017年2月19日15:07:29 15 | */ 16 | public class MenuWarpper extends BaseControllerWarpper { 17 | 18 | public MenuWarpper(List> list) { 19 | super(list); 20 | } 21 | 22 | @Override 23 | public void warpTheMap(Map map) { 24 | map.put("statusName", ConstantFactory.me().getMenuStatusName((Integer) map.get("status"))); 25 | map.put("isMenuName", IsMenu.valueOf((Integer) map.get("ismenu"))); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/NoticeWrapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.warpper; 2 | 3 | import com.stylefeng.guns.core.common.constant.factory.ConstantFactory; 4 | import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | * 部门列表的包装 10 | * 11 | * @author fengshuonan 12 | * @date 2017年4月25日 18:10:31 13 | */ 14 | public class NoticeWrapper extends BaseControllerWarpper { 15 | 16 | public NoticeWrapper(Object list) { 17 | super(list); 18 | } 19 | 20 | @Override 21 | public void warpTheMap(Map map) { 22 | Integer creater = (Integer) map.get("creater"); 23 | map.put("createrName", ConstantFactory.me().getUserNameById(creater)); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/RoleWarpper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.modular.system.warpper; 2 | 3 | import com.stylefeng.guns.core.common.constant.factory.ConstantFactory; 4 | import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | /** 10 | * 角色列表的包装类 11 | * 12 | * @author fengshuonan 13 | * @date 2017年2月19日10:59:02 14 | */ 15 | public class RoleWarpper extends BaseControllerWarpper { 16 | 17 | public RoleWarpper(List> list) { 18 | super(list); 19 | } 20 | 21 | @Override 22 | public void warpTheMap(Map map) { 23 | map.put("pName", ConstantFactory.me().getSingleRoleName((Integer) map.get("pid"))); 24 | map.put("deptName", ConstantFactory.me().getDeptName((Integer) map.get("deptid"))); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /guns-admin/src/main/resources/META-INF/spring-devtools.properties: -------------------------------------------------------------------------------- 1 | restart.include.beetl=/beetl-2.8.5.jar -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/WEB-INF/view/blackboard.html: -------------------------------------------------------------------------------- 1 | @layout("/common/_container.html"){ 2 |
3 |
4 |
5 | @for(notice in noticeList){ 6 |
7 | 8 | ${notice.content} 9 |
10 | @} 11 |
12 |
13 |
14 | @} 15 | -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/WEB-INF/view/common/tags/NameCon.tag: -------------------------------------------------------------------------------- 1 | @/* 2 | 名称查询条件标签的参数说明: 3 | 4 | name : 查询条件的名称 5 | id : 查询内容的input框id 6 | @*/ 7 |
8 |
9 | 12 |
13 | 14 |
-------------------------------------------------------------------------------- /guns-admin/src/main/webapp/WEB-INF/view/common/tags/SelectCon.tag: -------------------------------------------------------------------------------- 1 | @/* 2 | 选择查询条件标签的参数说明: 3 | 4 | name : 查询条件的名称 5 | id : 查询内容的input框id 6 | @*/ 7 |
8 |
9 | 12 |
13 | 16 |
-------------------------------------------------------------------------------- /guns-admin/src/main/webapp/WEB-INF/view/common/tags/TimeCon.tag: -------------------------------------------------------------------------------- 1 | @/* 2 | 时间查询条件标签的参数说明: 3 | 4 | name : 查询条件的名称 5 | id : 查询内容的input框id 6 | isTime : 日期是否带有小时和分钟(true/false) 7 | @*/ 8 |
9 |
10 | 13 |
14 | 15 |
-------------------------------------------------------------------------------- /guns-admin/src/main/webapp/WEB-INF/view/common/tags/avatar.tag: -------------------------------------------------------------------------------- 1 | @/* 2 | 头像参数的说明: 3 | name : 名称 4 | id : 头像的id 5 | @*/ 6 |
7 | 8 |
9 |
10 |
13 | @}else{ 14 | src="${ctxPath}/kaptcha/${avatarImg}">
15 | @} 16 |
17 |
18 |
19 |
20 |  上传 21 |
22 |
23 | 24 | 25 | @if(isNotEmpty(underline) && underline == 'true'){ 26 |
27 | @} 28 | 29 | 30 | -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/WEB-INF/view/common/tags/button.tag: -------------------------------------------------------------------------------- 1 | @/* 2 | 按钮标签中各个参数的说明: 3 | 4 | btnType : 按钮的类型决定了颜色(default-灰色,primary-绿色,success-蓝色,info-淡蓝色,warning-黄色,danger-红色,white-白色) 5 | space : 按钮左侧是否有间隔(true/false) 6 | clickFun : 点击按钮所执行的方法 7 | icon : 按钮上的图标的样式 8 | name : 按钮名称 9 | @*/ 10 | 11 | @var spaceCss = ""; 12 | @var btnType = ""; 13 | @if(isEmpty(space) || space == "false"){ 14 | @ spaceCss = ""; 15 | @}else{ 16 | @ spaceCss = "button-margin"; 17 | @} 18 | @if(isEmpty(btnCss)){ 19 | @ btnType = "primary"; 20 | @}else{ 21 | @ btnType = btnCss; 22 | @} 23 | 26 | 27 | -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/WEB-INF/view/common/tags/select.tag: -------------------------------------------------------------------------------- 1 | @/* 2 | select标签中各个参数的说明: 3 | name : select的名称 4 | id : select的id 5 | underline : 是否带分割线 6 | @*/ 7 |
8 | 9 |
10 | 13 | @if(isNotEmpty(hidden)){ 14 | 15 | @} 16 |
17 |
18 | @if(isNotEmpty(underline) && underline == 'true'){ 19 |
20 | @} 21 | 22 | 23 | -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/WEB-INF/view/common/tags/table.tag: -------------------------------------------------------------------------------- 1 | @/* 2 | 表格标签的参数说明: 3 | 4 | id : table表格的id 5 | @*/ 6 | 7 | 8 | 9 | 10 | 11 | 12 |
-------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/patterns/header-profile-skin-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/patterns/header-profile-skin-1.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/patterns/header-profile-skin-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/patterns/header-profile-skin-3.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/patterns/header-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/patterns/header-profile.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/patterns/shattered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/patterns/shattered.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/chosen/chosen-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/chosen/chosen-sprite.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/chosen/chosen-sprite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/chosen/chosen-sprite@2x.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/iCheck/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/iCheck/green.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/iCheck/green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/iCheck/green@2x.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/images/sprite-skin-flat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/images/sprite-skin-flat.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/validate/bootstrapValidator.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * BootstrapValidator (http://bootstrapvalidator.com) 3 | * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3 4 | * 5 | * @version v0.5.3, built on 2014-11-05 9:14:18 PM 6 | * @author https://twitter.com/nghuuphuoc 7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc 8 | * @license Commercial: http://bootstrapvalidator.com/license/ 9 | * Non-commercial: http://creativecommons.org/licenses/by-nc-nd/3.0/ 10 | */ 11 | 12 | .bv-form .help-block{margin-bottom:0}.bv-form .tooltip-inner{text-align:left}.nav-tabs li.bv-tab-success>a{color:#3c763d}.nav-tabs li.bv-tab-error>a{color:#a94442}.bv-form .bv-icon-no-label{top:0}.bv-form .bv-icon-input-group{top:0;z-index:100} -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/webuploader/webuploader.css: -------------------------------------------------------------------------------- 1 | .webuploader-container { 2 | position: relative; 3 | } 4 | .webuploader-element-invisible { 5 | position: absolute !important; 6 | clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ 7 | clip: rect(1px,1px,1px,1px); 8 | } 9 | .webuploader-pick { 10 | position: relative; 11 | display: inline-block; 12 | cursor: pointer; 13 | background: #1ab394; 14 | padding: 6px 12px; 15 | color: #fff; 16 | text-align: center; 17 | border-radius: 3px; 18 | overflow: hidden; 19 | font-size: 14px; 20 | font-weight: 400; 21 | } 22 | .webuploader-pick-hover { 23 | background: #18ab8d; 24 | } 25 | 26 | .webuploader-pick-disable { 27 | opacity: 0.6; 28 | pointer-events:none; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/1_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/1_close.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/1_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/1_open.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/2.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/3.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/4.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/5.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/6.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/7.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/8.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/diy/9.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/line_conn.gif -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/loading.gif -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/zTreeStandard.gif -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/css/plugins/ztree/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/css/plugins/ztree/img/zTreeStandard.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/favicon.ico -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/img/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/img/bg.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/img/boy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/img/boy.gif -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/img/girl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/img/girl.gif -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/img/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/img/icons.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/img/loading-upload.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/img/loading-upload.gif -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/img/locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/img/locked.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/img/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/img/user.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.1 - 2017-02-22 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2017 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(a){return"每页显示 "+a+" 条记录"},formatShowingRows:function(a,b,c){return"显示第 "+a+" 到第 "+b+" 条记录,总共 "+c+" 条记录"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"},formatExport:function(){return"导出数据"},formatClearFilters:function(){return"清空过滤"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["zh-CN"])}(jQuery); -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/laydate/theme/default/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/js/plugins/laydate/theme/default/font/iconfont.eot -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/laydate/theme/default/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/js/plugins/laydate/theme/default/font/iconfont.ttf -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/laydate/theme/default/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/js/plugins/laydate/theme/default/font/iconfont.woff -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/icon-ext.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/icon.png -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/loading-0.gif -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/loading-1.gif -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/js/plugins/layer/theme/default/loading-2.gif -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/webuploader/Uploader.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-admin/src/main/webapp/static/js/plugins/webuploader/Uploader.swf -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/js/plugins/webuploader/webuploader.css: -------------------------------------------------------------------------------- 1 | .webuploader-container { 2 | position: relative; 3 | } 4 | .webuploader-element-invisible { 5 | position: absolute !important; 6 | clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ 7 | clip: rect(1px,1px,1px,1px); 8 | } 9 | .webuploader-pick { 10 | position: relative; 11 | display: inline-block; 12 | cursor: pointer; 13 | background: #00b7ee; 14 | padding: 10px 15px; 15 | color: #fff; 16 | text-align: center; 17 | border-radius: 3px; 18 | overflow: hidden; 19 | } 20 | .webuploader-pick-hover { 21 | background: #00a2d4; 22 | } 23 | 24 | .webuploader-pick-disable { 25 | opacity: 0.6; 26 | pointer-events:none; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /guns-admin/src/main/webapp/static/modular/system/code/code.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 代码生成管理初始化 3 | */ 4 | var Code = { 5 | 6 | }; 7 | 8 | /** 9 | * 提交代码生成 10 | */ 11 | Code.generate = function () { 12 | var baseAjax = Feng.baseAjax("/code/generate","生成代码"); 13 | baseAjax.set("bizChName"); 14 | baseAjax.set("bizEnName"); 15 | baseAjax.set("path"); 16 | baseAjax.set("moduleName"); 17 | baseAjax.start(); 18 | }; 19 | -------------------------------------------------------------------------------- /guns-admin/src/test/java/com/stylefeng/guns/CommonTest.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import com.stylefeng.guns.base.BaseJunit; 4 | import com.stylefeng.guns.core.shiro.ShiroKit; 5 | import org.junit.Test; 6 | 7 | public class CommonTest extends BaseJunit { 8 | 9 | @Test 10 | public void testPwd() { 11 | String admin = ShiroKit.md5("admin", "8pgby"); 12 | System.out.print("admin 加密后的密码是:" + admin); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-admin/src/test/java/com/stylefeng/guns/shiro/Base64Test.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.shiro; 2 | 3 | import org.springframework.util.Base64Utils; 4 | 5 | import java.io.UnsupportedEncodingException; 6 | import java.util.Arrays; 7 | 8 | public class Base64Test { 9 | 10 | /** 11 | * Shiro 记住密码采用的是AES加密,AES key length 需要是16位,该方法生成16位的key 12 | */ 13 | public static void main(String[] args) { 14 | 15 | String keyStr = "guns"; 16 | 17 | byte[] keys; 18 | try { 19 | keys = keyStr.getBytes("UTF-8"); 20 | System.out.println(Base64Utils.encodeToString(Arrays.copyOf(keys, 16))); 21 | } catch (UnsupportedEncodingException e) { 22 | e.printStackTrace(); 23 | } 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /guns-admin/src/test/java/com/stylefeng/guns/system/BlackBoardTest.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.system; 2 | 3 | import com.stylefeng.guns.base.BaseJunit; 4 | import com.stylefeng.guns.modular.system.dao.NoticeMapper; 5 | import org.junit.Test; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import static org.junit.Assert.assertTrue; 12 | 13 | /** 14 | * 首页通知展示测试 15 | * 16 | * @author fengshuonan 17 | * @date 2017-05-21 15:02 18 | */ 19 | public class BlackBoardTest extends BaseJunit { 20 | 21 | @Autowired 22 | NoticeMapper noticeMapper; 23 | 24 | @Test 25 | public void blackBoardTest() { 26 | List> notices = noticeMapper.list(null); 27 | assertTrue(notices.size() > 0); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /guns-admin/src/test/java/com/stylefeng/guns/system/UserTest.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.system; 2 | 3 | import com.stylefeng.guns.base.BaseJunit; 4 | import com.stylefeng.guns.modular.system.dao.UserMapper; 5 | import org.junit.Test; 6 | 7 | import javax.annotation.Resource; 8 | 9 | /** 10 | * 用户测试 11 | * 12 | * @author fengshuonan 13 | * @date 2017-04-27 17:05 14 | */ 15 | public class UserTest extends BaseJunit { 16 | 17 | @Resource 18 | UserMapper userMapper; 19 | 20 | @Test 21 | public void userTest() throws Exception { 22 | 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/AlipayApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @EnableDubboConfiguration // 开启dubbo配置 9 | public class AlipayApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(AlipayApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/GunsRestServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsRestServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(AlipayApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * MybatisPlus配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017年8月23日12:51:41 13 | */ 14 | @Configuration 15 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.*.dao", "com.stylefeng.guns.rest.common.persistence.dao"}) 16 | public class MybatisPlusConfig { 17 | 18 | /** 19 | * mybatis-plus分页插件 20 | */ 21 | @Bean 22 | public PaginationInterceptor paginationInterceptor() { 23 | return new PaginationInterceptor(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/config/TraceConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import brave.spring.beans.TracingFactoryBean; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import zipkin2.reporter.AsyncReporter; 7 | import zipkin2.reporter.okhttp3.OkHttpSender; 8 | 9 | /** 10 | * zipkin 配置 11 | */ 12 | @Configuration 13 | public class TraceConfig { 14 | 15 | @Bean(name = "tracing") 16 | public TracingFactoryBean getTracingBean() { 17 | TracingFactoryBean tracingFactoryBean = new TracingFactoryBean(); 18 | tracingFactoryBean.setLocalServiceName("alipay"); 19 | tracingFactoryBean.setSpanReporter( 20 | AsyncReporter.create(OkHttpSender.create("http://118.126.111.144:9411/api/v2/spans"))); 21 | return tracingFactoryBean; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/config/Constants.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.config; 2 | 3 | /** 4 | * Created by liuyangkly on 15/7/29. 5 | */ 6 | public class Constants { 7 | 8 | private Constants() { 9 | // No Constructor. 10 | } 11 | 12 | public static final String SUCCESS = "10000"; // 成功 13 | public static final String PAYING = "10003"; // 用户支付中 14 | public static final String FAILED = "40004"; // 失败 15 | public static final String ERROR = "20000"; // 系统异常 16 | } 17 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/TradeStatus.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model; 2 | 3 | /** 4 | * Created by liuyangkly on 15/8/29. 5 | */ 6 | public enum TradeStatus { 7 | SUCCESS // 业务交易明确成功,比如支付成功、退货成功 8 | 9 | ,FAILED // 业务交易明确失败,比如支付明确失败、退货明确失败 10 | 11 | ,UNKNOWN // 业务交易状态未知,此时不清楚该业务是否成功或者失败,需要商户自行确认 12 | } 13 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/hb/EquipStatus.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model.hb; 2 | 3 | /** 4 | * Created by liuyangkly on 15/8/27. 5 | */ 6 | public enum EquipStatus { 7 | ON("10") // 开机 8 | 9 | ,OFF("20") // 关机 10 | 11 | ,NORMAL("30") // 正常 12 | 13 | ,SLEEP("40") // 进入休眠 14 | 15 | ,AWAKE("41"); // 唤醒 16 | 17 | private String value; 18 | 19 | EquipStatus(String value) { 20 | this.value = value; 21 | } 22 | 23 | public String getValue() { 24 | return value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/hb/EquipStatusAdapter.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model.hb; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonPrimitive; 5 | import com.google.gson.JsonSerializationContext; 6 | import com.google.gson.JsonSerializer; 7 | 8 | import java.lang.reflect.Type; 9 | 10 | /** 11 | * Created by liuyangkly on 15/8/27. 12 | */ 13 | public class EquipStatusAdapter implements JsonSerializer { 14 | @Override 15 | public JsonElement serialize(EquipStatus equipStatus, Type type, JsonSerializationContext jsonSerializationContext) { 16 | return new JsonPrimitive(equipStatus.getValue()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/hb/ExceptionInfo.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model.hb; 2 | 3 | /** 4 | * Created by liuyangkly on 15/8/27. 5 | */ 6 | public enum ExceptionInfo { 7 | HE_PRINTER // 打印机异常; 8 | 9 | ,HE_SCANER // 扫描枪异常; 10 | 11 | ,HE_OTHER // 其他硬件异常 12 | } 13 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/hb/ExceptionInfoAdapter.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model.hb; 2 | 3 | import com.stylefeng.guns.rest.modular.alipay.utils.*; 4 | import com.google.gson.JsonElement; 5 | import com.google.gson.JsonPrimitive; 6 | import com.google.gson.JsonSerializationContext; 7 | import com.google.gson.JsonSerializer; 8 | import org.apache.commons.lang.StringUtils; 9 | 10 | import java.lang.reflect.Type; 11 | import java.util.List; 12 | 13 | /** 14 | * Created by liuyangkly on 15/8/27. 15 | */ 16 | public class ExceptionInfoAdapter implements JsonSerializer> { 17 | @Override 18 | public JsonElement serialize(List exceptionInfos, Type type, JsonSerializationContext jsonSerializationContext) { 19 | if (Utils.isListEmpty(exceptionInfos)) { 20 | return null; 21 | } 22 | 23 | return new JsonPrimitive(StringUtils.join(exceptionInfos, "|")); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/hb/HbStatus.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model.hb; 2 | 3 | /** 4 | * Created by liuyangkly on 15/8/27. 5 | */ 6 | public enum HbStatus { 7 | S // 交易成功(包括支付宝返回“处理中”) 8 | 9 | ,I // 支付宝返回处理中 10 | 11 | ,F // 支付宝返回失败 12 | 13 | ,P // POSP返回失败,或商户系统失败 14 | 15 | ,X // 建立连接异常 16 | 17 | ,Y // 报文上送异常 18 | 19 | ,Z // 报文接收异常 20 | 21 | ,C // 收银员取消 22 | } 23 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/hb/Product.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model.hb; 2 | 3 | /** 4 | * Created by liuyangkly on 15/8/27. 5 | */ 6 | public enum Product { 7 | FP // 当面付产品 8 | 9 | ,MP // 医疗产品 10 | } 11 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/hb/TradeInfo.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model.hb; 2 | 3 | /** 4 | * Created by liuyangkly on 15/9/28. 5 | */ 6 | public interface TradeInfo { 7 | // 获取交易状态 8 | public HbStatus getStatus(); 9 | 10 | // 获取交易时间 11 | public double getTimeConsume(); 12 | } 13 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/hb/Type.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model.hb; 2 | 3 | /** 4 | * Created by liuyangkly on 15/8/27. 5 | */ 6 | public enum Type { 7 | CR // 收银机 8 | 9 | ,STORE // 门店 10 | 11 | ,VM // 售卖机 12 | 13 | ,MD // 医疗设备 14 | 15 | ,SOFT_POS // 软POS 16 | 17 | ,POS // POS终端 18 | 19 | ,ALI_POS // 支付宝POS 20 | } 21 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/model/result/Result.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.model.result; 2 | 3 | /** 4 | * Created by liuyangkly on 15/8/27. 5 | */ 6 | public interface Result { 7 | 8 | // 判断交易是否在业务上成功, 返回true说明一定成功,但是返回false并不代表业务不成功!因为还有unknown的状态可能业务已经成功了 9 | public boolean isTradeSuccess(); 10 | } 11 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/service/AlipayMonitorService.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.service; 2 | 3 | import com.alipay.api.response.MonitorHeartbeatSynResponse; 4 | import com.stylefeng.guns.rest.modular.alipay.model.builder.AlipayHeartbeatSynRequestBuilder; 5 | 6 | /** 7 | * Created by liuyangkly on 15/10/22. 8 | */ 9 | public interface AlipayMonitorService { 10 | 11 | // 交易保障接口 https://openhome.alipay.com/platform/document.htm#mobileApp-barcodePay-API-heartBeat 12 | 13 | // 可以提供给系统商/pos厂商使用 14 | public MonitorHeartbeatSynResponse heartbeatSyn(AlipayHeartbeatSynRequestBuilder builder); 15 | } 16 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/alipay/service/impl/hb/TradeListener.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.alipay.service.impl.hb; 2 | 3 | /** 4 | * Created by liuyangkly on 15/10/27. 5 | */ 6 | public interface TradeListener { 7 | 8 | // 支付成功 9 | public void onPayTradeSuccess(String outTradeNo, long beforeCall); 10 | 11 | // 支付处理中 12 | public void onPayInProgress(String outTradeNo, long beforeCall); 13 | 14 | // 支付失败 15 | public void onPayFailed(String outTradeNo, long beforeCall); 16 | 17 | // 建立连接异常 18 | public void onConnectException(String outTradeNo, long beforeCall); 19 | 20 | // 报文上送异常 21 | public void onSendException(String outTradeNo, long beforeCall); 22 | 23 | // 报文接收异常 24 | public void onReceiveException(String outTradeNo, long beforeCall); 25 | } 26 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.controller.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 认证的响应结果 7 | * 8 | * @author fengshuonan 9 | * @Date 2017/8/24 13:58 10 | */ 11 | public class AuthResponse implements Serializable { 12 | 13 | private static final long serialVersionUID = 1250166508152483573L; 14 | 15 | /** 16 | * jwt token 17 | */ 18 | private final String token; 19 | 20 | /** 21 | * 用于客户端混淆md5加密 22 | */ 23 | private final String randomKey; 24 | 25 | public AuthResponse(String token, String randomKey) { 26 | this.token = token; 27 | this.randomKey = randomKey; 28 | } 29 | 30 | public String getToken() { 31 | return this.token; 32 | } 33 | 34 | public String getRandomKey() { 35 | return randomKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/BaseTransferEntity.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.converter; 2 | 3 | /** 4 | * 基础的传输bean 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 15:52 8 | */ 9 | public class BaseTransferEntity { 10 | 11 | private String object; //base64编码的json字符串 12 | 13 | private String sign; //签名 14 | 15 | public String getObject() { 16 | return object; 17 | } 18 | 19 | public void setObject(String object) { 20 | this.object = object; 21 | } 22 | 23 | public String getSign() { 24 | return sign; 25 | } 26 | 27 | public void setSign(String sign) { 28 | this.sign = sign; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/auth/security/DataSecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security; 2 | 3 | /** 4 | *
 5 |  * 信息传递的保护措施(传递的数据为json)
 6 |  *
 7 |  * 说明:
 8 |  * 可以根据实际开发时的需要,编写自己的数据加密方案,只需实现此类,并在WebConfig下配置您所编写的实现类即可
 9 |  * 
10 | * 11 | * @author fengshuonan 12 | * @date 2017-09-18 20:41 13 | */ 14 | public interface DataSecurityAction { 15 | 16 | /** 17 | * 执行数据的保护措施 18 | * 19 | * @author stylefeng 20 | * @Date 2017/9/18 20:42 21 | */ 22 | String doAction(String beProtected); 23 | 24 | /** 25 | * 解除保护 26 | * 27 | * @author stylefeng 28 | * @Date 2017/9/18 20:45 29 | */ 30 | String unlock(String securityCode); 31 | } 32 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/auth/security/impl/Base64SecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security.impl; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.security.DataSecurityAction; 4 | import org.springframework.util.Base64Utils; 5 | 6 | /** 7 | * 对数据进行base64编码的方式 8 | * 9 | * @author fengshuonan 10 | * @date 2017-09-18 20:43 11 | */ 12 | public class Base64SecurityAction implements DataSecurityAction { 13 | 14 | @Override 15 | public String doAction(String beProtected) { 16 | return Base64Utils.encodeToString(beProtected.getBytes()); 17 | } 18 | 19 | @Override 20 | public String unlock(String securityCode) { 21 | byte[] bytes = Base64Utils.decodeFromString(securityCode); 22 | return new String(bytes); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/IReqValidator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.validator.dto.Credence; 4 | 5 | /** 6 | *

验证请求/auth接口时,请求参数的正确性

7 | *

8 | *

如果想拓展验证方法只需实现这个接口,然后在AuthenticationRestController类中注意相应实现的本接口的类即可

9 | * 10 | * @author fengshuonan 11 | * @date 2017-08-23 11:48 12 | */ 13 | public interface IReqValidator { 14 | 15 | /** 16 | * 通过请求参数验证 17 | * 18 | * @author fengshuonan 19 | * @Date 2017/8/23 11:49 20 | */ 21 | boolean validate(Credence credence); 22 | } 23 | -------------------------------------------------------------------------------- /guns-alipay/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/dto/Credence.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator.dto; 2 | 3 | /** 4 | * 验证的凭据 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-27 13:27 8 | */ 9 | public interface Credence { 10 | 11 | /** 12 | * 凭据名称 13 | */ 14 | String getCredenceName(); 15 | 16 | /** 17 | * 密码或者是其他的验证码之类的 18 | */ 19 | String getCredenceCode(); 20 | } 21 | -------------------------------------------------------------------------------- /guns-alipay/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Configure logging for testing: optionally with log file 2 | 3 | #log4j.rootLogger=debug,appender 4 | log4j.rootLogger=info,appender 5 | #log4j.rootLogger=error,appender 6 | 7 | #\u8F93\u51FA\u5230\u63A7\u5236\u53F0 8 | log4j.appender.appender=org.apache.log4j.ConsoleAppender 9 | #\u6837\u5F0F\u4E3ATTCCLayout 10 | log4j.appender.appender.layout=org.apache.log4j.TTCCLayout -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/alipay/AliPayServiceAPI.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.alipay; 2 | 3 | import com.stylefeng.guns.api.alipay.vo.AliPayInfoVO; 4 | import com.stylefeng.guns.api.alipay.vo.AliPayResultVO; 5 | 6 | /** 7 | * Created by lucasma 8 | */ 9 | public interface AliPayServiceAPI { 10 | 11 | // 获取二维码 12 | AliPayInfoVO getQRCode(String orderId); 13 | 14 | // 获取订单支付状态 15 | AliPayResultVO getOrderStatus(String orderId); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/alipay/AliPayServiceMock.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.alipay; 2 | 3 | import com.stylefeng.guns.api.alipay.vo.AliPayInfoVO; 4 | import com.stylefeng.guns.api.alipay.vo.AliPayResultVO; 5 | 6 | /** 7 | * 本地伪装:业务接口降级 8 | */ 9 | public class AliPayServiceMock implements AliPayServiceAPI { 10 | 11 | @Override 12 | public AliPayInfoVO getQRCode(String orderId) { 13 | return null; 14 | } 15 | 16 | @Override 17 | public AliPayResultVO getOrderStatus(String orderId) { 18 | AliPayResultVO aliPayResultVO = new AliPayResultVO(); 19 | aliPayResultVO.setOrderId(orderId); 20 | aliPayResultVO.setOrderStatus(0); 21 | aliPayResultVO.setOrderMsg("尚未支付成功!"); 22 | return aliPayResultVO; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/alipay/vo/AliPayInfoVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.alipay.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by lucasma 9 | */ 10 | @Data 11 | public class AliPayInfoVO implements Serializable { 12 | 13 | private String orderId; 14 | private String QRCodeAddress; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/alipay/vo/AliPayResultVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.alipay.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by lucasma 9 | */ 10 | @Data 11 | public class AliPayResultVO implements Serializable { 12 | 13 | private String orderId; 14 | private Integer orderStatus; 15 | private String orderMsg; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/AreaVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class AreaVO implements Serializable { 9 | 10 | // 主键编号 11 | private String areaId; 12 | // 显示名称 13 | private String areaName; 14 | // 是否选中,默认不选中 15 | private boolean isActive; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/BrandVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class BrandVO implements Serializable { 9 | 10 | // 主键编号 11 | private String brandId; 12 | // 显示名称 13 | private String brandName; 14 | // 是否选中,默认不选中 15 | private boolean isActive = false; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/CinemaInfoVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class CinemaInfoVO implements Serializable { 9 | 10 | // 主键编号 11 | private String cinemaId; 12 | // 影院图片地址 13 | private String imgUrl; 14 | // 影院名称 15 | private String cinemaName; 16 | // 影院地址 17 | private String cinemaAddress; 18 | // 影院电话 19 | private String cinemaPhone; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/CinemaQueryVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class CinemaQueryVO implements Serializable { 9 | 10 | // 影院编号 11 | private Integer brandId = 99; 12 | // 行政区编号 13 | private Integer districtId = 99; 14 | // 影厅类型 15 | private Integer hallType = 99; 16 | // 每页条数 17 | private Integer pageSize = 12; 18 | // 当前页数 19 | private Integer nowPage = 1; 20 | 21 | } -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/CinemaVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class CinemaVO implements Serializable { 9 | 10 | // 主键编号 11 | private String uuid; 12 | // 影院名称 13 | private String cinemaName; 14 | // 影院地址 15 | private String address; 16 | // 最低票价 17 | private String minimumPrice; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/FilmFieldVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class FilmFieldVO implements Serializable { 9 | 10 | // 主键编号 11 | private String fieldId; 12 | // 开始时间 13 | private String beginTime; 14 | // 结束时间 15 | private String endTime; 16 | // 电影语言 17 | private String language; 18 | // 放映厅名称 19 | private String hallName; 20 | // 票价 21 | private String price; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/FilmInfoVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | @Data 9 | public class FilmInfoVO implements Serializable { 10 | 11 | // 电影编号 12 | private String filmId; 13 | // 电影名称 14 | private String filmName; 15 | // 电影时长 16 | private String filmLength; 17 | // 电影类型 18 | private String filmType; 19 | // 电影类型 20 | private String filmCats; 21 | // 演员列表 22 | private String actors; 23 | // 图片地址 24 | private String imgAddress; 25 | // 影片信息 26 | private List filmFields; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/HallInfoVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class HallInfoVO implements Serializable { 9 | 10 | // 主键编号 11 | private String hallFieldId; 12 | // 放映厅名称 13 | private String hallName; 14 | // 票价 15 | private String price; 16 | // 座位文件存放地址 17 | private String seatFile; 18 | // TODO 已售座位必须关联订单才能查询 19 | private String soldSeats; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/HallTypeVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class HallTypeVO implements Serializable { 9 | 10 | // 主键编号 11 | private String hallTypeId; 12 | // 显示名称 13 | private String hallTypeName; 14 | // 是否选中,默认不选中 15 | private boolean isActive; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/cinema/vo/OrderQueryVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.cinema.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class OrderQueryVO implements Serializable { 9 | 10 | private String cinemaId; 11 | private String filmPrice; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/FilmAsyncServiceApi.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film; 2 | 3 | import com.stylefeng.guns.api.film.vo.*; 4 | 5 | import java.util.List; 6 | 7 | public interface FilmAsyncServiceApi { 8 | 9 | // 获取影片描述信息 10 | FilmDescVO getFilmDesc(String filmId); 11 | 12 | // 获取图片信息 13 | ImgVO getImgs(String filmId); 14 | 15 | // 获取导演信息 16 | ActorVO getDectInfo(String filmId); 17 | 18 | // 获取演员信息 19 | List getActors(String filmId); 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/ActorRequestVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class ActorRequestVO { 9 | 10 | private ActorVO director; 11 | private List actors; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/ActorVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 影片演员信息 9 | */ 10 | @Data 11 | public class ActorVO implements Serializable { 12 | 13 | private String imgAddress; 14 | private String directorName; 15 | private String roleName; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/BannerVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 首页banner 9 | */ 10 | @Data 11 | public class BannerVO implements Serializable { 12 | 13 | private String bannerId; 14 | private String bannerAddress; 15 | private String bannerUrl; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/CatVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class CatVO implements Serializable { 9 | 10 | private String catId; 11 | private String catName; 12 | private boolean isActive; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/FilmDescVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 影片描述信息 9 | */ 10 | @Data 11 | public class FilmDescVO implements Serializable { 12 | 13 | private String biography; 14 | private String filmId; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/FilmDetailVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 影片详细信息 9 | */ 10 | @Data 11 | public class FilmDetailVO implements Serializable { 12 | 13 | private String filmId; 14 | private String filmName; 15 | private String filmEnName; 16 | private String imgAddress; 17 | private String score; 18 | private String scoreNum; 19 | private String totalBox; 20 | private String info01; 21 | private String info02; 22 | private String info03; 23 | private InfoRequestVO info04; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/FilmIndexVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * 首页信息 10 | */ 11 | @Data 12 | public class FilmIndexVO implements Serializable { 13 | 14 | // 首页banners 15 | private List banners; 16 | 17 | // 热门电影 18 | private FilmVO hotFilms; 19 | 20 | // 即将上映 21 | private FilmVO soonFilms; 22 | 23 | // 获取票房排行榜 24 | private List boxRanking; 25 | 26 | // 人气排行榜 27 | private List expectRanking; 28 | 29 | // 前100的影片排行 30 | private List top100; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/FilmInfo.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 电影信息 9 | */ 10 | @Data 11 | public class FilmInfo implements Serializable { 12 | 13 | private String filmId; 14 | private int filmType; 15 | private String imgAddress; 16 | private String filmName; 17 | private String filmScore; 18 | private int expectNum; 19 | private String showTime; 20 | private int boxNum; 21 | private String score; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/FilmVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | @Data 9 | public class FilmVO implements Serializable { 10 | 11 | private int filmNum; 12 | private int nowPage; 13 | private int totalPage; 14 | private List filmInfo; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/ImgVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 影片图片信息 9 | */ 10 | @Data 11 | public class ImgVO implements Serializable { 12 | 13 | private String mainImg; 14 | private String img01; 15 | private String img02; 16 | private String img03; 17 | private String img04; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/InfoRequestVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class InfoRequestVO { 7 | 8 | private String biography; 9 | private ActorRequestVO actors; 10 | private ImgVO imgVO; 11 | private String filmId; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/SourceVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class SourceVO implements Serializable { 9 | 10 | private String sourceId; 11 | private String sourceName; 12 | private boolean isActive; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/film/vo/YearVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class YearVO implements Serializable { 9 | 10 | private String yearId; 11 | private String yearName; 12 | // 前端被选中项 13 | private boolean isActive; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/order/OrderServiceAPI.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.order; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.stylefeng.guns.api.order.vo.OrderVO; 5 | 6 | public interface OrderServiceAPI { 7 | 8 | // 验证售出的票是否为真 9 | boolean isTrueSeats(String fieldId, String seats); 10 | 11 | // 已经销售的座位里,有没有这些座位 12 | boolean isNotSoldSeats(String fieldId, String seats); 13 | 14 | // 创建订单信息 15 | OrderVO saveOrderInfo(Integer fieldId, String soldSeats, String seatsName, Integer userId); 16 | 17 | // 获取登录用户已经购买的订单 18 | Page getOrderByUserId(Integer userId, Page page); 19 | 20 | // 根据放映场次查询,获取所有已经销售的座位编号 21 | String getSoldSeatsByFieldId(Integer fieldId); 22 | 23 | // 根据订单编号获取订单信息 24 | OrderVO getOrderInfoById(String orderId); 25 | 26 | // 修改订单状态 27 | boolean paySuccess(String orderId); 28 | 29 | boolean payFail(String orderId); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/order/vo/OrderVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.order.vo; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | @Data 8 | public class OrderVO implements Serializable { 9 | 10 | private String orderId; 11 | private String filmName; 12 | private String fieldTime; 13 | private String cinemaName; 14 | private String seatsName; 15 | private String orderPrice; 16 | private String orderTimeStamp; 17 | private String orderStatus; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/user/UserAPI.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.user; 2 | 3 | import com.stylefeng.guns.api.user.vo.UserInfoModel; 4 | import com.stylefeng.guns.api.user.vo.UserModel; 5 | 6 | public interface UserAPI { 7 | 8 | int login(String username, String password); 9 | 10 | boolean register(UserModel userModel); 11 | 12 | boolean checkUsername(String username); 13 | 14 | UserInfoModel getUserInfo(int uuid); 15 | 16 | UserInfoModel updateUserInfo(UserInfoModel userInfoModel); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/user/vo/UserInfoModel.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.api.user.vo; 2 | 3 | 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 用户信息,排除敏感信息 10 | */ 11 | @Data 12 | public class UserInfoModel implements Serializable{ 13 | 14 | private Integer uuid; 15 | private String username; 16 | private String nickname; 17 | private String email; 18 | private String phone; 19 | private int sex; 20 | private String birthday; 21 | private String lifeState; 22 | private String biography; 23 | private String address; 24 | private String headAddress; 25 | private long beginTime; 26 | private long updateTime; 27 | 28 | } -------------------------------------------------------------------------------- /guns-api/src/main/java/com/stylefeng/guns/api/user/vo/UserModel.java: -------------------------------------------------------------------------------- 1 | 2 | package com.stylefeng.guns.api.user.vo; 3 | 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 注册使用 10 | */ 11 | @Data 12 | public class UserModel implements Serializable { 13 | 14 | private String username; 15 | private String password; 16 | private String email; 17 | private String phone; 18 | private String address; 19 | 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /guns-api/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # AutoConfiguration 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | com.stylefeng.guns.core.base.controller.GlobalController,\ 4 | com.stylefeng.guns.core.config.DefaultFastjsonConfig,\ 5 | com.stylefeng.guns.core.config.MultiDataSourceConfig,\ 6 | com.stylefeng.guns.core.config.SingleDataSourceConfig,\ 7 | com.stylefeng.guns.core.config.DefaultProperties,\ 8 | com.stylefeng.guns.core.config.DefaultWebConfig -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/CinemaApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @EnableDubboConfiguration 8 | @SpringBootApplication(scanBasePackages = {"com.stylefeng.guns"}) 9 | public class CinemaApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(CinemaApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/GunsRestServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsRestServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(CinemaApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocAreaDictTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocAreaDictT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 地域信息表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-04 13 | */ 14 | public interface MoocAreaDictTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocBrandDictTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocBrandDictT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 品牌信息表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-04 13 | */ 14 | public interface MoocBrandDictTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocCinemaTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocCinemaT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 影院信息表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-04 13 | */ 14 | public interface MoocCinemaTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocFieldTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.api.cinema.vo.FilmInfoVO; 4 | import com.stylefeng.guns.api.cinema.vo.HallInfoVO; 5 | import com.stylefeng.guns.rest.common.persistence.model.MoocFieldT; 6 | import com.baomidou.mybatisplus.mapper.BaseMapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 放映场次表 Mapper 接口 14 | *

15 | * 16 | * @author liu 17 | * @since 2018-10-04 18 | */ 19 | public interface MoocFieldTMapper extends BaseMapper { 20 | 21 | List getFilmInfos(@Param("cinemaId") int cinemaId); 22 | 23 | HallInfoVO getHallInfo(@Param("fieldId") int fieldId); 24 | 25 | FilmInfoVO getFilmInfoById(@Param("fieldId") int fieldId); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocHallDictTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocHallDictT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 地域信息表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-04 13 | */ 14 | public interface MoocHallDictTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocHallFilmInfoTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocHallFilmInfoT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 影厅电影信息表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-04 13 | */ 14 | public interface MoocHallFilmInfoTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/MoocAreaDictTMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/MoocBrandDictTMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/MoocHallDictTMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * MybatisPlus配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017年8月23日12:51:41 13 | */ 14 | @Configuration 15 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.*.dao", "com.stylefeng.guns.rest.common.persistence.dao"}) 16 | public class MybatisPlusConfig { 17 | 18 | /** 19 | * mybatis-plus分页插件 20 | */ 21 | @Bean 22 | public PaginationInterceptor paginationInterceptor() { 23 | return new PaginationInterceptor(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/config/TraceConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import brave.spring.beans.TracingFactoryBean; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import zipkin2.reporter.AsyncReporter; 7 | import zipkin2.reporter.okhttp3.OkHttpSender; 8 | 9 | /** 10 | * zipkin 配置 11 | */ 12 | @Configuration 13 | public class TraceConfig { 14 | 15 | @Bean(name = "tracing") 16 | public TracingFactoryBean getTracingBean() { 17 | TracingFactoryBean tracingFactoryBean = new TracingFactoryBean(); 18 | tracingFactoryBean.setLocalServiceName("cinema"); 19 | tracingFactoryBean.setSpanReporter( 20 | AsyncReporter.create(OkHttpSender.create("http://118.126.111.144:9411/api/v2/spans"))); 21 | return tracingFactoryBean; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.controller.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 认证的响应结果 7 | * 8 | * @author fengshuonan 9 | * @Date 2017/8/24 13:58 10 | */ 11 | public class AuthResponse implements Serializable { 12 | 13 | private static final long serialVersionUID = 1250166508152483573L; 14 | 15 | /** 16 | * jwt token 17 | */ 18 | private final String token; 19 | 20 | /** 21 | * 用于客户端混淆md5加密 22 | */ 23 | private final String randomKey; 24 | 25 | public AuthResponse(String token, String randomKey) { 26 | this.token = token; 27 | this.randomKey = randomKey; 28 | } 29 | 30 | public String getToken() { 31 | return this.token; 32 | } 33 | 34 | public String getRandomKey() { 35 | return randomKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/BaseTransferEntity.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.converter; 2 | 3 | /** 4 | * 基础的传输bean 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 15:52 8 | */ 9 | public class BaseTransferEntity { 10 | 11 | private String object; //base64编码的json字符串 12 | 13 | private String sign; //签名 14 | 15 | public String getObject() { 16 | return object; 17 | } 18 | 19 | public void setObject(String object) { 20 | this.object = object; 21 | } 22 | 23 | public String getSign() { 24 | return sign; 25 | } 26 | 27 | public void setSign(String sign) { 28 | this.sign = sign; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/modular/auth/security/DataSecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security; 2 | 3 | /** 4 | *
 5 |  * 信息传递的保护措施(传递的数据为json)
 6 |  *
 7 |  * 说明:
 8 |  * 可以根据实际开发时的需要,编写自己的数据加密方案,只需实现此类,并在WebConfig下配置您所编写的实现类即可
 9 |  * 
10 | * 11 | * @author fengshuonan 12 | * @date 2017-09-18 20:41 13 | */ 14 | public interface DataSecurityAction { 15 | 16 | /** 17 | * 执行数据的保护措施 18 | * 19 | * @author stylefeng 20 | * @Date 2017/9/18 20:42 21 | */ 22 | String doAction(String beProtected); 23 | 24 | /** 25 | * 解除保护 26 | * 27 | * @author stylefeng 28 | * @Date 2017/9/18 20:45 29 | */ 30 | String unlock(String securityCode); 31 | } 32 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/modular/auth/security/impl/Base64SecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security.impl; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.security.DataSecurityAction; 4 | import org.springframework.util.Base64Utils; 5 | 6 | /** 7 | * 对数据进行base64编码的方式 8 | * 9 | * @author fengshuonan 10 | * @date 2017-09-18 20:43 11 | */ 12 | public class Base64SecurityAction implements DataSecurityAction { 13 | 14 | @Override 15 | public String doAction(String beProtected) { 16 | return Base64Utils.encodeToString(beProtected.getBytes()); 17 | } 18 | 19 | @Override 20 | public String unlock(String securityCode) { 21 | byte[] bytes = Base64Utils.decodeFromString(securityCode); 22 | return new String(bytes); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/IReqValidator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.validator.dto.Credence; 4 | 5 | /** 6 | *

验证请求/auth接口时,请求参数的正确性

7 | *

8 | *

如果想拓展验证方法只需实现这个接口,然后在AuthenticationRestController类中注意相应实现的本接口的类即可

9 | * 10 | * @author fengshuonan 11 | * @date 2017-08-23 11:48 12 | */ 13 | public interface IReqValidator { 14 | 15 | /** 16 | * 通过请求参数验证 17 | * 18 | * @author fengshuonan 19 | * @Date 2017/8/23 11:49 20 | */ 21 | boolean validate(Credence credence); 22 | } 23 | -------------------------------------------------------------------------------- /guns-cinema/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/dto/Credence.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator.dto; 2 | 3 | /** 4 | * 验证的凭据 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-27 13:27 8 | */ 9 | public interface Credence { 10 | 11 | /** 12 | * 凭据名称 13 | */ 14 | String getCredenceName(); 15 | 16 | /** 17 | * 密码或者是其他的验证码之类的 18 | */ 19 | String getCredenceCode(); 20 | } 21 | -------------------------------------------------------------------------------- /guns-cinema/src/test/java/com/stylefeng/guns/GunsRestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsRestApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/CoreFlag.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core; 2 | 3 | /** 4 | * 此类用来获取core模块的包路径 5 | * 6 | * @author fengshuonan 7 | * @Date 2017/12/5 下午12:44 8 | */ 9 | public class CoreFlag { 10 | 11 | } -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/base/controller/GunsErrorView.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.base.controller; 2 | 3 | import org.springframework.web.servlet.View; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | import java.util.Map; 8 | 9 | /** 10 | * 错误页面的默认跳转(例如请求404的时候,默认走这个视图解析器) 11 | * 12 | * @author fengshuonan 13 | * @date 2017-05-21 11:34 14 | */ 15 | public class GunsErrorView implements View { 16 | 17 | @Override 18 | public String getContentType() { 19 | return "text/html"; 20 | } 21 | 22 | @Override 23 | public void render(Map map, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { 24 | httpServletRequest.getRequestDispatcher("/global/error").forward(httpServletRequest, httpServletResponse); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/base/tips/ErrorTip.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.base.tips; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | 5 | /** 6 | * 返回给前台的错误提示 7 | * 8 | * @author fengshuonan 9 | * @date 2016年11月12日 下午5:05:22 10 | */ 11 | @Slf4j 12 | public class ErrorTip extends Tip { 13 | 14 | public ErrorTip(int status, String msg) { 15 | super(); 16 | log.error("系统出现异常,异常code={},异常信息={}", status, msg); 17 | this.status = status; 18 | this.msg = msg; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/base/tips/SuccessTip.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.base.tips; 2 | 3 | /** 4 | * 返回给前台的成功提示 5 | * 6 | * @author fengshuonan 7 | * @date 2016年11月12日 下午5:05:22 8 | */ 9 | public class SuccessTip extends Tip { 10 | 11 | public SuccessTip(){ 12 | super.status = 200; 13 | super.msg = "操作成功"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/base/tips/Tip.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.base.tips; 2 | 3 | /** 4 | * 返回给前台的提示(最终转化为json形式) 5 | * 6 | * @author fengshuonan 7 | * @Date 2017年1月11日 下午11:58:00 8 | */ 9 | public abstract class Tip { 10 | 11 | protected int status; 12 | protected String msg; 13 | 14 | public int getStatus() { 15 | return status; 16 | } 17 | 18 | public void setStatus(int status) { 19 | this.status = status; 20 | } 21 | 22 | public String getMsg() { 23 | return msg; 24 | } 25 | 26 | public void setMsg(String msg) { 27 | this.msg = msg; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/cache/ILoader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stylefeng.guns.core.cache; 17 | 18 | /** 19 | * 数据重载 20 | */ 21 | public interface ILoader { 22 | Object load(); 23 | } 24 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/config/DefaultMultiConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.config; 2 | 3 | import com.stylefeng.guns.core.mutidatasource.aop.MultiSourceExAop; 4 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * 多数据源配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017/5/20 21:58 13 | */ 14 | @Configuration 15 | @ConditionalOnProperty(prefix = "guns", name = "muti-datasource-open", havingValue = "true") 16 | public class DefaultMultiConfig { 17 | 18 | @Bean 19 | public MultiSourceExAop multiSourceExAop() { 20 | return new MultiSourceExAop(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/config/DefaultProperties.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.config; 2 | 3 | import com.stylefeng.guns.core.config.properties.DruidProperties; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.annotation.PropertySource; 8 | 9 | /** 10 | * 默认的配置 11 | * 12 | * @author fengshuonan 13 | * @date 2018-01-07 12:33 14 | */ 15 | @Configuration 16 | @PropertySource("classpath:/default-config.properties") 17 | public class DefaultProperties { 18 | 19 | @Bean 20 | @ConfigurationProperties(prefix = "spring.datasource") 21 | public DruidProperties druidProperties() { 22 | return new DruidProperties(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/exception/GunsException.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.exception; 2 | 3 | /** 4 | * 封装guns的异常 5 | * 6 | * @author fengshuonan 7 | * @Date 2017/12/28 下午10:32 8 | */ 9 | public class GunsException extends RuntimeException { 10 | 11 | private Integer code; 12 | 13 | private String message; 14 | 15 | public GunsException(ServiceExceptionEnum serviceExceptionEnum) { 16 | this.code = serviceExceptionEnum.getCode(); 17 | this.message = serviceExceptionEnum.getMessage(); 18 | } 19 | 20 | public Integer getCode() { 21 | return code; 22 | } 23 | 24 | public void setCode(Integer code) { 25 | this.code = code; 26 | } 27 | 28 | @Override 29 | public String getMessage() { 30 | return message; 31 | } 32 | 33 | public void setMessage(String message) { 34 | this.message = message; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/exception/ServiceExceptionEnum.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.exception; 2 | 3 | /** 4 | * 抽象接口 5 | * 6 | * @author fengshuonan 7 | * @date 2017-12-28-下午10:27 8 | */ 9 | public interface ServiceExceptionEnum { 10 | 11 | /** 12 | * 获取异常编码 13 | */ 14 | Integer getCode(); 15 | 16 | /** 17 | * 获取异常信息 18 | */ 19 | String getMessage(); 20 | } 21 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/mutidatasource/DataSourceContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.mutidatasource; 2 | 3 | /** 4 | * datasource的上下文 5 | * 6 | * @author fengshuonan 7 | * @date 2017年3月5日 上午9:10:58 8 | */ 9 | public class DataSourceContextHolder { 10 | 11 | private static final ThreadLocal contextHolder = new ThreadLocal(); 12 | 13 | /** 14 | * 设置数据源类型 15 | * 16 | * @param dataSourceType 数据库类型 17 | */ 18 | public static void setDataSourceType(String dataSourceType) { 19 | contextHolder.set(dataSourceType); 20 | } 21 | 22 | /** 23 | * 获取数据源类型 24 | */ 25 | public static String getDataSourceType() { 26 | return contextHolder.get(); 27 | } 28 | 29 | /** 30 | * 清除数据源类型 31 | */ 32 | public static void clearDataSourceType() { 33 | contextHolder.remove(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/mutidatasource/DynamicDataSource.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.mutidatasource; 2 | 3 | import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; 4 | 5 | /** 6 | * 动态数据源 7 | * 8 | * @author fengshuonan 9 | * @date 2017年3月5日 上午9:11:49 10 | */ 11 | public class DynamicDataSource extends AbstractRoutingDataSource { 12 | 13 | @Override 14 | protected Object determineCurrentLookupKey() { 15 | return DataSourceContextHolder.getDataSourceType(); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/mutidatasource/annotion/DataSource.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.mutidatasource.annotion; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 7 | * 多数据源标识 8 | * 9 | * @author fengshuonan 10 | * @date 2017年3月5日 上午9:44:24 11 | */ 12 | @Inherited 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Target({ ElementType.METHOD }) 15 | public @interface DataSource { 16 | 17 | String name() default ""; 18 | } 19 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/page/PageInfoBT.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.page; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 分页结果的封装(for Bootstrap Table) 9 | * 10 | * @author fengshuonan 11 | * @Date 2017年1月22日 下午11:06:41 12 | */ 13 | public class PageInfoBT { 14 | 15 | // 结果集 16 | private List rows; 17 | 18 | // 总数 19 | private long total; 20 | 21 | public PageInfoBT(Page page) { 22 | this.rows = page.getRecords(); 23 | this.total = page.getTotal(); 24 | } 25 | 26 | public List getRows() { 27 | return rows; 28 | } 29 | 30 | public void setRows(List rows) { 31 | this.rows = rows; 32 | } 33 | 34 | public long getTotal() { 35 | return total; 36 | } 37 | 38 | public void setTotal(long total) { 39 | this.total = total; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/support/ObjectKit.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.support; 2 | 3 | /** 4 | * 一些通用的函数 5 | * 6 | * @author Looly 7 | * 8 | */ 9 | public class ObjectKit { 10 | /** 11 | * 比较两个对象是否相等。
12 | * 相同的条件有两个,满足其一即可:
13 | * 1. obj1 == null && obj2 == null; 2. obj1.equals(obj2) 14 | * 15 | * @param obj1 对象1 16 | * @param obj2 对象2 17 | * @return 是否相等 18 | */ 19 | public static boolean equals(Object obj1, Object obj2) { 20 | return (obj1 != null) ? (obj1.equals(obj2)) : (obj2 == null); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/util/HttpSessionHolder.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import javax.servlet.http.HttpSession; 4 | 5 | /** 6 | * 非Controller中获取当前session的工具类 7 | * 8 | * @author fengshuonan 9 | * @date 2016年11月28日 上午10:24:31 10 | */ 11 | public class HttpSessionHolder { 12 | 13 | private static ThreadLocal tl = new ThreadLocal(); 14 | 15 | public static void put(HttpSession s) { 16 | tl.set(s); 17 | } 18 | 19 | public static HttpSession get() { 20 | return tl.get(); 21 | } 22 | 23 | public static void remove() { 24 | tl.remove(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/util/IdGenerator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import com.baomidou.mybatisplus.toolkit.IdWorker; 4 | 5 | /** 6 | * 唯一id生成器 7 | * 8 | * @author fengshuonan 9 | * @date 2017-08-23 11:10 10 | */ 11 | public class IdGenerator { 12 | 13 | public static String getId() { 14 | return String.valueOf(IdWorker.getId()); 15 | } 16 | 17 | public static long getIdLong() { 18 | return IdWorker.getId(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/util/SqlUtil.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * sql语句工具类 8 | * 9 | * @author fengshuonan 10 | * @date 2016年12月6日 下午1:01:54 11 | */ 12 | public class SqlUtil { 13 | 14 | /** 15 | * @Description 根据集合的大小,输出相应个数"?" 16 | * @author fengshuonan 17 | */ 18 | public static String parse(List list) { 19 | String str = ""; 20 | if (list != null && list.size() > 0) { 21 | str = str + "?"; 22 | for (int i = 1; i < list.size(); i++) { 23 | str = str + ",?"; 24 | } 25 | } 26 | return str; 27 | } 28 | 29 | public static void main(String[] args) { 30 | ArrayList arrayList = new ArrayList<>(); 31 | arrayList.add(2); 32 | arrayList.add(2); 33 | System.out.println(parse(arrayList)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /guns-core/src/main/java/com/stylefeng/guns/core/util/UUIDUtil.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import java.util.UUID; 4 | 5 | public class UUIDUtil { 6 | 7 | /** 8 | * 数据库不建议存:- 9 | * @return 10 | */ 11 | public static String genUuid(){ 12 | return UUID.randomUUID().toString().replace("-",""); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-core/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # AutoConfiguration 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | com.stylefeng.guns.core.base.controller.GlobalController,\ 4 | com.stylefeng.guns.core.config.DefaultFastjsonConfig,\ 5 | com.stylefeng.guns.core.config.MultiDataSourceConfig,\ 6 | com.stylefeng.guns.core.config.SingleDataSourceConfig,\ 7 | com.stylefeng.guns.core.config.DefaultProperties,\ 8 | com.stylefeng.guns.core.config.DefaultWebConfig -------------------------------------------------------------------------------- /guns-example-client/src/main/java/com/stylefeng/sso/client/SsoClientExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.sso.client; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; 6 | 7 | /** 8 | * SSO 客户端示例 9 | * 10 | * @author stylefeng 11 | * @Date 2018年2月3日15:34:08 12 | */ 13 | @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) 14 | public class SsoClientExampleApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(SsoClientExampleApplication.class, args); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /guns-example-client/src/main/java/com/stylefeng/sso/client/auth/AuthApiFactory.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.sso.client.auth; 2 | 3 | import com.stylefeng.sso.plugin.api.AuthApi; 4 | import com.stylefeng.sso.plugin.model.LoginUser; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * 用户鉴权服务的空实现 12 | * 13 | * @author fengshuonan 14 | * @Date 2018/8/31 下午12:57 15 | */ 16 | @Service 17 | public class AuthApiFactory implements AuthApi { 18 | 19 | @Override 20 | public LoginUser getLoginUser(Integer userId) { 21 | return new LoginUser(); 22 | } 23 | 24 | @Override 25 | public List findPermissionsByRoleId(Integer roleId) { 26 | return new ArrayList<>(); 27 | } 28 | 29 | @Override 30 | public String findRoleNameByRoleId(Integer roleId) { 31 | return ""; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /guns-example-client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 3 | 4 | spring: 5 | application: 6 | name: sso-client 7 | profiles: 8 | active: local 9 | aop: 10 | proxy-target-class: true 11 | mvc: 12 | static-path-pattern: /static/** 13 | view: 14 | prefix: /WEB-INF/view 15 | servlet: 16 | multipart: 17 | max-request-size: 100MB 18 | max-file-size: 100MB 19 | 20 | mybatis-plus: 21 | typeAliasesPackage: com.stylefeng.sso.client.modular.entity 22 | 23 | # 单点信息配置 24 | sso: 25 | serverUrl: http://localhost:8000/sso/ -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/favicon.ico -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /guns-example-client/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-example-client/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/FilmApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication(scanBasePackages = {"com.stylefeng.guns"}) 8 | @EnableDubboConfiguration 9 | public class FilmApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(FilmApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/FilmServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class FilmServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(FilmApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocActorTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.api.film.vo.ActorVO; 4 | import com.stylefeng.guns.rest.common.persistence.model.MoocActorT; 5 | import com.baomidou.mybatisplus.mapper.BaseMapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 演员表 Mapper 接口 12 | * 13 | * @author liu 14 | * @since 2018-10-03 15 | */ 16 | public interface MoocActorTMapper extends BaseMapper { 17 | 18 | List getActors(@Param("filmId") String filmId); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocBannerTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocBannerT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * banner信息表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-03 13 | */ 14 | public interface MoocBannerTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocCatDictTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocCatDictT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 类型信息表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-03 13 | */ 14 | public interface MoocCatDictTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocFilmInfoTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocFilmInfoT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 影片主表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-03 13 | */ 14 | public interface MoocFilmInfoTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocFilmTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.api.film.vo.FilmDetailVO; 4 | import com.stylefeng.guns.rest.common.persistence.model.MoocFilmT; 5 | import com.baomidou.mybatisplus.mapper.BaseMapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | /** 9 | * 影片主表 Mapper 接口 10 | * 11 | * @author liu 12 | * @since 2018-10-03 13 | */ 14 | public interface MoocFilmTMapper extends BaseMapper { 15 | 16 | FilmDetailVO getFilmDetailByName(@Param("filmName") String filmName); 17 | 18 | FilmDetailVO getFilmDetailById(@Param("uuid") String uuid); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocSourceDictTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocSourceDictT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 区域信息表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-03 13 | */ 14 | public interface MoocSourceDictTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocYearDictTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocYearDictT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 年代信息表 Mapper 接口 9 | *

10 | * 11 | * @author liu 12 | * @since 2018-10-03 13 | */ 14 | public interface MoocYearDictTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/MoocBannerTMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/MoocCatDictTMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/MoocSourceDictTMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/MoocYearDictTMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * MybatisPlus配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017年8月23日12:51:41 13 | */ 14 | @Configuration 15 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.*.dao", "com.stylefeng.guns.rest.common.persistence.dao"}) 16 | public class MybatisPlusConfig { 17 | 18 | /** 19 | * mybatis-plus分页插件 20 | */ 21 | @Bean 22 | public PaginationInterceptor paginationInterceptor() { 23 | return new PaginationInterceptor(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.controller.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 认证的响应结果 7 | * 8 | * @author fengshuonan 9 | * @Date 2017/8/24 13:58 10 | */ 11 | public class AuthResponse implements Serializable { 12 | 13 | private static final long serialVersionUID = 1250166508152483573L; 14 | 15 | /** 16 | * jwt token 17 | */ 18 | private final String token; 19 | 20 | /** 21 | * 用于客户端混淆md5加密 22 | */ 23 | private final String randomKey; 24 | 25 | public AuthResponse(String token, String randomKey) { 26 | this.token = token; 27 | this.randomKey = randomKey; 28 | } 29 | 30 | public String getToken() { 31 | return this.token; 32 | } 33 | 34 | public String getRandomKey() { 35 | return randomKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/BaseTransferEntity.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.converter; 2 | 3 | /** 4 | * 基础的传输bean 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 15:52 8 | */ 9 | public class BaseTransferEntity { 10 | 11 | private String object; //base64编码的json字符串 12 | 13 | private String sign; //签名 14 | 15 | public String getObject() { 16 | return object; 17 | } 18 | 19 | public void setObject(String object) { 20 | this.object = object; 21 | } 22 | 23 | public String getSign() { 24 | return sign; 25 | } 26 | 27 | public void setSign(String sign) { 28 | this.sign = sign; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/modular/auth/security/DataSecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security; 2 | 3 | /** 4 | *
 5 |  * 信息传递的保护措施(传递的数据为json)
 6 |  *
 7 |  * 说明:
 8 |  * 可以根据实际开发时的需要,编写自己的数据加密方案,只需实现此类,并在WebConfig下配置您所编写的实现类即可
 9 |  * 
10 | * 11 | * @author fengshuonan 12 | * @date 2017-09-18 20:41 13 | */ 14 | public interface DataSecurityAction { 15 | 16 | /** 17 | * 执行数据的保护措施 18 | * 19 | * @author stylefeng 20 | * @Date 2017/9/18 20:42 21 | */ 22 | String doAction(String beProtected); 23 | 24 | /** 25 | * 解除保护 26 | * 27 | * @author stylefeng 28 | * @Date 2017/9/18 20:45 29 | */ 30 | String unlock(String securityCode); 31 | } 32 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/modular/auth/security/impl/Base64SecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security.impl; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.security.DataSecurityAction; 4 | import org.springframework.util.Base64Utils; 5 | 6 | /** 7 | * 对数据进行base64编码的方式 8 | * 9 | * @author fengshuonan 10 | * @date 2017-09-18 20:43 11 | */ 12 | public class Base64SecurityAction implements DataSecurityAction { 13 | 14 | @Override 15 | public String doAction(String beProtected) { 16 | return Base64Utils.encodeToString(beProtected.getBytes()); 17 | } 18 | 19 | @Override 20 | public String unlock(String securityCode) { 21 | byte[] bytes = Base64Utils.decodeFromString(securityCode); 22 | return new String(bytes); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/IReqValidator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.validator.dto.Credence; 4 | 5 | /** 6 | *

验证请求/auth接口时,请求参数的正确性

7 | *

8 | *

如果想拓展验证方法只需实现这个接口,然后在AuthenticationRestController类中注意相应实现的本接口的类即可

9 | * 10 | * @author fengshuonan 11 | * @date 2017-08-23 11:48 12 | */ 13 | public interface IReqValidator { 14 | 15 | /** 16 | * 通过请求参数验证 17 | * 18 | * @author fengshuonan 19 | * @Date 2017/8/23 11:49 20 | */ 21 | boolean validate(Credence credence); 22 | } 23 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/dto/Credence.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator.dto; 2 | 3 | /** 4 | * 验证的凭据 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-27 13:27 8 | */ 9 | public interface Credence { 10 | 11 | /** 12 | * 凭据名称 13 | */ 14 | String getCredenceName(); 15 | 16 | /** 17 | * 密码或者是其他的验证码之类的 18 | */ 19 | String getCredenceCode(); 20 | } 21 | -------------------------------------------------------------------------------- /guns-film/src/main/java/com/stylefeng/guns/rest/modular/example/ExampleController.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.example; 2 | 3 | import com.stylefeng.guns.rest.common.SimpleObject; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * 常规控制器 11 | * 12 | * @author fengshuonan 13 | * @date 2017-08-23 16:02 14 | */ 15 | @Controller 16 | @RequestMapping("/hello") 17 | public class ExampleController { 18 | 19 | @RequestMapping("") 20 | public ResponseEntity hello(@RequestBody SimpleObject simpleObject) { 21 | System.out.println(simpleObject.getUser()); 22 | return ResponseEntity.ok("请求成功!"); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /guns-film/src/test/java/com/stylefeng/guns/GunsRestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsRestApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/GunsGatewayApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; 7 | import org.springframework.cloud.netflix.hystrix.EnableHystrix; 8 | import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard; 9 | import org.springframework.scheduling.annotation.EnableAsync; 10 | 11 | @SpringBootApplication(scanBasePackages = {"com.stylefeng.guns"}) 12 | @EnableDubboConfiguration 13 | @EnableAsync 14 | @EnableHystrixDashboard 15 | @EnableCircuitBreaker 16 | @EnableHystrix 17 | public class GunsGatewayApplication { 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(GunsGatewayApplication.class, args); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/GunsGatewayServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsGatewayServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(GunsGatewayApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/common/CurrentUser.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common; 2 | 3 | /** 4 | * 增加Threadlocal的用户信息保存 5 | */ 6 | public class CurrentUser { 7 | 8 | // 线程绑定的存储空间 9 | // private static final ThreadLocal threadLocal = new ThreadLocal<>(); 10 | private static final InheritableThreadLocal threadLocal = new InheritableThreadLocal<>(); 11 | // 因为 Hystrix 会线程切换,InheritableThreadLocal 可以在切换时保存线程信息 12 | 13 | // 将用户id放入存储空间 14 | public static void saveUserId(String userId) { 15 | threadLocal.set(userId); 16 | } 17 | 18 | // 将用户id取出 19 | public static String getCurrentUserId() { 20 | return threadLocal.get(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.stylefeng.guns.rest.common.persistence.model.User; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author stylefeng 12 | * @since 2017-08-23 13 | */ 14 | public interface UserMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * MybatisPlus配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017年8月23日12:51:41 13 | */ 14 | @Configuration 15 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.*.dao", "com.stylefeng.guns.rest.common.persistence.dao"}) 16 | public class MybatisPlusConfig { 17 | 18 | /** 19 | * mybatis-plus分页插件 20 | */ 21 | @Bean 22 | public PaginationInterceptor paginationInterceptor() { 23 | return new PaginationInterceptor(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/Client.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular; 2 | 3 | import com.alibaba.dubbo.config.annotation.Reference; 4 | import com.stylefeng.guns.api.user.UserAPI; 5 | 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class Client { 10 | 11 | @Reference(interfaceClass = UserAPI.class) 12 | private UserAPI userAPI; 13 | 14 | public void run() { 15 | userAPI.login("admin", "password"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.controller.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 认证的响应结果 7 | * 8 | * @author fengshuonan 9 | * @Date 2017/8/24 13:58 10 | */ 11 | public class AuthResponse implements Serializable { 12 | 13 | private static final long serialVersionUID = 1250166508152483573L; 14 | 15 | /** 16 | * jwt token 17 | */ 18 | private final String token; 19 | 20 | /** 21 | * 用于客户端混淆md5加密 22 | */ 23 | private final String randomKey; 24 | 25 | public AuthResponse(String token, String randomKey) { 26 | this.token = token; 27 | this.randomKey = randomKey; 28 | } 29 | 30 | public String getToken() { 31 | return this.token; 32 | } 33 | 34 | public String getRandomKey() { 35 | return randomKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/BaseTransferEntity.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.converter; 2 | 3 | /** 4 | * 基础的传输bean 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 15:52 8 | */ 9 | public class BaseTransferEntity { 10 | 11 | private String object; //base64编码的json字符串 12 | 13 | private String sign; //签名 14 | 15 | public String getObject() { 16 | return object; 17 | } 18 | 19 | public void setObject(String object) { 20 | this.object = object; 21 | } 22 | 23 | public String getSign() { 24 | return sign; 25 | } 26 | 27 | public void setSign(String sign) { 28 | this.sign = sign; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/security/DataSecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security; 2 | 3 | /** 4 | *
 5 |  * 信息传递的保护措施(传递的数据为json)
 6 |  *
 7 |  * 说明:
 8 |  * 可以根据实际开发时的需要,编写自己的数据加密方案,只需实现此类,并在WebConfig下配置您所编写的实现类即可
 9 |  * 
10 | * 11 | * @author fengshuonan 12 | * @date 2017-09-18 20:41 13 | */ 14 | public interface DataSecurityAction { 15 | 16 | /** 17 | * 执行数据的保护措施 18 | * 19 | * @author stylefeng 20 | * @Date 2017/9/18 20:42 21 | */ 22 | String doAction(String beProtected); 23 | 24 | /** 25 | * 解除保护 26 | * 27 | * @author stylefeng 28 | * @Date 2017/9/18 20:45 29 | */ 30 | String unlock(String securityCode); 31 | } 32 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/security/impl/Base64SecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security.impl; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.security.DataSecurityAction; 4 | import org.springframework.util.Base64Utils; 5 | 6 | /** 7 | * 对数据进行base64编码的方式 8 | * 9 | * @author fengshuonan 10 | * @date 2017-09-18 20:43 11 | */ 12 | public class Base64SecurityAction implements DataSecurityAction { 13 | 14 | @Override 15 | public String doAction(String beProtected) { 16 | return Base64Utils.encodeToString(beProtected.getBytes()); 17 | } 18 | 19 | @Override 20 | public String unlock(String securityCode) { 21 | byte[] bytes = Base64Utils.decodeFromString(securityCode); 22 | return new String(bytes); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/IReqValidator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.validator.dto.Credence; 4 | 5 | /** 6 | *

验证请求/auth接口时,请求参数的正确性

7 | *

8 | *

如果想拓展验证方法只需实现这个接口,然后在AuthenticationRestController类中注意相应实现的本接口的类即可

9 | * 10 | * @author fengshuonan 11 | * @date 2017-08-23 11:48 12 | */ 13 | public interface IReqValidator { 14 | 15 | /** 16 | * 通过请求参数验证 17 | * 18 | * @author fengshuonan 19 | * @Date 2017/8/23 11:49 20 | */ 21 | boolean validate(Credence credence); 22 | } 23 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/dto/Credence.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator.dto; 2 | 3 | /** 4 | * 验证的凭据 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-27 13:27 8 | */ 9 | public interface Credence { 10 | 11 | /** 12 | * 凭据名称 13 | */ 14 | String getCredenceName(); 15 | 16 | /** 17 | * 密码或者是其他的验证码之类的 18 | */ 19 | String getCredenceCode(); 20 | } 21 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/cinema/vo/CinemaConditionResponseVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.cinema.vo; 2 | 3 | import com.stylefeng.guns.api.cinema.vo.AreaVO; 4 | import com.stylefeng.guns.api.cinema.vo.BrandVO; 5 | import com.stylefeng.guns.api.cinema.vo.HallTypeVO; 6 | import lombok.Data; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | public class CinemaConditionResponseVO { 12 | 13 | private List brandList; 14 | private List areaList; 15 | private List halltypeList; 16 | 17 | } 18 | 19 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/cinema/vo/CinemaFieldResponseVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.cinema.vo; 2 | 3 | import com.stylefeng.guns.api.cinema.vo.CinemaInfoVO; 4 | import com.stylefeng.guns.api.cinema.vo.FilmInfoVO; 5 | import com.stylefeng.guns.api.cinema.vo.HallInfoVO; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class CinemaFieldResponseVO { 10 | 11 | private CinemaInfoVO cinemaInfo; 12 | private FilmInfoVO filmInfo; 13 | private HallInfoVO hallInfo; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/cinema/vo/CinemaFieldsResponseVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.cinema.vo; 2 | 3 | import com.stylefeng.guns.api.cinema.vo.CinemaInfoVO; 4 | import com.stylefeng.guns.api.cinema.vo.FilmInfoVO; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class CinemaFieldsResponseVO { 11 | 12 | private CinemaInfoVO cinemaInfo; 13 | private List filmList; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/cinema/vo/CinemaListResponseVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.cinema.vo; 2 | 3 | import com.stylefeng.guns.api.cinema.vo.CinemaVO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class CinemaListResponseVO { 10 | 11 | private List cinemas; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/example/ExampleController.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.example; 2 | 3 | import com.stylefeng.guns.rest.common.CurrentUser; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | /** 9 | * 常规控制器 10 | * 11 | * @author fengshuonan 12 | * @date 2017-08-23 16:02 13 | */ 14 | @Controller 15 | @RequestMapping("/hello") 16 | public class ExampleController { 17 | 18 | /** 19 | * 测试 20 | * 21 | * @return 22 | */ 23 | @RequestMapping("") 24 | public ResponseEntity hello() { 25 | /* System.out.println(simpleObject.getUser());*/ 26 | System.out.println(CurrentUser.getCurrentUserId()); 27 | return ResponseEntity.ok("请求成功!"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/film/vo/FilmConditionVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.film.vo; 2 | 3 | import com.stylefeng.guns.api.film.vo.CatVO; 4 | import com.stylefeng.guns.api.film.vo.SourceVO; 5 | import com.stylefeng.guns.api.film.vo.YearVO; 6 | import lombok.Data; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | public class FilmConditionVO { 12 | 13 | private List catInfo; 14 | private List sourceInfo; 15 | private List yearInfo; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/film/vo/FilmIndexVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.film.vo; 2 | 3 | import com.stylefeng.guns.api.film.vo.BannerVO; 4 | import com.stylefeng.guns.api.film.vo.FilmInfo; 5 | import com.stylefeng.guns.api.film.vo.FilmVO; 6 | import lombok.Data; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | public class FilmIndexVO { 12 | private List banners; 13 | private FilmVO hotFilms; 14 | private FilmVO soonFilms; 15 | private List boxRanking; 16 | private List expectRanking; 17 | private List top100; 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/film/vo/FilmRequestVO.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.film.vo; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 影片查询条件 7 | */ 8 | @Data 9 | public class FilmRequestVO { 10 | 11 | // 查询类型 1-正在热映 2-即将上映 3-经典影片 12 | private Integer showType = 1; 13 | // 排序方式 1-按热门搜索 2-按时间搜索 3-按评价搜索 14 | private Integer sortId = 1; 15 | // 类型编号 16 | private Integer catId = 99; 17 | // 区域编号 18 | private Integer sourceId = 99; 19 | // 年代编号 20 | private Integer yearId = 99; 21 | // 影片列表当前页 22 | private Integer nowPage = 1; 23 | // 每页显示条数 24 | private Integer pageSize = 18; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /guns-gateway/src/test/java/com/stylefeng/guns/GunsRestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsRestApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-generator/src/main/java/com/stylefeng/guns/generator/action/GunsCodeGenerator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.generator.action; 2 | 3 | 4 | import com.stylefeng.guns.generator.action.config.GunsGeneratorConfig; 5 | 6 | /** 7 | * 代码生成器,可以生成实体,dao,service,controller,html,js 8 | * 9 | * @author stylefeng 10 | * @Date 2017/5/21 12:38 11 | */ 12 | public class GunsCodeGenerator { 13 | 14 | public static void main(String[] args) { 15 | 16 | /** 17 | * Mybatis-Plus的代码生成器: 18 | * mp的代码生成器可以生成实体,mapper,mapper对应的xml,service 19 | */ 20 | GunsGeneratorConfig gunsGeneratorConfig = new GunsGeneratorConfig(); 21 | gunsGeneratorConfig.doMpGeneration(); 22 | 23 | /** 24 | * guns的生成器: 25 | * guns的代码生成器可以生成controller,html页面,页面对应的js 26 | */ 27 | gunsGeneratorConfig.doGunsGeneration(); 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /guns-generator/src/main/resources/gunsTemplate/advanced/menu_sql.sql.btl: -------------------------------------------------------------------------------- 1 | <% for(menu in sqls.menus!){ %> 2 | INSERT INTO `guns`.`sys_menu` (`id`, `code`, `pcode`, `pcodes`, `name`, `icon`, `url`, `num`, `levels`, `ismenu`, `tips`, `status`, `isopen`) VALUES ('${menu.id}', '${menu.code}', '${menu.pcode}', '${menu.pcodes}', '${menu.name}', '${menu.icon}', '${menu.url}', '${menu.num}', '${menu.levels}', '${menu.ismenu}', NULL, '${menu.status}', '${menu.isopen}'); 3 | <% } %> -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/GunsRestServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsRestServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(OrderApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/OrderApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @EnableDubboConfiguration 8 | @SpringBootApplication(scanBasePackages = {"com.stylefeng.guns"}) 9 | public class OrderApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(OrderApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocOrder2017TMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.stylefeng.guns.api.order.vo.OrderVO; 5 | import com.stylefeng.guns.rest.common.persistence.model.MoocOrder2017T; 6 | import com.baomidou.mybatisplus.mapper.BaseMapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 订单信息表 Mapper 接口 13 | * 14 | * @author liu 15 | * @since 2018-10-05 16 | */ 17 | public interface MoocOrder2017TMapper extends BaseMapper { 18 | 19 | String getSeatsByFieldId(@Param("fieldId") String fieldId); 20 | 21 | OrderVO getOrderInfoById(@Param("orderId") String orderId); 22 | 23 | List getOrdersByUserId(@Param("userId") Integer userId, Page page); 24 | 25 | String getSoldSeatsByFieldId(@Param("fieldId") Integer fieldId); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocOrder2018TMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.stylefeng.guns.api.order.vo.OrderVO; 5 | import com.stylefeng.guns.rest.common.persistence.model.MoocOrder2018T; 6 | import com.baomidou.mybatisplus.mapper.BaseMapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 订单信息表 Mapper 接口 13 | * 14 | * @author liu 15 | * @since 2018-10-05 16 | */ 17 | public interface MoocOrder2018TMapper extends BaseMapper { 18 | 19 | String getSeatsByFieldId(@Param("fieldId") String fieldId); 20 | 21 | OrderVO getOrderInfoById(@Param("orderId") String orderId); 22 | 23 | List getOrdersByUserId(@Param("userId") Integer userId, Page page); 24 | 25 | String getSoldSeatsByFieldId(@Param("fieldId") Integer fieldId); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocOrderTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.stylefeng.guns.api.order.vo.OrderVO; 5 | import com.stylefeng.guns.rest.common.persistence.model.MoocOrderT; 6 | import com.baomidou.mybatisplus.mapper.BaseMapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 订单信息表 Mapper 接口 13 | * 14 | * @author liu 15 | * @since 2018-10-05 16 | */ 17 | public interface MoocOrderTMapper extends BaseMapper { 18 | 19 | String getSeatsByFieldId(@Param("fieldId") String fieldId); 20 | 21 | OrderVO getOrderInfoById(@Param("orderId") String orderId); 22 | 23 | List getOrdersByUserId(@Param("userId") Integer userId, Page page); 24 | 25 | String getSoldSeatsByFieldId(@Param("fieldId") Integer fieldId); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * MybatisPlus配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017年8月23日12:51:41 13 | */ 14 | @Configuration 15 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.*.dao", "com.stylefeng.guns.rest.common.persistence.dao"}) 16 | public class MybatisPlusConfig { 17 | 18 | /** 19 | * mybatis-plus分页插件 20 | */ 21 | @Bean 22 | public PaginationInterceptor paginationInterceptor() { 23 | return new PaginationInterceptor(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/config/TraceConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import brave.spring.beans.TracingFactoryBean; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import zipkin2.reporter.AsyncReporter; 7 | import zipkin2.reporter.okhttp3.OkHttpSender; 8 | 9 | /** 10 | * zipkin 配置 11 | */ 12 | @Configuration 13 | public class TraceConfig { 14 | 15 | @Bean(name = "tracing") 16 | public TracingFactoryBean getTracingBean() { 17 | TracingFactoryBean tracingFactoryBean = new TracingFactoryBean(); 18 | tracingFactoryBean.setLocalServiceName("order"); 19 | tracingFactoryBean.setSpanReporter( 20 | AsyncReporter.create(OkHttpSender.create("http://118.126.111.144:9411/api/v2/spans"))); 21 | return tracingFactoryBean; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.controller.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 认证的响应结果 7 | * 8 | * @author fengshuonan 9 | * @Date 2017/8/24 13:58 10 | */ 11 | public class AuthResponse implements Serializable { 12 | 13 | private static final long serialVersionUID = 1250166508152483573L; 14 | 15 | /** 16 | * jwt token 17 | */ 18 | private final String token; 19 | 20 | /** 21 | * 用于客户端混淆md5加密 22 | */ 23 | private final String randomKey; 24 | 25 | public AuthResponse(String token, String randomKey) { 26 | this.token = token; 27 | this.randomKey = randomKey; 28 | } 29 | 30 | public String getToken() { 31 | return this.token; 32 | } 33 | 34 | public String getRandomKey() { 35 | return randomKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/BaseTransferEntity.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.converter; 2 | 3 | /** 4 | * 基础的传输bean 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 15:52 8 | */ 9 | public class BaseTransferEntity { 10 | 11 | private String object; //base64编码的json字符串 12 | 13 | private String sign; //签名 14 | 15 | public String getObject() { 16 | return object; 17 | } 18 | 19 | public void setObject(String object) { 20 | this.object = object; 21 | } 22 | 23 | public String getSign() { 24 | return sign; 25 | } 26 | 27 | public void setSign(String sign) { 28 | this.sign = sign; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/modular/auth/security/DataSecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security; 2 | 3 | /** 4 | *
 5 |  * 信息传递的保护措施(传递的数据为json)
 6 |  *
 7 |  * 说明:
 8 |  * 可以根据实际开发时的需要,编写自己的数据加密方案,只需实现此类,并在WebConfig下配置您所编写的实现类即可
 9 |  * 
10 | * 11 | * @author fengshuonan 12 | * @date 2017-09-18 20:41 13 | */ 14 | public interface DataSecurityAction { 15 | 16 | /** 17 | * 执行数据的保护措施 18 | * 19 | * @author stylefeng 20 | * @Date 2017/9/18 20:42 21 | */ 22 | String doAction(String beProtected); 23 | 24 | /** 25 | * 解除保护 26 | * 27 | * @author stylefeng 28 | * @Date 2017/9/18 20:45 29 | */ 30 | String unlock(String securityCode); 31 | } 32 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/modular/auth/security/impl/Base64SecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security.impl; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.security.DataSecurityAction; 4 | import org.springframework.util.Base64Utils; 5 | 6 | /** 7 | * 对数据进行base64编码的方式 8 | * 9 | * @author fengshuonan 10 | * @date 2017-09-18 20:43 11 | */ 12 | public class Base64SecurityAction implements DataSecurityAction { 13 | 14 | @Override 15 | public String doAction(String beProtected) { 16 | return Base64Utils.encodeToString(beProtected.getBytes()); 17 | } 18 | 19 | @Override 20 | public String unlock(String securityCode) { 21 | byte[] bytes = Base64Utils.decodeFromString(securityCode); 22 | return new String(bytes); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/IReqValidator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.validator.dto.Credence; 4 | 5 | /** 6 | *

验证请求/auth接口时,请求参数的正确性

7 | *

8 | *

如果想拓展验证方法只需实现这个接口,然后在AuthenticationRestController类中注意相应实现的本接口的类即可

9 | * 10 | * @author fengshuonan 11 | * @date 2017-08-23 11:48 12 | */ 13 | public interface IReqValidator { 14 | 15 | /** 16 | * 通过请求参数验证 17 | * 18 | * @author fengshuonan 19 | * @Date 2017/8/23 11:49 20 | */ 21 | boolean validate(Credence credence); 22 | } 23 | -------------------------------------------------------------------------------- /guns-order/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/dto/Credence.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator.dto; 2 | 3 | /** 4 | * 验证的凭据 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-27 13:27 8 | */ 9 | public interface Credence { 10 | 11 | /** 12 | * 凭据名称 13 | */ 14 | String getCredenceName(); 15 | 16 | /** 17 | * 密码或者是其他的验证码之类的 18 | */ 19 | String getCredenceCode(); 20 | } 21 | -------------------------------------------------------------------------------- /guns-order/src/test/java/com/stylefeng/guns/GunsRestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import com.stylefeng.guns.rest.OrderApplication; 4 | import com.stylefeng.guns.rest.common.util.FTPUtil; 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | import org.springframework.test.context.junit4.SpringRunner; 10 | 11 | @RunWith(SpringRunner.class) 12 | @SpringBootTest(classes = OrderApplication.class) 13 | public class GunsRestApplicationTests { 14 | 15 | @Autowired 16 | private FTPUtil ftpUtil; 17 | 18 | @Test 19 | public void contextLoads() { 20 | String fileStrByAddress = ftpUtil.getFileStrByAddress("seats/123214.json"); 21 | System.out.println(fileStrByAddress); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/GunsRestApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication(scanBasePackages = {"com.stylefeng.guns"}) 7 | public class GunsRestApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(GunsRestApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/GunsRestServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsRestServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(GunsRestApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.stylefeng.guns.rest.common.persistence.model.User; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author stylefeng 12 | * @since 2017-08-23 13 | */ 14 | public interface UserMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * MybatisPlus配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017年8月23日12:51:41 13 | */ 14 | @Configuration 15 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.*.dao", "com.stylefeng.guns.rest.common.persistence.dao"}) 16 | public class MybatisPlusConfig { 17 | 18 | /** 19 | * mybatis-plus分页插件 20 | */ 21 | @Bean 22 | public PaginationInterceptor paginationInterceptor() { 23 | return new PaginationInterceptor(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.controller.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 认证的响应结果 7 | * 8 | * @author fengshuonan 9 | * @Date 2017/8/24 13:58 10 | */ 11 | public class AuthResponse implements Serializable { 12 | 13 | private static final long serialVersionUID = 1250166508152483573L; 14 | 15 | /** 16 | * jwt token 17 | */ 18 | private final String token; 19 | 20 | /** 21 | * 用于客户端混淆md5加密 22 | */ 23 | private final String randomKey; 24 | 25 | public AuthResponse(String token, String randomKey) { 26 | this.token = token; 27 | this.randomKey = randomKey; 28 | } 29 | 30 | public String getToken() { 31 | return this.token; 32 | } 33 | 34 | public String getRandomKey() { 35 | return randomKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/BaseTransferEntity.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.converter; 2 | 3 | /** 4 | * 基础的传输bean 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 15:52 8 | */ 9 | public class BaseTransferEntity { 10 | 11 | private String object; //base64编码的json字符串 12 | 13 | private String sign; //签名 14 | 15 | public String getObject() { 16 | return object; 17 | } 18 | 19 | public void setObject(String object) { 20 | this.object = object; 21 | } 22 | 23 | public String getSign() { 24 | return sign; 25 | } 26 | 27 | public void setSign(String sign) { 28 | this.sign = sign; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/security/DataSecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security; 2 | 3 | /** 4 | *
 5 |  * 信息传递的保护措施(传递的数据为json)
 6 |  *
 7 |  * 说明:
 8 |  * 可以根据实际开发时的需要,编写自己的数据加密方案,只需实现此类,并在WebConfig下配置您所编写的实现类即可
 9 |  * 
10 | * 11 | * @author fengshuonan 12 | * @date 2017-09-18 20:41 13 | */ 14 | public interface DataSecurityAction { 15 | 16 | /** 17 | * 执行数据的保护措施 18 | * 19 | * @author stylefeng 20 | * @Date 2017/9/18 20:42 21 | */ 22 | String doAction(String beProtected); 23 | 24 | /** 25 | * 解除保护 26 | * 27 | * @author stylefeng 28 | * @Date 2017/9/18 20:45 29 | */ 30 | String unlock(String securityCode); 31 | } 32 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/security/impl/Base64SecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security.impl; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.security.DataSecurityAction; 4 | import org.springframework.util.Base64Utils; 5 | 6 | /** 7 | * 对数据进行base64编码的方式 8 | * 9 | * @author fengshuonan 10 | * @date 2017-09-18 20:43 11 | */ 12 | public class Base64SecurityAction implements DataSecurityAction { 13 | 14 | @Override 15 | public String doAction(String beProtected) { 16 | return Base64Utils.encodeToString(beProtected.getBytes()); 17 | } 18 | 19 | @Override 20 | public String unlock(String securityCode) { 21 | byte[] bytes = Base64Utils.decodeFromString(securityCode); 22 | return new String(bytes); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/IReqValidator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.validator.dto.Credence; 4 | 5 | /** 6 | *

验证请求/auth接口时,请求参数的正确性

7 | *

8 | *

如果想拓展验证方法只需实现这个接口,然后在AuthenticationRestController类中注意相应实现的本接口的类即可

9 | * 10 | * @author fengshuonan 11 | * @date 2017-08-23 11:48 12 | */ 13 | public interface IReqValidator { 14 | 15 | /** 16 | * 通过请求参数验证 17 | * 18 | * @author fengshuonan 19 | * @Date 2017/8/23 11:49 20 | */ 21 | boolean validate(Credence credence); 22 | } 23 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/dto/Credence.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator.dto; 2 | 3 | /** 4 | * 验证的凭据 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-27 13:27 8 | */ 9 | public interface Credence { 10 | 11 | /** 12 | * 凭据名称 13 | */ 14 | String getCredenceName(); 15 | 16 | /** 17 | * 密码或者是其他的验证码之类的 18 | */ 19 | String getCredenceCode(); 20 | } 21 | -------------------------------------------------------------------------------- /guns-rest/src/main/java/com/stylefeng/guns/rest/modular/example/ExampleController.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.example; 2 | 3 | import com.stylefeng.guns.rest.common.SimpleObject; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * 常规控制器 11 | * 12 | * @author fengshuonan 13 | * @date 2017-08-23 16:02 14 | */ 15 | @Controller 16 | @RequestMapping("/hello") 17 | public class ExampleController { 18 | 19 | @RequestMapping("") 20 | public ResponseEntity hello(@RequestBody SimpleObject simpleObject) { 21 | System.out.println(simpleObject.getUser()); 22 | return ResponseEntity.ok("请求成功!"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-rest/src/test/java/com/stylefeng/guns/GunsRestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsRestApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-sso-plugin/src/main/java/com/stylefeng/sso/plugin/api/AuthApi.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.sso.plugin.api; 2 | 3 | import com.stylefeng.sso.plugin.model.LoginUser; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 定义shirorealm所需数据的接口 9 | * 10 | * @author fengshuonan 11 | * @date 2016年12月5日 上午10:23:34 12 | */ 13 | public interface AuthApi { 14 | 15 | /** 16 | * 根据系统用户获取Shiro的用户 17 | * 18 | * @param userId 用户id 19 | */ 20 | LoginUser getLoginUser(Integer userId); 21 | 22 | /** 23 | * 获取权限列表通过角色id 24 | * 25 | * @param roleId 角色id 26 | */ 27 | List findPermissionsByRoleId(Integer roleId); 28 | 29 | /** 30 | * 根据角色id获取角色名称 31 | * 32 | * @param roleId 角色id 33 | */ 34 | String findRoleNameByRoleId(Integer roleId); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /guns-sso-plugin/src/main/java/com/stylefeng/sso/plugin/cache/ClientCache.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.sso.plugin.cache; 2 | 3 | /** 4 | * sso客户端缓存 5 | * 6 | * @author fengshuonan 7 | * @date 2018-02-04 14:17 8 | */ 9 | public interface ClientCache { 10 | 11 | /** 12 | * 判断是否存在失效的token 13 | */ 14 | boolean containsInvalidKey(String key); 15 | 16 | /** 17 | * 添加失效的缓存 18 | */ 19 | void addInvalidKey(String key); 20 | 21 | /** 22 | * 删除失效的缓存 23 | */ 24 | void removeInvalidKey(String key); 25 | } 26 | -------------------------------------------------------------------------------- /guns-sso-plugin/src/main/java/com/stylefeng/sso/plugin/config/SsoAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.sso.plugin.config; 2 | 3 | import com.stylefeng.sso.plugin.api.SsoApi; 4 | import com.stylefeng.sso.plugin.util.SsoSpringContextHolder; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * sso自动配置 10 | * 11 | * @author fengshuonan 12 | * @date 2018-02-04 12:16 13 | */ 14 | @Configuration 15 | public class SsoAutoConfiguration { 16 | 17 | @Bean 18 | public SsoSpringContextHolder springContextHolder() { 19 | return new SsoSpringContextHolder(); 20 | } 21 | 22 | @Bean 23 | public SsoApi ssoAuthApi() { 24 | return new SsoApi(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /guns-sso-plugin/src/main/java/com/stylefeng/sso/plugin/model/enums/ResponseStatus.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.sso.plugin.model.enums; 2 | 3 | /** 4 | * 响应结果的枚举 5 | * 6 | * @author fengshuonan 7 | * @date 2018-02-04 12:01 8 | */ 9 | public enum ResponseStatus { 10 | 11 | SUCCESS(200, "成功"), 12 | WRONG_TOKEN(600, "token错误"); 13 | 14 | Integer code; 15 | String message; 16 | 17 | ResponseStatus(Integer code, String message) { 18 | this.code = code; 19 | this.message = message; 20 | } 21 | 22 | public Integer getCode() { 23 | return code; 24 | } 25 | 26 | public void setCode(Integer code) { 27 | this.code = code; 28 | } 29 | 30 | public String getMessage() { 31 | return message; 32 | } 33 | 34 | public void setMessage(String message) { 35 | this.message = message; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guns-sso-plugin/src/main/java/com/stylefeng/sso/plugin/properties/SsoProperties.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.sso.plugin.properties; 2 | 3 | /** 4 | * sso配置 5 | * 6 | * @author fengshuonan 7 | * @date 2018-02-03 20:53 8 | */ 9 | public class SsoProperties { 10 | 11 | public static final String BEETLCONF_PREFIX = "sso"; 12 | 13 | /** 14 | * sso服务器的地址,以/结尾(不支持携带参数的url) 15 | */ 16 | private String serverUrl; 17 | 18 | public String getServerUrl() { 19 | return serverUrl; 20 | } 21 | 22 | public void setServerUrl(String serverUrl) { 23 | this.serverUrl = serverUrl; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guns-sso-plugin/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 2 | com.stylefeng.sso.plugin.config.SsoAutoConfiguration -------------------------------------------------------------------------------- /guns-sso-server/src/main/java/com/stylefeng/sso/server/SsoServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.sso.server; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 6 | 7 | /** 8 | * 单点登录服务器 9 | * 10 | * @author stylefeng 11 | * @Date 2018年2月3日15:32:21 12 | */ 13 | @SpringBootApplication 14 | @EnableAspectJAutoProxy 15 | public class SsoServerApplication { 16 | 17 | public static void main(String[] args) { 18 | SpringApplication.run(SsoServerApplication.class, args); 19 | } 20 | } -------------------------------------------------------------------------------- /guns-sso-server/src/main/java/com/stylefeng/sso/server/modular/mapper/SysUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.sso.server.modular.mapper; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.stylefeng.sso.server.modular.entity.SysUser; 5 | 6 | /** 7 | *

8 | * 用户表 Mapper 接口 9 | *

10 | * 11 | * @author fengshuonan 12 | * @since 2018-08-29 13 | */ 14 | public interface SysUserMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-sso-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8000 3 | servlet: 4 | context-path: /sso 5 | 6 | spring: 7 | application: 8 | name: guns-sso-server 9 | profiles: 10 | active: local 11 | mvc: 12 | static-path-pattern: /static/** 13 | view: 14 | prefix: /WEB-INF/view 15 | datasource: 16 | url: jdbc:mysql://127.0.0.1:3306/sso_server?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=UTC 17 | username: root 18 | password: root 19 | aop: 20 | auto: true 21 | proxy-target-class: true 22 | 23 | mybatis-plus: 24 | typeAliasesPackage: com.stylefeng.sso.server.modular.entity 25 | 26 | log: 27 | path: sso-server -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/favicon.ico -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /guns-sso-server/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuhuiAndroid/cat-movie/b2f88ad311e34e515aa653ef8bf6e9a90b7e092f/guns-sso-server/src/main/webapp/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/UserApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication(scanBasePackages = {"com.stylefeng.guns"}) 8 | @EnableDubboConfiguration 9 | public class UserApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(UserApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/UserServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class UserServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(UserApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/MoocUserTMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.MoocUserT; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 用户表 Mapper 接口 9 | *

10 | * 11 | * @author jiangzh 12 | * @since 2018-10-12 13 | */ 14 | public interface MoocUserTMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.stylefeng.guns.rest.common.persistence.model.User; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author stylefeng 12 | * @since 2017-08-23 13 | */ 14 | public interface UserMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * MybatisPlus配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017年8月23日12:51:41 13 | */ 14 | @Configuration 15 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.*.dao", "com.stylefeng.guns.rest.common.persistence.dao"}) 16 | public class MybatisPlusConfig { 17 | 18 | /** 19 | * mybatis-plus分页插件 20 | */ 21 | @Bean 22 | public PaginationInterceptor paginationInterceptor() { 23 | return new PaginationInterceptor(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.controller.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 认证的响应结果 7 | * 8 | * @author fengshuonan 9 | * @Date 2017/8/24 13:58 10 | */ 11 | public class AuthResponse implements Serializable { 12 | 13 | private static final long serialVersionUID = 1250166508152483573L; 14 | 15 | /** 16 | * jwt token 17 | */ 18 | private final String token; 19 | 20 | /** 21 | * 用于客户端混淆md5加密 22 | */ 23 | private final String randomKey; 24 | 25 | public AuthResponse(String token, String randomKey) { 26 | this.token = token; 27 | this.randomKey = randomKey; 28 | } 29 | 30 | public String getToken() { 31 | return this.token; 32 | } 33 | 34 | public String getRandomKey() { 35 | return randomKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/BaseTransferEntity.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.converter; 2 | 3 | /** 4 | * 基础的传输bean 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 15:52 8 | */ 9 | public class BaseTransferEntity { 10 | 11 | private String object; //base64编码的json字符串 12 | 13 | private String sign; //签名 14 | 15 | public String getObject() { 16 | return object; 17 | } 18 | 19 | public void setObject(String object) { 20 | this.object = object; 21 | } 22 | 23 | public String getSign() { 24 | return sign; 25 | } 26 | 27 | public void setSign(String sign) { 28 | this.sign = sign; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/modular/auth/security/DataSecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security; 2 | 3 | /** 4 | *
 5 |  * 信息传递的保护措施(传递的数据为json)
 6 |  *
 7 |  * 说明:
 8 |  * 可以根据实际开发时的需要,编写自己的数据加密方案,只需实现此类,并在WebConfig下配置您所编写的实现类即可
 9 |  * 
10 | * 11 | * @author fengshuonan 12 | * @date 2017-09-18 20:41 13 | */ 14 | public interface DataSecurityAction { 15 | 16 | /** 17 | * 执行数据的保护措施 18 | * 19 | * @author stylefeng 20 | * @Date 2017/9/18 20:42 21 | */ 22 | String doAction(String beProtected); 23 | 24 | /** 25 | * 解除保护 26 | * 27 | * @author stylefeng 28 | * @Date 2017/9/18 20:45 29 | */ 30 | String unlock(String securityCode); 31 | } 32 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/modular/auth/security/impl/Base64SecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security.impl; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.security.DataSecurityAction; 4 | import org.springframework.util.Base64Utils; 5 | 6 | /** 7 | * 对数据进行base64编码的方式 8 | * 9 | * @author fengshuonan 10 | * @date 2017-09-18 20:43 11 | */ 12 | public class Base64SecurityAction implements DataSecurityAction { 13 | 14 | @Override 15 | public String doAction(String beProtected) { 16 | return Base64Utils.encodeToString(beProtected.getBytes()); 17 | } 18 | 19 | @Override 20 | public String unlock(String securityCode) { 21 | byte[] bytes = Base64Utils.decodeFromString(securityCode); 22 | return new String(bytes); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/IReqValidator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.validator.dto.Credence; 4 | 5 | /** 6 | *

验证请求/auth接口时,请求参数的正确性

7 | *

8 | *

如果想拓展验证方法只需实现这个接口,然后在AuthenticationRestController类中注意相应实现的本接口的类即可

9 | * 10 | * @author fengshuonan 11 | * @date 2017-08-23 11:48 12 | */ 13 | public interface IReqValidator { 14 | 15 | /** 16 | * 通过请求参数验证 17 | * 18 | * @author fengshuonan 19 | * @Date 2017/8/23 11:49 20 | */ 21 | boolean validate(Credence credence); 22 | } 23 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/dto/Credence.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.validator.dto; 2 | 3 | /** 4 | * 验证的凭据 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-27 13:27 8 | */ 9 | public interface Credence { 10 | 11 | /** 12 | * 凭据名称 13 | */ 14 | String getCredenceName(); 15 | 16 | /** 17 | * 密码或者是其他的验证码之类的 18 | */ 19 | String getCredenceCode(); 20 | } 21 | -------------------------------------------------------------------------------- /guns-user/src/main/java/com/stylefeng/guns/rest/modular/example/ExampleController.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.example; 2 | 3 | import com.stylefeng.guns.rest.common.SimpleObject; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | /** 10 | * 常规控制器 11 | * 12 | * @author fengshuonan 13 | * @date 2017-08-23 16:02 14 | */ 15 | @Controller 16 | @RequestMapping("/hello") 17 | public class ExampleController { 18 | 19 | @RequestMapping("") 20 | public ResponseEntity hello(@RequestBody SimpleObject simpleObject) { 21 | System.out.println(simpleObject.getUser()); 22 | return ResponseEntity.ok("请求成功!"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /guns-user/src/test/java/com/stylefeng/guns/GunsRestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsRestApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | --------------------------------------------------------------------------------