├── .gitignore ├── LICENSE ├── README.md ├── ginyi-springboot ├── .gitignore ├── .idea │ ├── .gitignore │ ├── compiler.xml │ ├── encodings.xml │ ├── inspectionProfiles │ │ └── Project_Default.xml │ ├── jarRepositories.xml │ ├── misc.xml │ └── vcs.xml ├── README.md ├── ginyi-common │ ├── ginyi-common-annotation │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi.common.annotation │ │ │ ├── Anonymous.java │ │ │ ├── CreateBy.java │ │ │ ├── CreateTime.java │ │ │ ├── Log.java │ │ │ ├── RepeatSubmit.java │ │ │ ├── UpdateBy.java │ │ │ └── UpdateTime.java │ ├── ginyi-common-constants │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── common │ │ │ └── constant │ │ │ ├── CacheConstants.java │ │ │ ├── CommonMessageConstants.java │ │ │ ├── HttpStatus.java │ │ │ └── UserConstants.java │ ├── ginyi-common-enums │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── common │ │ │ └── enums │ │ │ ├── BusinessStatus.java │ │ │ ├── BusinessType.java │ │ │ ├── HttpMethod.java │ │ │ └── OperatorType.java │ ├── ginyi-common-exception │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── common │ │ │ └── exception │ │ │ ├── CommonException.java │ │ │ ├── UnPermissionException.java │ │ │ ├── UserPasswordNotMatchException.java │ │ │ ├── UserPasswordRetryLimitExceedException.java │ │ │ └── handler │ │ │ └── GlobalExceptionHandler.java │ ├── ginyi-common-mysql │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── common │ │ │ └── mysql │ │ │ ├── MyPage.java │ │ │ ├── config │ │ │ └── MyBatisPlusInterceptorConfig.java │ │ │ ├── handler │ │ │ ├── JacksonArrayTypeHandler.java │ │ │ └── MyMetaObjectHandler.java │ │ │ └── interceptor │ │ │ └── MyInterceptor.java │ ├── ginyi-common-redis │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── common │ │ │ └── redis │ │ │ ├── cache │ │ │ └── RedisCache.java │ │ │ └── config │ │ │ └── RedisConfig.java │ ├── ginyi-common-result │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── common │ │ │ └── result │ │ │ ├── CommonResult.java │ │ │ └── StateCode.java │ ├── ginyi-common-swagger │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── common │ │ │ └── swagger │ │ │ ├── AddGroup.java │ │ │ ├── Swagger2Config.java │ │ │ └── UpdateGroup.java │ ├── ginyi-common-utils │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── common │ │ │ └── utils │ │ │ ├── Constants.java │ │ │ ├── DateUtils.java │ │ │ ├── EmailUtils.java │ │ │ ├── LogUtils.java │ │ │ ├── LunarCalendarUtil.java │ │ │ ├── MessageUtils.java │ │ │ ├── NumberUtils.java │ │ │ ├── ServletUtils.java │ │ │ ├── StringUtils.java │ │ │ ├── Threads.java │ │ │ ├── enums │ │ │ └── UserStatus.java │ │ │ ├── http │ │ │ ├── HttpHelper.java │ │ │ └── HttpUtils.java │ │ │ ├── ip │ │ │ ├── AddressUtils.java │ │ │ └── IpUtils.java │ │ │ ├── spring │ │ │ └── SpringUtils.java │ │ │ ├── text │ │ │ ├── CharsetKit.java │ │ │ ├── Convert.java │ │ │ └── StrFormatter.java │ │ │ └── uuid │ │ │ ├── IdUtils.java │ │ │ └── UUID.java │ └── pom.xml ├── ginyi-framework │ ├── ginyi-framework-core │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── framework │ │ │ └── core │ │ │ └── config │ │ │ ├── AppConfig.java │ │ │ └── GinyiConfig.java │ ├── ginyi-framework-security │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── framework │ │ │ └── security │ │ │ ├── aspectj │ │ │ └── LogAspect.java │ │ │ ├── config │ │ │ ├── ResourcesConfig.java │ │ │ ├── SecurityConfig.java │ │ │ └── ThreadPoolConfig.java │ │ │ ├── context │ │ │ ├── AuthenticationContextHolder.java │ │ │ └── PermissionContextHolder.java │ │ │ ├── filter │ │ │ ├── JwtAuthenticationTokenFilter.java │ │ │ ├── PropertyPreExcludeFilter.java │ │ │ └── RepeatedlyRequestWrapper.java │ │ │ ├── handle │ │ │ ├── AuthenticationEntryPointImpl.java │ │ │ └── LogoutSuccessHandlerImpl.java │ │ │ ├── interceptor │ │ │ ├── PreviewEnvInterceptor.java │ │ │ ├── RepeatSubmitInterceptor.java │ │ │ └── impl │ │ │ │ └── SameUrlDataInterceptor.java │ │ │ ├── manager │ │ │ ├── AsyncManager.java │ │ │ └── factory │ │ │ │ └── AsyncFactory.java │ │ │ ├── properties │ │ │ └── PermitAllUrlProperties.java │ │ │ ├── service │ │ │ ├── ISysNoticeServiceImpl.java │ │ │ ├── MonitorServiceImpl.java │ │ │ ├── PermissionService.java │ │ │ ├── SysConfigServiceImpl.java │ │ │ ├── SysDeptServiceImpl.java │ │ │ ├── SysLogServiceImpl.java │ │ │ ├── SysLoginLogServiceImpl.java │ │ │ ├── SysLoginServiceImpl.java │ │ │ ├── SysMenuServiceImpl.java │ │ │ ├── SysMonitorServiceImpl.java │ │ │ ├── SysOperationLogServiceImpl.java │ │ │ ├── SysPasswordServiceImpl.java │ │ │ ├── SysPermissionServiceImpl.java │ │ │ ├── SysPostServiceImpl.java │ │ │ ├── SysRoleServiceImpl.java │ │ │ ├── SysUserServiceImpl.java │ │ │ ├── SysVerifyServiceImpl.java │ │ │ ├── TokenServiceImpl.java │ │ │ └── UserDetailsServiceImpl.java │ │ │ └── utils │ │ │ └── SecurityUtils.java │ ├── ginyi-framework-websocket │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── ginyi │ │ │ └── framework │ │ │ └── websocket │ │ │ ├── WebSocket.java │ │ │ └── config │ │ │ └── WebSocketConfig.java │ └── pom.xml ├── ginyi-server │ ├── ginyi-server-admin │ │ ├── Dockerfile │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── ginyi │ │ │ │ └── server │ │ │ │ └── admin │ │ │ │ ├── AdminApplication.java │ │ │ │ ├── controller │ │ │ │ ├── SysDeptController.java │ │ │ │ ├── SysLogController.java │ │ │ │ ├── SysLoginController.java │ │ │ │ ├── SysMenuController.java │ │ │ │ ├── SysMonitorController.java │ │ │ │ ├── SysNoticeController.java │ │ │ │ ├── SysOnlineController.java │ │ │ │ ├── SysPostController.java │ │ │ │ ├── SysRoleController.java │ │ │ │ ├── SysUserController.java │ │ │ │ └── SysVerifyController.java │ │ │ │ └── swagger │ │ │ │ └── AdminSwagger2Config.java │ │ │ └── resources │ │ │ ├── config │ │ │ └── application.yml │ │ │ └── static │ │ │ └── i18n │ │ │ └── messages.properties │ ├── ginyi-server-common │ │ └── pom.xml │ ├── ginyi-server-web │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── ginyi │ │ │ │ └── server │ │ │ │ └── web │ │ │ │ ├── WebApplication.java │ │ │ │ ├── controller │ │ │ │ └── Test.java │ │ │ │ └── swagger │ │ │ │ └── WebSwagger2Config.java │ │ │ └── resources │ │ │ └── config │ │ │ └── application.yml │ └── pom.xml ├── ginyi-springboot.iml ├── ginyi-system │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── ginyi │ │ │ └── system │ │ │ ├── domain │ │ │ ├── BaseEntity.java │ │ │ ├── LoginUser.java │ │ │ ├── Sys.java │ │ │ ├── SysConfig.java │ │ │ ├── SysCpu.java │ │ │ ├── SysDept.java │ │ │ ├── SysFile.java │ │ │ ├── SysJvm.java │ │ │ ├── SysLogLogin.java │ │ │ ├── SysLogOperation.java │ │ │ ├── SysMemory.java │ │ │ ├── SysMenu.java │ │ │ ├── SysNotice.java │ │ │ ├── SysPost.java │ │ │ ├── SysRole.java │ │ │ ├── SysServer.java │ │ │ ├── SysUser.java │ │ │ └── model │ │ │ │ ├── dto │ │ │ │ ├── CacheDto.java │ │ │ │ ├── DeptDto.java │ │ │ │ ├── LoginDto.java │ │ │ │ ├── MenuDto.java │ │ │ │ ├── NoticeDto.java │ │ │ │ ├── PostDto.java │ │ │ │ ├── RegisterDto.java │ │ │ │ ├── RoleDto.java │ │ │ │ └── UserDto.java │ │ │ │ └── vo │ │ │ │ ├── BaseVo.java │ │ │ │ ├── CacheKeyVo.java │ │ │ │ ├── CacheVo.java │ │ │ │ ├── DeptVo.java │ │ │ │ ├── LoginVo.java │ │ │ │ ├── NoticeVo.java │ │ │ │ ├── PostVo.java │ │ │ │ ├── RoleVo.java │ │ │ │ ├── SessionUserVo.java │ │ │ │ └── UserVo.java │ │ │ ├── mapper │ │ │ ├── SysConfigMapper.java │ │ │ ├── SysDeptMapper.java │ │ │ ├── SysLogininforMapper.java │ │ │ ├── SysMenuMapper.java │ │ │ ├── SysNoticeMapper.java │ │ │ ├── SysOperLogMapper.java │ │ │ ├── SysPostMapper.java │ │ │ ├── SysRoleMapper.java │ │ │ └── SysUserMapper.java │ │ │ └── service │ │ │ ├── ISysConfigService.java │ │ │ ├── ISysDeptService.java │ │ │ ├── ISysLogService.java │ │ │ ├── ISysLoginService.java │ │ │ ├── ISysLogininforService.java │ │ │ ├── ISysMenuService.java │ │ │ ├── ISysMonitorService.java │ │ │ ├── ISysNoticeService.java │ │ │ ├── ISysOnlineService.java │ │ │ ├── ISysOperLogService.java │ │ │ ├── ISysPasswordService.java │ │ │ ├── ISysPermissionService.java │ │ │ ├── ISysPostService.java │ │ │ ├── ISysRoleService.java │ │ │ ├── ISysUserService.java │ │ │ ├── ITokenService.java │ │ │ └── IVerifyService.java │ │ └── resources │ │ ├── application.yml │ │ ├── logging-config.xml │ │ └── mapper │ │ ├── SysDeptMapper.xml │ │ ├── SysMenuMapper.xml │ │ ├── SysNoticeMapper.xml │ │ ├── SysPostMapper.xml │ │ ├── SysRoleMapper.xml │ │ └── SysUserMapper.xml ├── pom.xml └── sql │ ├── ginyi-spring-vue-mongo.sql │ └── ginyi-spring-vue-mysql.sql └── ginyi-vue3 ├── .editorconfig ├── .env.develop ├── .env.production ├── .gitignore ├── README.md ├── index.html ├── package.json ├── public ├── favicon.ico └── vite.svg ├── src ├── App.vue ├── api │ ├── controller │ │ ├── deptController.ts │ │ ├── logController.ts │ │ ├── menuController.ts │ │ ├── monitorController.ts │ │ ├── onlineController.ts │ │ ├── postController.ts │ │ ├── roleController.ts │ │ └── userController.ts │ ├── index.ts │ └── useRequest.tsx ├── assets │ ├── 404 │ │ ├── 404.png │ │ └── 404_cloud.png │ ├── bg-light.svg │ ├── home-bg.svg │ └── img │ │ └── logo.jpg ├── components │ ├── commonForm │ │ ├── index.vue │ │ ├── props.ts │ │ └── useCommonForm.ts │ ├── commonModal │ │ ├── index.vue │ │ ├── props.ts │ │ └── useCommonModal.ts │ ├── commonTable │ │ ├── index.vue │ │ ├── props.ts │ │ └── useCommonTable.ts │ └── monacoEditor │ │ ├── index.vue │ │ └── monacoEditorType.ts ├── config │ ├── console.log.ts │ ├── eventBus.ts │ └── setting.ts ├── dictionary │ ├── useDynamicDict.ts │ └── useStaticDict.ts ├── directives │ ├── draggable.ts │ ├── focus.ts │ ├── index.ts │ └── loading.ts ├── enums │ ├── storeKeyEnums.ts │ └── tableActionEnums.ts ├── hooks │ ├── useColor.ts │ ├── useCommonColums.ts │ ├── useDebthro.ts │ ├── useFormat.ts │ ├── useMenu.ts │ ├── useObject.ts │ ├── usePagination.ts │ ├── usePending.ts │ ├── useStorage.ts │ └── useTree.ts ├── interface │ └── modules │ │ └── system │ │ └── index.ts ├── layout │ ├── header │ │ ├── breadcrumb.vue │ │ ├── index.vue │ │ └── personnel.vue │ ├── index.vue │ ├── logo │ │ └── index.vue │ ├── menu │ │ └── index.vue │ ├── tabs │ │ └── index.vue │ └── theme │ │ └── index.vue ├── main.ts ├── plugins │ ├── naive-ui │ │ └── common.tsx │ └── pinia │ │ └── piniaPlugin.ts ├── router │ └── index.ts ├── store │ ├── index.ts │ └── modules │ │ ├── useRouterStore.ts │ │ ├── useSystemStore.ts │ │ └── useUserStore.ts ├── style │ └── index.css ├── views │ ├── 404 │ │ └── index.vue │ ├── home │ │ └── index.vue │ ├── login │ │ ├── index.vue │ │ ├── loginForm.vue │ │ └── registerForm.vue │ └── pages │ │ ├── monitor │ │ ├── cache │ │ │ └── index.vue │ │ ├── cacheList │ │ │ ├── columns.tsx │ │ │ └── index.vue │ │ ├── data │ │ │ └── index.vue │ │ ├── online │ │ │ ├── columns.tsx │ │ │ └── index.vue │ │ ├── service │ │ │ ├── columns.tsx │ │ │ └── index.vue │ │ └── task │ │ │ └── index.vue │ │ ├── order │ │ └── index.vue │ │ ├── product │ │ └── index.vue │ │ ├── system │ │ ├── department │ │ │ ├── columns.tsx │ │ │ ├── deptEditForm.vue │ │ │ ├── deptQueryForm.vue │ │ │ └── index.vue │ │ ├── dict │ │ │ └── index.vue │ │ ├── log │ │ │ ├── login │ │ │ │ ├── columns.tsx │ │ │ │ └── index.vue │ │ │ └── operation │ │ │ │ ├── columns.tsx │ │ │ │ ├── index.vue │ │ │ │ └── useColumns.ts │ │ ├── menu │ │ │ ├── columns.tsx │ │ │ ├── index.vue │ │ │ ├── menuEditForm.vue │ │ │ ├── menuQueryForm.vue │ │ │ └── useColumns.ts │ │ ├── notice │ │ │ └── index.vue │ │ ├── params │ │ │ └── index.vue │ │ ├── position │ │ │ ├── columns.tsx │ │ │ ├── index.vue │ │ │ ├── postEditForm.vue │ │ │ └── postQueryForm.vue │ │ ├── role │ │ │ ├── columns.tsx │ │ │ ├── index.vue │ │ │ ├── roleEditForm.vue │ │ │ └── roleQueryForm.vue │ │ └── user │ │ │ ├── columns.tsx │ │ │ ├── index.vue │ │ │ ├── useColumns.ts │ │ │ ├── userEditForm.vue │ │ │ └── userQueryForm.vue │ │ └── systools │ │ └── code │ │ └── index.vue └── vite-env.d.ts ├── tsconfig.json ├── tsconfig.node.json ├── vite.config.ts ├── web-types.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | ### gradle ### 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .settings/ 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | bin/ 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | rebel.xml 22 | /ginyi-springboot/.idea 23 | 24 | ### NetBeans ### 25 | nbproject/private/ 26 | build/ 27 | nbbuild/ 28 | nbdist/ 29 | .nb-gradle/ 30 | 31 | ### maven ### 32 | target/ 33 | *.war 34 | *.ear 35 | *.zip 36 | *.tar 37 | *.tar.gz 38 | *.versionsBackup 39 | 40 | ### vscode ### 41 | .vscode 42 | 43 | ### logs ### 44 | /logs/ 45 | *.log 46 | 47 | ### temp ignore ### 48 | *.cache 49 | *.diff 50 | *.patch 51 | *.tmp 52 | *.java~ 53 | *.properties~ 54 | *.xml~ 55 | 56 | ### system ignore ### 57 | .DS_Store 58 | Thumbs.db 59 | Servers 60 | .metadata 61 | 62 | 63 | /**/*.idea/** -------------------------------------------------------------------------------- /ginyi-springboot/.gitignore: -------------------------------------------------------------------------------- 1 | ### gradle ### 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .settings/ 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | bin/ 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | rebel.xml 22 | 23 | ### NetBeans ### 24 | nbproject/private/ 25 | build/ 26 | nbbuild/ 27 | nbdist/ 28 | .nb-gradle/ 29 | 30 | ### maven ### 31 | target/ 32 | *.war 33 | *.ear 34 | *.zip 35 | *.tar 36 | *.tar.gz 37 | *.versionsBackup 38 | 39 | ### vscode ### 40 | .vscode 41 | 42 | ### logs ### 43 | /logs/ 44 | *.log 45 | 46 | ### temp ignore ### 47 | *.cache 48 | *.diff 49 | *.patch 50 | *.tmp 51 | *.java~ 52 | *.properties~ 53 | *.xml~ 54 | 55 | ### system ignore ### 56 | .DS_Store 57 | Thumbs.db 58 | Servers 59 | .metadata 60 | -------------------------------------------------------------------------------- /ginyi-springboot/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # 默认忽略的文件 2 | /shelf/ 3 | /workspace.xml 4 | # 基于编辑器的 HTTP 客户端请求 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /ginyi-springboot/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /ginyi-springboot/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 34 | 35 | 39 | 40 | -------------------------------------------------------------------------------- /ginyi-springboot/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ginyi-springboot/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ginyi-springboot/README.md: -------------------------------------------------------------------------------- 1 | ### 项目地址 2 | 3 | 接口文档:http://114.132.120.190:8066/doc.html 4 | 5 | 代码仓库:https://gitee.com/Ginyi/ginyi-spring-vue 6 | 7 | 8 | 9 | ### 帮助文档 10 | 11 | - 没有~不想写文档...如果`Star`数量破`1k`,可以考虑一下! 12 | - 可以参考`Ruoyi`的文档 http://doc.ruoyi.vip/ 13 | 14 | 15 | 16 | ### 项目特色 17 | 18 | - 使用主流技术栈`SpringBoot`、`Mybatis-plus`、`Redis`、`MySQL`、`MongoDB`等,易上手! 19 | - 基于`SpringSecurity`安全框架实现`RBAC`的权限模式,易扩展易维护! 20 | - 基于`Maven`多模块,可在上层应用中创建多个服务!模块分明,各司其职! 21 | - 内置多个后台系统常用功能,搭配完善的接口文档: 22 | - 系统管理:`用户管理`、`部门管理`、`岗位管理`、`角色管理`、`菜单管理`等 23 | - 日志管理:`登录日志`、`操作日志`、`在线用户`等 24 | 25 | 26 | 27 | ### 前置知识 28 | 29 | **重点:**使用本项目时,你需要具备以下基础知识: 30 | 31 | 1. `SpringBoot`框架基础,熟悉`MVC`分层的开发模式! 32 | 2. `Maven`基础,掌握多模块项目下,服务间的依赖引用! 33 | 3. `Redis`、`MongoDB`中间件、`Mybatis`和`Mybatis-plus`等`ORM`框架的使用! 34 | 35 | 36 | 37 | ### 项目环境 38 | 39 | **注意:**使用本项目时,为了你能愉快地进行开发,请尽可能使用以下环境进行开发: 40 | 41 | 1. `JDK v1.8` 42 | 2. `Maven v3.6.3` 43 | 3. `MySQL v8.0` 44 | 4. `IntelliJ IDEA` 45 | 46 | 47 | 48 | ### 项目结构 49 | 50 | ```bash 51 | ginyi-springboot 52 | | 53 | ├─ ginyi-common # 通用模块 54 | │ ├─ ginyi-common-annotation # 通用注解 55 | │ ├─ ginyi-common-constants # 通用常量 56 | │ ├─ ginyi-common-enums # 通用枚举 57 | │ ├─ ginyi-common-exception # 通用异常处理 58 | │ ├─ ginyi-common-mysql # 通用MySql配置 59 | │ ├─ ginyi-common-redis # 通用Redis配置 60 | │ ├─ ginyi-common-result # 通用结果集 61 | │ ├─ ginyi-common-swagger # 通用在线接口文档配置 62 | │ └─ ginyi-common-utils # 通用工具类 63 | | 64 | ├─ ginyi-framework # 框架模块 65 | │ ├─ ginyi-framework-core # 框架核心 66 | │ ├─ ginyi-framework-security # 安全框架 67 | │ └─ ginyi-framework-websocket # 实时通讯框架 68 | | 69 | ├─ ginyi-server # 服务模块(对外提供api接口) 70 | │ ├─ ginyi-server-admin # 后台系统端(包含系统接口) 71 | │ ├─ ginyi-server-common # 通用服务 72 | │ └─ ginyi-server-web # 前台应用端 73 | | 74 | ├─ ginyi-system # 系统服务模块(包含yaml配置、系统Entity、系统Service、系统Mapper等) 75 | | 76 | └─ sql # 数据库文件 77 | ``` 78 | 79 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-annotation/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-common 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common-annotation 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | com.ginyi 22 | ginyi-common-enums 23 | ${ginyi.version} 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-annotation/src/main/java/ginyi.common.annotation/Anonymous.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 匿名访问不鉴权注解 7 | * 8 | * @author ruoyi 9 | */ 10 | @Target({ ElementType.METHOD, ElementType.TYPE }) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Documented 13 | public @interface Anonymous 14 | { 15 | } 16 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-annotation/src/main/java/ginyi.common.annotation/CreateBy.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 自动设置创建人 10 | */ 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target({ElementType.FIELD}) 13 | public @interface CreateBy { 14 | String value() default ""; 15 | } -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-annotation/src/main/java/ginyi.common.annotation/CreateTime.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 自动设置创建时间 10 | */ 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target({ElementType.FIELD}) 13 | public @interface CreateTime { 14 | String value() default ""; 15 | } -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-annotation/src/main/java/ginyi.common.annotation/Log.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.annotation; 2 | 3 | import ginyi.common.enums.BusinessType; 4 | import ginyi.common.enums.OperatorType; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * 自定义操作日志记录注解 10 | * 11 | * @author ruoyi 12 | */ 13 | @Target({ElementType.PARAMETER, ElementType.METHOD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Documented 16 | public @interface Log { 17 | /** 18 | * 模块 19 | */ 20 | public String title() default ""; 21 | 22 | /** 23 | * 功能 24 | */ 25 | public BusinessType businessType() default BusinessType.OTHER; 26 | 27 | /** 28 | * 操作人类别 29 | */ 30 | public OperatorType operatorType() default OperatorType.MANAGE; 31 | 32 | /** 33 | * 是否保存请求的参数 34 | */ 35 | public boolean isSaveRequestData() default true; 36 | 37 | /** 38 | * 是否保存响应的参数 39 | */ 40 | public boolean isSaveResponseData() default true; 41 | } 42 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-annotation/src/main/java/ginyi.common.annotation/RepeatSubmit.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 自定义注解防止表单重复提交 7 | * 8 | * @author ruoyi 9 | */ 10 | @Inherited 11 | @Target(ElementType.METHOD) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Documented 14 | public @interface RepeatSubmit { 15 | /** 16 | * 间隔时间(ms),小于此时间视为重复提交 17 | */ 18 | public int interval() default 5000; 19 | 20 | /** 21 | * 提示消息 22 | */ 23 | public String message() default "不允许重复提交,请稍候再试"; 24 | } 25 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-annotation/src/main/java/ginyi.common.annotation/UpdateBy.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 自动设置修改人 10 | */ 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target({ElementType.FIELD}) 13 | public @interface UpdateBy { 14 | String value() default ""; 15 | } 16 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-annotation/src/main/java/ginyi.common.annotation/UpdateTime.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 自动设置修改时间 10 | */ 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target({ElementType.FIELD}) 13 | public @interface UpdateTime { 14 | String value() default ""; 15 | } 16 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-constants/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-common 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common-constants 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-constants/src/main/java/ginyi/common/constant/HttpStatus.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.constant; 2 | 3 | /** 4 | * 返回状态码 5 | * 6 | * @author ruoyi 7 | */ 8 | public class HttpStatus 9 | { 10 | /** 11 | * 操作成功 12 | */ 13 | public static final int SUCCESS = 200; 14 | 15 | /** 16 | * 对象创建成功 17 | */ 18 | public static final int CREATED = 201; 19 | 20 | /** 21 | * 请求已经被接受 22 | */ 23 | public static final int ACCEPTED = 202; 24 | 25 | /** 26 | * 操作已经执行成功,但是没有返回数据 27 | */ 28 | public static final int NO_CONTENT = 204; 29 | 30 | /** 31 | * 资源已被移除 32 | */ 33 | public static final int MOVED_PERM = 301; 34 | 35 | /** 36 | * 重定向 37 | */ 38 | public static final int SEE_OTHER = 303; 39 | 40 | /** 41 | * 资源没有被修改 42 | */ 43 | public static final int NOT_MODIFIED = 304; 44 | 45 | /** 46 | * 参数列表错误(缺少,格式不匹配) 47 | */ 48 | public static final int BAD_REQUEST = 400; 49 | 50 | /** 51 | * 未授权 52 | */ 53 | public static final int UNAUTHORIZED = 401; 54 | 55 | /** 56 | * 访问受限,授权过期 57 | */ 58 | public static final int FORBIDDEN = 403; 59 | 60 | /** 61 | * 资源,服务未找到 62 | */ 63 | public static final int NOT_FOUND = 404; 64 | 65 | /** 66 | * 不允许的http方法 67 | */ 68 | public static final int BAD_METHOD = 405; 69 | 70 | /** 71 | * 资源冲突,或者资源被锁 72 | */ 73 | public static final int CONFLICT = 409; 74 | 75 | /** 76 | * 不支持的数据,媒体类型 77 | */ 78 | public static final int UNSUPPORTED_TYPE = 415; 79 | 80 | /** 81 | * 系统内部错误 82 | */ 83 | public static final int ERROR = 500; 84 | 85 | /** 86 | * 接口未实现 87 | */ 88 | public static final int NOT_IMPLEMENTED = 501; 89 | 90 | /** 91 | * 系统警告消息 92 | */ 93 | public static final int WARN = 601; 94 | } 95 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-enums/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-common 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common-enums 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-enums/src/main/java/ginyi/common/enums/BusinessStatus.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.enums; 2 | 3 | /** 4 | * 操作状态 5 | * 6 | * @author ruoyi 7 | */ 8 | public enum BusinessStatus { 9 | /** 10 | * 成功 11 | */ 12 | SUCCESS, 13 | 14 | /** 15 | * 失败 16 | */ 17 | FAIL, 18 | } 19 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-enums/src/main/java/ginyi/common/enums/BusinessType.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.enums; 2 | 3 | /** 4 | * 业务操作类型 5 | * 6 | * @author ruoyi 7 | */ 8 | public enum BusinessType { 9 | /** 10 | * 其它 11 | */ 12 | OTHER, 13 | 14 | /** 15 | * 新增 16 | */ 17 | INSERT, 18 | 19 | /** 20 | * 修改 21 | */ 22 | UPDATE, 23 | 24 | /** 25 | * 删除 26 | */ 27 | DELETE, 28 | 29 | /** 30 | * 授权 31 | */ 32 | GRANT, 33 | 34 | /** 35 | * 导出 36 | */ 37 | EXPORT, 38 | 39 | /** 40 | * 导入 41 | */ 42 | IMPORT, 43 | 44 | /** 45 | * 强退 46 | */ 47 | FORCE, 48 | 49 | /** 50 | * 生成代码 51 | */ 52 | GENCODE, 53 | 54 | /** 55 | * 清空数据 56 | */ 57 | CLEAN, 58 | } 59 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-enums/src/main/java/ginyi/common/enums/HttpMethod.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.enums; 2 | 3 | import org.springframework.lang.Nullable; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * 请求方式 10 | * 11 | * @author ruoyi 12 | */ 13 | public enum HttpMethod { 14 | GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; 15 | 16 | private static final Map mappings = new HashMap<>(16); 17 | 18 | static { 19 | for (HttpMethod httpMethod : values()) { 20 | mappings.put(httpMethod.name(), httpMethod); 21 | } 22 | } 23 | 24 | @Nullable 25 | public static HttpMethod resolve(@Nullable String method) { 26 | return (method != null ? mappings.get(method) : null); 27 | } 28 | 29 | public boolean matches(String method) { 30 | return (this == resolve(method)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-enums/src/main/java/ginyi/common/enums/OperatorType.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.enums; 2 | 3 | /** 4 | * 操作人类别 5 | * 6 | * @author ruoyi 7 | */ 8 | public enum OperatorType { 9 | /** 10 | * 其它 11 | */ 12 | OTHER, 13 | 14 | /** 15 | * 后台用户 16 | */ 17 | MANAGE, 18 | 19 | /** 20 | * 手机端用户 21 | */ 22 | MOBILE 23 | } 24 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-exception/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-common 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common-exception 13 | 14 | 15 | 16 | 17 | com.ginyi 18 | ginyi-common-result 19 | ${ginyi.version} 20 | 21 | 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter-web 26 | 27 | 28 | 29 | 30 | com.ginyi 31 | ginyi-common-constants 32 | ${ginyi.version} 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-exception/src/main/java/ginyi/common/exception/CommonException.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.exception; 2 | 3 | import ginyi.common.result.StateCode; 4 | import lombok.Data; 5 | 6 | /** 7 | * 通用的异常处理 8 | */ 9 | @Data 10 | public class CommonException extends RuntimeException{ 11 | 12 | private StateCode state; 13 | private Object data; 14 | 15 | public CommonException(StateCode state, Object data) { 16 | this.state = state; 17 | this.data = data; 18 | } 19 | 20 | public CommonException(StateCode state) { 21 | this.state = state; 22 | this.data = data; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-exception/src/main/java/ginyi/common/exception/UnPermissionException.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.exception; 2 | 3 | import ginyi.common.result.StateCode; 4 | import lombok.Data; 5 | 6 | /** 7 | * 没有对应的接口权限 8 | */ 9 | @Data 10 | public class UnPermissionException extends RuntimeException{ 11 | private static final long serialVersionUID = 1L; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-exception/src/main/java/ginyi/common/exception/UserPasswordNotMatchException.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.exception; 2 | 3 | /** 4 | * 用户密码不正确或不符合规范异常类 5 | */ 6 | public class UserPasswordNotMatchException extends RuntimeException{ 7 | private static final long serialVersionUID = 1L; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-exception/src/main/java/ginyi/common/exception/UserPasswordRetryLimitExceedException.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.exception; 2 | 3 | import ginyi.common.result.StateCode; 4 | import lombok.Data; 5 | 6 | /** 7 | * 用户错误最大次数异常类 8 | */ 9 | @Data 10 | public class UserPasswordRetryLimitExceedException extends RuntimeException { 11 | 12 | private static final long serialVersionUID = 1L; 13 | private StateCode state; 14 | private Object data; 15 | 16 | public UserPasswordRetryLimitExceedException(StateCode state, Object data) { 17 | this.state = state; 18 | this.data = data; 19 | } 20 | 21 | public UserPasswordRetryLimitExceedException(StateCode state) { 22 | this.state = state; 23 | this.data = data; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-mysql/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-common 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common-mysql 13 | 14 | 15 | 16 | 17 | mysql 18 | mysql-connector-java 19 | 20 | 21 | 22 | 23 | com.alibaba 24 | druid-spring-boot-starter 25 | 26 | 27 | 28 | 29 | org.mybatis.spring.boot 30 | mybatis-spring-boot-starter 31 | 32 | 33 | 34 | 35 | com.baomidou 36 | mybatis-plus-boot-starter 37 | 38 | 39 | 40 | com.fasterxml.jackson.core 41 | jackson-databind 42 | 43 | 44 | 45 | com.ginyi 46 | ginyi-common-constants 47 | ${ginyi.version} 48 | 49 | 50 | 51 | com.ginyi 52 | ginyi-common-annotation 53 | ${ginyi.version} 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-mysql/src/main/java/ginyi/common/mysql/MyPage.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.mysql; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import lombok.Data; 5 | 6 | /** 7 | * 分页参数有传,根据分页查询,没传,查询所有 8 | */ 9 | @Data 10 | public class MyPage { 11 | 12 | /** 13 | * 当前页 14 | */ 15 | private Long pageNum; 16 | /** 17 | * 每页条数 18 | */ 19 | private Long pageSize; 20 | /** 21 | * 是否进行分页 22 | */ 23 | private boolean isPage; 24 | 25 | public MyPage() { 26 | } 27 | 28 | public MyPage(Long page, Long pageSize) { 29 | if ((page != null && page > 0) && (pageSize != null && pageSize > 0)) { 30 | this.pageNum = page; 31 | this.pageSize = pageSize; 32 | this.isPage = true; 33 | }else { 34 | this.pageNum = 1L; 35 | this.pageSize = 10L; 36 | this.isPage = false; 37 | } 38 | } 39 | 40 | public Page getPage(){ 41 | return this.isPage ? new Page(this.pageNum, this.pageSize) : new Page().setSize(10000L); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-mysql/src/main/java/ginyi/common/mysql/config/MyBatisPlusInterceptorConfig.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.mysql.config; 2 | 3 | import com.baomidou.mybatisplus.annotation.DbType; 4 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; 5 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | @Configuration 10 | public class MyBatisPlusInterceptorConfig { 11 | 12 | @Bean 13 | public MybatisPlusInterceptor myBatisPlusInterceptor() { 14 | // 定义拦截器 15 | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); 16 | // 分页拦截器 17 | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); 18 | return interceptor; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-mysql/src/main/java/ginyi/common/mysql/handler/JacksonArrayTypeHandler.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.mysql.handler; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | import lombok.SneakyThrows; 7 | import lombok.extern.slf4j.Slf4j; 8 | 9 | import java.util.List; 10 | 11 | @Slf4j 12 | public class JacksonArrayTypeHandler extends AbstractJsonTypeHandler { 13 | 14 | private final Class type; 15 | 16 | private final ObjectMapper objectMapper; 17 | 18 | public JacksonArrayTypeHandler(Class type) { 19 | objectMapper = new ObjectMapper(); 20 | this.type = type; 21 | } 22 | 23 | 24 | @SneakyThrows 25 | @Override 26 | protected List parse(String json) { 27 | if (type.equals(List.class)) { 28 | return objectMapper.readValue(json, List.class); 29 | } else { 30 | return JSON.parseArray(json, type); 31 | } 32 | } 33 | 34 | @SneakyThrows 35 | @Override 36 | protected String toJson(List obj) { 37 | return objectMapper.writeValueAsString(obj); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-mysql/src/main/java/ginyi/common/mysql/handler/MyMetaObjectHandler.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.mysql.handler; 2 | 3 | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; 4 | import ginyi.common.constant.UserConstants; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.apache.ibatis.reflection.MetaObject; 7 | import org.springframework.stereotype.Component; 8 | import javax.annotation.Resource; 9 | import javax.servlet.http.HttpServletRequest; 10 | import java.util.Date; 11 | 12 | @Slf4j 13 | @Component 14 | public class MyMetaObjectHandler implements MetaObjectHandler { 15 | 16 | @Resource 17 | private HttpServletRequest request; 18 | 19 | /** 20 | * 插入时的填充策略 21 | * 22 | * @param metaObject 23 | */ 24 | @Override 25 | public void insertFill(MetaObject metaObject) { 26 | this.setFieldValByName("createBy", request.getAttribute(UserConstants.CURRENT_USER), metaObject); 27 | this.setFieldValByName("createTime", new Date(), metaObject); 28 | this.setFieldValByName("updateBy", request.getAttribute(UserConstants.CURRENT_USER), metaObject); 29 | this.setFieldValByName("updateTime", new Date(), metaObject); 30 | } 31 | 32 | /** 33 | * 更新时的填充策略 34 | * 35 | * @param metaObject 36 | */ 37 | @Override 38 | public void updateFill(MetaObject metaObject) { 39 | this.setFieldValByName("updateBy", request.getAttribute(UserConstants.CURRENT_USER), metaObject); 40 | this.setFieldValByName("updateTime", new Date(), metaObject); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-redis/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-common 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common-redis 13 | 14 | 15 | 16 | org.springframework.data 17 | spring-data-redis 18 | 19 | 20 | 21 | redis.clients 22 | jedis 23 | 24 | 25 | 26 | org.apache.commons 27 | commons-pool2 28 | 29 | 30 | 31 | com.alibaba.fastjson2 32 | fastjson2 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-result/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-common 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common-result 13 | 14 | 15 | 16 | 17 | io.springfox 18 | springfox-swagger2 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-result/src/main/java/ginyi/common/result/CommonResult.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.result; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @ApiModel(value = "结果类") 11 | public class CommonResult implements Serializable { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | @ApiModelProperty(value = "状态码") 16 | private Integer code; 17 | 18 | @ApiModelProperty(value = "状态信息") 19 | private String msg; 20 | 21 | @ApiModelProperty(value = "返回数据") 22 | private T data; 23 | 24 | /** 25 | * 返回格式 26 | * @param state 27 | * @param data 28 | * @param 29 | * @return 30 | */ 31 | private static CommonResult res(StateCode state, T data){ 32 | CommonResult commonResult = new CommonResult<>(); 33 | commonResult.setCode(state.getCode()); 34 | commonResult.setMsg(state.getMessage()); 35 | commonResult.setData(data); 36 | return commonResult; 37 | } 38 | 39 | /** 40 | * 成功的返回,不需要 data 41 | * @param 42 | * @return 43 | */ 44 | public static CommonResult success(){ 45 | return res(StateCode.SUCCESS, null); 46 | } 47 | 48 | /** 49 | * 成功的返回,需要 data 50 | * @param data 51 | * @param 52 | * @return 53 | */ 54 | public static CommonResult success(T data){ 55 | return res(StateCode.SUCCESS, data); 56 | } 57 | 58 | /** 59 | * 失败的返回,不需要 data 60 | * @param state 61 | * @return 62 | */ 63 | public static CommonResult error(StateCode state){ 64 | return res(state, null); 65 | } 66 | 67 | /** 68 | * 失败的返回,需要 data, 即错误信息 69 | * @param state 70 | * @param 71 | * @return 72 | */ 73 | public static CommonResult error(StateCode state, T data){ 74 | return res(state, data); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-result/src/main/java/ginyi/common/result/StateCode.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.result; 2 | 3 | 4 | public enum StateCode { 5 | 6 | SUCCESS(200, "操作成功"), 7 | 8 | ERROR_SYSTEM(5000, "系统异常"), 9 | ERROR_UNAUTHENTICATION(5001, "登陆授权异常"), 10 | ERROR_TIMEOUT_REQUEST(5002, "请求超时"), 11 | ERROR_TIMEOUT_TOKEN(5003, "无效令牌"), 12 | ERROR_INVALID_SIGN(5004, "无效签名"), 13 | ERROR_AUTHENTICATION_VALID(5005, "认证失败或令牌已过期"), 14 | ERROR_NOT_PERMISSION(5006, "权限不足"), 15 | ERROR_LIMITED(5007, "操作受限"), 16 | 17 | ERROR_BUSINESS(6000,"业务逻辑异常"), 18 | ERROR_PARAMS(6001,"参数校验错误"), 19 | ERROR_REQUEST_PARAMS(6002,"请求参数异常"), 20 | ERROR_PARAMS_SERVICE(6003,"参数逻辑校验错误"), 21 | ERROR_DATA_FORMAT(6004, "数据格式错误"), 22 | ERROR_EXIST(6005, "数据已存在"), 23 | ERROR_NOT_EXIST(6006, "数据不存在"), 24 | 25 | ERROR_NOT_SUPPORT(7000, "不支持该文件类型"), 26 | ERROR_LIMIT_EXCEEDED(7001, "超出请求次数上限"), 27 | ERROR_MULTIPART(7002, "文件上传异常"), 28 | ; 29 | 30 | private final int code; 31 | private final String message; 32 | 33 | StateCode(final int code, final String message) { 34 | this.code = code; 35 | this.message = message; 36 | } 37 | 38 | public int getCode(){ 39 | return this.code; 40 | } 41 | 42 | public String getMessage() { 43 | return message; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-swagger/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-common 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common-swagger 13 | 14 | 15 | 16 | 17 | io.springfox 18 | springfox-swagger2 19 | 20 | 21 | io.springfox 22 | springfox-swagger-ui 23 | 24 | 25 | 26 | 27 | com.github.xiaoymin 28 | knife4j-spring-boot-starter 29 | 30 | 31 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-swagger/src/main/java/ginyi/common/swagger/AddGroup.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.swagger; 2 | 3 | /** 4 | * 此接口不要删除,用于参数校验的分组 5 | */ 6 | public interface AddGroup { 7 | } 8 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-swagger/src/main/java/ginyi/common/swagger/UpdateGroup.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.swagger; 2 | 3 | /** 4 | * 此接口不要删除,用于参数校验的分组 5 | */ 6 | public interface UpdateGroup { 7 | } 8 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-common 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common-utils 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-starter-web 24 | 25 | 26 | 27 | 28 | org.apache.commons 29 | commons-lang3 30 | 31 | 32 | 33 | 34 | io.jsonwebtoken 35 | jjwt 36 | ${jwt.version} 37 | 38 | 39 | 40 | com.alibaba.fastjson2 41 | fastjson2 42 | 43 | 44 | 45 | 46 | com.sun.mail 47 | javax.mail 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/Constants.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.utils; 2 | 3 | /** 4 | * 通用常量信息 5 | * 6 | * @author ruoyi 7 | */ 8 | public class Constants { 9 | /** 10 | * UTF-8 字符集 11 | */ 12 | public static final String UTF8 = "UTF-8"; 13 | 14 | /** 15 | * GBK 字符集 16 | */ 17 | public static final String GBK = "GBK"; 18 | 19 | /** 20 | * 通用成功标识 21 | */ 22 | public static final String SUCCESS = "0"; 23 | 24 | /** 25 | * 通用失败标识 26 | */ 27 | public static final String FAIL = "1"; 28 | 29 | /** 30 | * 登录成功 31 | */ 32 | public static final String LOGIN_SUCCESS = "Success"; 33 | 34 | /** 35 | * 注销 36 | */ 37 | public static final String LOGOUT = "Logout"; 38 | 39 | /** 40 | * 注册 41 | */ 42 | public static final String REGISTER = "Register"; 43 | 44 | /** 45 | * 登录失败 46 | */ 47 | public static final String LOGIN_FAIL = "Error"; 48 | 49 | 50 | /** 51 | * 令牌前缀 52 | */ 53 | public static final String TOKEN_PREFIX = "Bearer "; 54 | 55 | /** 56 | * 令牌前缀 57 | */ 58 | public static final String LOGIN_USER_KEY = "login_user_key"; 59 | 60 | /** 61 | * 资源映射路径 前缀 62 | */ 63 | public static final String RESOURCE_PREFIX = "/profile"; 64 | 65 | /** 66 | * 令牌 67 | */ 68 | public static final String TOKEN = "token"; 69 | 70 | 71 | /** 72 | * 验证码有效期(分钟) 73 | */ 74 | public static final Integer CAPTCHA_EXPIRATION = 2; 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/EmailUtils.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.utils; 2 | 3 | import cn.hutool.extra.mail.MailUtil; 4 | 5 | /** 6 | * 邮箱工具类 7 | * 如何使用: 8 | * 1、需要在对应的应用服务模块下(如ginyi-server-admin)的resource目录下,新建config目录,再新建mail.setting配置文件 9 | * 2、具体配置信息参考 https://www.hutool.cn/docs/#/extra/邮件工具-MailUtil 10 | */ 11 | public class EmailUtils { 12 | 13 | /** 14 | * 单点发送 15 | * @param to 目标 16 | * @param subject 标题 17 | * @param message 信息 18 | * @param isHtml 是否为html信息 19 | * @return 20 | */ 21 | public static boolean sendToOne(String to, String subject, String message, Boolean isHtml) { 22 | String result = MailUtil.send(to, subject, message, isHtml); 23 | return result != null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/LogUtils.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.utils; 2 | 3 | /** 4 | * 处理并记录日志文件 5 | * 6 | * @author ruoyi 7 | */ 8 | public class LogUtils { 9 | public static String getBlock(Object msg) { 10 | if (msg == null) { 11 | msg = ""; 12 | } 13 | return "[" + msg.toString() + "]"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/MessageUtils.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.utils; 2 | 3 | import ginyi.common.utils.spring.SpringUtils; 4 | import org.springframework.context.MessageSource; 5 | import org.springframework.context.i18n.LocaleContextHolder; 6 | 7 | /** 8 | * 获取i18n资源文件 9 | * 10 | * @author ruoyi 11 | */ 12 | public class MessageUtils { 13 | /** 14 | * 根据消息键和参数 获取消息 委托给spring messageSource 15 | * 16 | * @param code 消息键 17 | * @param args 参数 18 | * @return 获取国际化翻译值 19 | */ 20 | public static String message(String code, Object... args) { 21 | MessageSource messageSource = SpringUtils.getBean(MessageSource.class); 22 | return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/NumberUtils.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.utils; 2 | 3 | import java.math.BigDecimal; 4 | import java.math.RoundingMode; 5 | 6 | public class NumberUtils { 7 | 8 | public static double round(double number, int decimalPlaces) { 9 | BigDecimal bigDecimal = new BigDecimal(Double.toString(number)); 10 | bigDecimal = bigDecimal.setScale(decimalPlaces, RoundingMode.HALF_UP); 11 | return bigDecimal.doubleValue(); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/enums/UserStatus.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.utils.enums; 2 | 3 | /** 4 | * 用户状态 5 | * 6 | * @author ruoyi 7 | */ 8 | public enum UserStatus { 9 | OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"); 10 | 11 | private final String code; 12 | private final String info; 13 | 14 | UserStatus(String code, String info) { 15 | this.code = code; 16 | this.info = info; 17 | } 18 | 19 | public String getCode() { 20 | return code; 21 | } 22 | 23 | public String getInfo() { 24 | return info; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/http/HttpHelper.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.utils.http; 2 | 3 | import org.apache.commons.lang3.exception.ExceptionUtils; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | import javax.servlet.ServletRequest; 8 | import java.io.BufferedReader; 9 | import java.io.IOException; 10 | import java.io.InputStream; 11 | import java.io.InputStreamReader; 12 | import java.nio.charset.StandardCharsets; 13 | 14 | /** 15 | * 通用http工具封装 16 | * 17 | * @author ruoyi 18 | */ 19 | public class HttpHelper { 20 | private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class); 21 | 22 | public static String getBodyString(ServletRequest request) { 23 | StringBuilder sb = new StringBuilder(); 24 | BufferedReader reader = null; 25 | try (InputStream inputStream = request.getInputStream()) { 26 | reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); 27 | String line = ""; 28 | while ((line = reader.readLine()) != null) { 29 | sb.append(line); 30 | } 31 | } catch (IOException e) { 32 | LOGGER.warn("getBodyString出现问题!"); 33 | } finally { 34 | if (reader != null) { 35 | try { 36 | reader.close(); 37 | } catch (IOException e) { 38 | LOGGER.error(ExceptionUtils.getMessage(e)); 39 | } 40 | } 41 | } 42 | return sb.toString(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/ip/AddressUtils.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.utils.ip; 2 | 3 | import com.alibaba.fastjson2.JSON; 4 | import com.alibaba.fastjson2.JSONObject; 5 | import ginyi.common.utils.Constants; 6 | import ginyi.common.utils.StringUtils; 7 | import ginyi.common.utils.http.HttpUtils; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | /** 12 | * 获取地址类 13 | * 14 | * @author ruoyi 15 | */ 16 | public class AddressUtils { 17 | private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); 18 | 19 | // IP地址查询 20 | public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp"; 21 | 22 | // 未知地址 23 | public static final String UNKNOWN = "XX XX"; 24 | 25 | public static String getRealAddressByIP(String ip) { 26 | // 内网不查询 27 | if (IpUtils.internalIp(ip)) { 28 | return "内网IP"; 29 | } 30 | try { 31 | String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK); 32 | if (StringUtils.isEmpty(rspStr)) { 33 | log.error("获取地理位置异常 {}", ip); 34 | return UNKNOWN; 35 | } 36 | JSONObject obj = JSON.parseObject(rspStr); 37 | String region = obj.getString("pro"); 38 | String city = obj.getString("city"); 39 | return String.format("%s %s", region, city); 40 | } catch (Exception e) { 41 | log.error("获取地理位置异常 {}", ip); 42 | } 43 | return UNKNOWN; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/ginyi-common-utils/src/main/java/ginyi/common/utils/uuid/IdUtils.java: -------------------------------------------------------------------------------- 1 | package ginyi.common.utils.uuid; 2 | 3 | /** 4 | * ID生成器工具类 5 | * 6 | * @author ruoyi 7 | */ 8 | public class IdUtils { 9 | /** 10 | * 获取随机UUID 11 | * 12 | * @return 随机UUID 13 | */ 14 | public static String randomUUID() { 15 | return UUID.randomUUID().toString(); 16 | } 17 | 18 | /** 19 | * 简化的UUID,去掉了横线 20 | * 21 | * @return 简化的UUID,去掉了横线 22 | */ 23 | public static String simpleUUID() { 24 | return UUID.randomUUID().toString(true); 25 | } 26 | 27 | /** 28 | * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID 29 | * 30 | * @return 随机UUID 31 | */ 32 | public static String fastUUID() { 33 | return UUID.fastUUID().toString(); 34 | } 35 | 36 | /** 37 | * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID 38 | * 39 | * @return 简化的UUID,去掉了横线 40 | */ 41 | public static String fastSimpleUUID() { 42 | return UUID.fastUUID().toString(true); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-springboot 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-common 13 | pom 14 | 15 | ginyi-common-mysql 16 | ginyi-common-redis 17 | ginyi-common-exception 18 | ginyi-common-result 19 | ginyi-common-utils 20 | ginyi-common-swagger 21 | ginyi-common-constants 22 | ginyi-common-annotation 23 | ginyi-common-enums 24 | 25 | 26 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-framework 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-framework-core 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-starter-aop 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-core/src/main/java/ginyi/framework/core/config/AppConfig.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.core.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.fusesource.jansi.Ansi; 5 | import org.springframework.context.ConfigurableApplicationContext; 6 | import org.springframework.core.env.ConfigurableEnvironment; 7 | 8 | import java.net.InetAddress; 9 | import java.net.UnknownHostException; 10 | 11 | @Slf4j 12 | public class AppConfig { 13 | 14 | /** 15 | * 彩色打印字体 16 | */ 17 | public static String colorPrint(String s, Ansi.Color color) { 18 | return Ansi.ansi().eraseScreen().fg(color).a(s).reset().toString(); 19 | } 20 | 21 | public static void printAppInfo(ConfigurableApplicationContext context) throws UnknownHostException { 22 | // 获取环境配置信息 23 | ConfigurableEnvironment env = context.getEnvironment(); 24 | String projectName = env.getProperty("ginyi.project-name"); 25 | String contextPath = env.getProperty("server.servlet.context-path"); 26 | String port = env.getProperty("server.port"); 27 | String baseUrl = "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + port + contextPath; 28 | String swaggerDoc = baseUrl + "swagger-ui.html"; 29 | String knife4jDoc = baseUrl + "doc.html"; 30 | 31 | String startSuccess = "\n" + 32 | " _______ __ __ __ ____ ____ __ \n" + 33 | " / _____|| | | \\ | | \\ \\ / / | | 项目名称:" + projectName + "\n" + 34 | "| | __ | | | \\| | \\ \\/ / | | 服务地址:" + baseUrl + "\n" + 35 | "| | |_ | | | | | \\_ _/ | | 接口文档:" + knife4jDoc + " or " + swaggerDoc + "\n" + 36 | "| |__| | | | | |\\ | | | | | 如果你喜欢这个项目,欢迎Star!https://gitee.com/Ginyi/ginyi-spring-vue \n" + 37 | " \\______| |__| |__| \\__| |__| |__| 启动成功...\n"; 38 | 39 | log.info("\n{}", colorPrint(startSuccess, Ansi.Color.CYAN)); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-core/src/main/java/ginyi/framework/core/config/GinyiConfig.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.core.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * 读取项目相关配置 10 | * 11 | * @author ruoyi 12 | */ 13 | @Component 14 | public class GinyiConfig { 15 | 16 | /** 17 | * 上传路径 18 | */ 19 | @Value("${ginyi.profile}") 20 | public static String profile; 21 | 22 | /** 23 | * 获取导入上传路径 24 | */ 25 | public static String getImportPath() { 26 | return profile + "/import"; 27 | } 28 | 29 | /** 30 | * 获取头像上传路径 31 | */ 32 | public static String getAvatarPath() { 33 | return profile + "/avatar"; 34 | } 35 | 36 | /** 37 | * 获取下载路径 38 | */ 39 | public static String getDownloadPath() { 40 | return profile + "/download/"; 41 | } 42 | 43 | /** 44 | * 获取上传路径 45 | */ 46 | public static String getUploadPath() { 47 | return profile + "/upload"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-framework 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-framework-security 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-security 23 | 24 | 25 | 26 | com.ginyi 27 | ginyi-framework-core 28 | ${ginyi.version} 29 | 30 | 31 | 32 | 33 | eu.bitwalker 34 | UserAgentUtils 35 | 36 | 37 | 38 | com.ginyi 39 | ginyi-common-enums 40 | ${ginyi.version} 41 | 42 | 43 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/context/AuthenticationContextHolder.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.context; 2 | 3 | import org.springframework.security.core.Authentication; 4 | 5 | /** 6 | * 身份验证信息 7 | * 8 | * @author ruoyi 9 | */ 10 | public class AuthenticationContextHolder { 11 | private static final ThreadLocal contextHolder = new ThreadLocal<>(); 12 | 13 | public static Authentication getContext() { 14 | return contextHolder.get(); 15 | } 16 | 17 | public static void setContext(Authentication context) { 18 | contextHolder.set(context); 19 | } 20 | 21 | public static void clearContext() { 22 | contextHolder.remove(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/context/PermissionContextHolder.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.context; 2 | 3 | import ginyi.common.utils.text.Convert; 4 | import org.springframework.web.context.request.RequestAttributes; 5 | import org.springframework.web.context.request.RequestContextHolder; 6 | 7 | /** 8 | * 权限信息 9 | * 10 | * @author ruoyi 11 | */ 12 | public class PermissionContextHolder { 13 | private static final String PERMISSION_CONTEXT_ATTRIBUTES = "PERMISSION_CONTEXT"; 14 | 15 | public static void setContext(String permission) { 16 | RequestContextHolder.currentRequestAttributes().setAttribute(PERMISSION_CONTEXT_ATTRIBUTES, permission, 17 | RequestAttributes.SCOPE_REQUEST); 18 | } 19 | 20 | public static String getContext() { 21 | return Convert.toStr(RequestContextHolder.currentRequestAttributes().getAttribute(PERMISSION_CONTEXT_ATTRIBUTES, 22 | RequestAttributes.SCOPE_REQUEST)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/filter/JwtAuthenticationTokenFilter.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.filter; 2 | 3 | import ginyi.common.utils.StringUtils; 4 | import ginyi.framework.security.utils.SecurityUtils; 5 | import ginyi.system.domain.LoginUser; 6 | import ginyi.system.service.ITokenService; 7 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 8 | import org.springframework.security.core.context.SecurityContextHolder; 9 | import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; 10 | import org.springframework.stereotype.Component; 11 | import org.springframework.web.filter.OncePerRequestFilter; 12 | 13 | import javax.annotation.Resource; 14 | import javax.servlet.FilterChain; 15 | import javax.servlet.ServletException; 16 | import javax.servlet.http.HttpServletRequest; 17 | import javax.servlet.http.HttpServletResponse; 18 | import java.io.IOException; 19 | 20 | /** 21 | * token过滤器 验证token有效性 22 | * 23 | * @author ruoyi 24 | */ 25 | @Component 26 | public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { 27 | @Resource 28 | private ITokenService tokenService; 29 | 30 | @Override 31 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) 32 | throws ServletException, IOException { 33 | LoginUser loginUser = tokenService.getLoginUser(request); 34 | if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) { 35 | tokenService.verifyToken(loginUser); 36 | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); 37 | authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); 38 | SecurityContextHolder.getContext().setAuthentication(authenticationToken); 39 | } 40 | chain.doFilter(request, response); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/filter/PropertyPreExcludeFilter.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.filter; 2 | 3 | import com.alibaba.fastjson2.filter.SimplePropertyPreFilter; 4 | 5 | /** 6 | * 排除JSON敏感属性 7 | * 8 | * @author ruoyi 9 | */ 10 | public class PropertyPreExcludeFilter extends SimplePropertyPreFilter { 11 | public PropertyPreExcludeFilter() { 12 | } 13 | 14 | public PropertyPreExcludeFilter addExcludes(String... filters) { 15 | for (int i = 0; i < filters.length; i++) { 16 | this.getExcludes().add(filters[i]); 17 | } 18 | return this; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/handle/AuthenticationEntryPointImpl.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.handle; 2 | 3 | import com.alibaba.fastjson2.JSON; 4 | import ginyi.common.constant.CommonMessageConstants; 5 | import ginyi.common.result.CommonResult; 6 | import ginyi.common.result.StateCode; 7 | import ginyi.common.utils.ServletUtils; 8 | import org.springframework.security.core.AuthenticationException; 9 | import org.springframework.security.web.AuthenticationEntryPoint; 10 | import org.springframework.stereotype.Component; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import java.io.IOException; 15 | import java.io.Serializable; 16 | 17 | /** 18 | * 认证失败处理类 返回未授权 19 | * 20 | * @author ruoyi 21 | */ 22 | @Component 23 | public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable { 24 | private static final long serialVersionUID = -8970718410437077606L; 25 | 26 | @Override 27 | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) 28 | throws IOException { 29 | ServletUtils.renderString(response, JSON.toJSONString(CommonResult.error(StateCode.ERROR_AUTHENTICATION_VALID, CommonMessageConstants.SYS_AUTHENTICATION_VALID))); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/interceptor/RepeatSubmitInterceptor.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.interceptor; 2 | 3 | import com.alibaba.fastjson2.JSON; 4 | import ginyi.common.annotation.RepeatSubmit; 5 | import ginyi.common.result.CommonResult; 6 | import ginyi.common.result.StateCode; 7 | import ginyi.common.utils.ServletUtils; 8 | import org.springframework.stereotype.Component; 9 | import org.springframework.web.method.HandlerMethod; 10 | import org.springframework.web.servlet.HandlerInterceptor; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import java.lang.reflect.Method; 15 | 16 | /** 17 | * 防止重复提交拦截器 18 | * 19 | * @author ruoyi 20 | */ 21 | @Component 22 | public abstract class RepeatSubmitInterceptor implements HandlerInterceptor { 23 | @Override 24 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 25 | if (handler instanceof HandlerMethod) { 26 | HandlerMethod handlerMethod = (HandlerMethod) handler; 27 | Method method = handlerMethod.getMethod(); 28 | RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class); 29 | if (annotation != null) { 30 | if (this.isRepeatSubmit(request, annotation)) { 31 | CommonResult commonResult = CommonResult.error(StateCode.ERROR_PARAMS_SERVICE, annotation.message()); 32 | ServletUtils.renderString(response, JSON.toJSONString(commonResult)); 33 | return false; 34 | } 35 | } 36 | return true; 37 | } else { 38 | return true; 39 | } 40 | } 41 | 42 | /** 43 | * 验证是否重复提交由子类实现具体的防重复提交的规则 44 | * 45 | * @param request 46 | * @return 47 | * @throws Exception 48 | */ 49 | public abstract boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation); 50 | } 51 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/manager/AsyncManager.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.manager; 2 | 3 | import ginyi.common.utils.Threads; 4 | import ginyi.common.utils.spring.SpringUtils; 5 | 6 | import java.util.TimerTask; 7 | import java.util.concurrent.ScheduledExecutorService; 8 | import java.util.concurrent.TimeUnit; 9 | 10 | /** 11 | * 异步任务管理器 12 | * 13 | * @author ruoyi 14 | */ 15 | public class AsyncManager { 16 | /** 17 | * 操作延迟10毫秒 18 | */ 19 | private final int OPERATE_DELAY_TIME = 10; 20 | 21 | /** 22 | * 异步操作任务调度线程池 23 | */ 24 | private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService"); 25 | 26 | /** 27 | * 单例模式 28 | */ 29 | private AsyncManager() { 30 | } 31 | 32 | private static AsyncManager me = new AsyncManager(); 33 | 34 | public static AsyncManager me() { 35 | return me; 36 | } 37 | 38 | /** 39 | * 执行任务 40 | * 41 | * @param task 任务 42 | */ 43 | public void execute(TimerTask task) { 44 | executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); 45 | } 46 | 47 | /** 48 | * 停止任务线程池 49 | */ 50 | public void shutdown() { 51 | Threads.shutdownAndAwaitTermination(executor); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/service/SysLoginLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.service; 2 | 3 | import ginyi.system.domain.SysLogLogin; 4 | import ginyi.system.service.ISysLogininforService; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 系统访问日志情况信息 服务层处理 11 | * 12 | * @author ruoyi 13 | */ 14 | @Service 15 | public class SysLoginLogServiceImpl implements ISysLogininforService { 16 | 17 | /** 18 | * 新增系统登录日志 19 | * 20 | * @param logininfor 访问日志对象 21 | */ 22 | @Override 23 | public void insertLogininfor(SysLogLogin logininfor) { 24 | // todo 待写~ 25 | } 26 | 27 | /** 28 | * 查询系统登录日志集合 29 | * 30 | * @param logininfor 访问日志对象 31 | * @return 登录记录集合 32 | */ 33 | @Override 34 | public List selectLogininforList(SysLogLogin logininfor) { 35 | // todo 待写~ 36 | return null; 37 | } 38 | 39 | /** 40 | * 批量删除系统登录日志 41 | * 42 | * @param infoIds 需要删除的登录日志ID 43 | * @return 结果 44 | */ 45 | @Override 46 | public int deleteLogininforByIds(Long[] infoIds) { 47 | // todo 待写~ 48 | return 0; 49 | } 50 | 51 | /** 52 | * 清空系统登录日志 53 | */ 54 | @Override 55 | public void cleanLogininfor() { 56 | // todo 待写~ 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/service/SysOperationLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.service; 2 | 3 | import ginyi.system.domain.SysLogOperation; 4 | import ginyi.system.service.ISysOperLogService; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 操作日志 服务层处理 11 | * 12 | * @author ruoyi 13 | */ 14 | @Service 15 | public class SysOperationLogServiceImpl implements ISysOperLogService { 16 | 17 | /** 18 | * 新增操作日志 19 | * 20 | * @param operLog 操作日志对象 21 | */ 22 | @Override 23 | public void insertOperlog(SysLogOperation operLog) { 24 | // todo 待写~ 25 | } 26 | 27 | /** 28 | * 查询系统操作日志集合 29 | * 30 | * @param operLog 操作日志对象 31 | * @return 操作日志集合 32 | */ 33 | @Override 34 | public List selectOperLogList(SysLogOperation operLog) { 35 | // todo 待写~ 36 | return null; 37 | } 38 | 39 | /** 40 | * 批量删除系统操作日志 41 | * 42 | * @param operIds 需要删除的操作日志ID 43 | * @return 结果 44 | */ 45 | @Override 46 | public int deleteOperLogByIds(Long[] operIds) { 47 | // todo 待写~ 48 | return 0; 49 | } 50 | 51 | /** 52 | * 查询操作日志详细 53 | * 54 | * @param operId 操作ID 55 | * @return 操作日志对象 56 | */ 57 | @Override 58 | public SysLogOperation selectOperLogById(Long operId) { 59 | // todo 待写~ 60 | return null; 61 | } 62 | 63 | /** 64 | * 清空操作日志 65 | */ 66 | @Override 67 | public void cleanOperLog() { 68 | // todo 待写~ 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-security/src/main/java/ginyi/framework/security/utils/SecurityUtils.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.security.utils; 2 | 3 | import ginyi.common.constant.CommonMessageConstants; 4 | import ginyi.common.exception.CommonException; 5 | import ginyi.common.result.StateCode; 6 | import ginyi.system.domain.LoginUser; 7 | import org.springframework.security.core.Authentication; 8 | import org.springframework.security.core.context.SecurityContextHolder; 9 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 10 | 11 | /** 12 | * 安全服务工具类 13 | * 14 | * @author ruoyi 15 | */ 16 | public class SecurityUtils { 17 | /** 18 | * 获取Authentication 19 | */ 20 | public static Authentication getAuthentication() { 21 | return SecurityContextHolder.getContext().getAuthentication(); 22 | } 23 | 24 | /** 25 | * 获取用户 26 | **/ 27 | public static LoginUser getLoginUser() { 28 | try { 29 | return (LoginUser) getAuthentication().getPrincipal(); 30 | } catch (Exception e) { 31 | throw new CommonException(StateCode.ERROR_SYSTEM, CommonMessageConstants.USER_NOT_FOUND); 32 | } 33 | } 34 | 35 | /** 36 | * 判断密码是否相同 37 | * 38 | * @param rawPassword 真实密码 39 | * @param encodedPassword 加密后字符 40 | * @return 结果 41 | */ 42 | public static boolean matchesPassword(String rawPassword, String encodedPassword) { 43 | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); 44 | return passwordEncoder.matches(rawPassword, encodedPassword); 45 | } 46 | 47 | /** 48 | * 生成BCryptPasswordEncoder密码 49 | * 50 | * @param password 密码 51 | * @return 加密字符串 52 | */ 53 | public static String encryptPassword(String password) { 54 | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); 55 | return passwordEncoder.encode(password); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-websocket/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-framework 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-framework-websocket 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-websocket 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/ginyi-framework-websocket/src/main/java/ginyi/framework/websocket/config/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package ginyi.framework.websocket.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.socket.server.standard.ServerEndpointExporter; 6 | 7 | @Configuration 8 | public class WebSocketConfig { 9 | /** 10 | * 注入ServerEndpointExporter, 11 | * 这个bean会自动注册使用了@ServerEndpoint注解声明的Websocket endpoint 12 | */ 13 | @Bean 14 | public ServerEndpointExporter serverEndpointExporter() { 15 | return new ServerEndpointExporter(); 16 | } 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-framework/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-springboot 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-framework 13 | pom 14 | 15 | ginyi-framework-core 16 | ginyi-framework-security 17 | ginyi-framework-websocket 18 | 19 | 20 | 21 | 22 | 23 | 24 | com.ginyi 25 | ginyi-system 26 | ${ginyi.version} 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-admin/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | COPY *.jar /app.jar 3 | EXPOSE 8066 4 | ENTRYPOINT ["java","-jar","/app.jar"] -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-admin/src/main/java/ginyi/server/admin/AdminApplication.java: -------------------------------------------------------------------------------- 1 | package ginyi.server.admin; 2 | 3 | 4 | import ginyi.framework.core.config.AppConfig; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.mybatis.spring.annotation.MapperScan; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | import org.springframework.context.ConfigurableApplicationContext; 10 | 11 | import java.net.UnknownHostException; 12 | 13 | // 扫描系统服务的包以及自身所在模块的包 14 | @SpringBootApplication(scanBasePackages = { 15 | "ginyi.system", 16 | "ginyi.common", 17 | "ginyi.framework.security", 18 | "ginyi.server.admin" 19 | }) 20 | @MapperScan({ 21 | "ginyi.system.**.mapper", 22 | "ginyi.server.admin.**.mapper" 23 | }) 24 | @Slf4j 25 | public class AdminApplication { 26 | public static void main(String[] args) throws UnknownHostException { 27 | ConfigurableApplicationContext context = SpringApplication.run(AdminApplication.class, args); 28 | AppConfig.printAppInfo(context); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-admin/src/main/java/ginyi/server/admin/controller/SysLogController.java: -------------------------------------------------------------------------------- 1 | package ginyi.server.admin.controller; 2 | 3 | import ginyi.common.result.CommonResult; 4 | import ginyi.system.domain.SysLogLogin; 5 | import ginyi.system.domain.SysLogOperation; 6 | import ginyi.system.domain.model.vo.BaseVo; 7 | import ginyi.system.service.ISysLogService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.security.access.prepost.PreAuthorize; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import javax.annotation.Resource; 14 | 15 | @Api(tags = "日志模块") 16 | @RestController 17 | @RequestMapping("/api/log") 18 | public class SysLogController { 19 | 20 | @Resource 21 | private ISysLogService logService; 22 | 23 | @ApiOperation("登录日志") 24 | @GetMapping("/getLoginLogList") 25 | @PreAuthorize("@ss.hasPermission('monitor:operlog:list')") 26 | public CommonResult> loginLogList(@RequestParam(value = "page", required = false) Long page, 27 | @RequestParam(value = "pageSize", required = false) Long pageSize) { 28 | BaseVo list = logService.getLoginLogList(page, pageSize); 29 | return CommonResult.success(list); 30 | } 31 | 32 | @ApiOperation("操作日志") 33 | @GetMapping("/getOperationLogList") 34 | @PreAuthorize("@ss.hasPermission('monitor:loginlog:list')") 35 | public CommonResult> operationLogList(@RequestParam(value = "page", required = false) Long page, 36 | @RequestParam(value = "pageSize", required = false) Long pageSize) { 37 | BaseVo list = logService.getOperationLogList(page, pageSize); 38 | return CommonResult.success(list); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-admin/src/main/java/ginyi/server/admin/controller/SysLoginController.java: -------------------------------------------------------------------------------- 1 | package ginyi.server.admin.controller; 2 | 3 | import ginyi.common.result.CommonResult; 4 | import ginyi.system.domain.model.dto.LoginDto; 5 | import ginyi.system.domain.model.dto.RegisterDto; 6 | import ginyi.system.domain.model.vo.LoginVo; 7 | import ginyi.system.service.ISysLoginService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import lombok.extern.slf4j.Slf4j; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.validation.annotation.Validated; 13 | import org.springframework.web.bind.annotation.PostMapping; 14 | import org.springframework.web.bind.annotation.RequestBody; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.RestController; 17 | 18 | @RestController 19 | @RequestMapping("/api/user") 20 | @Api(tags = "登录模块") 21 | @Slf4j 22 | public class SysLoginController { 23 | 24 | @Autowired 25 | private ISysLoginService loginService; 26 | 27 | @ApiOperation("用户登录") 28 | @PostMapping("/login") 29 | public CommonResult login(@RequestBody @Validated LoginDto loginDto) { 30 | LoginVo loginVo = loginService.login(loginDto); 31 | return CommonResult.success(loginVo); 32 | } 33 | 34 | @ApiOperation("用户注册") 35 | @PostMapping("/register") 36 | public CommonResult register(@RequestBody @Validated RegisterDto registerDto) { 37 | loginService.register(registerDto); 38 | return CommonResult.success(); 39 | } 40 | 41 | @ApiOperation("退出登录") 42 | @PostMapping("/logout") 43 | public CommonResult logout() { 44 | return CommonResult.success(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-admin/src/main/java/ginyi/server/admin/controller/SysVerifyController.java: -------------------------------------------------------------------------------- 1 | package ginyi.server.admin.controller; 2 | 3 | import ginyi.common.result.CommonResult; 4 | import ginyi.system.service.IVerifyService; 5 | import io.swagger.annotations.Api; 6 | import io.swagger.annotations.ApiOperation; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.annotation.Resource; 14 | import javax.servlet.http.HttpServletRequest; 15 | import java.util.HashMap; 16 | 17 | @RestController 18 | @Api(tags = "验证码模块") 19 | @RequestMapping("/api/verify") 20 | public class SysVerifyController { 21 | 22 | @Resource 23 | private IVerifyService verifyService; 24 | 25 | @ApiOperation("图片验证码") 26 | @GetMapping("/captcha") 27 | public CommonResult captcha(){ 28 | String img = verifyService.captcha(); 29 | HashMap map = new HashMap<>(); 30 | map.put("img", img); 31 | return CommonResult.success(map); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-admin/src/main/java/ginyi/server/admin/swagger/AdminSwagger2Config.java: -------------------------------------------------------------------------------- 1 | package ginyi.server.admin.swagger; 2 | 3 | import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; 4 | import ginyi.common.swagger.Swagger2Config; 5 | import org.springframework.context.annotation.Configuration; 6 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 7 | 8 | 9 | @EnableSwagger2 10 | @EnableKnife4j 11 | @Configuration 12 | public class AdminSwagger2Config extends Swagger2Config { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-admin/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | # 说明: 2 | # 1、这是 ginyi-server-admin 模块下特有的配置项 3 | # 2、更多全局通用的配置项在 ginyi-system 系统应用服务下 4 | # 3、如果需要对重写全局的配置项的话,可以将其对应的属性配置拷贝至本配置中,会自动覆盖! 5 | 6 | 7 | # 应用服务 8 | server: 9 | # 服务端口 10 | port: 8066 11 | 12 | 13 | # 接口文档的配置 14 | swagger: 15 | group-name: admin 16 | # 接口文档url 17 | swagger-url: 写点什么呢~~~ 18 | # 接口文档标题 19 | swagger-title: Ginyi-admin api doc 20 | # 接口文档版本号 21 | swaggerversion: 1.0 22 | # 接口文档描述 23 | swagger-description: 这是swagger接口文档~ -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-admin/src/main/resources/static/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | #错误消息 2 | not.null=* 必须填写 3 | user.jcaptcha.error=验证码错误 4 | user.jcaptcha.expire=验证码已失效 5 | user.not.exists=用户不存在/密码错误 6 | user.password.not.match=用户不存在/密码错误 7 | user.password.retry.limit.count=密码输入错误{0}次 8 | user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 9 | user.password.delete=对不起,您的账号已被删除 10 | user.blocked=用户已封禁,请联系管理员 11 | role.blocked=角色已封禁,请联系管理员 12 | user.logout.success=退出成功 13 | 14 | length.not.valid=长度必须在{min}到{max}个字符之间 15 | 16 | user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 17 | user.password.not.valid=* 5-50个字符 18 | 19 | user.email.not.valid=邮箱格式错误 20 | user.mobile.phone.number.not.valid=手机号格式错误 21 | user.login.success=登录成功 22 | user.register.success=注册成功 23 | user.notfound=请重新登录 24 | user.forcelogout=管理员强制退出,请重新登录 25 | user.unknown.error=未知错误,请重新登录 26 | 27 | ##文件上传消息 28 | upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! 29 | upload.filename.exceed.length=上传的文件名最长{0}个字符 30 | 31 | ##权限 32 | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] 33 | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] 34 | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] 35 | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] 36 | no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] 37 | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] 38 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-server 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | ginyi-server-common 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-web/src/main/java/ginyi/server/web/WebApplication.java: -------------------------------------------------------------------------------- 1 | package ginyi.server.web; 2 | 3 | import ginyi.framework.core.config.AppConfig; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.mybatis.spring.annotation.MapperScan; 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.context.ConfigurableApplicationContext; 9 | import org.springframework.data.redis.core.RedisTemplate; 10 | 11 | import javax.sql.DataSource; 12 | import java.net.UnknownHostException; 13 | 14 | @Slf4j 15 | // 扫描系统服务的包以及自身所在模块的包 16 | @SpringBootApplication(scanBasePackages = { 17 | "ginyi.system", 18 | "ginyi.common", 19 | "ginyi.framework.websocket", 20 | "ginyi.framework.security", 21 | "ginyi.server.web" 22 | }) 23 | @MapperScan({ 24 | "ginyi.system.**.mapper", 25 | "ginyi.server.admin.**.mapper" 26 | }) 27 | public class WebApplication { 28 | 29 | public static void main(String[] args) throws UnknownHostException { 30 | ConfigurableApplicationContext context = SpringApplication.run(WebApplication.class, args); 31 | AppConfig.printAppInfo(context); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-web/src/main/java/ginyi/server/web/controller/Test.java: -------------------------------------------------------------------------------- 1 | package ginyi.server.web.controller; 2 | 3 | 4 | import ginyi.common.result.CommonResult; 5 | import ginyi.system.domain.model.dto.LoginDto; 6 | import ginyi.system.domain.model.vo.LoginVo; 7 | import ginyi.system.service.ISysLoginService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import lombok.extern.slf4j.Slf4j; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.validation.annotation.Validated; 13 | import org.springframework.web.bind.annotation.PostMapping; 14 | import org.springframework.web.bind.annotation.RequestBody; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.RestController; 17 | 18 | @RestController 19 | @RequestMapping("/api/user") 20 | @Api(tags = "登录模块") 21 | @Slf4j 22 | public class Test { 23 | 24 | @Autowired 25 | private ISysLoginService loginService; 26 | 27 | @ApiOperation("测试用户登录") 28 | @PostMapping("/login") 29 | public CommonResult login(@RequestBody @Validated LoginDto loginDto) { 30 | LoginVo loginVo = loginService.login(loginDto); 31 | return CommonResult.success(loginVo); 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-web/src/main/java/ginyi/server/web/swagger/WebSwagger2Config.java: -------------------------------------------------------------------------------- 1 | package ginyi.server.web.swagger; 2 | 3 | import ginyi.common.swagger.Swagger2Config; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 6 | 7 | @EnableSwagger2 8 | @Configuration 9 | public class WebSwagger2Config extends Swagger2Config { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/ginyi-server-web/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | # 说明: 2 | # 1、这是 ginyi-server-web 模块下特有的配置项 3 | # 2、更多全局通用的配置项在 ginyi-system 系统应用服务下 4 | # 3、如果需要对重写全局的配置项的话,可以将其对应的属性配置拷贝至本配置中,会自动覆盖! 5 | 6 | 7 | # 应用服务 8 | server: 9 | # 服务端口 10 | port: 8055 11 | 12 | 13 | # 接口文档的配置 14 | swagger: 15 | group-name: web 16 | # 接口文档url 17 | swagger-url: 写点什么呢~~~ 18 | # 接口文档标题 19 | swagger-title: Ginyi-web api doc 20 | # 接口文档版本号 21 | swaggerversion: 1.0 22 | # 接口文档描述 23 | swagger-description: 这是swagger接口文档~ 24 | 25 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ginyi-springboot 7 | com.ginyi 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | 4.0.0 12 | 13 | ginyi-server 14 | pom 15 | 16 | 17 | ginyi-server-web 18 | ginyi-server-admin 19 | ginyi-server-common 20 | 21 | 22 | 23 | 24 | 25 | 26 | com.ginyi 27 | ginyi-framework-security 28 | ${ginyi.version} 29 | 30 | 31 | 32 | 33 | com.ginyi 34 | ginyi-framework-core 35 | ${ginyi.version} 36 | 37 | 38 | 39 | 40 | com.ginyi 41 | ginyi-framework-websocket 42 | ${ginyi.version} 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/Sys.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | /** 7 | * 系统相关信息 8 | * 9 | * @author ruoyi 10 | */ 11 | @Data 12 | public class Sys { 13 | /** 14 | * 服务器名称 15 | */ 16 | @ApiModelProperty("服务器名称") 17 | private String computerName; 18 | 19 | /** 20 | * 服务器Ip 21 | */ 22 | @ApiModelProperty("服务器ip") 23 | private String computerIp; 24 | 25 | /** 26 | * 项目路径 27 | */ 28 | @ApiModelProperty("项目路径") 29 | private String userDir; 30 | 31 | /** 32 | * 操作系统 33 | */ 34 | @ApiModelProperty("操作系统") 35 | private String osName; 36 | 37 | /** 38 | * 系统架构 39 | */ 40 | @ApiModelProperty("系统架构") 41 | private String osArch; 42 | } 43 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysConfig.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import lombok.Data; 5 | import org.apache.commons.lang3.builder.ToStringBuilder; 6 | import org.apache.commons.lang3.builder.ToStringStyle; 7 | 8 | /** 9 | * 参数配置表 sys_config 10 | * 11 | * @author ruoyi 12 | */ 13 | @Data 14 | public class SysConfig extends BaseEntity { 15 | private static final long serialVersionUID = 1L; 16 | 17 | /** 18 | * 参数主键 19 | */ 20 | @TableId 21 | private Long configId; 22 | 23 | /** 24 | * 参数名称 25 | */ 26 | private String configName; 27 | 28 | /** 29 | * 参数键名 30 | */ 31 | private String configKey; 32 | 33 | /** 34 | * 参数键值 35 | */ 36 | private String configValue; 37 | 38 | /** 39 | * 系统内置(Y是 N否) 40 | */ 41 | private String configType; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysCpu.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | /** 7 | * CPU相关信息 8 | * @author ruoyi 9 | */ 10 | @Data 11 | public class SysCpu { 12 | /** 13 | * 核心数,直接回显数字 14 | */ 15 | @ApiModelProperty("核心数") 16 | private int cpuNum; 17 | 18 | /** 19 | * CPU总的使用率,不需要回显 20 | */ 21 | @ApiModelProperty("CPU总使用率,不需要回显") 22 | private double total; 23 | 24 | /** 25 | * CPU系统使用率,拼接 % 回显 26 | */ 27 | @ApiModelProperty("CPU系统使用率") 28 | private double sys; 29 | 30 | /** 31 | * CPU用户使用率,拼接 % 回显 32 | */ 33 | @ApiModelProperty("CPU用户使用率") 34 | private double used; 35 | 36 | /** 37 | * CPU当前等待率,拼接 % 回显 38 | */ 39 | @ApiModelProperty("CPU当前等待率") 40 | private double wait; 41 | 42 | /** 43 | * CPU当前空闲率,拼接 % 回显 44 | */ 45 | @ApiModelProperty("CPU当前空闲率") 46 | private double free; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysFile.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | /** 7 | * 系统文件相关信息 8 | * 9 | * @author ruoyi 10 | */ 11 | @Data 12 | 13 | public class SysFile { 14 | /** 15 | * 盘符路径 16 | */ 17 | @ApiModelProperty("盘符路径") 18 | private String dirName; 19 | 20 | /** 21 | * 文件类型 22 | */ 23 | @ApiModelProperty("文件类型") 24 | private String typeName; 25 | 26 | /** 27 | * 总大小,单位G 28 | */ 29 | @ApiModelProperty("总大小,单位G") 30 | private double total; 31 | 32 | /** 33 | * 剩余大小,单位G 34 | */ 35 | @ApiModelProperty("可用大小,单位G") 36 | private double free; 37 | 38 | /** 39 | * 已经使用量,单位G 40 | */ 41 | @ApiModelProperty("已用大小,单位G") 42 | private double used; 43 | 44 | /** 45 | * 资源的使用率 46 | */ 47 | @ApiModelProperty("已用百分比") 48 | private double usage; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysJvm.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | /** 7 | * JVM相关信息 8 | * 9 | * @author ruoyi 10 | */ 11 | @Data 12 | public class SysJvm { 13 | /** 14 | * 当前JVM占用的内存总数,单位M 15 | */ 16 | @ApiModelProperty("当前JVM占用的内存总数,单位M") 17 | private double total; 18 | 19 | /** 20 | * JVM最大可用内存总数,单位M 21 | */ 22 | @ApiModelProperty("JVM最大可用内存总数,单位M") 23 | private double max; 24 | 25 | /** 26 | * JVM空闲内存,单位M 27 | */ 28 | @ApiModelProperty("JVM空闲内存,单位M") 29 | private double free; 30 | 31 | /** 32 | * JDK名称 33 | */ 34 | @ApiModelProperty("JDK名称") 35 | private String name; 36 | 37 | /** 38 | * JDK版本 39 | */ 40 | @ApiModelProperty("JDK版本") 41 | private String version; 42 | 43 | /** 44 | * JDK路径 45 | */ 46 | @ApiModelProperty("JDK路径") 47 | private String home; 48 | 49 | /** 50 | * 已用内存,单位M 51 | */ 52 | @ApiModelProperty("已用内存,单位M") 53 | private double used; 54 | 55 | /** 56 | * 使用率 57 | */ 58 | @ApiModelProperty("内存使用率") 59 | private double usage; 60 | 61 | /** 62 | * 运行参数 63 | */ 64 | @ApiModelProperty("运行参数") 65 | private String inputArgs; 66 | 67 | 68 | /** 69 | * 运行时间 70 | */ 71 | @ApiModelProperty("运行时间") 72 | private String runTime; 73 | 74 | /** 75 | * 启动时间 76 | */ 77 | @ApiModelProperty("启动时间") 78 | private String startTime; 79 | 80 | } 81 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysLogLogin.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | import org.springframework.data.mongodb.core.mapping.Document; 8 | 9 | import java.util.Date; 10 | 11 | @Data 12 | @ApiModel("登录日志返回数据") 13 | @Document("sys_log_login") 14 | public class SysLogLogin extends BaseEntity { 15 | private static final long serialVersionUID = 1L; 16 | 17 | @ApiModelProperty("ID") 18 | private String id; 19 | 20 | @ApiModelProperty("用户账号") 21 | private String userName; 22 | 23 | @ApiModelProperty("登录状态 0成功 1失败") 24 | private String status; 25 | 26 | @ApiModelProperty("登录IP地址") 27 | private String ipaddr; 28 | 29 | @ApiModelProperty("登录地点") 30 | private String loginLocation; 31 | 32 | @ApiModelProperty("浏览器类型") 33 | private String browser; 34 | 35 | @ApiModelProperty("操作系统") 36 | private String os; 37 | 38 | @ApiModelProperty("提示消息") 39 | private String msg; 40 | 41 | @JsonFormat 42 | @ApiModelProperty("登录时间") 43 | private Date loginTime; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysLogOperation.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import org.springframework.data.mongodb.core.mapping.Document; 9 | 10 | import java.util.Date; 11 | 12 | 13 | @EqualsAndHashCode(callSuper = true) 14 | @Data 15 | @ApiModel("操作日志返回数据") 16 | @Document("sys_log_operation") 17 | public class SysLogOperation extends BaseEntity { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @ApiModelProperty("ID") 21 | private String id; 22 | 23 | @ApiModelProperty("操作模块") 24 | private String title; 25 | 26 | @ApiModelProperty("业务类型(0其它 1新增 2修改 3删除)") 27 | private Integer businessType; 28 | 29 | @ApiModelProperty("业务类型数组") 30 | private Integer[] businessTypes; 31 | 32 | @ApiModelProperty("请求方法") 33 | private String method; 34 | 35 | @ApiModelProperty("请求方式") 36 | private String requestMethod; 37 | 38 | @ApiModelProperty("操作类别(0其它 1后台用户 2手机端用户)") 39 | private Integer operatorType; 40 | 41 | @ApiModelProperty("操作人员") 42 | private String operationName; 43 | 44 | @ApiModelProperty("部门名称") 45 | private String deptName; 46 | 47 | @ApiModelProperty("请求URL") 48 | private String operationUrl; 49 | 50 | @ApiModelProperty("操作地址") 51 | private String operationIp; 52 | 53 | @ApiModelProperty("操作地点") 54 | private String operationLocation; 55 | 56 | @ApiModelProperty("请求参数") 57 | private String operationParam; 58 | 59 | @ApiModelProperty("返回参数") 60 | private String jsonResult; 61 | 62 | @ApiModelProperty("操作状态(0正常 1异常)") 63 | private Integer status; 64 | 65 | @ApiModelProperty("错误消息") 66 | private String errorMsg; 67 | 68 | @JsonFormat 69 | @ApiModelProperty("操作时间") 70 | private Date operationTime; 71 | 72 | } 73 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysMemory.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | * 內存相关信息 9 | * 10 | * @author ruoyi 11 | */ 12 | @Data 13 | public class SysMemory { 14 | /** 15 | * 内存总量,单位G 16 | */ 17 | @ApiModelProperty("内存总数,单位G") 18 | private double total; 19 | 20 | /** 21 | * 已用内存,单位G 22 | */ 23 | @ApiModelProperty("已用内存,单位G") 24 | private double used; 25 | 26 | /** 27 | * 剩余内存,单位G 28 | */ 29 | @ApiModelProperty("可用内存,单位G") 30 | private double free; 31 | 32 | /** 33 | * 内存使用率 34 | */ 35 | @ApiModelProperty("使用率") 36 | private double usage; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysNotice.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import ginyi.system.domain.BaseEntity; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | 8 | import java.util.List; 9 | 10 | @EqualsAndHashCode(callSuper = true) 11 | @Data 12 | public class SysNotice extends BaseEntity { 13 | 14 | /** 15 | * 通知的id 16 | */ 17 | @ApiModelProperty("通知的id") 18 | private Long noticeId; 19 | 20 | /** 21 | * 通知标题 22 | */ 23 | @ApiModelProperty("通知标题") 24 | private String title; 25 | 26 | /** 27 | * 通知的类型(0通知,1公告) 28 | */ 29 | @ApiModelProperty("通知的类型(0通知,1公告)") 30 | private String type; 31 | 32 | /** 33 | * 通知的内容 34 | */ 35 | @ApiModelProperty("通知的内容") 36 | private String content; 37 | 38 | /** 39 | * 通知的用户 40 | */ 41 | @ApiModelProperty("通知的用户") 42 | private List userIds; 43 | 44 | /** 45 | * 已读的用户 46 | */ 47 | @ApiModelProperty("已读的用户") 48 | private List userReadIds; 49 | 50 | /** 51 | * 通知的状态(0正常,1关闭) 52 | */ 53 | @ApiModelProperty("通知的状态(0正常,1关闭)") 54 | private String status; 55 | } 56 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysPost.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | import org.apache.ibatis.annotations.Select; 9 | 10 | /** 11 | * 岗位表 sys_post 12 | * 13 | * @author ruoyi 14 | */ 15 | @EqualsAndHashCode(callSuper = true) 16 | @Data 17 | public class SysPost extends BaseEntity { 18 | private static final long serialVersionUID = 1L; 19 | 20 | /** 21 | * 岗位序号 22 | */ 23 | @TableId 24 | private Long postId; 25 | 26 | /** 27 | * 岗位编码 28 | */ 29 | private String postCode; 30 | 31 | /** 32 | * 岗位名称 33 | */ 34 | private String postName; 35 | 36 | /** 37 | * 岗位排序 38 | */ 39 | private Integer sort; 40 | 41 | /** 42 | * 状态(0正常 1停用) 43 | */ 44 | private String status; 45 | 46 | /** 47 | * 用户是否存在此岗位标识 默认不存在 48 | */ 49 | @TableField(select = false, exist = false) 50 | private boolean flag = false; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/SysServer.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 服务器相关信息 10 | * 11 | * @author ruoyi 12 | */ 13 | @Data 14 | public class SysServer { 15 | 16 | /** 17 | * 服务器信息 18 | */ 19 | @ApiModelProperty("服务器信息") 20 | private Sys sys; 21 | 22 | /** 23 | * cpu 24 | */ 25 | @ApiModelProperty("cpu相关信息") 26 | private SysCpu cpu; 27 | 28 | /** 29 | * 硬盘 30 | */ 31 | @ApiModelProperty("系统硬盘") 32 | private List file; 33 | 34 | /** 35 | * jvm 36 | */ 37 | @ApiModelProperty("Java虚拟机") 38 | private SysJvm jvm; 39 | 40 | /** 41 | * 内存 42 | */ 43 | @ApiModelProperty("内存信息") 44 | private SysMemory memory; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/dto/CacheDto.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | @ApiModel("缓存数据请求参数") 8 | @Data 9 | public class CacheDto { 10 | 11 | /** 12 | * 键名 13 | */ 14 | @ApiModelProperty("键名") 15 | private String key; 16 | 17 | /** 18 | * 类型 19 | */ 20 | @ApiModelProperty("数据类型") 21 | private String type; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/dto/DeptDto.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.dto; 2 | 3 | import ginyi.common.swagger.AddGroup; 4 | import ginyi.common.swagger.UpdateGroup; 5 | import ginyi.system.domain.BaseEntity; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | 10 | import javax.validation.constraints.*; 11 | import java.util.Date; 12 | import java.util.List; 13 | 14 | @EqualsAndHashCode(callSuper = true) 15 | @Data 16 | public class DeptDto extends BaseEntity { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | @ApiModelProperty("部门id") 21 | @NotNull(groups = UpdateGroup.class, message = "部门id不能为空") 22 | private Long deptId; 23 | 24 | /** 25 | * 根据部门ids获取用户列表专用 26 | */ 27 | @ApiModelProperty("部门id(根据部门ids获取用户列表专用)") 28 | private List deptIds; 29 | 30 | @ApiModelProperty("父级id") 31 | private Long parentId; 32 | 33 | private String ancestors; 34 | 35 | @ApiModelProperty("部门名称") 36 | @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "部门名称不能为空") 37 | @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") 38 | private String deptName; 39 | 40 | @ApiModelProperty("显示顺序") 41 | @NotNull(groups = {AddGroup.class, UpdateGroup.class}, message = "显示顺序不能为空") 42 | private Integer sort; 43 | 44 | @ApiModelProperty("部门负责人") 45 | private String leader; 46 | 47 | @ApiModelProperty("部门负责人电话") 48 | @Pattern(regexp = "(?:0|86|\\+86)?1[3-9]\\d{9}", message = "手机号码格式不正确") 49 | private String phone; 50 | 51 | @ApiModelProperty("部门负责人邮箱") 52 | @Email(message = "邮箱格式不正确") 53 | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") 54 | private String email; 55 | 56 | @ApiModelProperty("状态,0正常,1停用") 57 | @Size(min = 0, max = 1, message = "状态不合法,0正常,1停用") 58 | private String status; 59 | 60 | @ApiModelProperty("创建时间,开始时间") 61 | private Date beginTime; 62 | 63 | @ApiModelProperty("创建时间,结束时间") 64 | private Date endTime; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/dto/LoginDto.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import org.hibernate.validator.constraints.Length; 7 | 8 | import javax.validation.constraints.NotEmpty; 9 | 10 | /** 11 | * 用户登录对象 12 | * 13 | * @author ruoyi 14 | */ 15 | @Data 16 | @ApiModel("登录用户参数") 17 | public class LoginDto { 18 | 19 | @ApiModelProperty(value = "用户名", required = true) 20 | @NotEmpty(message = "用户名不能为空") 21 | @Length(min = 5, max = 15, message = "用户名长度必须在5~15个字符之间") 22 | private String username; 23 | 24 | @ApiModelProperty(value = "密码", required = true) 25 | @NotEmpty(message = "密码不能为空") 26 | @Length(min = 6, max = 15, message = "密码长度必须在6~15个字符之间") 27 | private String password; 28 | 29 | @ApiModelProperty(value = "验证码") 30 | private String code; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/dto/NoticeDto.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.dto; 2 | 3 | import ginyi.common.swagger.AddGroup; 4 | import ginyi.common.swagger.UpdateGroup; 5 | import ginyi.system.domain.BaseEntity; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | import javax.validation.constraints.NotBlank; 12 | import javax.validation.constraints.NotEmpty; 13 | import javax.validation.constraints.NotNull; 14 | import javax.validation.constraints.Size; 15 | import java.util.List; 16 | 17 | @EqualsAndHashCode(callSuper = true) 18 | @Data 19 | @ApiModel("系统通知公告请求参数") 20 | public class NoticeDto extends BaseEntity { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * 通知的id 26 | */ 27 | @ApiModelProperty("通知的id") 28 | @NotNull(groups = UpdateGroup.class, message = "通知id不能为空") 29 | private Long noticeId; 30 | 31 | /** 32 | * 通知标题 33 | */ 34 | @ApiModelProperty("通知标题") 35 | @Size(max = 50, message = "通知标题长度不能超过50个字符") 36 | @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "通知标题不能为空") 37 | private String title; 38 | 39 | /** 40 | * 通知的类型(0通知,1公告) 41 | */ 42 | @ApiModelProperty("通知的类型(0通知,1公告)") 43 | @NotEmpty(groups = {AddGroup.class, UpdateGroup.class}, message = "通知的类型不能为空") 44 | private String type; 45 | 46 | /** 47 | * 通知的内容 48 | */ 49 | @ApiModelProperty("通知的内容") 50 | @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "通知的内容不能为空") 51 | private String content; 52 | 53 | /** 54 | * 通知的用户 55 | */ 56 | @ApiModelProperty("通知的用户") 57 | private List userIds; 58 | 59 | 60 | /** 61 | * 已读的用户 62 | */ 63 | @ApiModelProperty("已读的用户") 64 | private List userReadIds; 65 | 66 | /** 67 | * 通知的状态(0正常,1关闭) 68 | */ 69 | @ApiModelProperty("通知的状态(0正常,1关闭)") 70 | @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "通知的状态不能为空") 71 | private String status; 72 | } 73 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/dto/PostDto.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.dto; 2 | 3 | import ginyi.common.swagger.AddGroup; 4 | import ginyi.common.swagger.UpdateGroup; 5 | import ginyi.system.domain.BaseEntity; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | import javax.validation.constraints.NotBlank; 12 | import javax.validation.constraints.NotNull; 13 | import javax.validation.constraints.Size; 14 | import java.util.Date; 15 | import java.util.List; 16 | 17 | @EqualsAndHashCode(callSuper = true) 18 | @Data 19 | @ApiModel("系统岗位参数") 20 | public class PostDto extends BaseEntity { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | @ApiModelProperty("岗位id") 25 | @NotNull(groups = UpdateGroup.class, message = "岗位id不能为空") 26 | private Long postId; 27 | 28 | /** 29 | * 根据岗位ids获取用户列表专用 30 | */ 31 | @ApiModelProperty("岗位id(根据岗位ids获取用户列表专用)") 32 | private List postIds; 33 | 34 | @ApiModelProperty("岗位编码") 35 | @NotBlank(groups = {UpdateGroup.class, AddGroup.class}, message = "岗位编码不能为空") 36 | private String postCode; 37 | 38 | @ApiModelProperty("岗位名称") 39 | @NotBlank(groups = {UpdateGroup.class, AddGroup.class}, message = "岗位名称不能为空") 40 | private String postName; 41 | 42 | @ApiModelProperty("岗位排序") 43 | @NotNull(groups = {UpdateGroup.class, AddGroup.class}, message = "岗位顺序不能为空") 44 | private Integer sort; 45 | 46 | @ApiModelProperty("状态(0正常 1停用)") 47 | @Size(min = 0, max = 1, message = "状态不合法") 48 | @NotBlank(groups = {UpdateGroup.class, AddGroup.class}, message = "岗位状态不能为空") 49 | private String status; 50 | 51 | @ApiModelProperty("创建时间,开始时间") 52 | private Date beginTime; 53 | 54 | @ApiModelProperty("创建时间,结束时间") 55 | private Date endTime; 56 | 57 | } 58 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/dto/RegisterDto.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import lombok.Data; 5 | 6 | @Data 7 | @ApiModel("用户注册参数") 8 | public class RegisterDto extends LoginDto { 9 | } 10 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/dto/RoleDto.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.dto; 2 | 3 | import ginyi.common.swagger.AddGroup; 4 | import ginyi.common.swagger.UpdateGroup; 5 | import ginyi.system.domain.BaseEntity; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | import javax.validation.constraints.NotBlank; 12 | import javax.validation.constraints.NotNull; 13 | import javax.validation.constraints.Size; 14 | import java.util.Date; 15 | import java.util.List; 16 | 17 | @EqualsAndHashCode(callSuper = true) 18 | @Data 19 | @ApiModel("系统角色请求参数") 20 | public class RoleDto extends BaseEntity { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | @ApiModelProperty("角色ID") 25 | @NotNull(groups = UpdateGroup.class, message = "角色id不能为空") 26 | private Long roleId; 27 | 28 | /** 29 | * 根据角色ids获取用户列表专用 30 | */ 31 | @ApiModelProperty("岗位id(根据角色ids获取用户列表专用)") 32 | private List roleIds; 33 | 34 | @ApiModelProperty("角色名称") 35 | @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "角色名称不能为空") 36 | @Size(max = 20, message = "角色名称不能超过20个字符") 37 | private String roleName; 38 | 39 | @ApiModelProperty("角色权限字符串") 40 | @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "角色权限字符串不能为空") 41 | @Size(max = 20, message = "角色权限字符不能超过20个字符") 42 | private String roleKey; 43 | 44 | @ApiModelProperty("角色排序") 45 | @NotNull(groups = {AddGroup.class, UpdateGroup.class}, message = "角色排序不能为空") 46 | private Integer sort; 47 | 48 | @ApiModelProperty("角色状态(0正常 1停用)") 49 | @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "角色状态不能为空") 50 | @Size(max = 1, message = "状态不合法") 51 | private String status; 52 | 53 | @ApiModelProperty("角色菜单权限") 54 | private List permissions; 55 | 56 | @ApiModelProperty("创建时间,开始时间") 57 | private Date beginTime; 58 | 59 | @ApiModelProperty("创建时间,结束时间") 60 | private Date endTime; 61 | } 62 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/BaseVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 基础 vo 10 | */ 11 | @Data 12 | public class BaseVo { 13 | @ApiModelProperty("列表数据") 14 | private List list; 15 | 16 | @ApiModelProperty("总条数") 17 | private Integer count; 18 | } 19 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/CacheKeyVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class CacheKeyVo { 8 | 9 | /** 10 | * 键名 11 | */ 12 | @ApiModelProperty("键名") 13 | private String key; 14 | 15 | /** 16 | * 数据类型 17 | */ 18 | @ApiModelProperty("类型") 19 | private String type; 20 | } 21 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/CacheVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class CacheVo { 8 | 9 | /** 10 | * 键名 11 | */ 12 | @ApiModelProperty("键名") 13 | private String key; 14 | 15 | /** 16 | * 键值 17 | */ 18 | @ApiModelProperty("键名") 19 | private Object value; 20 | 21 | /** 22 | * 时间 23 | */ 24 | @ApiModelProperty("剩余时间") 25 | private long expire; 26 | } 27 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/DeptVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import ginyi.system.domain.BaseEntity; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | @EqualsAndHashCode(callSuper = true) 10 | @Data 11 | @ApiModel("系统部门返回数据") 12 | public class DeptVo extends BaseEntity { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | @ApiModelProperty("部门id") 17 | private Long deptId; 18 | 19 | @ApiModelProperty("父级id") 20 | private Long parentId; 21 | 22 | private String ancestors; 23 | 24 | @ApiModelProperty("部门名称") 25 | private String deptName; 26 | 27 | @ApiModelProperty("显示顺序") 28 | private Integer sort; 29 | 30 | @ApiModelProperty("部门负责人") 31 | private String leader; 32 | 33 | @ApiModelProperty("部门负责人电话") 34 | private String phone; 35 | 36 | @ApiModelProperty("部门负责人邮箱") 37 | private String email; 38 | 39 | @ApiModelProperty("状态,0正常,1停用") 40 | private String status; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/LoginVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import org.springframework.beans.factory.annotation.Value; 7 | 8 | @Data 9 | @ApiModel("登录返回数据") 10 | public class LoginVo { 11 | 12 | @ApiModelProperty(value = "Token令牌", required = true) 13 | private String token; 14 | 15 | @ApiModelProperty(value = "Token请求头Key", required = true) 16 | private String tokenHeader; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/NoticeVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import ginyi.system.domain.BaseEntity; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | @EqualsAndHashCode(callSuper = true) 10 | @Data 11 | @ApiModel("系统通知公告返回数据") 12 | public class NoticeVo extends BaseEntity { 13 | /** 14 | * 通知的id 15 | */ 16 | @ApiModelProperty("通知的id") 17 | private Long noticeId; 18 | 19 | /** 20 | * 通知标题 21 | */ 22 | @ApiModelProperty("通知标题") 23 | private String title; 24 | 25 | /** 26 | * 通知的类型(0通知,1公告) 27 | */ 28 | @ApiModelProperty("通知的类型(0通知,1公告)") 29 | private String type; 30 | 31 | /** 32 | * 通知的内容 33 | */ 34 | @ApiModelProperty("通知的内容") 35 | private String content; 36 | 37 | /** 38 | * 是否已读 39 | */ 40 | @ApiModelProperty("是否已读") 41 | private boolean haveRead; 42 | 43 | /** 44 | * 通知的状态(0正常,1关闭) 45 | */ 46 | @ApiModelProperty("通知的状态(0正常,1关闭)") 47 | private String status; 48 | } 49 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/PostVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import ginyi.system.domain.BaseEntity; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | @EqualsAndHashCode(callSuper = true) 12 | @Data 13 | @ApiModel("系统岗位返回数据") 14 | public class PostVo extends BaseEntity { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | @ApiModelProperty("岗位序号") 19 | private Long postId; 20 | 21 | @ApiModelProperty("岗位编码") 22 | private String postCode; 23 | 24 | @ApiModelProperty("岗位名称") 25 | private String postName; 26 | 27 | @ApiModelProperty("岗位排序") 28 | private Integer sort; 29 | 30 | @ApiModelProperty("状态(0正常 1停用)") 31 | private String status; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/RoleVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import ginyi.system.domain.BaseEntity; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | import java.util.List; 10 | 11 | @EqualsAndHashCode(callSuper = true) 12 | @Data 13 | @ApiModel("系统角色返回数据") 14 | public class RoleVo extends BaseEntity { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | @ApiModelProperty("角色ID") 19 | private Long roleId; 20 | 21 | @ApiModelProperty("角色名称") 22 | private String roleName; 23 | 24 | @ApiModelProperty("角色权限字符串") 25 | private String roleKey; 26 | 27 | @ApiModelProperty("角色排序") 28 | private Integer sort; 29 | 30 | @ApiModelProperty("角色状态(0正常 1停用)") 31 | private String status; 32 | 33 | @ApiModelProperty("角色菜单权限") 34 | private List permissions; 35 | } 36 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/SessionUserVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class SessionUserVo { 7 | 8 | /** 9 | * 用户唯一标识 10 | */ 11 | private String token; 12 | 13 | /** 14 | * 登录时间 15 | */ 16 | private Long loginTime; 17 | 18 | /** 19 | * 登录IP地址 20 | */ 21 | private String ipaddr; 22 | 23 | /** 24 | * 登录地点 25 | */ 26 | private String loginLocation; 27 | 28 | /** 29 | * 浏览器类型 30 | */ 31 | private String browser; 32 | 33 | /** 34 | * 操作系统 35 | */ 36 | private String os; 37 | 38 | /** 39 | * 登录名称 40 | */ 41 | private String username; 42 | } 43 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/domain/model/vo/UserVo.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.domain.model.vo; 2 | 3 | import ginyi.system.domain.BaseEntity; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @ApiModel("系统用户返回数据") 12 | public class UserVo extends BaseEntity { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | @ApiModelProperty("用户id") 17 | private Long userId; 18 | 19 | @ApiModelProperty("用户账号") 20 | private String userName; 21 | 22 | @ApiModelProperty("部门id") 23 | private Long deptId; 24 | 25 | @ApiModelProperty("用户昵称") 26 | private String nickName; 27 | 28 | @ApiModelProperty("邮箱") 29 | private String email; 30 | 31 | @ApiModelProperty("手机号码") 32 | private String phoneNumber; 33 | 34 | @ApiModelProperty("性别(0男 1女 2未知)") 35 | private String sex; 36 | 37 | @ApiModelProperty("头像") 38 | private String avatar; 39 | 40 | @ApiModelProperty("密码") 41 | private String password; 42 | 43 | @ApiModelProperty("状态(0正常 1停用)") 44 | private String status; 45 | 46 | @ApiModelProperty("岗位id") 47 | private List postIds; 48 | 49 | @ApiModelProperty("角色id") 50 | private List roleIds; 51 | } 52 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/mapper/SysConfigMapper.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import ginyi.system.domain.SysConfig; 5 | 6 | /** 7 | * 系统配置表 8 | */ 9 | public interface SysConfigMapper extends BaseMapper { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/mapper/SysDeptMapper.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import ginyi.system.domain.SysDept; 7 | import ginyi.system.domain.model.dto.DeptDto; 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | public interface SysDeptMapper extends BaseMapper { 11 | 12 | /** 13 | * 查询部门列表 14 | * 15 | * @param deptDto 16 | * @param page 17 | */ 18 | public IPage list(@Param("deptDto") DeptDto deptDto, Page page); 19 | 20 | /** 21 | * 新增部门 22 | * 23 | * @param deptDto 24 | */ 25 | public void insertDept(@Param("deptDto") DeptDto deptDto); 26 | 27 | /** 28 | * 更新部门 29 | * 30 | * @param deptDto 31 | */ 32 | public void updateDept(@Param("deptDto") DeptDto deptDto); 33 | 34 | /** 35 | * 更新状态 36 | * 37 | * @param deptDto 38 | */ 39 | public void updateDeptStatus(@Param("deptDto") DeptDto deptDto); 40 | } 41 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/mapper/SysLogininforMapper.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.mapper; 2 | 3 | import ginyi.system.domain.SysLogLogin; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 系统访问日志情况信息 数据层 9 | * 10 | * @author ruoyi 11 | */ 12 | public interface SysLogininforMapper { 13 | /** 14 | * 新增系统登录日志 15 | * 16 | * @param logininfor 访问日志对象 17 | */ 18 | public void insertLogininfor(SysLogLogin logininfor); 19 | 20 | /** 21 | * 查询系统登录日志集合 22 | * 23 | * @param logininfor 访问日志对象 24 | * @return 登录记录集合 25 | */ 26 | public List selectLogininforList(SysLogLogin logininfor); 27 | 28 | /** 29 | * 批量删除系统登录日志 30 | * 31 | * @param infoIds 需要删除的登录日志ID 32 | * @return 结果 33 | */ 34 | public int deleteLogininforByIds(Long[] infoIds); 35 | 36 | /** 37 | * 清空系统登录日志 38 | * 39 | * @return 结果 40 | */ 41 | public int cleanLogininfor(); 42 | } 43 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/mapper/SysMenuMapper.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import ginyi.system.domain.SysMenu; 5 | import ginyi.system.domain.model.dto.MenuDto; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 菜单表 数据层 12 | * 13 | * @author ruoyi 14 | */ 15 | public interface SysMenuMapper extends BaseMapper { 16 | /** 17 | * 根据用户ID查询权限 18 | * 19 | * @param userId 用户ID 20 | * @return 权限列表 21 | */ 22 | public List selectMenuPermsByUserId(Long userId); 23 | 24 | /** 25 | * 根据角色ID查询权限 26 | * 27 | * @param roleId 角色ID 28 | * @return 权限列表 29 | */ 30 | public List selectMenuPermsByRoleId(Long roleId); 31 | 32 | /** 33 | * 根据用户查询系统菜单列表 34 | * 35 | * @return 菜单列表 36 | */ 37 | public List selectMenuListByUserId(Long userId); 38 | 39 | /** 40 | * 管理员查询(管理)菜单列表 41 | * @return 42 | */ 43 | public List selectMenuListByAdmin(@Param("menuDto") MenuDto menuDto); 44 | 45 | /** 46 | * 添加菜单 47 | * @param menuDto 48 | * @return 49 | */ 50 | public boolean insertMenu(@Param("menuDto") MenuDto menuDto); 51 | 52 | /** 53 | * 更新菜单 54 | * @param menuDto 55 | */ 56 | public void updateMenu(@Param("menuDto") MenuDto menuDto); 57 | 58 | /** 59 | * 更新状态 60 | * @param menuDto 61 | */ 62 | public void updateMenuStatus(@Param("menuDto") MenuDto menuDto); 63 | } 64 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/mapper/SysNoticeMapper.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import ginyi.system.domain.SysNotice; 7 | import ginyi.system.domain.model.dto.NoticeDto; 8 | import ginyi.system.domain.model.vo.NoticeVo; 9 | import org.apache.ibatis.annotations.Param; 10 | 11 | 12 | public interface SysNoticeMapper extends BaseMapper { 13 | 14 | /** 15 | * 获取通知公告列表 16 | */ 17 | public IPage list(@Param("noticeDto") NoticeDto noticeDto, Page page); 18 | 19 | /** 20 | * 发布通知公告 21 | */ 22 | public void addNotice(@Param("noticeDto") NoticeDto noticeDto); 23 | 24 | /** 25 | * 获取用户通知公告列表 26 | * @param userId 27 | * @param page 28 | * @return 29 | */ 30 | public IPage getUserNoticeList(Long userId, Page page); 31 | 32 | /** 33 | * 确认收到通知公告 34 | * @param notice 35 | */ 36 | public void haveRead(@Param("notice") SysNotice notice); 37 | 38 | /** 39 | * 根据 noticeId 查询通知公告 40 | * @param noticeId 41 | * @return 42 | */ 43 | public SysNotice selectOne(Long noticeId); 44 | 45 | /** 46 | * 更新通知公告 47 | * @param noticeDto 48 | */ 49 | public void updateNotice(@Param("noticeDto") NoticeDto noticeDto); 50 | } 51 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/mapper/SysOperLogMapper.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.mapper; 2 | 3 | import ginyi.system.domain.SysLogOperation; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 操作日志 数据层 9 | * 10 | * @author ruoyi 11 | */ 12 | public interface SysOperLogMapper { 13 | /** 14 | * 新增操作日志 15 | * 16 | * @param operLog 操作日志对象 17 | */ 18 | public void insertOperlog(SysLogOperation operLog); 19 | 20 | /** 21 | * 查询系统操作日志集合 22 | * 23 | * @param operLog 操作日志对象 24 | * @return 操作日志集合 25 | */ 26 | public List selectOperLogList(SysLogOperation operLog); 27 | 28 | /** 29 | * 批量删除系统操作日志 30 | * 31 | * @param operIds 需要删除的操作日志ID 32 | * @return 结果 33 | */ 34 | public int deleteOperLogByIds(Long[] operIds); 35 | 36 | /** 37 | * 查询操作日志详细 38 | * 39 | * @param operId 操作ID 40 | * @return 操作日志对象 41 | */ 42 | public SysLogOperation selectOperLogById(Long operId); 43 | 44 | /** 45 | * 清空操作日志 46 | */ 47 | public void cleanOperLog(); 48 | } 49 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/mapper/SysPostMapper.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import ginyi.system.domain.SysPost; 7 | import ginyi.system.domain.model.dto.PostDto; 8 | import ginyi.system.domain.model.vo.PostVo; 9 | import org.apache.ibatis.annotations.Param; 10 | 11 | /** 12 | * 岗位 13 | */ 14 | public interface SysPostMapper extends BaseMapper { 15 | 16 | /** 17 | * 查询岗位列表 18 | * 19 | * @param postDto 20 | * @param page 21 | * @return 22 | */ 23 | public IPage list(@Param("postDto") PostDto postDto, Page page); 24 | 25 | /** 26 | * 新增岗位 27 | * 28 | * @param postDto 29 | */ 30 | public void insertPost(@Param("postDto") PostDto postDto); 31 | 32 | /** 33 | * 更新岗位 34 | * 35 | * @param postDto 36 | */ 37 | public void updatePost(@Param("postDto") PostDto postDto); 38 | 39 | /** 40 | * 更新状态 41 | * @param postDto 42 | */ 43 | public void updatePostStatus(@Param("postDto") PostDto postDto); 44 | } 45 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/mapper/SysRoleMapper.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import ginyi.system.domain.SysRole; 7 | import ginyi.system.domain.model.dto.RoleDto; 8 | import ginyi.system.domain.model.vo.RoleVo; 9 | import org.apache.ibatis.annotations.Param; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * 角色表 数据层 15 | * 16 | * @author ruoyi 17 | */ 18 | public interface SysRoleMapper extends BaseMapper { 19 | 20 | 21 | /** 22 | * 根据用户ID查询角色 23 | * 24 | * @param userId 用户ID 25 | * @return 角色列表 26 | */ 27 | public List selectRolePermissionByUserId(Long userId); 28 | 29 | /** 30 | * 查询角色列表 31 | * 32 | * @param roleDto 33 | * @param page 34 | * @return 35 | */ 36 | public IPage list(@Param("roleDto") RoleDto roleDto, Page page); 37 | 38 | /** 39 | * 新增角色 40 | * 41 | * @param roleDto 42 | */ 43 | public void insertRole(@Param("roleDto") RoleDto roleDto); 44 | 45 | /** 46 | * 新增角色对应的菜单权限 47 | * 48 | * @param roleDto 49 | */ 50 | public void insertRoleMenu(@Param("roleDto") RoleDto roleDto); 51 | 52 | /** 53 | * 更新角色 54 | * 55 | * @param roleDto 56 | */ 57 | public void updateRole(@Param("roleDto") RoleDto roleDto); 58 | 59 | /** 60 | * 更新角色对应的菜单权限 61 | * 62 | * @param roleDto 63 | */ 64 | public void updateRoleMenu(@Param("roleDto") RoleDto roleDto); 65 | 66 | /** 67 | * 根据角色id查询角色详情 68 | * @param roleId 69 | * @return 70 | */ 71 | public RoleVo selectRoleByRoleId(Long roleId); 72 | 73 | /** 74 | * 更新状态 75 | * @param roleDto 76 | */ 77 | public void updateRoleStatus(@Param("roleDto") RoleDto roleDto); 78 | } 79 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysConfigService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | public interface ISysConfigService { 4 | 5 | /** 6 | * 获取验证码开关 7 | * 8 | * @return true开启,false关闭 9 | */ 10 | public boolean selectCaptchaEnabled(); 11 | 12 | /** 13 | * 根据键名查询参数配置信息 14 | * 15 | * @param configKey 参数key 16 | * @return 参数键值 17 | */ 18 | public String selectConfigByKey(String configKey); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysDeptService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.SysDept; 4 | import ginyi.system.domain.model.dto.DeptDto; 5 | import ginyi.system.domain.model.vo.BaseVo; 6 | import ginyi.system.domain.model.vo.DeptVo; 7 | 8 | import java.util.Set; 9 | 10 | /** 11 | * 系统部门 12 | */ 13 | public interface ISysDeptService { 14 | 15 | /** 16 | * 获取部门列表 17 | * @param deptDto 18 | * @param page 19 | * @param pageSize 20 | */ 21 | public BaseVo list(DeptDto deptDto, Long page, Long pageSize); 22 | 23 | /** 24 | * 根据部门id获取部门详情 25 | * @param deptId 26 | * @return 27 | */ 28 | public DeptVo getDeptByDeptId(Long deptId); 29 | 30 | /** 31 | * 新增部门 32 | * @param deptDto 33 | */ 34 | public void addDept(DeptDto deptDto); 35 | 36 | /** 37 | * 更新部门 38 | * @param deptDto 39 | */ 40 | public void updateDept(DeptDto deptDto); 41 | 42 | /** 43 | * 删除部门 44 | * @param deptId 45 | */ 46 | public void removeDeptById(Long deptId); 47 | 48 | /** 49 | * 批量删除部门 50 | * @param ids 51 | */ 52 | public void removeDeptByIds(Set ids); 53 | 54 | /** 55 | * 更改状态(0正常 1停用) 56 | * @param deptDto 57 | */ 58 | public void updateStatus(DeptDto deptDto); 59 | } 60 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysLogService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.SysLogLogin; 4 | import ginyi.system.domain.SysLogOperation; 5 | import ginyi.system.domain.model.vo.BaseVo; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | 8 | import java.util.List; 9 | 10 | public interface ISysLogService { 11 | 12 | /** 13 | * 获取登录日志 14 | * @param page 15 | * @param pageSize 16 | * @return 17 | */ 18 | public BaseVo getLoginLogList(Long page, Long pageSize); 19 | 20 | /** 21 | * 获取操作日志 22 | * @param page 23 | * @param pageSize 24 | * @return 25 | */ 26 | public BaseVo getOperationLogList(Long page, Long pageSize); 27 | } 28 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysLoginService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.model.dto.LoginDto; 4 | import ginyi.system.domain.model.dto.RegisterDto; 5 | import ginyi.system.domain.model.vo.LoginVo; 6 | 7 | public interface ISysLoginService { 8 | 9 | /** 10 | * 登录验证 11 | * @param loginDto 12 | * @return 13 | */ 14 | public LoginVo login(LoginDto loginDto); 15 | 16 | /** 17 | * 用户注册 18 | * @param registerDto 19 | */ 20 | public void register(RegisterDto registerDto); 21 | } 22 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysLogininforService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.SysLogLogin; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 系统访问日志情况信息 服务层 9 | * 10 | * @author ruoyi 11 | */ 12 | public interface ISysLogininforService { 13 | /** 14 | * 新增系统登录日志 15 | * 16 | * @param logininfor 访问日志对象 17 | */ 18 | public void insertLogininfor(SysLogLogin logininfor); 19 | 20 | /** 21 | * 查询系统登录日志集合 22 | * 23 | * @param logininfor 访问日志对象 24 | * @return 登录记录集合 25 | */ 26 | public List selectLogininforList(SysLogLogin logininfor); 27 | 28 | /** 29 | * 批量删除系统登录日志 30 | * 31 | * @param infoIds 需要删除的登录日志ID 32 | * @return 结果 33 | */ 34 | public int deleteLogininforByIds(Long[] infoIds); 35 | 36 | /** 37 | * 清空系统登录日志 38 | */ 39 | public void cleanLogininfor(); 40 | } 41 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysMenuService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.SysMenu; 4 | import ginyi.system.domain.model.dto.MenuDto; 5 | import ginyi.system.domain.model.vo.BaseVo; 6 | 7 | import java.util.Set; 8 | 9 | /** 10 | * 菜单 业务层 11 | * 12 | * @author ruoyi 13 | */ 14 | public interface ISysMenuService { 15 | /** 16 | * 根据角色ID查询权限 17 | * 18 | * @param roleId 角色ID 19 | * @return 权限列表 20 | */ 21 | public Set selectMenuPermsByRoleId(Long roleId); 22 | 23 | /** 24 | * 根据用户ID查询权限 25 | * 26 | * @param userId 用户ID 27 | * @return 权限列表 28 | */ 29 | public Set selectMenuPermsByUserId(Long userId); 30 | 31 | /** 32 | * 根据用户查询系统菜单列表 33 | * 34 | * @return 菜单列表 35 | */ 36 | public BaseVo selectMenuList(); 37 | 38 | /** 39 | * 管理员查询系统菜单列表 40 | * 41 | * @return 菜单列表 42 | */ 43 | public BaseVo list(MenuDto menuDto); 44 | 45 | /** 46 | * 添加菜单 47 | * @param menuDto 48 | */ 49 | public void addMenu(MenuDto menuDto); 50 | 51 | /** 52 | * 根据id获取菜单详情 53 | * @param menuId 54 | * @return 55 | */ 56 | public SysMenu getMenuById(Long menuId); 57 | 58 | /** 59 | * 更新菜单 60 | * @param menuDto 61 | */ 62 | public void updateMenu(MenuDto menuDto); 63 | 64 | /** 65 | * 根据菜单id删除 66 | * @param menuId 67 | */ 68 | public void removeMenuById(Long menuId); 69 | 70 | /** 71 | * 根据ids批量删除菜单 72 | * @param ids 73 | */ 74 | public void removeMenuByIds(Set ids); 75 | 76 | /** 77 | * 更改状态(0正常 1停用) 78 | * @param menuDto 79 | */ 80 | public void updateStatus(MenuDto menuDto); 81 | } 82 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysMonitorService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.SysServer; 4 | import ginyi.system.domain.model.dto.CacheDto; 5 | import ginyi.system.domain.model.vo.BaseVo; 6 | import ginyi.system.domain.model.vo.CacheKeyVo; 7 | import ginyi.system.domain.model.vo.CacheVo; 8 | 9 | /** 10 | * 系统服务 11 | */ 12 | public interface ISysMonitorService { 13 | 14 | /** 15 | * 获取系统服务信息,如 cpu、内存 等 16 | */ 17 | public SysServer getServerInfo() throws InterruptedException; 18 | 19 | /** 20 | * 获取缓存列表 21 | */ 22 | public BaseVo getCacheList(); 23 | 24 | /** 25 | * 获取缓存详情 26 | */ 27 | public CacheVo getCacheDetails(CacheDto cacheDto); 28 | 29 | /** 30 | * 删除缓存 31 | */ 32 | public void removeCache(String key); 33 | } 34 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysNoticeService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.SysNotice; 4 | import ginyi.system.domain.model.dto.NoticeDto; 5 | import ginyi.system.domain.model.vo.BaseVo; 6 | import ginyi.system.domain.model.vo.NoticeVo; 7 | 8 | /** 9 | * 通知公告 10 | */ 11 | public interface ISysNoticeService { 12 | 13 | /** 14 | * 获取通知公告列表 15 | * @param noticeDto 16 | * @param page 17 | * @param pageSize 18 | * @return 19 | */ 20 | public BaseVo list(NoticeDto noticeDto, Long page, Long pageSize); 21 | 22 | /** 23 | * 发布通知公告 24 | * @param noticeDto 25 | */ 26 | public void add(NoticeDto noticeDto); 27 | 28 | /** 29 | * 获取用户通知公告列表 30 | * @param page 31 | * @param pageSize 32 | * @return 33 | */ 34 | public BaseVo getUserNoticeList(Long page, Long pageSize); 35 | 36 | /** 37 | * 确认收到通知公告 38 | * @param noticeId 39 | */ 40 | public void haveRead(Long noticeId); 41 | 42 | /** 43 | * 删除通知公告 44 | * @param noticeId 45 | */ 46 | public void remove(Long noticeId); 47 | 48 | /** 49 | * 更新通知公告 50 | * @param noticeDto 51 | */ 52 | public void updateNotice(NoticeDto noticeDto); 53 | } 54 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysOnlineService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.model.vo.BaseVo; 4 | import ginyi.system.domain.model.vo.SessionUserVo; 5 | 6 | import java.util.Set; 7 | 8 | public interface ISysOnlineService { 9 | 10 | /** 11 | * 当前在线用户列表 12 | */ 13 | public BaseVo getOnlineUserList(Long page, Long pageSize); 14 | 15 | /** 16 | * 强制用户下线 17 | * @param sessionId 18 | */ 19 | public void removeUser(String sessionId); 20 | 21 | /** 22 | * 批量强制用户下线 23 | * @param ids 24 | */ 25 | public void removeUser(Set ids); 26 | } 27 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysOperLogService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.SysLogOperation; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 操作日志 服务层 9 | * 10 | * @author ruoyi 11 | */ 12 | public interface ISysOperLogService { 13 | /** 14 | * 新增操作日志 15 | * 16 | * @param operLog 操作日志对象 17 | */ 18 | public void insertOperlog(SysLogOperation operLog); 19 | 20 | /** 21 | * 查询系统操作日志集合 22 | * 23 | * @param operLog 操作日志对象 24 | * @return 操作日志集合 25 | */ 26 | public List selectOperLogList(SysLogOperation operLog); 27 | 28 | /** 29 | * 批量删除系统操作日志 30 | * 31 | * @param operIds 需要删除的操作日志ID 32 | * @return 结果 33 | */ 34 | public int deleteOperLogByIds(Long[] operIds); 35 | 36 | /** 37 | * 查询操作日志详细 38 | * 39 | * @param operId 操作ID 40 | * @return 操作日志对象 41 | */ 42 | public SysLogOperation selectOperLogById(Long operId); 43 | 44 | /** 45 | * 清空操作日志 46 | */ 47 | public void cleanOperLog(); 48 | } 49 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysPasswordService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.SysUser; 4 | 5 | public interface ISysPasswordService { 6 | 7 | public void validate(SysUser user); 8 | } 9 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysPermissionService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.SysUser; 4 | 5 | import java.util.Set; 6 | 7 | public interface ISysPermissionService { 8 | 9 | /** 10 | * 获取角色数据权限 11 | * 12 | * @param user 用户信息 13 | * @return 角色权限信息 14 | */ 15 | public Set getRolePermission(SysUser user); 16 | 17 | /** 18 | * 获取菜单数据权限 19 | * 20 | * @param user 用户信息 21 | * @return 菜单权限信息 22 | */ 23 | public Set getMenuPermission(SysUser user); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysPostService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.model.dto.PostDto; 4 | import ginyi.system.domain.model.dto.RoleDto; 5 | import ginyi.system.domain.model.vo.BaseVo; 6 | import ginyi.system.domain.model.vo.PostVo; 7 | 8 | import java.util.Set; 9 | 10 | public interface ISysPostService { 11 | 12 | /** 13 | * 查询岗位列表 14 | * 15 | * @param postDto 16 | * @param page 17 | * @param pageSize 18 | * @return 19 | */ 20 | public BaseVo list(PostDto postDto, Long page, Long pageSize); 21 | 22 | /** 23 | * 根据岗位id获取岗位详情 24 | * 25 | * @param postId 26 | * @return 27 | */ 28 | public PostVo getPostByPostId(Long postId); 29 | 30 | /** 31 | * 添加岗位 32 | * 33 | * @param postDto 34 | */ 35 | public void addPost(PostDto postDto); 36 | 37 | /** 38 | * 更新岗位 39 | * 40 | * @param postDto 41 | */ 42 | public void updatePost(PostDto postDto); 43 | 44 | /** 45 | * 根据id删除岗位 46 | * 47 | * @param postId 48 | */ 49 | public void removePostById(Long postId); 50 | 51 | /** 52 | * 批量删除岗位 53 | * 54 | * @param ids 55 | */ 56 | void removeDeptByIds(Set ids); 57 | 58 | /** 59 | * 更改状态(0正常 1停用) 60 | * @param postDto 61 | */ 62 | public void updateStatus(PostDto postDto); 63 | } 64 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ISysRoleService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.model.dto.RoleDto; 4 | import ginyi.system.domain.model.dto.UserDto; 5 | import ginyi.system.domain.model.vo.BaseVo; 6 | import ginyi.system.domain.model.vo.RoleVo; 7 | 8 | import java.util.Set; 9 | 10 | public interface ISysRoleService { 11 | /** 12 | * 根据用户ID查询角色权限 13 | * 14 | * @param userId 用户ID 15 | * @return 权限列表 16 | */ 17 | public Set selectRolePermissionByUserId(Long userId); 18 | 19 | /** 20 | * 角色列表 21 | * 22 | * @param roleDto 23 | * @param page 24 | * @param pageSize 25 | * @return 26 | */ 27 | BaseVo list(RoleDto roleDto, Long page, Long pageSize); 28 | 29 | /** 30 | * 根据角色id获取角色 31 | * 32 | * @param roleId 33 | * @return 34 | */ 35 | public RoleVo getRoleByRoleId(Long roleId); 36 | 37 | /** 38 | * 新增角色 39 | * 40 | * @param roleDto 41 | */ 42 | public void addRole(RoleDto roleDto); 43 | 44 | /** 45 | * 跟新角色 46 | * 47 | * @param roleDto 48 | */ 49 | public void updateRole(RoleDto roleDto); 50 | 51 | /** 52 | * 删除角色 53 | * 54 | * @param roleId 55 | */ 56 | public void removeByRoleId(Long roleId); 57 | 58 | /** 59 | * 批量删除角色 60 | * 61 | * @param ids 62 | */ 63 | public void removeByRoleIds(Set ids); 64 | 65 | /** 66 | * 更改状态(0正常 1停用) 67 | * @param roleDto 68 | */ 69 | public void updateStatus(RoleDto roleDto); 70 | } 71 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/ITokenService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | import ginyi.system.domain.LoginUser; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | public interface ITokenService { 8 | 9 | /** 10 | * 创建令牌 11 | * 12 | * @param loginUser 用户信息 13 | * @return 令牌 14 | */ 15 | public String createToken(LoginUser loginUser); 16 | 17 | /** 18 | * 获取用户身份信息 19 | * 20 | * @return 用户信息 21 | */ 22 | public LoginUser getLoginUser(HttpServletRequest request); 23 | 24 | /** 25 | * 删除用户身份信息 26 | */ 27 | public void delLoginUser(String token); 28 | 29 | /** 30 | * 验证令牌有效期,相差不足20分钟,自动刷新缓存 31 | * 32 | * @param loginUser 33 | * @return 令牌 34 | */ 35 | public void verifyToken(LoginUser loginUser); 36 | } 37 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/java/ginyi/system/service/IVerifyService.java: -------------------------------------------------------------------------------- 1 | package ginyi.system.service; 2 | 3 | public interface IVerifyService { 4 | 5 | /** 6 | * 图片验证码 7 | */ 8 | public String captcha(); 9 | 10 | /** 11 | * 校验验证码 12 | */ 13 | public void checkImgCode(String code); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ginyi-springboot/ginyi-system/src/main/resources/logging-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | %d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %magenta([%21thread]) %green([%-50.50class]) >>> %cyan(%msg) %n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ${LOG_PATH}/ginyi-springboot-%d{yyyy-MM-dd}.%i.log 21 | 22 | 23 | 100MB 24 | 25 | 26 | 15 27 | 28 | 29 | ${LOG_PATTERN} 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /ginyi-vue3/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_size = 4 6 | -------------------------------------------------------------------------------- /ginyi-vue3/.env.develop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ginyi3705/ginyi-spring-vue/6c07298cd34c75cc803a61af22a0af2ce6e7cf01/ginyi-vue3/.env.develop -------------------------------------------------------------------------------- /ginyi-vue3/.env.production: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ginyi3705/ginyi-spring-vue/6c07298cd34c75cc803a61af22a0af2ce6e7cf01/ginyi-vue3/.env.production -------------------------------------------------------------------------------- /ginyi-vue3/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /ginyi-vue3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ginyi-vue3", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "module", 6 | "web-types": "web-types.json", 7 | "scripts": { 8 | "dev": "vite", 9 | "build": "vite build", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "@types/node": "^18.11.18", 14 | "@vicons/ionicons5": "^0.12.0", 15 | "@vitejs/plugin-vue-jsx": "^3.0.0", 16 | "@vueuse/core": "^9.10.0", 17 | "axios": "^1.2.2", 18 | "less": "^4.1.3", 19 | "less-loader": "^11.1.0", 20 | "mitt": "^3.0.0", 21 | "monaco-editor": "^0.36.0", 22 | "naive-ui": "^2.34.3", 23 | "pinia": "^2.0.28", 24 | "vue": "^3.2.45", 25 | "vue-router": "^4.1.6", 26 | "vuedraggable": "^4.1.0" 27 | }, 28 | "devDependencies": { 29 | "@vitejs/plugin-vue": "^4.0.0", 30 | "typescript": "^4.9.3", 31 | "vite": "^4.0.0", 32 | "vue-tsc": "^1.0.11" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ginyi-vue3/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ginyi3705/ginyi-spring-vue/6c07298cd34c75cc803a61af22a0af2ce6e7cf01/ginyi-vue3/public/favicon.ico -------------------------------------------------------------------------------- /ginyi-vue3/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ginyi-vue3/src/App.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 48 | -------------------------------------------------------------------------------- /ginyi-vue3/src/api/controller/logController.ts: -------------------------------------------------------------------------------- 1 | import useRequest from "@/api/useRequest"; 2 | import {IPage} from "@/interface/modules/system"; 3 | 4 | export class logController { 5 | /** 6 | * 获取操作日志 7 | * @param data 8 | * @param pagination 9 | */ 10 | static getOperationLogList(data: any, pagination?: IPage): Promise { 11 | return useRequest({ 12 | url: "/api/log/getOperationLogList", 13 | method: "get", 14 | params: pagination, 15 | }) 16 | } 17 | 18 | /** 19 | * 获取登录日志 20 | * @param data 21 | * @param pagination 22 | */ 23 | static getLoginLogList(data: any, pagination?: IPage): Promise { 24 | return useRequest({ 25 | url: "/api/log/getLoginLogList", 26 | method: "get", 27 | params: pagination, 28 | }) 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/api/controller/monitorController.ts: -------------------------------------------------------------------------------- 1 | import useRequest from "@/api/useRequest"; 2 | 3 | export class monitorController { 4 | /** 5 | * 获取服务器信息 6 | */ 7 | static getServerInfo(): Promise { 8 | return useRequest({ 9 | url: "/api/monitor/getServerInfo", 10 | method: "get", 11 | }) 12 | } 13 | 14 | /** 15 | * 获取缓存列表 16 | */ 17 | static getCacheList(): Promise { 18 | return useRequest({ 19 | url: "/api/monitor/getCacheList", 20 | method: "get", 21 | }) 22 | } 23 | 24 | /** 25 | * 获取缓存数据 26 | */ 27 | static getCacheValue(data: any): Promise { 28 | return useRequest({ 29 | url: "/api/monitor/getCacheValue", 30 | method: "post", 31 | data: data 32 | }) 33 | } 34 | 35 | /** 36 | * 删除缓存 37 | */ 38 | static removeCache(key: string): Promise { 39 | return useRequest({ 40 | url: `/api/monitor/removeCache/${key}`, 41 | method: "post", 42 | }) 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/api/controller/onlineController.ts: -------------------------------------------------------------------------------- 1 | import useRequest from "@/api/useRequest"; 2 | import {IPage} from "@/interface/modules/system"; 3 | 4 | export class onlineController { 5 | /** 6 | * 获取在线用户 7 | * @param data 8 | * @param pagination 9 | */ 10 | static getOnlineUserList(data: any, pagination?: IPage): Promise { 11 | return useRequest({ 12 | url: "/api/online/getOnlineUserList", 13 | method: "get", 14 | params: pagination, 15 | }) 16 | } 17 | 18 | /** 19 | * 强制退出 20 | * @param token 21 | */ 22 | static removeUser(token: any): Promise { 23 | return useRequest({ 24 | url: `/api/online/removeUser/${token}`, 25 | method: "post", 26 | }) 27 | } 28 | 29 | /** 30 | * 批量强制退出 31 | * @param data 32 | */ 33 | static batchRemoveUser(data: any): Promise { 34 | return useRequest({ 35 | url: "/api/online/removeUser", 36 | method: "post", 37 | data 38 | }) 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/api/index.ts: -------------------------------------------------------------------------------- 1 | import {userController} from "@/api/controller/userController"; 2 | import {menuController} from "@/api/controller/menuController"; 3 | import {deptController} from "@/api/controller/deptController"; 4 | import {postController} from "@/api/controller/postController"; 5 | import {roleController} from "@/api/controller/roleController"; 6 | import {logController} from "@/api/controller/logController"; 7 | import {onlineController} from "@/api/controller/onlineController"; 8 | import {monitorController} from "@/api/controller/monitorController"; 9 | 10 | export { 11 | userController, 12 | menuController, 13 | deptController, 14 | postController, 15 | roleController, 16 | logController, 17 | onlineController, 18 | monitorController 19 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/assets/404/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ginyi3705/ginyi-spring-vue/6c07298cd34c75cc803a61af22a0af2ce6e7cf01/ginyi-vue3/src/assets/404/404.png -------------------------------------------------------------------------------- /ginyi-vue3/src/assets/404/404_cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ginyi3705/ginyi-spring-vue/6c07298cd34c75cc803a61af22a0af2ce6e7cf01/ginyi-vue3/src/assets/404/404_cloud.png -------------------------------------------------------------------------------- /ginyi-vue3/src/assets/img/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ginyi3705/ginyi-spring-vue/6c07298cd34c75cc803a61af22a0af2ce6e7cf01/ginyi-vue3/src/assets/img/logo.jpg -------------------------------------------------------------------------------- /ginyi-vue3/src/components/commonForm/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 41 | 42 | -------------------------------------------------------------------------------- /ginyi-vue3/src/components/commonForm/props.ts: -------------------------------------------------------------------------------- 1 | export const definedProps = { 2 | /** 3 | * 确认按钮的文本内容 4 | */ 5 | submitButtonText: { 6 | type: String, 7 | default: "提交" 8 | }, 9 | /** 10 | * 取消按钮的文本内容 11 | */ 12 | cancelButtonText: { 13 | type: String, 14 | default: "重置" 15 | }, 16 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/components/commonModal/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 47 | 48 | -------------------------------------------------------------------------------- /ginyi-vue3/src/components/commonModal/props.ts: -------------------------------------------------------------------------------- 1 | export const definedProps = { 2 | /** 3 | * 模型标题 4 | */ 5 | title: { 6 | type: String, 7 | default: "标题" 8 | }, 9 | /** 10 | * 模型预设 11 | */ 12 | preset: { 13 | type: String, 14 | default: "dialog" 15 | }, 16 | /** 17 | * 确定按钮文本内容 18 | */ 19 | positiveText: { 20 | type: String, 21 | default: "确认" 22 | }, 23 | /** 24 | * 取消按钮文本内容 25 | */ 26 | negativeText: { 27 | type: String, 28 | default: "取消" 29 | }, 30 | show: { 31 | type: Boolean, 32 | default: false 33 | } 34 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/components/commonTable/useCommonTable.ts: -------------------------------------------------------------------------------- 1 | import {reactive, ref} from "vue"; 2 | import {PaginationInfo, PaginationSizeOption} from "naive-ui"; 3 | 4 | export const useCommonTable = (getListApi: Function) => { 5 | 6 | const tableTotal = ref(0) 7 | const tableDataList = ref>([]) 8 | const tableLoading = ref(true) 9 | const tablePagination = reactive({ 10 | page: 1, 11 | pageSize: 10, 12 | pageSizes: [10, 30, 50, 100] as Array, 13 | itemCount: 0, 14 | size: "small", 15 | showQuickJumper: true, 16 | showSizePicker: true, 17 | prefix(info: PaginationInfo) { 18 | return `总共 ${info.itemCount} 条` 19 | } 20 | }) 21 | 22 | const onPageChange = (page: number) => { 23 | tablePagination.page = page 24 | getDataList() 25 | } 26 | const onPageSizeChange = (pageSize: number) => { 27 | tablePagination.pageSize = pageSize 28 | getDataList() 29 | 30 | } 31 | 32 | /** 33 | * 获取列表数据 34 | * @param data 35 | */ 36 | const getDataList = (data: any = {}) => { 37 | tableLoading.value = true 38 | getListApi(data, { 39 | page: tablePagination.page, 40 | pageSize: tablePagination.pageSize 41 | }).then((res: any) => { 42 | tableDataList.value = res.data.list 43 | tablePagination.itemCount = res.data.count 44 | tableLoading.value = false 45 | }).catch((e: any) => { 46 | tableLoading.value = true 47 | }) 48 | } 49 | 50 | return { 51 | tableTotal, 52 | tableDataList, 53 | tablePagination, 54 | tableLoading, 55 | onPageChange, 56 | onPageSizeChange, 57 | getDataList 58 | } 59 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/components/monacoEditor/monacoEditorType.ts: -------------------------------------------------------------------------------- 1 | import { PropType } from 'vue' 2 | 3 | export type Theme = 'vs' | 'hc-black' | 'vs-dark' 4 | export type FoldingStrategy = 'auto' | 'indentation' 5 | export type RenderLineHighlight = 'all' | 'line' | 'none' | 'gutter' 6 | export interface Options { 7 | automaticLayout: boolean // 自适应布局 8 | foldingStrategy: FoldingStrategy // 折叠方式 auto | indentation 9 | renderLineHighlight: RenderLineHighlight // 行亮 10 | selectOnLineNumbers: boolean // 显示行号 11 | minimap: { 12 | // 关闭小地图 13 | enabled: boolean 14 | } 15 | readOnly: boolean // 只读 16 | fontSize: number // 字体大小 17 | scrollBeyondLastLine: boolean // 取消代码后面一大段空白 18 | overviewRulerBorder: boolean // 不要滚动条的边框 19 | } 20 | 21 | export const editorProps = { 22 | modelValue: { 23 | type: String as PropType, 24 | default: null, 25 | }, 26 | width: { 27 | type: [String, Number] as PropType, 28 | default: '100%', 29 | }, 30 | height: { 31 | type: [String, Number] as PropType, 32 | default: '100%', 33 | }, 34 | language: { 35 | type: String as PropType, 36 | default: 'javascript', 37 | }, 38 | theme: { 39 | type: String as PropType, 40 | validator(value: string): boolean { 41 | return ['vs', 'hc-black', 'vs-dark'].includes(value) 42 | }, 43 | default: 'vs-dark', 44 | }, 45 | options: { 46 | type: Object as PropType, 47 | default: function () { 48 | return { 49 | automaticLayout: true, 50 | foldingStrategy: 'indentation', 51 | renderLineHighlight: 'all', 52 | selectOnLineNumbers: true, 53 | minimap: { 54 | enabled: true, 55 | }, 56 | readOnly: false, 57 | fontSize: 16, 58 | scrollBeyondLastLine: false, 59 | overviewRulerBorder: false, 60 | } 61 | }, 62 | }, 63 | } 64 | -------------------------------------------------------------------------------- /ginyi-vue3/src/config/console.log.ts: -------------------------------------------------------------------------------- 1 | export const banner: string = "%c" + 2 | " _______ __ __ __ ____ ____ __ \n" + 3 | " / _____|| | | \\ | | \\ \\ / / | | \n" + 4 | "| | __ | | | \\| | \\ \\/ / | | \n" + 5 | "| | |_ | | | | | \\_ _/ | | Version: %c1.0.0%c\n" + 6 | "| |__| | | | | |\\ | | | | | 如果你喜欢这个项目,欢迎Star!https://gitee.com/Ginyi/ginyi-spring-vue 💖💖💖\n" + 7 | " \\______| |__| |__| \\__| |__| |__| Copyright © 2023-Now Ginyi@aliyun.com. All rights reserved.\n"; 8 | 9 | console.log(banner, "color:#00a3a3","color:#fdbe24", "color:#00a3a3") 10 | -------------------------------------------------------------------------------- /ginyi-vue3/src/config/eventBus.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 事件总线 3 | */ 4 | import mitt from 'mitt'; 5 | export const eventBus = mitt(); -------------------------------------------------------------------------------- /ginyi-vue3/src/config/setting.ts: -------------------------------------------------------------------------------- 1 | import {IProject} from "@/interface/modules/system"; 2 | import Logo from "@/assets/img/logo.jpg"; 3 | 4 | /** 5 | * 项目配置 6 | */ 7 | export const setting: IProject = { 8 | devBaseURL: "http://127.0.0.1:8066", 9 | prodBaseURL: "http://192.168.0.102:8066", 10 | logo: Logo, 11 | title: "Ginyi", 12 | name: "管理系统", 13 | author: "Ginyi@aliyun.com", 14 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/dictionary/useDynamicDict.ts: -------------------------------------------------------------------------------- 1 | import {deptController, menuController, postController, roleController} from "@/api"; 2 | import {useRemoveEmptyChildrenField} from "@/hooks/useTree"; 3 | import {ref} from "vue"; 4 | 5 | 6 | export const useDynamicDict = () => { 7 | 8 | // 部门字典 9 | const deptDict = ref>([]); 10 | // 岗位字典 11 | const postDict = ref>([]); 12 | // 角色字典 13 | const roleDict = ref>([]); 14 | // 菜单字典 15 | const menuDict = ref>([]); 16 | 17 | /** 18 | * 获取部门字典 19 | */ 20 | (async () => { 21 | if (deptDict.value.length === 0) { 22 | const {data} = await deptController.list({}) 23 | deptDict.value = useRemoveEmptyChildrenField(data.list) 24 | } 25 | })(); 26 | 27 | /** 28 | * 获取角色字典 29 | */ 30 | (async () => { 31 | if (roleDict.value.length === 0) { 32 | const {data} = await roleController.list({}) 33 | roleDict.value = data.list 34 | } 35 | })(); 36 | 37 | /** 38 | * 获取岗位字典 39 | */ 40 | (async () => { 41 | if (postDict.value.length === 0) { 42 | const {data} = await postController.list({}) 43 | postDict.value = data.list 44 | } 45 | })(); 46 | 47 | /** 48 | * 获取菜单字典 49 | */ 50 | (async () => { 51 | if (menuDict.value.length === 0) { 52 | const {data} = await menuController.list({filterButton: "0"}) 53 | menuDict.value = useRemoveEmptyChildrenField(data.list) 54 | } 55 | })(); 56 | 57 | 58 | return { 59 | deptDict, 60 | postDict, 61 | roleDict, 62 | menuDict 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /ginyi-vue3/src/directives/draggable.ts: -------------------------------------------------------------------------------- 1 | import {Directive} from "vue"; 2 | 3 | export const drag: Directive = { 4 | mounted(el: HTMLElement) { 5 | // 设置目标元素基础属性 6 | el.style.cursor = "move"; 7 | el.style.position = "fixed"; 8 | el.style.zIndex = "99999"; 9 | 10 | // 监听鼠标在目标元素上按下 11 | el.addEventListener("mousedown", (e) => { 12 | // 当前目标元素的left与top 13 | const left = el.offsetLeft; 14 | const top = el.offsetTop; 15 | // 保存按下的鼠标的X与Y 16 | const mouseX = e.clientX; 17 | const mouseY = e.clientY; 18 | 19 | // 监听鼠标移动 20 | document.onmousemove = (e) => { 21 | // 鼠标移动的距离 22 | let disX = e.clientX - mouseX; 23 | let disY = e.clientY - mouseY; 24 | 25 | el.style.left = (left + disX) + "px"; 26 | el.style.top = (top + disY) + "px"; 27 | return false // 防止选中文本,文本拖动的问题 28 | } 29 | 30 | // 监听鼠标抬起 31 | document.onmouseup = () => { 32 | document.onmousemove = null; 33 | document.onmouseup = null; 34 | } 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ginyi-vue3/src/directives/focus.ts: -------------------------------------------------------------------------------- 1 | import {Directive, DirectiveBinding} from "vue"; 2 | 3 | /** 4 | * 自动获取输入框焦点 5 | * 同个页面使用多个v-focus,最后一个生效 6 | */ 7 | export const focus: Directive = { 8 | mounted(el: HTMLElement, binding: DirectiveBinding) { 9 | 10 | /** 11 | * 原生输入框 v-focus.native 12 | */ 13 | if (binding.modifiers?.native) { 14 | el.focus() 15 | return; 16 | } 17 | /** 18 | * n-input v-focus 19 | */ 20 | const input = el?.childNodes[0]?.childNodes[1]?.childNodes[0]; 21 | // @ts-ignore 22 | input.focus(); 23 | } 24 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/directives/index.ts: -------------------------------------------------------------------------------- 1 | import {App} from 'vue'; 2 | import {focus} from "@/directives/focus"; 3 | import {loading} from "@/directives/loading"; 4 | import {drag} from "@/directives/draggable" 5 | 6 | /** 7 | * 注册全局自定义指令 8 | * 注意:需要在web-types.json声明一下,避免编译器警告 9 | * @param app 10 | */ 11 | export const initDirectives = (app: App) => { 12 | // 自动获取焦点 13 | app.directive('focus', focus); 14 | app.directive('loading', loading); 15 | app.directive('drag', drag); 16 | } 17 | -------------------------------------------------------------------------------- /ginyi-vue3/src/directives/loading.ts: -------------------------------------------------------------------------------- 1 | import {createApp, Directive} from "vue"; 2 | import NSpin from "naive-ui" 3 | 4 | /** 5 | * 加载中... 6 | */ 7 | export const loading: Directive = { 8 | 9 | } 10 | 11 | -------------------------------------------------------------------------------- /ginyi-vue3/src/enums/storeKeyEnums.ts: -------------------------------------------------------------------------------- 1 | export const enum storeKeyEnums { 2 | SYSTEM = "system", 3 | USER = "user", 4 | ROUTER = "router", 5 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/enums/tableActionEnums.ts: -------------------------------------------------------------------------------- 1 | export enum tableActionEnums { 2 | // 新增 3 | ADD = "add", 4 | // 编辑 5 | EDIT = "edit", 6 | // 删除 7 | DELETE = "delete", 8 | // 批量删除 9 | BATCH_DELETE = "BATCH_DELETE", 10 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/hooks/useColor.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 将传递的百分比与十六进制颜色的R、G或B相加 3 | * @param {string} color 要更改的颜色 4 | * @param {number} amount 更改颜色的量 5 | * @returns {string} 颜色的处理部分 6 | */ 7 | function useAddLight(color: string, amount: number): string { 8 | const cc = parseInt(color, 16) + amount; 9 | const c = cc > 255 ? 255 : cc; 10 | return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}`; 11 | } 12 | 13 | /** 14 | * 根据传递的百分比点亮6个字符的HEX颜色 15 | * @param {string} color 要更改的颜色 16 | * @param {number} amount 更改颜色的量 17 | * @returns {string} 处理后的颜色表示为HEX 18 | */ 19 | export function useLighten(color: string, amount: number): string { 20 | color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color; 21 | amount = Math.trunc((255 * amount) / 100); 22 | return `#${useAddLight(color.substring(0, 2), amount)}${useAddLight( 23 | color.substring(2, 4), 24 | amount 25 | )}${useAddLight(color.substring(4, 6), amount)}`; 26 | } 27 | 28 | /** 29 | * hex转rgba 30 | * @param bgColor 31 | * @param alpha 32 | */ 33 | export const useHexToRgba = (bgColor: string, alpha = 0.2): string => { 34 | let color = bgColor.slice(1); // 去掉'#'号 35 | let rgba = [ 36 | parseInt("0x" + color.slice(0, 2)), 37 | parseInt("0x" + color.slice(2, 4)), 38 | parseInt("0x" + color.slice(4, 6)), 39 | alpha 40 | ]; 41 | return `rgba(${rgba.toString()})`; 42 | }; -------------------------------------------------------------------------------- /ginyi-vue3/src/hooks/useCommonColums.ts: -------------------------------------------------------------------------------- 1 | import {useStaticDict} from "@/dictionary/useStaticDict"; 2 | 3 | export const useCommonColumns = () => { 4 | const {statusDict, successDict} = useStaticDict() 5 | 6 | 7 | /** 8 | * 渲染状态字典 9 | * @param stateId 10 | */ 11 | const useRenderStateById = (stateId: string) => { 12 | const temp = statusDict.value.filter(state => { 13 | return state.value === stateId 14 | }) 15 | return temp.length !== 0 ? temp[0].label : undefined; 16 | } 17 | 18 | /** 19 | * 渲染成功字典 20 | * @param successId 21 | */ 22 | const useRenderSuccessById = (successId: string) => { 23 | const temp = successDict.value.filter(state => { 24 | return state.value === successId.toString() 25 | }) 26 | return temp.length !== 0 ? temp[0].label : undefined; 27 | } 28 | 29 | return { 30 | useRenderStateById, 31 | useRenderSuccessById 32 | } 33 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/hooks/useDebthro.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 节流 3 | * @param {*} fn 执行函数 4 | * @param {*} wait 节流时间,毫秒 5 | */ 6 | export const useThrottle = function (fn: Function, wait?: number) { 7 | let timer: any; 8 | return function (this: any) { 9 | if (!timer) { 10 | timer = setTimeout(() => { 11 | fn.apply(this, arguments) 12 | timer = null 13 | }, wait) 14 | } 15 | } 16 | } 17 | 18 | /** 19 | * 防抖 20 | * @param {*} fn 执行函数 21 | * @param {*} wait 防抖时间,毫秒 22 | */ 23 | export const useDebounce = function (fn: Function, wait: number) { 24 | let timer: any 25 | return function (this: any) { 26 | // 如果多次触发将上次记录延迟清除掉 27 | if (timer !== null) { 28 | clearTimeout(timer) 29 | } else { 30 | timer = setTimeout(() => { 31 | fn.apply(this, arguments) 32 | timer = null 33 | }, wait) 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/hooks/useFormat.ts: -------------------------------------------------------------------------------- 1 | export const useFormatTime = (times: number, showTime = true) => { 2 | try { 3 | const time = new Date(times) 4 | const year = time.getFullYear(); 5 | const month = time.getMonth() + 1; 6 | const date = time.getDate(); 7 | const hour = time.getHours(); 8 | const minute = time.getMinutes(); 9 | const second = time.getSeconds(); 10 | const NewDate = year + "-" + (month < 10 ? '0' + month : month) + "-" + (date < 10 ? '0' + date : date) 11 | const NewTime = hour + ":" + (minute < 10 ? '0' + minute : minute) + ":" + (second < 10 ? '0' + second : second); 12 | if (showTime) return `${NewDate} ${NewTime}` 13 | return NewDate 14 | } catch (e) { 15 | console.error('时间戳不合法') 16 | } 17 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/hooks/useMenu.ts: -------------------------------------------------------------------------------- 1 | import {useLoadIcon, useRenderIcon} from "@/plugins/naive-ui/common"; 2 | 3 | /** 4 | * 重新格式菜单列表,主要是为了渲染 icon 和 删除空children 5 | * @param menuList 6 | * @param formatIcon 是否需要处理icon 7 | */ 8 | export const useMenuFormat = (menuList: any, formatIcon?: boolean): any => { 9 | return menuList.map((menu: any) => { 10 | if (formatIcon) { 11 | menu.icon = useRenderIcon(useLoadIcon(menu.icon)) 12 | } 13 | if (menu.children?.length > 0) { 14 | useMenuFormat(menu.children, formatIcon) 15 | } else { 16 | delete menu.children 17 | } 18 | return menu 19 | }) 20 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/hooks/useObject.ts: -------------------------------------------------------------------------------- 1 | import * as Icons from "@vicons/ionicons5"; 2 | 3 | /** 4 | * 简单实现对象的深度克隆 5 | * 注意: 6 | * 1、使用该方式会出现一些问题,如值为undefined、函数、Date类型等属性会无法被克隆,此处待完善!!! 7 | * 2、非得使用undefined的话,可以使用null替代 8 | * @param obj 9 | */ 10 | export function useDeepClone(obj: T): T { 11 | // 如果是基本数据类型,直接返回 12 | if (typeof obj !== 'object' || obj === null) { 13 | return obj; 14 | } 15 | // 根据类型创建新对象或数组 16 | const newObj = Array.isArray(obj) ? [] : {}; 17 | // 递归复制属性或元素 18 | for (const key in obj) { 19 | // @ts-ignore 20 | newObj[key] = useDeepClone(obj[key]); 21 | } 22 | return newObj as T; 23 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/hooks/usePagination.ts: -------------------------------------------------------------------------------- 1 | import {reactive} from "vue"; 2 | import {PaginationInfo, PaginationSizeOption} from "naive-ui"; 3 | 4 | export const usePagination = () => { 5 | const pagination = reactive({ 6 | page: 1, 7 | pageSize: 5, 8 | pageSizes: [5, 10, 20, 50] as Array, 9 | itemCount: 0, 10 | size: "small", 11 | showQuickJumper: true, 12 | showSizePicker: true, 13 | prefix(info: PaginationInfo) { 14 | return `总共 ${info.itemCount} 条` 15 | } 16 | }) 17 | 18 | const onPageChange = (page: number) => { 19 | pagination.page = page 20 | } 21 | const onPageSizeChange = (pageSize: number) => { 22 | pagination.pageSize = pageSize 23 | } 24 | 25 | return { 26 | pagination 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /ginyi-vue3/src/hooks/usePending.ts: -------------------------------------------------------------------------------- 1 | import axios, {AxiosRequestConfig} from "axios"; 2 | 3 | const pendingMap = new Map(); 4 | 5 | /** 6 | * 生成每个请求唯一的键 7 | * @param {*} config 8 | * @returns string 9 | */ 10 | export const getPendingKey = (config: AxiosRequestConfig) => { 11 | let {url, method, params, data} = config; 12 | // response里面返回的config.data是个字符串对象 13 | if (typeof data === 'string') { 14 | data = JSON.parse(data); 15 | } 16 | return [url, method, JSON.stringify(params), JSON.stringify(data)].join('&'); 17 | } 18 | 19 | /** 20 | * 储存每个请求唯一值, 也就是cancel()方法, 用于取消请求 21 | * @param {*} config 22 | */ 23 | export const addPending = (config: AxiosRequestConfig) => { 24 | const pendingKey = getPendingKey(config); 25 | config.cancelToken = config.cancelToken || new axios.CancelToken((cancel) => { 26 | if (!pendingMap.has(pendingKey)) { 27 | pendingMap.set(pendingKey, cancel); 28 | } 29 | }); 30 | } 31 | 32 | /** 33 | * 删除重复的请求 34 | * @param {*} config 35 | */ 36 | export const removePending = (config: AxiosRequestConfig): boolean => { 37 | const pendingKey = getPendingKey(config); 38 | if (pendingMap.has(pendingKey)) { 39 | const cancelToken = pendingMap.get(pendingKey); 40 | cancelToken(pendingKey); 41 | pendingMap.delete(pendingKey); 42 | return true; 43 | }else { 44 | return false; 45 | } 46 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/hooks/useStorage.ts: -------------------------------------------------------------------------------- 1 | import {storeKeyEnums} from "@/enums/storeKeyEnums"; 2 | 3 | export class storage { 4 | 5 | /** 6 | * 默认的存储时间(天) 7 | */ 8 | private static expireTime: number = 7 9 | 10 | /** 11 | * 设置缓存数据 12 | * @param key 13 | * @param value 14 | * @param expire 过期时间,单位天 15 | */ 16 | static set(key: string, value: any, expire?: number) { 17 | const data = JSON.stringify({ 18 | value, 19 | expire: expire !== undefined ? Date.now() + expire * 60 * 60 * 24 * 7 * 1000 : Date.now() + this.expireTime * 60 * 60 * 24 * 7 * 1000, 20 | }); 21 | localStorage.setItem(key, data) 22 | } 23 | 24 | /** 25 | * 获取缓存数据 26 | * @param key 27 | */ 28 | static get(key: string): any { 29 | const data: any = localStorage.getItem(key) 30 | if (data) { 31 | const {value, expire} = JSON.parse(data); 32 | // 在有效期内直接返回 33 | if ([null, undefined].includes(expire) || expire >= Date.now()) { 34 | return value; 35 | } 36 | // 清除缓存 37 | this.remove(key) 38 | return null 39 | } 40 | } 41 | 42 | /** 43 | * 清除缓存 44 | * @param key 45 | */ 46 | static remove(key: string) { 47 | localStorage.removeItem(key) 48 | } 49 | 50 | /** 51 | * 清除缓存,除系统配置外 52 | */ 53 | static clear() { 54 | let keys: Array = []; 55 | for (let i = 0; i < localStorage.length; i++) { 56 | keys.push(localStorage.key(i) as string) 57 | } 58 | keys.map(key => { 59 | if (key.indexOf(storeKeyEnums.SYSTEM) === -1) { 60 | this.remove(key as string) 61 | } 62 | }) 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ginyi-vue3/src/layout/header/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | -------------------------------------------------------------------------------- /ginyi-vue3/src/layout/header/personnel.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 60 | 61 | -------------------------------------------------------------------------------- /ginyi-vue3/src/layout/logo/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 34 | 35 | -------------------------------------------------------------------------------- /ginyi-vue3/src/main.ts: -------------------------------------------------------------------------------- 1 | import {createApp} from 'vue' 2 | import App from '@/App.vue' 3 | import router from "@/router"; 4 | import naive from 'naive-ui'; 5 | import {initStore} from '@/store'; 6 | import "@/plugins/naive-ui/common" 7 | import "@/config/console.log"; 8 | import {initDirectives} from "@/directives"; 9 | import {initIcon} from "@/plugins/naive-ui/common"; 10 | import "@/style/index.css" 11 | 12 | const app = createApp(App) 13 | initStore(app) 14 | initDirectives(app) 15 | initIcon(app) 16 | 17 | app.use(router) 18 | app.use(naive) 19 | app.mount('#app') 20 | -------------------------------------------------------------------------------- /ginyi-vue3/src/plugins/naive-ui/common.tsx: -------------------------------------------------------------------------------- 1 | import type {App} from "vue"; 2 | import {Component, computed, createVNode} from "vue"; 3 | import {createDiscreteApi, NIcon} from "naive-ui"; 4 | import * as Icons from "@vicons/ionicons5"; 5 | import {useSystemStore} from "@/store/modules/useSystemStore"; 6 | import {storeToRefs} from "pinia"; 7 | import {useLighten} from "@/hooks/useColor"; 8 | 9 | /** 10 | * 加延时是为了让 pinia 完成初始化,时间可适当调长些 11 | */ 12 | setTimeout(() => { 13 | const {getTheme, themeColor} = storeToRefs(useSystemStore()) 14 | const configProviderPropsRef = computed(() => ({ 15 | theme: getTheme.value, 16 | themeOverrides: { 17 | common: { 18 | primaryColor: themeColor?.value, 19 | primaryColorHover: useLighten(themeColor?.value as string, 6), 20 | primaryColorPressed: useLighten(themeColor?.value as string, 6), 21 | }, 22 | LoadingBar: { 23 | colorLoading: themeColor?.value as string, 24 | }, 25 | }, 26 | })); 27 | const {message, dialog, notification, loadingBar} = createDiscreteApi( 28 | ["message", "dialog", "notification", "loadingBar"], 29 | { 30 | configProviderProps: configProviderPropsRef, 31 | } 32 | ); 33 | 34 | window.$message = message; 35 | window.$dialog = dialog; 36 | window.$notification = notification; 37 | window.$loading = loadingBar; 38 | }, 100) 39 | 40 | 41 | /** 42 | * 加载图标,要配合【 renderIcon 】一起使用 43 | * @param icon 44 | */ 45 | export const useLoadIcon = (icon: string) => { 46 | return Icons[icon as keyof typeof Icons]; 47 | } 48 | 49 | /** 50 | * 渲染icon,不一定要配合【 loadIcon 】,可以单独使用 51 | * @param icon 52 | */ 53 | export const useRenderIcon = (icon: Component) => { 54 | return () => { 55 | return 56 | } 57 | } 58 | 59 | const icon = (props: { icon: string }) => { 60 | const {icon} = props; 61 | return createVNode(Icons[icon as keyof typeof Icons]); 62 | }; 63 | 64 | export function initIcon(app: App): void { 65 | app.component('Icon', icon); 66 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/plugins/pinia/piniaPlugin.ts: -------------------------------------------------------------------------------- 1 | import {PiniaPluginContext} from "pinia"; 2 | import {storage} from "@/hooks/useStorage"; 3 | import {toRaw} from "vue"; 4 | 5 | /** 6 | * 做状态持久化 7 | * @param key 8 | */ 9 | export const piniaPlugin = (key?: string) => { 10 | const piniaKey: string = 'PiniaKey' 11 | return (context: PiniaPluginContext) => { 12 | const {store} = context 13 | const data = storage.get(`${key ?? piniaKey}-${store.$id}`) 14 | // 每次 pinia 中的状态发生改变时,都会执行 $subscribe 15 | store.$subscribe(() => { 16 | // store.$state 需要转换成普通对象,可以console.log看看 17 | storage.set(`${key ?? piniaKey}-${store.$id}`, toRaw(store.$state)) 18 | }) 19 | // 即将 data 解构,后重新赋值给 pinia 的 state,实现持久化 20 | return { 21 | ...data 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/store/index.ts: -------------------------------------------------------------------------------- 1 | import type {App} from 'vue'; 2 | import {createPinia} from 'pinia'; 3 | import {piniaPlugin} from "@/plugins/pinia/piniaPlugin"; 4 | 5 | const store = createPinia(); 6 | store.use(piniaPlugin()) 7 | 8 | export const initStore = (app: App) => { 9 | app.use(store); 10 | } 11 | 12 | export {store}; -------------------------------------------------------------------------------- /ginyi-vue3/src/store/modules/useUserStore.ts: -------------------------------------------------------------------------------- 1 | import {defineStore} from "pinia"; 2 | import {storeKeyEnums} from "@/enums/storeKeyEnums"; 3 | import {IUser} from "@/interface/modules/system"; 4 | import {storage} from "@/hooks/useStorage"; 5 | import {userController} from "@/api"; 6 | import {useSystemStore} from "@/store/modules/useSystemStore"; 7 | 8 | export const useUserStore = defineStore(storeKeyEnums.USER, { 9 | state: (): IUser => ({ 10 | username: undefined, 11 | tokenKey: undefined, 12 | authorization: undefined 13 | }), 14 | getters: { 15 | getName(): string | undefined { 16 | return this.username 17 | }, 18 | }, 19 | actions: { 20 | login(username: string | undefined, data: any): Promise { 21 | return new Promise((resolve, reject) => { 22 | this.username = username 23 | this.tokenKey = data.tokenHeader 24 | this.authorization = data.token 25 | storage.set(data.tokenHeader, data.token) 26 | resolve(null); 27 | }) 28 | }, 29 | logout(): Promise { 30 | return new Promise((resolve, reject) => { 31 | userController.logout().then(() => { 32 | useUserStore().$reset() 33 | useSystemStore().removeAllTabs() 34 | useSystemStore().resetBreadMenuList() 35 | storage.clear() 36 | resolve(null); 37 | }) 38 | }) 39 | } 40 | } 41 | }) -------------------------------------------------------------------------------- /ginyi-vue3/src/style/index.css: -------------------------------------------------------------------------------- 1 | /* 全局样式 */ 2 | .n-card.n-card--bordered { 3 | border-radius: 10px; 4 | } 5 | 6 | /* 滚动条的宽度 */ 7 | ::-webkit-scrollbar { 8 | width: 6px; 9 | } 10 | 11 | /* 滚动条里面小方块 */ 12 | ::-webkit-scrollbar-thumb { 13 | border-radius: 4px; 14 | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); 15 | background: rgba(153, 153, 153, 0.3); 16 | } 17 | 18 | /* 滚动条里面轨道 */ 19 | ::-webkit-scrollbar-track { 20 | border-radius: 0; 21 | } 22 | 23 | /* 内容主体区过渡动画 */ 24 | .fade-main-move, 25 | .fade-main-enter-active, 26 | .fade-main-leave-active { 27 | transition: all 0.3s ease; 28 | } 29 | 30 | .fade-main-enter-from, 31 | .fade-main-leave-to { 32 | opacity: 0; 33 | transform: translateX(30px); 34 | } 35 | 36 | .fade-main-leave-active { 37 | position: absolute; 38 | } 39 | 40 | /* 抽屉面板内容区 */ 41 | .n-drawer .n-drawer-content .n-drawer-body-content-wrapper { 42 | box-sizing: border-box; 43 | padding: 0; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/monitor/cache/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/monitor/cacheList/columns.tsx: -------------------------------------------------------------------------------- 1 | import {DataTableColumns, NButton, NSpace} from "naive-ui"; 2 | import {eventBus} from "@/config/eventBus"; 3 | import {h} from "vue"; 4 | 5 | /** 6 | * 查看详情的点击事件 7 | * @param row 8 | */ 9 | const handleClickDetails = (row: any) => { 10 | eventBus.emit("handleClickDetails", row) 11 | } 12 | 13 | /** 14 | * 删除的点击事件 15 | * @param row 16 | */ 17 | const handleClickDelete = (row: any) => { 18 | eventBus.emit("handleClickDelete", row) 19 | } 20 | 21 | export const columns: DataTableColumns = [ 22 | { 23 | title: "键名", 24 | key: "key", 25 | ellipsis: { 26 | tooltip: true 27 | } 28 | }, 29 | { 30 | title: "操作", 31 | key: "action", 32 | width: 160, 33 | render: (row) => ( 34 | h(NSpace, null, () => [ 35 | h(NButton, { 36 | type: "primary", size: "small", onClick: () => handleClickDetails(row)}, {default: () => "查看详情"}), 37 | h(NButton, {type: "error", size: "small", onClick: () => handleClickDelete(row)}, {default: () => "删除"}) 38 | ]) 39 | ) 40 | } 41 | ] -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/monitor/data/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/monitor/online/columns.tsx: -------------------------------------------------------------------------------- 1 | import {DataTableColumns} from "naive-ui"; 2 | 3 | 4 | export const columns: DataTableColumns = [ 5 | { 6 | title: "会话编号", 7 | key: "token", 8 | width: 200, 9 | ellipsis: { 10 | tooltip: true 11 | } 12 | }, 13 | { 14 | title: "登录名称", 15 | key: "username" 16 | }, 17 | { 18 | title: "主机IP", 19 | key: "ipaddr", 20 | }, 21 | { 22 | title: "登录地点", 23 | key: "loginLocation", 24 | }, 25 | { 26 | title: "浏览器", 27 | key: "browser", 28 | }, 29 | { 30 | title: "操作系统", 31 | key: "os", 32 | }, 33 | { 34 | title: "登录时间", 35 | key: "loginTime", 36 | width: 200 37 | } 38 | ] -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/monitor/service/columns.tsx: -------------------------------------------------------------------------------- 1 | import {DataTableColumns, NTag} from "naive-ui"; 2 | 3 | export const columns: DataTableColumns = [ 4 | { 5 | title: "盘符路径", 6 | key: "dirName", 7 | }, 8 | { 9 | title: "盘符类型", 10 | key: "typeName", 11 | }, 12 | { 13 | title: "总大小", 14 | key: "total", 15 | render: (row) => ( 16 | {row.total}GB 17 | ) 18 | }, 19 | { 20 | title: "已用大小", 21 | key: "used", 22 | render: (row) => ( 23 | {row.used}GB 24 | ) 25 | }, 26 | { 27 | title: "可用大小", 28 | key: "free", 29 | render: (row) => ( 30 | {row.free}GB 31 | ) 32 | }, 33 | { 34 | title: "已用百分比", 35 | key: "usage", 36 | render: (row) => ( 37 | {row.usage}% 38 | ) 39 | }, 40 | ] -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/monitor/task/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/order/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/product/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/department/columns.tsx: -------------------------------------------------------------------------------- 1 | import {DataTableColumns, NSwitch, NTag} from "naive-ui"; 2 | import {useCommonColumns} from "@/hooks/useCommonColums"; 3 | import {h} from "vue"; 4 | import {eventBus} from "@/config/eventBus"; 5 | 6 | const {useRenderStateById} = useCommonColumns() 7 | /** 8 | * 状态的点击事件 9 | * @param row 10 | */ 11 | const handleSwitchClick = (row: any) => { 12 | eventBus.emit("handleDeptStatusSwitchClick", row) 13 | } 14 | 15 | export const columns: DataTableColumns = [ 16 | { 17 | title: "部门名称", 18 | key: "deptName" 19 | }, 20 | { 21 | title: "状态", 22 | key: "status", 23 | render: (row) => ( 24 | h(NSwitch, { 25 | value: row.status === "0", 26 | onClick: () => handleSwitchClick(row) 27 | }, { 28 | checked: () => "正常", 29 | unchecked: () => "禁用" 30 | }) 31 | ) 32 | }, 33 | { 34 | title: "排序", 35 | key: "sort", 36 | }, 37 | { 38 | title: "创建时间", 39 | key: "createTime", 40 | } 41 | ] -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/dict/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/log/login/columns.tsx: -------------------------------------------------------------------------------- 1 | import {DataTableColumns, NTag} from "naive-ui"; 2 | import {useCommonColumns} from "@/hooks/useCommonColums"; 3 | 4 | const {useRenderSuccessById} = useCommonColumns() 5 | 6 | 7 | export const columns: DataTableColumns = [ 8 | { 9 | title: "用户名称", 10 | key: "userName", 11 | }, 12 | { 13 | title: "登录地址", 14 | key: "ipaddr" 15 | }, 16 | { 17 | title: "登录地点", 18 | key: "loginLocation", 19 | }, 20 | { 21 | title: "浏览器", 22 | key: "browser", 23 | }, 24 | { 25 | title: "操作系统", 26 | key: "os", 27 | }, 28 | { 29 | title: "登录状态", 30 | key: "status", 31 | render: (row) => ( 32 | 33 | {useRenderSuccessById(row.status)} 34 | 35 | ) 36 | }, 37 | { 38 | title: "操作信息", 39 | key: "msg", 40 | ellipsis: { 41 | tooltip: true 42 | } 43 | }, 44 | { 45 | title: "登录日期", 46 | key: "createTime", 47 | width: 200 48 | } 49 | ] -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/log/operation/columns.tsx: -------------------------------------------------------------------------------- 1 | import {DataTableColumns, NTag} from "naive-ui"; 2 | import {useCommonColumns} from "@/hooks/useCommonColums"; 3 | import {useColumns} from "@/views/pages/system/log/operation/useColumns"; 4 | 5 | const {useRenderSuccessById} = useCommonColumns() 6 | const {useRenderOperationType} = useColumns() 7 | 8 | 9 | export const columns: DataTableColumns = [ 10 | { 11 | title: "操作人员", 12 | key: "operationName", 13 | }, 14 | { 15 | title: "操作地址", 16 | key: "operationIp" 17 | }, 18 | { 19 | title: "操作地点", 20 | key: "operationLocation", 21 | }, 22 | { 23 | title: "系统模块", 24 | key: "title", 25 | }, 26 | { 27 | title: "操作类型", 28 | key: "businessType", 29 | render: (row) => ( 30 | 34 | {useRenderOperationType(row.businessType.toString())} 35 | 36 | ) 37 | }, 38 | { 39 | title: "请求方式", 40 | key: "requestMethod", 41 | }, 42 | { 43 | title: "操作状态", 44 | key: "status", 45 | render: (row) => ( 46 | 47 | {useRenderSuccessById(row.status)} 48 | 49 | ) 50 | }, 51 | { 52 | title: "操作时间", 53 | key: "createTime", 54 | width: 200 55 | } 56 | ] -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/log/operation/useColumns.ts: -------------------------------------------------------------------------------- 1 | import {useStaticDict} from "@/dictionary/useStaticDict"; 2 | 3 | export const useColumns = () => { 4 | const {operationType} = useStaticDict() 5 | 6 | const useRenderOperationType = (operation: string) => { 7 | const temp = operationType.value.filter(type => { 8 | return type.value === operation 9 | }) 10 | return temp.length !== 0 ? temp[0].label : undefined; 11 | } 12 | 13 | 14 | return { 15 | useRenderOperationType 16 | } 17 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/menu/useColumns.ts: -------------------------------------------------------------------------------- 1 | import {useStaticDict} from "@/dictionary/useStaticDict"; 2 | 3 | export const useColumns = () => { 4 | const {menuTypeDict} = useStaticDict() 5 | 6 | const useRenderMenuType = (menuType: string) => { 7 | const temp = menuTypeDict.value.filter(type => { 8 | return type.value === menuType 9 | }) 10 | return temp.length !== 0 ? temp[0].label : undefined; 11 | } 12 | 13 | 14 | return { 15 | useRenderMenuType 16 | } 17 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/notice/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/params/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/position/columns.tsx: -------------------------------------------------------------------------------- 1 | import {DataTableColumns, NSwitch, NTag} from "naive-ui"; 2 | import {useCommonColumns} from "@/hooks/useCommonColums"; 3 | import {h} from "vue"; 4 | import {eventBus} from "@/config/eventBus"; 5 | 6 | const {useRenderStateById} = useCommonColumns() 7 | /** 8 | * 状态的点击事件 9 | * @param row 10 | */ 11 | const handleSwitchClick = (row: any) => { 12 | eventBus.emit("handlePostStatusSwitchClick", row) 13 | } 14 | export const columns: DataTableColumns = [ 15 | { 16 | title: "岗位名称", 17 | key: "postName" 18 | }, 19 | { 20 | title: "岗位编码", 21 | key: "postCode" 22 | }, 23 | { 24 | title: "状态", 25 | key: "status", 26 | render: (row) => ( 27 | h(NSwitch, { 28 | value: row.status === "0", 29 | onClick: () => handleSwitchClick(row) 30 | }, { 31 | checked: () => "正常", 32 | unchecked: () => "禁用" 33 | }) 34 | ) 35 | }, 36 | { 37 | title: "排序", 38 | key: "sort", 39 | }, 40 | { 41 | title: "创建时间", 42 | key: "createTime", 43 | width: 200 44 | } 45 | ] -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/role/columns.tsx: -------------------------------------------------------------------------------- 1 | import {DataTableColumns, NSwitch, NTag} from "naive-ui"; 2 | import {useCommonColumns} from "@/hooks/useCommonColums"; 3 | import {h} from "vue"; 4 | import {eventBus} from "@/config/eventBus"; 5 | 6 | const {useRenderStateById} = useCommonColumns() 7 | /** 8 | * 状态的点击事件 9 | * @param row 10 | */ 11 | const handleSwitchClick = (row: any) => { 12 | eventBus.emit("handleRoleStatusSwitchClick", row) 13 | } 14 | 15 | export const columns: DataTableColumns = [ 16 | { 17 | title: "角色名称", 18 | key: "roleName" 19 | }, 20 | { 21 | title: "角色权限字符串", 22 | key: "roleKey" 23 | }, 24 | { 25 | title: "状态", 26 | key: "status", 27 | render: (row) => ( 28 | h(NSwitch, { 29 | value: row.status === "0", 30 | onClick: () => handleSwitchClick(row) 31 | }, { 32 | checked: () => "正常", 33 | unchecked: () => "禁用" 34 | }) 35 | ) 36 | }, 37 | { 38 | title: "排序", 39 | key: "sort", 40 | width: 80, 41 | }, 42 | { 43 | title: "创建时间", 44 | key: "createTime", 45 | width: 200 46 | } 47 | ] -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/system/user/useColumns.ts: -------------------------------------------------------------------------------- 1 | import {useStaticDict} from "@/dictionary/useStaticDict"; 2 | import {useDynamicDict} from "@/dictionary/useDynamicDict"; 3 | import {useArraySeparator, useFindParentNodes, useTreeToArray} from "@/hooks/useTree"; 4 | 5 | export const useColumns = () => { 6 | const {statusDict, sexDict} = useStaticDict() 7 | const {deptDict, roleDict, postDict} = useDynamicDict() 8 | 9 | const useRenderSexById = (sexId: string) => { 10 | const temp = sexDict.value.filter(sex => { 11 | return sex.value === sexId 12 | }) 13 | return temp.length !== 0 ? temp[0].label : undefined; 14 | } 15 | 16 | const useRenderDeptNameById = (deptId: string | number) => { 17 | const dataList = useFindParentNodes("deptId", deptId, "children", deptDict.value) 18 | return useArraySeparator(dataList as Array, "deptName") 19 | } 20 | 21 | const useRenderRoleNameByIds = (roleIds: Array) => { 22 | const temp = roleDict.value.filter(role => { 23 | return roleIds.includes(role.roleId) 24 | }) 25 | if (temp.length !== 0) { 26 | return temp.map(role => role.roleName) 27 | } 28 | } 29 | 30 | const useRenderPostNameByIds = (postIds: Array) => { 31 | const temp = postDict.value.filter(post => { 32 | return postIds.includes(post.postId) 33 | }) 34 | if (temp.length !== 0) { 35 | return temp.map(post => post.postName) 36 | } 37 | } 38 | 39 | 40 | return { 41 | useRenderSexById, 42 | useRenderDeptNameById, 43 | useRenderRoleNameByIds, 44 | useRenderPostNameByIds 45 | } 46 | } -------------------------------------------------------------------------------- /ginyi-vue3/src/views/pages/systools/code/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /ginyi-vue3/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | import {MessageApi} from "naive-ui/es/message"; 2 | import {NotificationApi} from "naive-ui/es/notification"; 3 | import {DialogApi} from "naive-ui/es/dialog"; 4 | import {LoadingBarApi} from "naive-ui/es/loading-bar"; 5 | 6 | declare global { 7 | 8 | interface Window { 9 | $message: MessageApi; 10 | $dialog: DialogApi; 11 | $notification: NotificationApi; 12 | $loading: LoadingBarApi; 13 | } 14 | 15 | declare module '*.svg' 16 | declare module '*.png' 17 | declare module '*.jpg' 18 | declare module '*.jpeg' 19 | declare module '*.gif' 20 | declare module '*.bmp' 21 | declare module '*.tiff' 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /ginyi-vue3/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "moduleResolution": "Node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "resolveJsonModule": true, 10 | "isolatedModules": true, 11 | "esModuleInterop": true, 12 | "lib": ["ESNext", "DOM"], 13 | "skipLibCheck": true, 14 | "noEmit": true, 15 | "baseUrl": ".", 16 | "paths": { 17 | "@/*": [ 18 | "src/*" 19 | ] 20 | }, 21 | "types": ["vite/client"] 22 | }, 23 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], 24 | "references": [ 25 | {"path": "./tsconfig.node.json"} 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /ginyi-vue3/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "ESNext", 5 | "moduleResolution": "Node", 6 | "allowSyntheticDefaultImports": true 7 | }, 8 | "include": ["vite.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /ginyi-vue3/vite.config.ts: -------------------------------------------------------------------------------- 1 | import {defineConfig} from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | import {resolve} from 'path' 4 | import vueJsxPlugin from "@vitejs/plugin-vue-jsx"; 5 | 6 | 7 | export default defineConfig({ 8 | envDir: ".", 9 | plugins: [vue(), vueJsxPlugin()], 10 | server: { 11 | host: '0.0.0.0', // 主机地址 12 | open: true, // 自动打开浏览器 13 | port: 3800 // 服务端口 14 | }, 15 | // 路径别名 16 | resolve: { 17 | alias: { 18 | '@': resolve(__dirname, './src') 19 | } 20 | }, 21 | optimizeDeps: { 22 | include: [ 23 | `monaco-editor/esm/vs/language/json/json.worker`, 24 | `monaco-editor/esm/vs/language/css/css.worker`, 25 | `monaco-editor/esm/vs/language/html/html.worker`, 26 | `monaco-editor/esm/vs/language/typescript/ts.worker`, 27 | `monaco-editor/esm/vs/editor/editor.worker` 28 | ], 29 | } 30 | }) -------------------------------------------------------------------------------- /ginyi-vue3/web-types.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/web-types", 3 | "framework": "vue", 4 | "name": "", 5 | "version": "", 6 | "contributions": { 7 | "html": { 8 | "js-types-syntax": "typescript", 9 | "attributes": [ 10 | { 11 | "name": "v-focus", 12 | "description": "自动获取输入框焦点\n1:naive-ui:v-focus \n2:原生控件:v-focus.native" 13 | }, 14 | { 15 | "name": "v-loading", 16 | "description": "加载中\ntrue开启\nfalse关闭" 17 | }, 18 | { 19 | "name": "v-drag", 20 | "description": "使元素可被拖拽" 21 | } 22 | ] 23 | } 24 | } 25 | } 26 | --------------------------------------------------------------------------------