├── LICENSE ├── README.md ├── db.sql ├── docker ├── README.md ├── boot │ ├── Dockerfile │ └── api │ │ └── application-local.yml ├── docker-compose.yml ├── mysql │ ├── conf │ │ └── my.cnf │ └── init │ │ └── init.sql ├── nginx │ └── conf.d │ │ └── yf-boot.conf └── startup.sh ├── yf-boot-api ├── application-local.yml ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── yf │ │ ├── BootApplication.java │ │ ├── ability │ │ ├── Constant.java │ │ ├── captcha │ │ │ ├── controller │ │ │ │ └── CaptchaController.java │ │ │ ├── dto │ │ │ │ └── request │ │ │ │ │ └── CheckCaptchaReqDTO.java │ │ │ └── service │ │ │ │ ├── CaptchaService.java │ │ │ │ └── impl │ │ │ │ └── CaptchaServiceImpl.java │ │ ├── excel │ │ │ ├── ExportExcel.java │ │ │ ├── ImportExcel.java │ │ │ ├── MyExcelWriter.java │ │ │ ├── annotation │ │ │ │ └── ExcelField.java │ │ │ └── service │ │ │ │ └── ExcelDictService.java │ │ ├── redis │ │ │ └── service │ │ │ │ ├── RedisService.java │ │ │ │ └── impl │ │ │ │ └── RedisServiceImpl.java │ │ ├── shiro │ │ │ ├── CNFilterFactoryBean.java │ │ │ ├── MyShiroRealm.java │ │ │ ├── aop │ │ │ │ └── JwtFilter.java │ │ │ ├── dto │ │ │ │ └── SysUserLoginDTO.java │ │ │ ├── jwt │ │ │ │ ├── JwtToken.java │ │ │ │ └── JwtUtils.java │ │ │ └── service │ │ │ │ └── ShiroUserService.java │ │ ├── task │ │ │ ├── enums │ │ │ │ ├── JobGroup.java │ │ │ │ └── JobPrefix.java │ │ │ └── service │ │ │ │ ├── JobService.java │ │ │ │ └── impl │ │ │ │ └── JobServiceImpl.java │ │ └── upload │ │ │ ├── enums │ │ │ └── UploadProvider.java │ │ │ ├── factory │ │ │ └── UploadFactory.java │ │ │ └── service │ │ │ └── UploadService.java │ │ ├── base │ │ ├── api │ │ │ ├── annon │ │ │ │ ├── DataProtect.java │ │ │ │ ├── Dict.java │ │ │ │ └── LogInject.java │ │ │ ├── api │ │ │ │ ├── ApiError.java │ │ │ │ ├── ApiRest.java │ │ │ │ ├── controller │ │ │ │ │ └── BaseController.java │ │ │ │ ├── dto │ │ │ │ │ ├── BaseBatchReqDTO.java │ │ │ │ │ ├── BaseDTO.java │ │ │ │ │ ├── BaseIdReqDTO.java │ │ │ │ │ ├── BaseIdRespDTO.java │ │ │ │ │ ├── BaseIdsReqDTO.java │ │ │ │ │ ├── BaseIfReqDTO.java │ │ │ │ │ ├── BaseListDTO.java │ │ │ │ │ ├── BaseQueryReqDTO.java │ │ │ │ │ ├── BaseStateReqDTO.java │ │ │ │ │ ├── BaseTokenReqDTO.java │ │ │ │ │ ├── BaseUserReqDTO.java │ │ │ │ │ ├── BooleanRespDTO.java │ │ │ │ │ ├── PagingReqDTO.java │ │ │ │ │ ├── PagingRespDTO.java │ │ │ │ │ └── PayReqDTO.java │ │ │ │ └── enums │ │ │ │ │ └── CommonState.java │ │ │ └── exception │ │ │ │ ├── ServiceException.java │ │ │ │ └── ServiceExceptionHandler.java │ │ ├── enums │ │ │ ├── DataScope.java │ │ │ └── PlatformType.java │ │ └── utils │ │ │ ├── AbcTags.java │ │ │ ├── BeanMapper.java │ │ │ ├── CacheKey.java │ │ │ ├── CalcUtils.java │ │ │ ├── CronUtils.java │ │ │ ├── DateUtils.java │ │ │ ├── DecimalUtils.java │ │ │ ├── DeptCodeGen.java │ │ │ ├── FileUtils.java │ │ │ ├── HtmlUtils.java │ │ │ ├── ImageUtils.java │ │ │ ├── InjectUtils.java │ │ │ ├── Md5Util.java │ │ │ ├── Reflections.java │ │ │ ├── ResourceUtil.java │ │ │ ├── SpringUtils.java │ │ │ ├── download │ │ │ ├── DownloadUtil.java │ │ │ ├── Downloader.java │ │ │ ├── temp │ │ │ │ ├── DownloadTemp.java │ │ │ │ └── DownloadTempThread.java │ │ │ └── thread │ │ │ │ └── DownloadThread.java │ │ │ ├── file │ │ │ ├── MD5Util.java │ │ │ ├── TextFileUtils.java │ │ │ └── ZipUtils.java │ │ │ ├── http │ │ │ └── HttpClientUtil.java │ │ │ ├── jackson │ │ │ ├── DesensitizeSerializer.java │ │ │ ├── JsonHelper.java │ │ │ ├── NumericBooleanDeserializer.java │ │ │ └── RawJsonDeserializer.java │ │ │ └── passwd │ │ │ ├── PassHandler.java │ │ │ └── PassInfo.java │ │ ├── config │ │ ├── BaseConfig.java │ │ ├── CorsConfig.java │ │ ├── DruidConfig.java │ │ ├── MultipartConfig.java │ │ ├── MybatisConfig.java │ │ ├── QuartzConfig.java │ │ ├── ShiroConfig.java │ │ ├── SwaggerConfig.java │ │ ├── jackson │ │ │ ├── JacksonConfig.java │ │ │ └── JacksonSerializerModifier.java │ │ └── websocket │ │ │ ├── CustomSpringConfigurator.java │ │ │ └── WebSocketConfig.java │ │ ├── plugins │ │ └── upload │ │ │ └── local │ │ │ ├── config │ │ │ └── LocalConfig.java │ │ │ ├── controller │ │ │ └── UploadController.java │ │ │ ├── dto │ │ │ ├── UploadReqDTO.java │ │ │ └── UploadRespDTO.java │ │ │ ├── service │ │ │ └── impl │ │ │ │ └── LocalUpServiceImpl.java │ │ │ └── utils │ │ │ └── OssUtils.java │ │ └── system │ │ ├── aspect │ │ ├── dict │ │ │ └── DataDictFilter.java │ │ └── mybatis │ │ │ ├── QueryInterceptor.java │ │ │ └── UpdateInterceptor.java │ │ └── modules │ │ ├── config │ │ ├── controller │ │ │ ├── CfgBaseController.java │ │ │ └── CfgSwitchController.java │ │ ├── dto │ │ │ ├── CfgBaseDTO.java │ │ │ └── CfgSwitchDTO.java │ │ ├── entity │ │ │ ├── CfgBase.java │ │ │ └── CfgSwitch.java │ │ ├── enums │ │ │ └── FuncSwitch.java │ │ ├── mapper │ │ │ ├── CfgBaseMapper.java │ │ │ └── CfgSwitchMapper.java │ │ └── service │ │ │ ├── CfgBaseService.java │ │ │ ├── CfgSwitchService.java │ │ │ └── impl │ │ │ ├── CfgBaseServiceImpl.java │ │ │ └── CfgSwitchServiceImpl.java │ │ ├── depart │ │ ├── controller │ │ │ └── SysDepartController.java │ │ ├── dto │ │ │ ├── SysDepartDTO.java │ │ │ ├── request │ │ │ │ ├── DepartQueryReqDTO.java │ │ │ │ └── DepartSortReqDTO.java │ │ │ └── response │ │ │ │ └── SysDepartTreeDTO.java │ │ ├── entity │ │ │ └── SysDepart.java │ │ ├── mapper │ │ │ └── SysDepartMapper.java │ │ └── service │ │ │ ├── SysDepartService.java │ │ │ └── impl │ │ │ └── SysDepartServiceImpl.java │ │ ├── dict │ │ ├── controller │ │ │ ├── SysDicController.java │ │ │ └── SysDicValueController.java │ │ ├── dto │ │ │ ├── SysDicDTO.java │ │ │ ├── SysDicValueDTO.java │ │ │ ├── ext │ │ │ │ └── DicValueTreeDTO.java │ │ │ └── request │ │ │ │ └── SysDicValueReqDTO.java │ │ ├── entity │ │ │ ├── SysDic.java │ │ │ └── SysDicValue.java │ │ ├── mapper │ │ │ ├── SysDicMapper.java │ │ │ └── SysDicValueMapper.java │ │ └── service │ │ │ ├── SysDicService.java │ │ │ ├── SysDicValueService.java │ │ │ └── impl │ │ │ ├── SysDicServiceImpl.java │ │ │ └── SysDicValueServiceImpl.java │ │ ├── menu │ │ ├── controller │ │ │ └── SysMenuController.java │ │ ├── dto │ │ │ ├── SysMenuDTO.java │ │ │ └── response │ │ │ │ ├── MenuTreeRespDTO.java │ │ │ │ └── RouteRespDTO.java │ │ ├── entity │ │ │ └── SysMenu.java │ │ ├── eums │ │ │ └── MenuType.java │ │ ├── mapper │ │ │ └── SysMenuMapper.java │ │ └── service │ │ │ ├── SysMenuService.java │ │ │ └── impl │ │ │ └── SysMenuServiceImpl.java │ │ ├── plugin │ │ ├── controller │ │ │ ├── PluginDataController.java │ │ │ ├── PluginGroupController.java │ │ │ └── PluginSchemaController.java │ │ ├── dto │ │ │ ├── PluginDataDTO.java │ │ │ ├── PluginGroupDTO.java │ │ │ └── PluginSchemaDTO.java │ │ ├── entity │ │ │ ├── PluginData.java │ │ │ ├── PluginGroup.java │ │ │ └── PluginSchema.java │ │ ├── mapper │ │ │ ├── PluginDataMapper.java │ │ │ ├── PluginGroupMapper.java │ │ │ └── PluginSchemaMapper.java │ │ └── service │ │ │ ├── PluginDataService.java │ │ │ ├── PluginGroupService.java │ │ │ ├── PluginSchemaService.java │ │ │ └── impl │ │ │ ├── PluginDataServiceImpl.java │ │ │ ├── PluginGroupServiceImpl.java │ │ │ └── PluginSchemaServiceImpl.java │ │ ├── role │ │ ├── controller │ │ │ └── SysRoleController.java │ │ ├── dto │ │ │ ├── SysRoleDTO.java │ │ │ └── SysRoleMenuDTO.java │ │ ├── entity │ │ │ ├── SysRole.java │ │ │ └── SysRoleMenu.java │ │ ├── mapper │ │ │ ├── SysRoleMapper.java │ │ │ └── SysRoleMenuMapper.java │ │ └── service │ │ │ ├── SysRoleMenuService.java │ │ │ ├── SysRoleService.java │ │ │ └── impl │ │ │ ├── SysRoleMenuServiceImpl.java │ │ │ └── SysRoleServiceImpl.java │ │ └── user │ │ ├── UserUtils.java │ │ ├── controller │ │ ├── SysUserBindController.java │ │ └── SysUserController.java │ │ ├── dto │ │ ├── SysUserBindDTO.java │ │ ├── SysUserDTO.java │ │ ├── SysUserRoleDTO.java │ │ ├── request │ │ │ ├── SysRoleMenuReqDTO.java │ │ │ ├── SysUserLoginReqDTO.java │ │ │ ├── SysUserPassReqDTO.java │ │ │ ├── SysUserQueryReqDTO.java │ │ │ ├── SysUserSaveReqDTO.java │ │ │ ├── SysUserUpdateReqDTO.java │ │ │ ├── UserRegReqDTO.java │ │ │ └── UserRoleReqDTO.java │ │ └── response │ │ │ ├── UserExportDTO.java │ │ │ └── UserListRespDTO.java │ │ ├── entity │ │ ├── SysUser.java │ │ ├── SysUserBind.java │ │ └── SysUserRole.java │ │ ├── enums │ │ ├── LoginType.java │ │ ├── RoleType.java │ │ ├── SysRoleId.java │ │ └── UserState.java │ │ ├── mapper │ │ ├── SysUserBindMapper.java │ │ ├── SysUserMapper.java │ │ └── SysUserRoleMapper.java │ │ ├── service │ │ ├── SysUserBindService.java │ │ ├── SysUserRoleService.java │ │ ├── SysUserService.java │ │ └── impl │ │ │ ├── SysUserBindServiceImpl.java │ │ │ ├── SysUserRoleServiceImpl.java │ │ │ └── SysUserServiceImpl.java │ │ └── utils │ │ └── SignUtils.java │ └── resources │ ├── application-dev.yml │ ├── application.yml │ ├── excel │ └── user_template.xlsx │ ├── logback-spring.xml │ └── mapper │ └── sys │ ├── config │ ├── CfgBaseMapper.xml │ └── CfgSwitchMapper.xml │ ├── depart │ └── SysDepartMapper.xml │ ├── dict │ ├── SysDicMapper.xml │ └── SysDicValueMapper.xml │ ├── menu │ └── SysMenuMapper.xml │ ├── plugin │ ├── PluginGroupMapper.xml │ └── PluginSchemaMapper.xml │ ├── role │ ├── SysRoleMapper.xml │ └── SysRoleMenuMapper.xml │ └── user │ ├── SysUserBindMapper.xml │ ├── SysUserMapper.xml │ └── SysUserRoleMapper.xml └── yf-boot-vue ├── .env.base ├── .env.dev ├── .env.pro ├── .env.test ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .husky ├── commit-msg ├── lintstagedrc.js └── pre-commit ├── .prettierignore ├── .stylelintignore ├── commitlint.config.js ├── index.html ├── package.json ├── plop ├── component │ ├── component.hbs │ ├── index.hbs │ └── prompt.js └── view │ ├── prompt.js │ └── view.hbs ├── plopfile.js ├── postcss.config.js ├── prettier.config.js ├── public ├── favicon.ico └── logo.png ├── src ├── App.vue ├── api │ ├── login │ │ ├── index.ts │ │ └── types.ts │ └── sys │ │ ├── config │ │ ├── index.ts │ │ └── switch.ts │ │ ├── depart │ │ └── index.ts │ │ ├── dict │ │ └── index.ts │ │ ├── menu │ │ └── index.ts │ │ ├── plugin │ │ ├── data.ts │ │ ├── index.ts │ │ └── schema.ts │ │ ├── role │ │ └── index.ts │ │ └── user │ │ └── index.ts ├── assets │ ├── imgs │ │ ├── avatar.jpg │ │ └── logo.png │ └── svgs │ │ ├── 403.svg │ │ ├── 404.svg │ │ ├── 500.svg │ │ ├── icon.svg │ │ ├── login-bg.svg │ │ ├── login-box-bg.svg │ │ ├── message.svg │ │ ├── money.svg │ │ ├── peoples.svg │ │ └── shopping.svg ├── components │ ├── Backtop │ │ ├── index.ts │ │ └── src │ │ │ └── Backtop.vue │ ├── Breadcrumb │ │ ├── index.ts │ │ └── src │ │ │ ├── Breadcrumb.vue │ │ │ └── helper.ts │ ├── Collapse │ │ ├── index.ts │ │ └── src │ │ │ └── Collapse.vue │ ├── ConfigGlobal │ │ ├── index.ts │ │ └── src │ │ │ ├── ConfigGlobal.vue │ │ │ └── types │ │ │ └── index.ts │ ├── ContentDetailWrap │ │ ├── index.ts │ │ └── src │ │ │ └── ContentDetailWrap.vue │ ├── ContentWrap │ │ ├── index.ts │ │ └── src │ │ │ └── ContentWrap.vue │ ├── ContextMenu │ │ ├── index.ts │ │ └── src │ │ │ ├── ContextMenu.vue │ │ │ └── types │ │ │ └── index.ts │ ├── CountTo │ │ ├── index.ts │ │ └── src │ │ │ └── CountTo.vue │ ├── DataTable │ │ ├── index.ts │ │ └── src │ │ │ ├── DataTable.vue │ │ │ └── types.ts │ ├── DataTree │ │ ├── index.ts │ │ └── src │ │ │ ├── DataTree.vue │ │ │ └── types.ts │ ├── Descriptions │ │ ├── index.ts │ │ └── src │ │ │ ├── Descriptions.vue │ │ │ └── types │ │ │ └── index.ts │ ├── DictListSelect │ │ ├── index.ts │ │ └── src │ │ │ ├── DictListSelect.vue │ │ │ └── types.ts │ ├── Echart │ │ ├── index.ts │ │ └── src │ │ │ └── Echart.vue │ ├── Editor │ │ ├── index.ts │ │ └── src │ │ │ └── Editor.vue │ ├── Error │ │ ├── index.ts │ │ └── src │ │ │ └── Error.vue │ ├── Footer │ │ ├── index.ts │ │ └── src │ │ │ └── Footer.vue │ ├── Highlight │ │ ├── index.ts │ │ └── src │ │ │ └── Highlight.vue │ ├── Icon │ │ ├── index.ts │ │ └── src │ │ │ ├── Icon.vue │ │ │ └── types │ │ │ └── index.ts │ ├── ImageViewer │ │ ├── index.ts │ │ └── src │ │ │ ├── ImageViewer.vue │ │ │ └── types │ │ │ └── index.ts │ ├── Infotip │ │ ├── index.ts │ │ └── src │ │ │ ├── Infotip.vue │ │ │ └── types │ │ │ └── index.ts │ ├── InputCaptcha │ │ ├── index.ts │ │ └── src │ │ │ └── InputCaptcha.vue │ ├── InputPassword │ │ ├── index.ts │ │ └── src │ │ │ └── InputPassword.vue │ ├── LocaleDropdown │ │ ├── index.ts │ │ └── src │ │ │ ├── LocaleDropdown.vue │ │ │ └── types │ │ │ └── index.ts │ ├── Logo │ │ ├── index.ts │ │ └── src │ │ │ └── Logo.vue │ ├── Menu │ │ ├── index.ts │ │ └── src │ │ │ ├── Menu.vue │ │ │ ├── components │ │ │ ├── useRenderMenuItem.tsx │ │ │ └── useRenderMenuTitle.tsx │ │ │ └── helper.ts │ ├── Permission │ │ ├── index.ts │ │ └── src │ │ │ ├── Permission.vue │ │ │ └── utils.ts │ ├── Qrcode │ │ ├── index.ts │ │ └── src │ │ │ ├── Qrcode.vue │ │ │ └── types │ │ │ └── index.ts │ ├── Screenfull │ │ ├── index.ts │ │ └── src │ │ │ └── Screenfull.vue │ ├── Search │ │ ├── index.ts │ │ └── src │ │ │ ├── Search.vue │ │ │ ├── components │ │ │ └── ActionButton.vue │ │ │ └── types │ │ │ └── index.ts │ ├── Setting │ │ ├── index.ts │ │ └── src │ │ │ ├── Setting.vue │ │ │ └── components │ │ │ ├── ColorRadioPicker.vue │ │ │ ├── InterfaceDisplay.vue │ │ │ └── LayoutRadioPicker.vue │ ├── SizeDropdown │ │ ├── index.ts │ │ └── src │ │ │ └── SizeDropdown.vue │ ├── TabMenu │ │ ├── index.ts │ │ └── src │ │ │ ├── TabMenu.vue │ │ │ └── helper.ts │ ├── Table │ │ ├── index.ts │ │ └── src │ │ │ ├── Table.vue │ │ │ ├── components │ │ │ └── TableActions.vue │ │ │ ├── helper │ │ │ └── index.ts │ │ │ └── types │ │ │ └── index.ts │ ├── TagsView │ │ ├── index.ts │ │ └── src │ │ │ ├── TagsView.vue │ │ │ └── helper.ts │ ├── ThemeSwitch │ │ ├── index.ts │ │ └── src │ │ │ └── ThemeSwitch.vue │ ├── UserInfo │ │ ├── index.ts │ │ └── src │ │ │ ├── UserInfo.vue │ │ │ └── components │ │ │ ├── LockDialog.vue │ │ │ └── LockPage.vue │ └── index.ts ├── config │ └── axios │ │ ├── config.ts │ │ ├── index.ts │ │ ├── service.ts │ │ └── types │ │ └── index.ts ├── directives │ ├── index.ts │ └── permission │ │ └── hasPermi.ts ├── hooks │ ├── event │ │ ├── useEmitt.ts │ │ └── useScrollTo.ts │ └── web │ │ ├── useConfigGlobal.ts │ │ ├── useCrudSchemas.ts │ │ ├── useDesign.ts │ │ ├── useForm.ts │ │ ├── useGuide.ts │ │ ├── useI18n.ts │ │ ├── useIcon.ts │ │ ├── useLocale.ts │ │ ├── useNProgress.ts │ │ ├── useNow.ts │ │ ├── usePageLoading.ts │ │ ├── useSearch.ts │ │ ├── useStorage.ts │ │ ├── useTable.ts │ │ ├── useTagsView.ts │ │ ├── useTimeAgo.ts │ │ ├── useTitle.ts │ │ ├── useValidator.ts │ │ └── useWatermark.ts ├── layout │ ├── Layout.vue │ └── components │ │ ├── AppView.vue │ │ ├── ToolHeader.vue │ │ └── useRenderLayout.tsx ├── locales │ ├── en.ts │ └── zh-CN.ts ├── main.ts ├── permission.ts ├── plugins │ ├── animate.css │ │ └── index.ts │ ├── echarts │ │ └── index.ts │ ├── elementPlus │ │ └── index.ts │ ├── svgIcon │ │ └── index.ts │ ├── unocss │ │ └── index.ts │ ├── uploader │ │ ├── index.ts │ │ └── src │ │ │ ├── FileUploader.vue │ │ │ └── types.ts │ └── vueI18n │ │ ├── helper.ts │ │ └── index.ts ├── router │ └── index.ts ├── store │ ├── index.ts │ └── modules │ │ ├── app.ts │ │ ├── locale.ts │ │ ├── lock.ts │ │ ├── permission.ts │ │ ├── tagsView.ts │ │ └── user.ts ├── styles │ ├── index.css │ ├── index.css.map │ ├── index.less │ ├── var.css │ └── variables.module.less ├── utils │ ├── color.ts │ ├── dateUtil.ts │ ├── domUtils.ts │ ├── index.ts │ ├── is.ts │ ├── propTypes.ts │ ├── routerHelper.ts │ ├── tree.ts │ └── tsxHelper.ts └── views │ ├── Dashboard │ └── Dashboard.vue │ ├── Error │ ├── 403.vue │ ├── 404.vue │ └── 500.vue │ ├── Login │ ├── Login.vue │ └── components │ │ ├── LoginForm.vue │ │ ├── RegisterForm.vue │ │ └── index.ts │ ├── Redirect │ └── Redirect.vue │ └── System │ ├── Config │ ├── Config.vue │ └── components │ │ ├── BaseConfig.vue │ │ └── SwitchConfig.vue │ ├── DataDict │ ├── DataDict.vue │ └── components │ │ ├── DictItem.vue │ │ ├── DictValue.vue │ │ └── types.ts │ ├── Depart │ ├── Depart.vue │ └── components │ │ └── DepartSelect.vue │ ├── Menu │ ├── Menu.vue │ └── types.ts │ ├── Plugin │ ├── Plugin.vue │ └── types.ts │ ├── Role │ ├── Role.vue │ ├── components │ │ ├── Grant.vue │ │ └── RoleSelect.vue │ └── types.ts │ └── User │ ├── User.vue │ └── types.ts ├── stylelint.config.js ├── tsconfig.json ├── types ├── components.d.ts ├── env.d.ts ├── global.d.ts └── router.d.ts ├── uno.config.ts └── vite.config.ts /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 孤傲的小笼包 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docker/boot/Dockerfile: -------------------------------------------------------------------------------- 1 | # 英特尔芯片用这个,默认 2 | FROM centos:7 3 | # ARM架构的芯片,Mac系统M1/M2... 4 | # FROM amd64/centos:7 5 | 6 | # 添加时区文件 7 | RUN echo "Asia/Shanghai" > /etc/timezone 8 | 9 | 10 | # 安装java 11 | RUN yum install -y java-1.8.0-openjdk-devel.x86_64 12 | 13 | #清理缓存,减少镜像大小 14 | RUN yum clean all 15 | 16 | # 运行项目 17 | VOLUME /data/run/api 18 | CMD sleep 10s && cd /data/run/api && java -jar yf-boot-api.jar --spring.config.location=application-local.yml 19 | -------------------------------------------------------------------------------- /docker/mysql/conf/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | user=mysql 3 | default-storage-engine=INNODB 4 | character-set-server=utf8 5 | # SQL模式,去除了分组的 6 | sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION 7 | # 最大连接数 8 | max_connections=3000 9 | # 对大小写不敏感 10 | lower_case_table_names=1 11 | # 最大数据发送,如果在导入数据报错,可以改大 12 | max_allowed_packet=200M 13 | [client] 14 | default-character-set=utf8 15 | [mysql] 16 | default-character-set=utf8 17 | 18 | -------------------------------------------------------------------------------- /docker/nginx/conf.d/yf-boot.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8686; 3 | server_name localhost; 4 | # listen 443 ssl; 5 | # ssl_certificate cert/7036742_docker.jeegen.com.pem; 6 | # ssl_certificate_key cert/7036742_docker.jeegen.com.key; 7 | # ssl_session_timeout 5m; 8 | # ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 9 | # ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 10 | # ssl_prefer_server_ciphers on; 11 | proxy_set_header X-Real-IP $remote_addr; 12 | proxy_set_header Host $host; 13 | proxy_http_version 1.1; 14 | proxy_set_header Upgrade $http_upgrade; 15 | proxy_set_header Connection 'upgrade'; 16 | client_max_body_size 2000m; 17 | # if ($scheme = http) { 18 | # return 301 https://$host$request_uri; 19 | # } 20 | 21 | 22 | # 动态决定到手机端还是PC端 23 | location / { 24 | root /data/run/dist; 25 | try_files $uri $uri/ /index.html last; 26 | } 27 | location ~/(api/|upload/file/){ 28 | proxy_pass http://api:8080; 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /docker/startup.sh: -------------------------------------------------------------------------------- 1 | docker-compose up -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/Constant.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability; 2 | 3 | 4 | /** 5 | * 通用常量 6 | * @author bool 7 | */ 8 | public class Constant { 9 | 10 | /** 11 | * 用户名前缀 12 | */ 13 | public static final String USER_NAME_KEY = "yf:exam:name:"; 14 | 15 | /** 16 | * 会话 17 | */ 18 | public static final String TOKEN = "token"; 19 | 20 | 21 | /** 22 | * 人脸识别 23 | */ 24 | public static final String FACE_TOKEN = "yf:face:"; 25 | 26 | /** 27 | * 文件上传路径 28 | */ 29 | public static final String FILE_PREFIX = "/upload/file/"; 30 | } 31 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/captcha/dto/request/CheckCaptchaReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.captcha.dto.request; 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 | /** 10 | * 图形验证码校验请求类 11 | * @author bool 12 | * @date 2020-02-21 10:18 13 | */ 14 | @Data 15 | @ApiModel(value="图形验证码校验请求类", description="图形验证码校验请求类") 16 | public class CheckCaptchaReqDTO implements Serializable { 17 | 18 | /** 19 | * 验证码键 20 | */ 21 | @ApiModelProperty(value = "前端产生的验证码键") 22 | private String captchaKey; 23 | 24 | /** 25 | * 用户输入的验证码 26 | */ 27 | @ApiModelProperty(value = "用户输入的验证码") 28 | private String captchaValue; 29 | } 30 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/captcha/service/CaptchaService.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.captcha.service; 2 | 3 | /** 4 | * 验证码业务类 5 | * @author bool 6 | * @date 2020-02-17 09:43 7 | */ 8 | public interface CaptchaService { 9 | 10 | /** 11 | * 保存验证码信息到Redis 12 | * @param key 13 | * @param value 14 | */ 15 | void saveCaptcha(String key, String value); 16 | 17 | /** 18 | * 校验验证码内容是否正确 19 | * @param key 20 | * @param input 21 | * @return 22 | */ 23 | boolean checkCaptcha(String key, String input); 24 | } 25 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/excel/annotation/ExcelField.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.excel.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Excel导出注解定义 10 | * @author bool 11 | */ 12 | @Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE}) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | public @interface ExcelField { 15 | 16 | /** 17 | * 导出的excel标题 18 | * @return 19 | */ 20 | String title(); 21 | 22 | /** 23 | * 数据过滤,格式如:0=正常,1=禁用 24 | * @return 25 | */ 26 | String filter() default ""; 27 | 28 | /** 29 | * 导出字段字段排序(升序) 30 | */ 31 | int sort() default 0; 32 | 33 | /** 34 | * 日期格式化 35 | * @return 36 | */ 37 | String pattern() default ""; 38 | 39 | /** 40 | * 数据字典类型 41 | */ 42 | String dictCode() default ""; 43 | 44 | /** 45 | * 查找字段 46 | * @return 47 | */ 48 | String dicText() default ""; 49 | 50 | /** 51 | * 查找表 52 | * @return 53 | */ 54 | String dictTable() default ""; 55 | } 56 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/excel/service/ExcelDictService.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.excel.service; 2 | 3 | /** 4 | * 数据字典的翻译,用于导入导出,如果需要翻译,则必须要实现此类 5 | * @author van 6 | */ 7 | public interface ExcelDictService { 8 | 9 | /** 10 | * 翻译字典标题 11 | * @param code 12 | * @param key 13 | * @return 14 | */ 15 | String findDictText(String code, String key); 16 | 17 | /** 18 | * 查找其它表的对应信息 19 | * @param table 20 | * @param text 21 | * @param code 22 | * @param key 23 | * @return 24 | */ 25 | String findTableText(String table, String text, String code, String key); 26 | } 27 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/shiro/CNFilterFactoryBean.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.shiro; 2 | 3 | import org.apache.shiro.spring.web.ShiroFilterFactoryBean; 4 | import org.apache.shiro.web.filter.InvalidRequestFilter; 5 | import org.apache.shiro.web.filter.mgt.DefaultFilter; 6 | import org.apache.shiro.web.filter.mgt.FilterChainManager; 7 | 8 | import javax.servlet.Filter; 9 | import java.util.Map; 10 | 11 | /** 12 | * 自定义过滤器,用于处理中文URL问题 13 | * 如:下载文件中包含中文会返回400错误,https://youdomain.com/upload/file/云帆考试系统用户手册.pdf 14 | * @author van 15 | */ 16 | public class CNFilterFactoryBean extends ShiroFilterFactoryBean { 17 | 18 | @Override 19 | protected FilterChainManager createFilterChainManager() { 20 | FilterChainManager manager = super.createFilterChainManager(); 21 | // URL携带中文400,servletPath中文校验bug 22 | Map filterMap = manager.getFilters(); 23 | Filter invalidRequestFilter = filterMap.get(DefaultFilter.invalidRequest.name()); 24 | if (invalidRequestFilter instanceof InvalidRequestFilter) { 25 | ((InvalidRequestFilter) invalidRequestFilter).setBlockNonAscii(false); 26 | } 27 | return manager; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/shiro/jwt/JwtToken.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.shiro.jwt; 2 | 3 | import lombok.Data; 4 | import org.apache.shiro.authc.AuthenticationToken; 5 | 6 | /** 7 | * @author bool 8 | */ 9 | @Data 10 | public class JwtToken implements AuthenticationToken { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | /** 15 | * JWT的字符token 16 | */ 17 | private String token; 18 | 19 | 20 | public JwtToken(String token) { 21 | this.token = token; 22 | } 23 | 24 | @Override 25 | public Object getPrincipal() { 26 | return token; 27 | } 28 | 29 | @Override 30 | public Object getCredentials() { 31 | return token; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/shiro/service/ShiroUserService.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.shiro.service; 2 | 3 | 4 | import com.yf.ability.shiro.dto.SysUserLoginDTO; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 获取用户角色权限信息,使用时必须要实现此方法才能进行权限控制 10 | * @author van 11 | */ 12 | public interface ShiroUserService { 13 | 14 | /** 15 | * 查找用户权限 16 | * @param userId 17 | * @return 18 | */ 19 | List permissions(String userId); 20 | 21 | /** 22 | * 查找用户角色列表 23 | * @param userId 24 | * @return 25 | */ 26 | List roles(String userId); 27 | 28 | /** 29 | * 获取会话缓存 30 | * @param token 31 | * @return 32 | */ 33 | SysUserLoginDTO token(String token); 34 | } 35 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/task/enums/JobGroup.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.task.enums; 2 | 3 | /** 4 | * 任务分组 5 | */ 6 | public interface JobGroup { 7 | 8 | /** 9 | * 系统任务 10 | */ 11 | String SYSTEM = "system"; 12 | } 13 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/task/enums/JobPrefix.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.task.enums; 2 | 3 | /** 4 | * 任务前缀 5 | * @author bool 6 | */ 7 | public interface JobPrefix { 8 | 9 | /** 10 | * 强制交卷的 11 | */ 12 | String BREAK_EXAM = "break_exam_"; 13 | 14 | /** 15 | * 颁发证书 16 | */ 17 | String GRANT_CERT = "grant_cert_"; 18 | 19 | /** 20 | * 加入错题本 21 | */ 22 | String ADD_BOOK = "add_book_"; 23 | 24 | /** 25 | * 读取视频时长 26 | */ 27 | String READ_DURATION = "read_duration_"; 28 | } 29 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/task/service/JobService.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.task.service; 2 | 3 | /** 4 | * 任务业务类,用于动态处理任务信息 5 | * @author bool 6 | * @date 2020/11/29 下午2:17 7 | */ 8 | public interface JobService { 9 | 10 | 11 | /** 12 | * 任务数据 13 | */ 14 | String TASK_DATA = "taskData"; 15 | 16 | /** 17 | * 添加定时任务 18 | * @param jobClass 19 | * @param jobName 20 | * @param jobGroup 21 | * @param cron 22 | * @param data 23 | */ 24 | void addCronJob(Class jobClass, String jobName, String jobGroup, String cron, String data); 25 | 26 | /** 27 | * 添加立即执行的任务 28 | * @param jobClass 29 | * @param jobName 30 | * @param jobGroup 31 | * @param data 32 | */ 33 | void addCronJob(Class jobClass, String jobName, String jobGroup, String data); 34 | 35 | /** 36 | * 暂停任务 37 | * @param jobName 38 | * @param jobGroup 39 | */ 40 | void pauseJob(String jobName, String jobGroup); 41 | 42 | /** 43 | * 恢复任务 44 | * @param triggerName 45 | * @param triggerGroup 46 | */ 47 | void resumeJob(String triggerName, String triggerGroup); 48 | 49 | /** 50 | * 删除job 51 | * @param jobName 52 | * @param jobGroup 53 | */ 54 | void deleteJob(String jobName, String jobGroup); 55 | } 56 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/upload/enums/UploadProvider.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.upload.enums; 2 | 3 | /** 4 | * 上传服务商枚举 5 | * @author bool 6 | */ 7 | public interface UploadProvider { 8 | 9 | /** 10 | * 本地上传 11 | */ 12 | String LOCAL = "local"; 13 | 14 | /** 15 | * 阿里云 16 | */ 17 | String OSS = "oss"; 18 | 19 | /** 20 | * 腾讯云 21 | */ 22 | String COS = "cos"; 23 | 24 | /** 25 | * 七牛云 26 | */ 27 | String QINIU = "qiniu"; 28 | } 29 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/upload/factory/UploadFactory.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.upload.factory; 2 | 3 | import com.yf.ability.upload.service.UploadService; 4 | import com.yf.base.utils.SpringUtils; 5 | import com.yf.system.modules.plugin.service.PluginDataService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * 服务器端上传文件方法 11 | * @author van 12 | */ 13 | @Service 14 | public class UploadFactory { 15 | 16 | /** 17 | * 配置分组 18 | */ 19 | private static final String GROUP_ID = "upload"; 20 | 21 | @Autowired 22 | private PluginDataService pluginDataService; 23 | 24 | /** 25 | * 获取工厂实例 26 | * @return 27 | */ 28 | public UploadService getService(){ 29 | 30 | // 获得实现类 31 | String clazz = pluginDataService.findServiceClazz(GROUP_ID); 32 | 33 | System.out.println("+++++服务实现类:"+clazz); 34 | 35 | try { 36 | return (UploadService)SpringUtils.getBean(Class.forName(clazz)); 37 | } catch (ClassNotFoundException e) { 38 | throw new RuntimeException(e); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/ability/upload/service/UploadService.java: -------------------------------------------------------------------------------- 1 | package com.yf.ability.upload.service; 2 | 3 | import com.yf.plugins.upload.local.dto.UploadRespDTO; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | import java.io.IOException; 9 | 10 | /** 11 | * 服务器端上传文件方法 12 | * @author van 13 | */ 14 | public interface UploadService { 15 | 16 | /** 17 | * 上传文件 18 | * @param multipartFile 19 | * @return 20 | */ 21 | UploadRespDTO upload(MultipartFile multipartFile); 22 | 23 | /** 24 | * 本地上传 25 | * @param localFile 26 | * @return 27 | */ 28 | String upload(String localFile); 29 | 30 | /** 31 | * 下载文件 32 | * @param request 33 | * @param response 34 | */ 35 | void download(HttpServletRequest request, HttpServletResponse response) throws IOException; 36 | } 37 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/annon/DataProtect.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.annon; 2 | 3 | 4 | import java.lang.annotation.Documented; 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | /** 11 | * 保护某些数据不被删除或更新 12 | * @author bool 13 | */ 14 | @Documented 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target({ElementType.TYPE, ElementType.METHOD}) 17 | public @interface DataProtect { 18 | 19 | /** 20 | * 更新保护 21 | * @return 22 | */ 23 | boolean update() default false; 24 | 25 | /** 26 | * 删除保护 27 | * @return 28 | */ 29 | boolean delete() default false; 30 | 31 | /** 32 | * 当前用户ID 33 | * @return 34 | */ 35 | boolean currUsr() default false; 36 | 37 | /** 38 | * 实体类名,获取表名 39 | * @return 40 | */ 41 | Class clazz(); 42 | } 43 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/annon/Dict.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.annon; 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 | * @author bool 11 | */ 12 | @Target(ElementType.FIELD) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | public @interface Dict { 15 | 16 | String dicCode(); 17 | 18 | String dicText() default ""; 19 | 20 | String dictTable() default ""; 21 | } 22 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/annon/LogInject.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.annon; 2 | 3 | 4 | import java.lang.annotation.Documented; 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | /** 11 | * 系统日志注入类 12 | * @author bool 13 | */ 14 | @Documented 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target({ElementType.TYPE, ElementType.METHOD}) 17 | public @interface LogInject { 18 | 19 | /** 20 | * 日志类型 21 | * @return 22 | */ 23 | String logType() default "日志类型"; 24 | 25 | /** 26 | * 日志标题 27 | * @return 28 | */ 29 | String title() default "系统日志"; 30 | } 31 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/ApiRest.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api; 2 | 3 | 4 | import com.yf.base.api.exception.ServiceException; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | * 数据结果返回的封装 12 | * @author bool 13 | * @date 2018/11/20 09:48 14 | */ 15 | @Data 16 | @NoArgsConstructor 17 | @ApiModel(value="接口响应", description="接口响应") 18 | public class ApiRest{ 19 | 20 | /** 21 | * 响应消息 22 | */ 23 | @ApiModelProperty(value = "响应消息") 24 | private String msg; 25 | /** 26 | * 响应代码 27 | */ 28 | @ApiModelProperty(value = "响应代码,0为成功,1为失败", required = true) 29 | private Integer code; 30 | 31 | /** 32 | * 请求或响应body 33 | */ 34 | @ApiModelProperty(value = "响应内容") 35 | protected T data; 36 | 37 | 38 | /** 39 | * 是否成功 40 | * @return 41 | */ 42 | public boolean isSuccess(){ 43 | return code.equals(0); 44 | } 45 | 46 | /** 47 | * 构造函数 48 | * @param error 49 | */ 50 | public ApiRest(ServiceException error){ 51 | this.code = error.getCode(); 52 | this.msg = error.getMsg(); 53 | } 54 | 55 | /** 56 | * 构造函数 57 | * @param error 58 | */ 59 | public ApiRest(ApiError error){ 60 | this.code = error.getCode(); 61 | this.msg = error.msg; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseBatchReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | *

11 | * 通用批量操作请求类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2019-04-20 12:15 16 | */ 17 | @Data 18 | @ApiModel(value="通用批量操作请求类", description="通用批量操作请求类") 19 | public class BaseBatchReqDTO extends BaseDTO { 20 | 21 | @ApiModelProperty(value = "要修改的对象列表", required=true) 22 | private List ids; 23 | 24 | @ApiModelProperty(value = "修改成为的值", required=true) 25 | private String toId; 26 | } 27 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 请求和响应的基础类,用于处理序列化 9 | * @author dav 10 | * @date 2019/3/16 15:56 11 | */ 12 | @Data 13 | public class BaseDTO implements Serializable { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseIdReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | /** 9 | *

10 | * 主键通用请求类,用于根据ID查询 11 | *

12 | * 13 | * @author 聪明笨狗 14 | * @since 2019-04-20 12:15 15 | */ 16 | @Data 17 | @ApiModel(value="主键通用请求类", description="主键通用请求类") 18 | public class BaseIdReqDTO extends BaseDTO { 19 | 20 | 21 | @ApiModelProperty(value = "主键ID", required=true) 22 | private String id; 23 | 24 | @JsonIgnore 25 | private String userId; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseIdRespDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | /** 10 | *

11 | * 主键通用响应类,用于添加后返回内容 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2019-04-20 12:15 16 | */ 17 | @Data 18 | @ApiModel(value="主键通用响应类", description="主键通用响应类") 19 | @AllArgsConstructor 20 | @NoArgsConstructor 21 | public class BaseIdRespDTO extends BaseDTO { 22 | 23 | @ApiModelProperty(value = "主键ID", required=true) 24 | private String id; 25 | } 26 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseIdsReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 通用ID列表类操作,用于批量删除、修改状态等 12 | * @author bool 13 | * @date 2019-08-01 19:07 14 | */ 15 | @Data 16 | @ApiModel(value="删除参数", description="删除参数") 17 | public class BaseIdsReqDTO extends BaseDTO { 18 | 19 | 20 | @JsonIgnore 21 | private String userId; 22 | 23 | @ApiModelProperty(value = "要删除的ID列表", required = true) 24 | private List ids; 25 | } 26 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseIfReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 是否状态通用请求 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2019-04-20 12:15 18 | */ 19 | @Data 20 | @ApiModel(value="是否状态通用请求", description="是否状态通用请求") 21 | @AllArgsConstructor 22 | @NoArgsConstructor 23 | public class BaseIfReqDTO extends BaseDTO { 24 | 25 | 26 | @ApiModelProperty(value = "要修改对象的ID列表", required=true) 27 | private List ids; 28 | 29 | @ApiModelProperty(value = "启用状态,true/false", required=true) 30 | private Boolean enabled; 31 | } 32 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseListDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | * 请求和响应的基础类,用于处理序列化 11 | * @author dav 12 | * @date 2019/3/16 15:56 13 | */ 14 | @Data 15 | public class BaseListDTO implements Serializable { 16 | 17 | @JsonIgnore 18 | private String userId; 19 | 20 | /** 21 | * 数据列表 22 | */ 23 | private List items; 24 | } 25 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseQueryReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | import java.util.Date; 10 | 11 | /** 12 | *

13 | * 按关键字查询请求通用类 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2019-04-20 12:15 18 | */ 19 | @Data 20 | @ApiModel(value="按关键字查询请求通用类", description="按关键字查询请求通用类") 21 | @AllArgsConstructor 22 | @NoArgsConstructor 23 | public class BaseQueryReqDTO extends BaseDTO { 24 | 25 | 26 | @ApiModelProperty(value = "日期开始", required=true) 27 | private Date statDateL; 28 | 29 | @ApiModelProperty(value = "日期结束", required=true) 30 | private Date statDateR; 31 | 32 | @ApiModelProperty(value = "关键字查询", required=true) 33 | private String q; 34 | } 35 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseStateReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 通用状态请求类,用于修改状态什么的 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2019-04-20 12:15 18 | */ 19 | @Data 20 | @ApiModel(value="通用状态请求类", description="通用状态请求类") 21 | @AllArgsConstructor 22 | @NoArgsConstructor 23 | public class BaseStateReqDTO extends BaseDTO { 24 | 25 | 26 | @ApiModelProperty(value = "要修改对象的ID列表", required=true) 27 | private List ids; 28 | 29 | @ApiModelProperty(value = "通用状态,0为正常,1为禁用", required=true) 30 | private Integer state; 31 | } 32 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseTokenReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | *

9 | * token通用请求类 10 | *

11 | * 12 | * @author 聪明笨狗 13 | * @since 2019-04-20 12:15 14 | */ 15 | @Data 16 | @ApiModel(value="token通用请求类", description="token通用请求类") 17 | public class BaseTokenReqDTO extends BaseDTO { 18 | 19 | 20 | @ApiModelProperty(value = "令牌", required=true) 21 | private String token; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseUserReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | *

12 | * 用户通用请求类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2019-04-20 12:15 17 | */ 18 | @Data 19 | @ApiModel(value="用户通用请求类", description="用户通用请求类") 20 | @AllArgsConstructor 21 | @NoArgsConstructor 22 | public class BaseUserReqDTO extends BaseDTO { 23 | 24 | 25 | @JsonIgnore 26 | @ApiModelProperty(value = "用户ID用来注入用的,可以不传") 27 | private String userId; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/BooleanRespDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | /** 10 | *

11 | * 主键通用响应类,用于添加后返回内容 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2019-04-20 12:15 16 | */ 17 | @Data 18 | @ApiModel(value="主键通用响应类", description="主键通用响应类") 19 | @AllArgsConstructor 20 | @NoArgsConstructor 21 | public class BooleanRespDTO extends BaseDTO { 22 | 23 | @ApiModelProperty(value = "主键ID", required=true) 24 | private Boolean effect; 25 | } 26 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/PagingReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.OrderItem; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.fasterxml.jackson.annotation.JsonIgnore; 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import lombok.Data; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 分页查询类 14 | * @param 15 | * @author bool 16 | */ 17 | @ApiModel(value="分页参数", description="分页参数") 18 | @Data 19 | public class PagingReqDTO { 20 | 21 | 22 | @ApiModelProperty(value = "当前页码", required = true, example = "1") 23 | private Integer current; 24 | 25 | @ApiModelProperty(value = "每页数量", required = true, example = "10") 26 | private Integer size; 27 | 28 | @ApiModelProperty(value = "查询参数") 29 | private T params; 30 | 31 | @ApiModelProperty(value = "排序方式") 32 | private List orders; 33 | 34 | @JsonIgnore 35 | @ApiModelProperty(value = "当前用户的ID") 36 | private String userId; 37 | 38 | /** 39 | * 转换成MyBatis的简单分页对象 40 | * @return 41 | */ 42 | public Page toPage(){ 43 | Page page = new Page(); 44 | page.setCurrent(this.current); 45 | page.setSize(this.size); 46 | page.setOrders(orders); 47 | return page; 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/PagingRespDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | 5 | /** 6 | * 分页响应类 7 | * @author bool 8 | * @date 2019-07-20 15:17 9 | * @param 10 | */ 11 | public class PagingRespDTO extends Page { 12 | 13 | /** 14 | * 获取页面总数量 15 | * @return 16 | */ 17 | @Override 18 | public long getPages() { 19 | if (this.getSize() == 0L) { 20 | return 0L; 21 | } else { 22 | long pages = this.getTotal() / this.getSize(); 23 | if (this.getTotal() % this.getSize() != 0L) { 24 | ++pages; 25 | } 26 | return pages; 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/dto/PayReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | /** 8 | *

9 | * 支付通用请求类 10 | *

11 | * 12 | * @author 聪明笨狗 13 | * @since 2019-04-20 12:15 14 | */ 15 | @Data 16 | @ApiModel(value="支付通用请求类", description="支付通用请求类") 17 | public class PayReqDTO extends BaseDTO { 18 | 19 | @ApiModelProperty(value = "下单成功的订单号", required=true) 20 | private String orderId; 21 | } 22 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/api/enums/CommonState.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.api.enums; 2 | 3 | /** 4 | * 通用的状态枚举信息 5 | * 6 | * @author bool 7 | * @date 2019-09-17 17:57 8 | */ 9 | public interface CommonState { 10 | 11 | /** 12 | * 普通状态,正常的 13 | */ 14 | Integer NORMAL = 0; 15 | /** 16 | * 非正常状态,禁用,下架等 17 | */ 18 | Integer ABNORMAL = 1; 19 | } 20 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/api/exception/ServiceException.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.api.exception; 2 | 3 | 4 | import com.yf.base.api.api.ApiError; 5 | import com.yf.base.api.api.ApiRest; 6 | import lombok.Data; 7 | 8 | 9 | /** 10 | * 通用异常处理类 11 | * @author bool 12 | */ 13 | @Data 14 | public class ServiceException extends RuntimeException{ 15 | 16 | /** 17 | * 错误码 18 | */ 19 | private Integer code; 20 | 21 | /** 22 | * 错误消息 23 | */ 24 | private String msg; 25 | 26 | 27 | /** 28 | * 从结果初始化 29 | * @param apiRest 30 | */ 31 | public ServiceException(ApiRest apiRest){ 32 | this.code = apiRest.getCode(); 33 | this.msg = apiRest.getMsg(); 34 | } 35 | 36 | /** 37 | * 从枚举中获取参数 38 | * @param apiError 39 | */ 40 | public ServiceException(ApiError apiError){ 41 | this.code = apiError.getCode(); 42 | this.msg = apiError.msg; 43 | } 44 | 45 | /** 46 | * 通用的错误信息 47 | * @param msg 48 | */ 49 | public ServiceException(String msg){ 50 | this.code = 1; 51 | this.msg = msg; 52 | } 53 | 54 | 55 | @Override 56 | public String getMessage(){ 57 | return this.msg; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/enums/DataScope.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.enums; 2 | 3 | /** 4 | * 数据权限枚举 5 | * @author bool 6 | */ 7 | public interface DataScope { 8 | 9 | /** 10 | * 本人数据 11 | */ 12 | Integer SCOPE_SELF = 1; 13 | /** 14 | * 本部门数据 15 | */ 16 | Integer SCOPE_DEPT = 2; 17 | /** 18 | * 本部门及以下数据 19 | */ 20 | Integer SCOPE_DEPT_DOWN = 3; 21 | /** 22 | * 全部数据 23 | */ 24 | Integer SCOPE_ALL = 4; 25 | } 26 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/enums/PlatformType.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.enums; 2 | 3 | /** 4 | * 程序平台类型、如小程序、网页版本、H5版 5 | * @author bool 6 | */ 7 | public interface PlatformType { 8 | 9 | /** 10 | * PC网页版本 11 | */ 12 | String PC = "pc"; 13 | /** 14 | * PDF文件 15 | */ 16 | String H5 = "h5"; 17 | } 18 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/AbcTags.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils; 2 | 3 | /** 4 | * 根据索引获取ABC 5 | * @author bool 6 | */ 7 | public class AbcTags { 8 | 9 | 10 | /** 11 | * 获取索引对应的ABC 12 | */ 13 | public static String[] tags = new String[]{ 14 | "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", 15 | "V", "W", "X" 16 | , "Y", "Z" 17 | }; 18 | 19 | /** 20 | * 获得ABC字符 21 | * @param index 22 | * @return 23 | */ 24 | public static String get(int index){ 25 | if(index > tags.length){ 26 | return ""; 27 | } 28 | return tags[index]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/CacheKey.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils; 2 | 3 | import java.text.MessageFormat; 4 | 5 | /** 6 | * 缓存Key定义 7 | * @author bool 8 | */ 9 | public interface CacheKey { 10 | 11 | /** 12 | * 网站 13 | */ 14 | String SITE = "sys:site"; 15 | 16 | /** 17 | * 菜单路由 18 | */ 19 | String MENU = "sys:menu"; 20 | 21 | /** 22 | * 数据字典 23 | */ 24 | String DICT = "sys:dict"; 25 | 26 | /** 27 | * 用户token 28 | */ 29 | String TOKEN = "user:token"; 30 | 31 | 32 | /** 33 | * 上传配置 34 | */ 35 | String UPLOAD = "sys:upload"; 36 | 37 | String SWITCH = "sys:switch"; 38 | 39 | /** 40 | * 课件解锁,用于在解锁下一个课件时写入缓存 41 | * @param userId 42 | * @param courseId 43 | * @return 44 | */ 45 | static String unlockKey(String userId, String courseId){ 46 | return MessageFormat.format("sys:file:unlock:{0}-{1}", userId, courseId); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/CronUtils.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | /** 7 | * 时间转换quartz表达式 8 | * @author bool 9 | * @date 2020/11/29 下午3:00 10 | */ 11 | public class CronUtils { 12 | 13 | /** 14 | * 格式化数据 15 | */ 16 | private static final String DATE_FORMAT = "ss mm HH dd MM ? yyyy"; 17 | 18 | /** 19 | * 准确的时间点到表达式 20 | * @param date 21 | * @return 22 | */ 23 | public static String dateToCron(final Date date){ 24 | SimpleDateFormat fmt = new SimpleDateFormat(DATE_FORMAT); 25 | String formatTimeStr = ""; 26 | if (date != null) { 27 | formatTimeStr = fmt.format(date); 28 | } 29 | return formatTimeStr; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/DeptCodeGen.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils; 2 | 3 | 4 | import com.yf.base.api.exception.ServiceException; 5 | 6 | /** 7 | * 部门编码生成器,用于生成每个级别的部门,每个同级部门最多支持2573个,超出会异常 8 | * @author Van 9 | */ 10 | public class DeptCodeGen { 11 | 12 | /** 13 | * 产生部门编号 14 | * @param num 15 | * @return 16 | */ 17 | public static String gen(int num){ 18 | 19 | if(num > 2573){ 20 | throw new ServiceException("每级最大支持2573个部门!"); 21 | } 22 | 23 | // 序列,0-99为A,100-199为B 24 | int index = num / 99; 25 | int left = num % 99; 26 | String tag = AbcTags.get(index); 27 | StringBuffer sb = new StringBuffer(tag); 28 | if(left < 10){ 29 | sb.append("0"); 30 | } 31 | 32 | sb.append(left); 33 | return sb.toString(); 34 | } 35 | 36 | public static void main(String[] args) { 37 | for(int i=0;i<=2573;i++){ 38 | System.out.println(gen(i)); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils; 2 | 3 | import java.io.File; 4 | 5 | /** 6 | * @author bool 7 | */ 8 | public class FileUtils { 9 | 10 | public static boolean checkDelete(String path){ 11 | 12 | if(path.contains("/.git/") || path.contains("/target/") || path.contains("/.idea/")){ 13 | return true; 14 | } 15 | 16 | return false; 17 | } 18 | 19 | 20 | public static void deleteDir(File file){ 21 | 22 | // 文件夹不存在 23 | if(!file.exists() || !file.isDirectory()){ 24 | return; 25 | } 26 | 27 | 28 | File [] files = file.listFiles(); 29 | if(files == null || files.length==0){ 30 | return; 31 | } 32 | 33 | for(File item: files){ 34 | if(file.isDirectory()){ 35 | deleteDir(item); 36 | continue; 37 | } 38 | 39 | 40 | if(checkDelete(item.getAbsolutePath())){ 41 | System.out.println("+++++++++删除文件:"+item.getAbsolutePath()); 42 | item.delete(); 43 | } 44 | } 45 | 46 | // 删除大文件夹 47 | if(checkDelete(file.getAbsolutePath())){ 48 | System.out.println("+++++++++删除文件:"+file.getAbsolutePath()); 49 | file.delete(); 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/SpringUtils.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * Spring获取工具 10 | * 11 | * @author bool 12 | * @date 2019-12-09 15:55 13 | */ 14 | @Component 15 | public class SpringUtils implements ApplicationContextAware { 16 | 17 | private static ApplicationContext applicationContext; 18 | 19 | @Override 20 | public void setApplicationContext(ApplicationContext context) throws BeansException { 21 | applicationContext = context; 22 | } 23 | 24 | public static T getBean(Class tClass) { 25 | return applicationContext.getBean(tClass); 26 | } 27 | 28 | public static T getBean(String name, Class type) { 29 | return applicationContext.getBean(name, type); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/download/temp/DownloadTemp.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils.download.temp; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 下载临时文件存储,用于边下载边将已经读取的数据记录下来,保存在文件中,下次读取自动从断点下载。 7 | * @author bool 8 | * @date 2018/8/24 09:02 9 | */ 10 | public class DownloadTemp { 11 | 12 | /** 13 | * 下载源URL 14 | */ 15 | private String url; 16 | /** 17 | * 文件的总长度 18 | */ 19 | private long fileLength; 20 | /** 21 | * 下载的线程列表 22 | */ 23 | private List threads; 24 | 25 | public String getUrl() { 26 | return url; 27 | } 28 | 29 | public void setUrl(String url) { 30 | this.url = url; 31 | } 32 | 33 | public long getFileLength() { 34 | return fileLength; 35 | } 36 | 37 | public void setFileLength(long fileLength) { 38 | this.fileLength = fileLength; 39 | } 40 | 41 | public List getThreads() { 42 | return threads; 43 | } 44 | 45 | public void setThreads(List threads) { 46 | this.threads = threads; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/download/temp/DownloadTempThread.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils.download.temp; 2 | 3 | /** 4 | * 下载线程信息,临时文件的一部分,用于保存各个线程的下载情况。 5 | * @author bool 6 | * @date 2018/8/24 09:03 7 | */ 8 | public class DownloadTempThread { 9 | 10 | /** 11 | * 线程名称 12 | */ 13 | private String threadName; 14 | /** 15 | * 跳过的字节数 16 | */ 17 | private long skip; 18 | /** 19 | * 读取的字节数 20 | */ 21 | private long pos; 22 | /** 23 | * 已经加载的数据,用于保存进度 24 | */ 25 | private long loaded; 26 | 27 | public String getThreadName() { 28 | return threadName; 29 | } 30 | 31 | public void setThreadName(String threadName) { 32 | this.threadName = threadName; 33 | } 34 | 35 | public long getSkip() { 36 | return skip; 37 | } 38 | 39 | public void setSkip(long skip) { 40 | this.skip = skip; 41 | } 42 | 43 | public long getPos() { 44 | return pos; 45 | } 46 | 47 | public void setPos(long pos) { 48 | this.pos = pos; 49 | } 50 | 51 | public long getLoaded() { 52 | return loaded; 53 | } 54 | 55 | public void setLoaded(long loaded) { 56 | this.loaded = loaded; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/jackson/NumericBooleanDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils.jackson; 2 | 3 | import com.fasterxml.jackson.core.JsonParser; 4 | import com.fasterxml.jackson.core.JsonProcessingException; 5 | import com.fasterxml.jackson.databind.DeserializationContext; 6 | import com.fasterxml.jackson.databind.JsonDeserializer; 7 | 8 | import java.io.IOException; 9 | 10 | /** 11 | * 接收参数时,将数字参数转换为实体的boolean参数 12 | * @author van 13 | */ 14 | public class NumericBooleanDeserializer extends JsonDeserializer { 15 | 16 | private static final String TRUE_TEXT = "1"; 17 | @Override 18 | public Boolean deserialize(JsonParser jp, DeserializationContext ctx) throws IOException, JsonProcessingException { 19 | return jp.getText().equals(TRUE_TEXT); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/jackson/RawJsonDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils.jackson; 2 | 3 | import com.fasterxml.jackson.core.JsonParser; 4 | import com.fasterxml.jackson.core.JsonProcessingException; 5 | import com.fasterxml.jackson.databind.DeserializationContext; 6 | import com.fasterxml.jackson.databind.JsonDeserializer; 7 | import com.fasterxml.jackson.databind.JsonNode; 8 | import com.fasterxml.jackson.databind.ObjectMapper; 9 | 10 | import java.io.IOException; 11 | 12 | /** 13 | * JSON序列化,从前端接收的对象转换成字符 14 | * @author van 15 | */ 16 | public class RawJsonDeserializer extends JsonDeserializer { 17 | 18 | private static final String TYPE_STRING = "STRING"; 19 | 20 | @Override 21 | public String deserialize(JsonParser jp, DeserializationContext ctxt) 22 | throws IOException, JsonProcessingException { 23 | 24 | ObjectMapper mapper = (ObjectMapper) jp.getCodec(); 25 | JsonNode node = mapper.readTree(jp); 26 | 27 | // 如果本身就是String类型,直接返回 28 | if(TYPE_STRING.equals(node.getNodeType().name())){ 29 | return node.textValue(); 30 | } 31 | 32 | return mapper.writeValueAsString(node); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/base/utils/passwd/PassInfo.java: -------------------------------------------------------------------------------- 1 | package com.yf.base.utils.passwd; 2 | 3 | /** 4 | * 密码实体 5 | * ClassName: PassInfo
6 | * date: 2018年2月13日 下午7:13:50
7 | * 8 | * @author Bool 9 | * @version 10 | */ 11 | public class PassInfo { 12 | 13 | //密码随机串码 14 | private String salt; 15 | 16 | //MD5后的密码 17 | private String password; 18 | 19 | public PassInfo(String salt, String password) { 20 | super(); 21 | this.salt = salt; 22 | this.password = password; 23 | } 24 | 25 | public String getSalt() { 26 | return salt; 27 | } 28 | public void setSalt(String salt) { 29 | this.salt = salt; 30 | } 31 | public String getPassword() { 32 | return password; 33 | } 34 | public void setPassword(String password) { 35 | this.password = password; 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/config/BaseConfig.java: -------------------------------------------------------------------------------- 1 | package com.yf.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | 8 | /** 9 | * 全局静态配置 10 | * @author bool 11 | */ 12 | @Data 13 | @Configuration 14 | @ConfigurationProperties(prefix = "ycloud") 15 | public class BaseConfig { 16 | 17 | 18 | /** 19 | * 演示模式 20 | */ 21 | private Boolean demo; 22 | 23 | /** 24 | * 踢出登录 25 | */ 26 | private Boolean loginTick; 27 | 28 | /** 29 | * 微信登录回调地址 30 | */ 31 | private String loginRedirect; 32 | 33 | /** 34 | * PC端登录同步地址 35 | */ 36 | private String loginSyncPc; 37 | 38 | /** 39 | * 手机端登录同步地址 40 | */ 41 | private String loginSyncH5; 42 | 43 | 44 | /** 45 | * 是否演示模式 46 | * @return 47 | */ 48 | public boolean isDemo(){ 49 | return this.demo!=null && this.demo; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.yf.config; 2 | 3 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.core.Ordered; 7 | import org.springframework.web.cors.CorsConfiguration; 8 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 9 | import org.springframework.web.filter.CorsFilter; 10 | 11 | import java.util.Arrays; 12 | 13 | 14 | /** 15 | * 网关全局设置,允许跨域 16 | * @author bool 17 | * @date 2019-08-13 17:28 18 | */ 19 | 20 | @Configuration 21 | public class CorsConfig { 22 | 23 | @Bean 24 | public FilterRegistrationBean corsFilter() { 25 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 26 | CorsConfiguration config = new CorsConfiguration(); 27 | 28 | config.setAllowCredentials(true); 29 | config.addAllowedOrigin(CorsConfiguration.ALL); 30 | config.addAllowedHeader(CorsConfiguration.ALL); 31 | config.setAllowedMethods(Arrays.asList("POST", "GET", "OPTIONS")); 32 | source.registerCorsConfiguration("/**", config); 33 | FilterRegistrationBean bean = new FilterRegistrationBean<>(new CorsFilter(source)); 34 | bean.setOrder(Ordered.HIGHEST_PRECEDENCE); 35 | return bean; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/config/MultipartConfig.java: -------------------------------------------------------------------------------- 1 | package com.yf.config; 2 | 3 | import org.springframework.boot.web.servlet.MultipartConfigFactory; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.util.unit.DataSize; 7 | 8 | import javax.servlet.MultipartConfigElement; 9 | 10 | /** 11 | * 文件上传配置 12 | * @author bool 13 | * @date 2019-07-29 16:23 14 | */ 15 | @Configuration 16 | public class MultipartConfig { 17 | 18 | @Bean 19 | public MultipartConfigElement multipartConfigElement() { 20 | MultipartConfigFactory factory = new MultipartConfigFactory(); 21 | // 单个数据大小 22 | factory.setMaxFileSize(DataSize.ofMegabytes(5000L)); 23 | /// 总上传数据大小 24 | factory.setMaxRequestSize(DataSize.ofMegabytes(5000L)); 25 | return factory.createMultipartConfig(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/config/MybatisConfig.java: -------------------------------------------------------------------------------- 1 | package com.yf.config; 2 | 3 | import com.yf.system.aspect.mybatis.QueryInterceptor; 4 | import com.yf.system.aspect.mybatis.UpdateInterceptor; 5 | import org.mybatis.spring.annotation.MapperScan; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * Mybatis过滤器配置 11 | * 注意:必须按顺序进行配置,否则容易出现业务异常 12 | * 13 | * @author bool 14 | */ 15 | @Configuration 16 | @MapperScan("com.yf.**.mapper") 17 | public class MybatisConfig { 18 | 19 | /** 20 | * 数据查询过滤器 21 | */ 22 | @Bean 23 | public QueryInterceptor queryInterceptor() { 24 | QueryInterceptor query = new QueryInterceptor(); 25 | query.setLimit(-1L); 26 | return query; 27 | } 28 | 29 | /** 30 | * 插入数据过滤器 31 | */ 32 | @Bean 33 | public UpdateInterceptor updateInterceptor() { 34 | return new UpdateInterceptor(); 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/config/QuartzConfig.java: -------------------------------------------------------------------------------- 1 | package com.yf.config; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | import javax.annotation.PostConstruct; 7 | 8 | /** 9 | * 定时任务配置类 10 | * @author bool 11 | */ 12 | @Log4j2 13 | @Configuration 14 | public class QuartzConfig { 15 | 16 | /** 17 | * 配置基础的系统任务 18 | */ 19 | @PostConstruct 20 | public void initSystem(){ 21 | log.error("+++++开始配置任务..."); 22 | } 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/config/jackson/JacksonConfig.java: -------------------------------------------------------------------------------- 1 | package com.yf.config.jackson; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; 7 | 8 | /** 9 | * JSON序列化配置 10 | * @author van 11 | */ 12 | @Configuration 13 | public class JacksonConfig { 14 | 15 | @Bean 16 | public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) { 17 | ObjectMapper objectMapper = builder.createXmlMapper(false).build(); 18 | objectMapper.setSerializerFactory(objectMapper.getSerializerFactory().withSerializerModifier(new JacksonSerializerModifier())); 19 | return objectMapper; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/config/jackson/JacksonSerializerModifier.java: -------------------------------------------------------------------------------- 1 | package com.yf.config.jackson; 2 | 3 | import com.fasterxml.jackson.databind.BeanDescription; 4 | import com.fasterxml.jackson.databind.SerializationConfig; 5 | import com.fasterxml.jackson.databind.ser.BeanPropertyWriter; 6 | import com.fasterxml.jackson.databind.ser.BeanSerializerModifier; 7 | import com.yf.base.api.annon.Dict; 8 | import com.yf.system.aspect.dict.DataDictFilter; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * JSON序列化处理器 14 | * @author van 15 | */ 16 | public class JacksonSerializerModifier extends BeanSerializerModifier { 17 | 18 | @Override 19 | public List changeProperties(SerializationConfig config, BeanDescription beanDesc, List beanProperties) { 20 | for (BeanPropertyWriter beanProperty : beanProperties) { 21 | 22 | // 数据字典翻译 23 | Dict dict = beanProperty.getAnnotation(Dict.class); 24 | if (dict != null){ 25 | DataDictFilter dictFieldSerializer = new DataDictFilter(beanProperty.getName(), dict.dicCode(), dict.dictTable(), dict.dicText()); 26 | beanProperty.assignSerializer(dictFieldSerializer); 27 | } 28 | } 29 | 30 | 31 | return beanProperties; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/config/websocket/CustomSpringConfigurator.java: -------------------------------------------------------------------------------- 1 | package com.yf.config.websocket; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.beans.factory.BeanFactory; 5 | import org.springframework.context.ApplicationContext; 6 | import org.springframework.context.ApplicationContextAware; 7 | 8 | import javax.websocket.server.ServerEndpointConfig; 9 | 10 | /** 11 | * 用于获取Spring容器 12 | * @author bool 13 | */ 14 | public class CustomSpringConfigurator extends ServerEndpointConfig.Configurator implements ApplicationContextAware { 15 | 16 | /** 17 | * Spring application context. 18 | */ 19 | private static volatile BeanFactory context; 20 | 21 | @Override 22 | public T getEndpointInstance(Class clazz) throws InstantiationException { 23 | return context.getBean(clazz); 24 | } 25 | 26 | @Override 27 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 28 | CustomSpringConfigurator.context = applicationContext; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/config/websocket/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package com.yf.config.websocket; 2 | 3 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.socket.config.annotation.EnableWebSocket; 7 | import org.springframework.web.socket.server.standard.ServerEndpointExporter; 8 | 9 | /** 10 | * Webscoket配置文件 11 | * @author bool 12 | * @date 2019-09-26 09:39 13 | */ 14 | @ConditionalOnWebApplication 15 | @Configuration 16 | @EnableWebSocket 17 | public class WebSocketConfig { 18 | 19 | @Bean 20 | public CustomSpringConfigurator customSpringConfigurator() { 21 | // 获取容器 22 | return new CustomSpringConfigurator(); 23 | } 24 | 25 | @Bean 26 | public ServerEndpointExporter serverEndpointExporter() { 27 | return new ServerEndpointExporter(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/plugins/upload/local/config/LocalConfig.java: -------------------------------------------------------------------------------- 1 | package com.yf.plugins.upload.local.config; 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 | /** 10 | *

11 | * 本地文件上传配置数据传输类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2021-02-05 11:16 16 | */ 17 | @Data 18 | @ApiModel(value="本地文件上传配置", description="本地文件上传配置") 19 | public class LocalConfig implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | @ApiModelProperty(value = "ID", required=true) 25 | private String id; 26 | 27 | @ApiModelProperty(value = "本地目录地址") 28 | private String localDir; 29 | 30 | @ApiModelProperty(value = "访问路径") 31 | private String visitUrl; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/plugins/upload/local/dto/UploadReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.plugins.upload.local.dto; 2 | 3 | 4 | import com.yf.base.api.api.dto.BaseDTO; 5 | import io.swagger.annotations.ApiModel; 6 | import io.swagger.annotations.ApiModelProperty; 7 | import lombok.Data; 8 | import org.springframework.web.multipart.MultipartFile; 9 | 10 | /** 11 | * 文件上传请求类 12 | * @author 13 | * @date 2019-12-26 17:54 14 | */ 15 | @Data 16 | @ApiModel(value="文件上传参数", description="文件上传参数") 17 | public class UploadReqDTO extends BaseDTO { 18 | 19 | @ApiModelProperty(value = "上传文件内容", required=true) 20 | private MultipartFile file; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/plugins/upload/local/dto/UploadRespDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.plugins.upload.local.dto; 2 | 3 | import com.yf.base.api.api.dto.BaseDTO; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | * 上传文件结果 12 | * @author bool 13 | */ 14 | @Data 15 | @AllArgsConstructor 16 | @NoArgsConstructor 17 | @ApiModel(value="文件上传响应", description="文件上传响应") 18 | public class UploadRespDTO extends BaseDTO { 19 | 20 | @ApiModelProperty(value = "上传后的完整的URL地址", required=true) 21 | private String url; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/config/dto/CfgBaseDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.config.dto; 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 | /** 10 | *

11 | * 通用配置请求类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2020-04-17 09:12 16 | */ 17 | @Data 18 | @ApiModel(value="通用配置", description="通用配置") 19 | public class CfgBaseDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | @ApiModelProperty(value = "ID", required=true) 25 | private String id; 26 | 27 | @ApiModelProperty(value = "系统名称") 28 | private String siteName; 29 | 30 | @ApiModelProperty(value = "登录LOGO") 31 | private String loginLogo; 32 | 33 | @ApiModelProperty(value = "登录背景") 34 | private String loginBg; 35 | 36 | @ApiModelProperty(value = "后台LOGO") 37 | private String backLogo; 38 | 39 | @ApiModelProperty(value = "版权信息") 40 | private String copyRight; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/config/dto/CfgSwitchDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.config.dto; 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 | /** 10 | *

11 | * 功能配置数据传输类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2021-11-06 12:02 16 | */ 17 | @Data 18 | @ApiModel(value="功能配置", description="功能配置") 19 | public class CfgSwitchDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | @ApiModelProperty(value = "功能名称", required=true) 25 | private String id; 26 | 27 | @ApiModelProperty(value = "开关或值") 28 | private String val; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/config/entity/CfgBase.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.config.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.baomidou.mybatisplus.extension.activerecord.Model; 8 | import lombok.Data; 9 | 10 | /** 11 | *

12 | * 通用配置实体类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-04-17 09:12 17 | */ 18 | @Data 19 | @TableName("el_cfg_base") 20 | public class CfgBase extends Model { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * ID 26 | */ 27 | @TableId(value = "id", type = IdType.ASSIGN_ID) 28 | private String id; 29 | 30 | /** 31 | * 系统名称 32 | */ 33 | @TableField("site_name") 34 | private String siteName; 35 | 36 | /** 37 | * 登录LOGO 38 | */ 39 | @TableField("login_logo") 40 | private String loginLogo; 41 | 42 | /** 43 | * 登录背景 44 | */ 45 | @TableField("login_bg") 46 | private String loginBg; 47 | 48 | /** 49 | * 后台LOGO 50 | */ 51 | @TableField("back_logo") 52 | private String backLogo; 53 | 54 | /** 55 | * 版权信息 56 | */ 57 | @TableField("copy_right") 58 | private String copyRight; 59 | 60 | } 61 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/config/entity/CfgSwitch.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.config.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.baomidou.mybatisplus.extension.activerecord.Model; 8 | import lombok.Data; 9 | 10 | /** 11 | *

12 | * 功能配置实体类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2021-11-06 12:02 17 | */ 18 | @Data 19 | @TableName("el_cfg_switch") 20 | public class CfgSwitch extends Model { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * 功能名称 26 | */ 27 | @TableId(value = "id", type = IdType.ASSIGN_ID) 28 | private String id; 29 | 30 | /** 31 | * 开关或值 32 | */ 33 | @TableField("val") 34 | private String val; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/config/enums/FuncSwitch.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.config.enums; 2 | 3 | /** 4 | * 功能名称ID枚举,对应数据库el_cfg_switch,用于系统逻辑判断 5 | */ 6 | public interface FuncSwitch { 7 | 8 | // 人脸识别 9 | String FACE_LOGIN = "faceLogin"; 10 | 11 | // 企业微信登录 12 | String CROP_LOGIN = "cropLogin"; 13 | 14 | // 是否T下线的 15 | String LOGIN_TICK = "loginTick"; 16 | 17 | // 手机号登录 18 | String MOBILE_LOGIN = "mobileLogin"; 19 | 20 | // 注册是否要审核 21 | String USER_AUDIT = "userAudit"; 22 | 23 | // 是否指定部门 24 | String USER_DEPT_TYPE = "userDeptType"; 25 | 26 | // 指定的部门 27 | String USER_DEPT_CODE = "userDeptCode"; 28 | 29 | // 是否开启注册 30 | String USER_REG = "userReg"; 31 | 32 | // 微信登录 33 | String WECHAT_LOGIN = "wechatLogin"; 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/config/mapper/CfgBaseMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.config.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.config.entity.CfgBase; 5 | 6 | /** 7 | *

8 | * 通用配置Mapper 9 | *

10 | * 11 | * @author 聪明笨狗 12 | * @since 2020-04-17 09:12 13 | */ 14 | public interface CfgBaseMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/config/mapper/CfgSwitchMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.config.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.config.entity.CfgSwitch; 5 | /** 6 | *

7 | * 功能配置Mapper 8 | *

9 | * 10 | * @author 聪明笨狗 11 | * @since 2021-11-06 12:02 12 | */ 13 | public interface CfgSwitchMapper extends BaseMapper { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/config/service/CfgBaseService.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.config.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.yf.system.modules.config.dto.CfgBaseDTO; 5 | import com.yf.system.modules.config.entity.CfgBase; 6 | 7 | /** 8 | *

9 | * 通用配置业务类 10 | *

11 | * 12 | * @author 聪明笨狗 13 | * @since 2020-04-17 09:12 14 | */ 15 | public interface CfgBaseService extends IService { 16 | 17 | /** 18 | * 查找公开配置信息 19 | * @return 20 | */ 21 | CfgBaseDTO findSimple(); 22 | 23 | /** 24 | * 保存配置 25 | * @param reqDTO 26 | */ 27 | void save(CfgBaseDTO reqDTO); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/config/service/CfgSwitchService.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.config.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.yf.system.modules.config.entity.CfgSwitch; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | *

10 | * 功能配置业务接口类 11 | *

12 | * 13 | * @author 聪明笨狗 14 | * @since 2021-11-06 12:02 15 | */ 16 | public interface CfgSwitchService extends IService { 17 | 18 | /** 19 | * 查找全部组成一个Map 20 | * @return 21 | */ 22 | Map allMap(); 23 | 24 | /** 25 | * 查询是否开启 26 | * @param id 27 | * @return 28 | */ 29 | Boolean isOn(String id); 30 | 31 | /** 32 | * 取值 33 | * @param id 34 | * @return 35 | */ 36 | String val(String id); 37 | 38 | /** 39 | * 保存功能开关 40 | * @param map 41 | */ 42 | void save(Map map); 43 | } 44 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/depart/dto/request/DepartQueryReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.depart.dto.request; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | *

12 | * 部门排序请求类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-03-14 10:37 17 | */ 18 | @Data 19 | @ApiModel(value="部门查询请求类", description="部门排序请求类") 20 | public class DepartQueryReqDTO implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | @ApiModelProperty(value = "分类ID") 25 | private String parentId; 26 | 27 | @JsonIgnore 28 | private String deptCodes; 29 | 30 | @JsonIgnore 31 | private String likeCode; 32 | 33 | @ApiModelProperty(value = "部门编号") 34 | private String deptCode; 35 | 36 | @ApiModelProperty(value = "部门名称") 37 | private String deptName; 38 | } 39 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/depart/dto/request/DepartSortReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.depart.dto.request; 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 | /** 10 | *

11 | * 部门排序请求类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2020-03-14 10:37 16 | */ 17 | @Data 18 | @ApiModel(value="拖动排序请求类", description="拖动排序请求类") 19 | public class DepartSortReqDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | @ApiModelProperty(value = "源菜单ID") 24 | private String form; 25 | 26 | @ApiModelProperty(value = "目标菜单ID") 27 | private String to; 28 | 29 | @ApiModelProperty(value = "目标类型,inner放入,before放在前面,after放到后面") 30 | private String dropType; 31 | } 32 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/depart/dto/response/SysDepartTreeDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.depart.dto.response; 2 | 3 | import com.yf.system.modules.depart.dto.SysDepartDTO; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 部门树结构响应类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-09-02 17:25 17 | */ 18 | @Data 19 | @ApiModel(value="部门树结构响应类", description="部门树结构响应类") 20 | public class SysDepartTreeDTO extends SysDepartDTO { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | @ApiModelProperty(value = "子列表", required=true) 25 | private List children; 26 | 27 | @ApiModelProperty(value = "前端显示用") 28 | private String text; 29 | 30 | @ApiModelProperty(value = "前端显示用") 31 | private String value; 32 | 33 | public String getText(){ 34 | return this.getDeptName(); 35 | } 36 | 37 | public String getValue(){ 38 | return this.getDeptCode(); 39 | } 40 | 41 | 42 | 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/depart/mapper/SysDepartMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.depart.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.depart.dto.request.DepartQueryReqDTO; 5 | import com.yf.system.modules.depart.dto.response.SysDepartTreeDTO; 6 | import com.yf.system.modules.depart.entity.SysDepart; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 部门信息Mapper 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2020-09-02 17:25 18 | */ 19 | public interface SysDepartMapper extends BaseMapper { 20 | 21 | /** 22 | * 部门树结构 23 | * @param query 24 | * @return 25 | */ 26 | List tree(@Param("query") DepartQueryReqDTO query); 27 | } 28 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/depart/service/SysDepartService.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.depart.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.yf.system.modules.depart.dto.SysDepartDTO; 5 | import com.yf.system.modules.depart.dto.request.DepartSortReqDTO; 6 | import com.yf.system.modules.depart.dto.response.SysDepartTreeDTO; 7 | import com.yf.system.modules.depart.entity.SysDepart; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 部门信息业务类 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2020-09-02 17:25 18 | */ 19 | public interface SysDepartService extends IService { 20 | 21 | /** 22 | * 保存 23 | * @param reqDTO 24 | */ 25 | void save(SysDepartDTO reqDTO); 26 | 27 | /** 28 | * 查找部门树结构 29 | * @return 30 | */ 31 | List findTree(boolean self); 32 | 33 | /** 34 | * 拖拽排序 35 | * @param reqDTO 36 | */ 37 | void sort(DepartSortReqDTO reqDTO); 38 | 39 | /** 40 | * 同步部门信息 41 | * @param str 以逗号隔开的部门 42 | * @return 43 | */ 44 | String syncDepart(String str); 45 | 46 | /** 47 | * 删除部门 48 | * @param ids 49 | */ 50 | void delete(List ids); 51 | } 52 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/dict/dto/SysDicDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.dict.dto; 2 | 3 | import com.yf.base.api.annon.Dict; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | *

12 | * 分类字典数据传输类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-12-01 14:00 17 | */ 18 | @Data 19 | @ApiModel(value="分类字典", description="分类字典") 20 | public class SysDicDTO implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | @ApiModelProperty(value = "ID", required=true) 26 | private String id; 27 | 28 | @ApiModelProperty(value = "字典编码") 29 | private String code; 30 | 31 | @Dict(dicCode = "dic_type") 32 | @ApiModelProperty(value = "1分类字典,2数据字典") 33 | private Integer type; 34 | 35 | @ApiModelProperty(value = "字典名称") 36 | private String title; 37 | 38 | @ApiModelProperty(value = "字典描述") 39 | private String remark; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/dict/dto/SysDicValueDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.dict.dto; 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 | /** 10 | *

11 | * 分类字典值数据传输类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2020-12-01 14:00 16 | */ 17 | @Data 18 | @ApiModel(value="分类字典值", description="分类字典值") 19 | public class SysDicValueDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | @ApiModelProperty(value = "ID/字典编码", required=true) 25 | private String id; 26 | 27 | @ApiModelProperty(value = "归属字典") 28 | private String dicCode; 29 | 30 | @ApiModelProperty(value = "子项编码") 31 | private String value; 32 | 33 | @ApiModelProperty(value = "分类名称") 34 | private String title; 35 | 36 | @ApiModelProperty(value = "上级ID") 37 | private String parentId; 38 | 39 | @ApiModelProperty(value = "描述") 40 | private String remark; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/dict/dto/ext/DicValueTreeDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.dict.dto.ext; 2 | 3 | import com.yf.system.modules.dict.dto.SysDicValueDTO; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 分类字典值数据传输类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-12-01 14:00 17 | */ 18 | @Data 19 | @ApiModel(value="分类字典值", description="分类字典值") 20 | public class DicValueTreeDTO extends SysDicValueDTO { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | @ApiModelProperty(value = "子类列表") 25 | private List children; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/dict/dto/request/SysDicValueReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.dict.dto.request; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 分类字典值数据传输类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-12-01 14:00 17 | */ 18 | @Data 19 | @ApiModel(value="数据字典请求类", description="数据字典请求类") 20 | public class SysDicValueReqDTO implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | @ApiModelProperty(value = "归属字典") 26 | private String dicCode; 27 | 28 | @ApiModelProperty(value = "排除值") 29 | private List excludes; 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/dict/entity/SysDic.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.dict.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import com.baomidou.mybatisplus.extension.activerecord.Model; 7 | import lombok.Data; 8 | 9 | /** 10 | *

11 | * 分类字典实体类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2020-12-01 14:00 16 | */ 17 | @Data 18 | @TableName("el_sys_dic") 19 | public class SysDic extends Model { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * ID 25 | */ 26 | @TableId(value = "id", type = IdType.ASSIGN_ID) 27 | private String id; 28 | 29 | /** 30 | * 字典编码 31 | */ 32 | private String code; 33 | 34 | /** 35 | * 1分类字典,2数据字典 36 | */ 37 | private Integer type; 38 | 39 | /** 40 | * 字典名称 41 | */ 42 | private String title; 43 | 44 | /** 45 | * 字典描述 46 | */ 47 | private String remark; 48 | 49 | } 50 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/dict/entity/SysDicValue.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.dict.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.baomidou.mybatisplus.extension.activerecord.Model; 8 | import lombok.Data; 9 | 10 | /** 11 | *

12 | * 分类字典值实体类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-12-01 14:00 17 | */ 18 | @Data 19 | @TableName("el_sys_dic_value") 20 | public class SysDicValue extends Model { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * ID/字典编码 26 | */ 27 | @TableId(value = "id", type = IdType.ASSIGN_ID) 28 | private String id; 29 | 30 | /** 31 | * 归属字典 32 | */ 33 | @TableField("dic_code") 34 | private String dicCode; 35 | 36 | /** 37 | * 子项编码 38 | */ 39 | @TableField("`value`") 40 | private String value; 41 | 42 | /** 43 | * 分类名称 44 | */ 45 | private String title; 46 | 47 | /** 48 | * 上级ID 49 | */ 50 | @TableField("parent_id") 51 | private String parentId; 52 | 53 | /** 54 | * 描述 55 | */ 56 | private String remark; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/dict/mapper/SysDicMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.dict.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.dict.entity.SysDic; 5 | /** 6 | *

7 | * 分类字典Mapper 8 | *

9 | * 10 | * @author 聪明笨狗 11 | * @since 2020-12-01 14:00 12 | */ 13 | public interface SysDicMapper extends BaseMapper { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/dict/mapper/SysDicValueMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.dict.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.dict.entity.SysDicValue; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | /** 8 | *

9 | * 分类字典值Mapper 10 | *

11 | * 12 | * @author 聪明笨狗 13 | * @since 2020-12-01 14:00 14 | */ 15 | public interface SysDicValueMapper extends BaseMapper { 16 | 17 | /** 18 | * 查找数据字典 19 | * @param dicCode 20 | * @param value 21 | * @return 22 | */ 23 | String findDictText(@Param("dicCode") String dicCode, @Param("value") String value); 24 | 25 | /** 26 | * 查找数据字典 27 | * @param dicTable 28 | * @param dicText 29 | * @param dicCode 30 | * @param value 31 | * @return 32 | */ 33 | String findTableText(@Param("dicTable") String dicTable, 34 | @Param("dicText") String dicText, 35 | @Param("dicCode") String dicCode, 36 | @Param("value") String value); 37 | } 38 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/dict/service/SysDicService.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.dict.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.yf.base.api.api.dto.PagingReqDTO; 6 | import com.yf.system.modules.dict.dto.SysDicDTO; 7 | import com.yf.system.modules.dict.entity.SysDic; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 分类字典业务类 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2020-12-01 14:00 18 | */ 19 | public interface SysDicService extends IService { 20 | 21 | /** 22 | * 分页查询数据 23 | * @param reqDTO 24 | * @return 25 | */ 26 | IPage paging(PagingReqDTO reqDTO); 27 | 28 | /** 29 | * 保存字典 30 | * @param reqDTO 31 | */ 32 | void save(SysDicDTO reqDTO); 33 | 34 | /** 35 | * 批量删除 36 | * @param ids 37 | */ 38 | void delete(List ids); 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/menu/eums/MenuType.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.menu.eums; 2 | 3 | /** 4 | * 菜单类型 5 | * @author bool 6 | */ 7 | public interface MenuType { 8 | 9 | 10 | /** 11 | * 目录 12 | */ 13 | Integer DIR = 1; 14 | 15 | /** 16 | * 菜单 17 | */ 18 | Integer MENU = 2; 19 | 20 | /** 21 | * 功能 22 | */ 23 | Integer FUNCTION = 3; 24 | } 25 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/plugin/dto/PluginGroupDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.plugin.dto; 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 | /** 10 | *

11 | * 插件分组数据传输类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2022-09-05 10:05 16 | */ 17 | @Data 18 | @ApiModel(value="插件分组", description="插件分组") 19 | public class PluginGroupDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | @ApiModelProperty(value = "ID", required=true) 25 | private String id; 26 | 27 | @ApiModelProperty(value = "分组名称") 28 | private String title; 29 | 30 | @ApiModelProperty(value = "独立排斥") 31 | private Boolean single; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/plugin/dto/PluginSchemaDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.plugin.dto; 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 | /** 10 | *

11 | * 插件元数据数据传输类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2022-09-05 10:05 16 | */ 17 | @Data 18 | @ApiModel(value="插件元数据", description="插件元数据") 19 | public class PluginSchemaDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | @ApiModelProperty(value = "ID", required=true) 25 | private String id; 26 | 27 | @ApiModelProperty(value = "元数据") 28 | private String schemaData; 29 | 30 | @ApiModelProperty(value = "分组") 31 | private String groupId; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/plugin/entity/PluginGroup.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.plugin.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import com.baomidou.mybatisplus.extension.activerecord.Model; 7 | import lombok.Data; 8 | 9 | /** 10 | *

11 | * 插件分组实体类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2022-09-05 10:05 16 | */ 17 | @Data 18 | @TableName("pl_plugin_group") 19 | public class PluginGroup extends Model { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * ID 25 | */ 26 | @TableId(value = "id", type = IdType.ASSIGN_ID) 27 | private String id; 28 | 29 | /** 30 | * 分组名称 31 | */ 32 | private String title; 33 | 34 | /** 35 | * 独立排斥 36 | */ 37 | private Boolean single; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/plugin/entity/PluginSchema.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.plugin.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.baomidou.mybatisplus.extension.activerecord.Model; 8 | import lombok.Data; 9 | 10 | /** 11 | *

12 | * 插件元数据实体类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2022-09-05 10:05 17 | */ 18 | @Data 19 | @TableName("pl_plugin_schema") 20 | public class PluginSchema extends Model { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * ID 26 | */ 27 | @TableId(value = "id", type = IdType.ASSIGN_ID) 28 | private String id; 29 | 30 | /** 31 | * 元数据 32 | */ 33 | private String schemaData; 34 | 35 | /** 36 | * 分组 37 | */ 38 | @TableField("group_id") 39 | private String groupId; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/plugin/mapper/PluginDataMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.plugin.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.plugin.entity.PluginData; 5 | /** 6 | *

7 | * 插件信息Mapper 8 | *

9 | * 10 | * @author 聪明笨狗 11 | * @since 2022-09-05 10:05 12 | */ 13 | public interface PluginDataMapper extends BaseMapper { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/plugin/mapper/PluginGroupMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.plugin.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.plugin.entity.PluginGroup; 5 | /** 6 | *

7 | * 插件分组Mapper 8 | *

9 | * 10 | * @author 聪明笨狗 11 | * @since 2022-09-05 10:05 12 | */ 13 | public interface PluginGroupMapper extends BaseMapper { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/plugin/mapper/PluginSchemaMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.plugin.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.plugin.entity.PluginSchema; 5 | /** 6 | *

7 | * 插件元数据Mapper 8 | *

9 | * 10 | * @author 聪明笨狗 11 | * @since 2022-09-05 10:05 12 | */ 13 | public interface PluginSchemaMapper extends BaseMapper { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/plugin/service/PluginGroupService.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.plugin.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.yf.base.api.api.dto.PagingReqDTO; 6 | import com.yf.system.modules.plugin.dto.PluginGroupDTO; 7 | import com.yf.system.modules.plugin.entity.PluginGroup; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 插件分组业务接口类 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2022-09-05 10:05 18 | */ 19 | public interface PluginGroupService extends IService { 20 | 21 | /** 22 | * 分页查询数据 23 | * @param reqDTO 24 | * @return 25 | */ 26 | IPage paging(PagingReqDTO reqDTO); 27 | 28 | /** 29 | * 添加或保存 30 | * @param reqDTO 31 | * @return 32 | */ 33 | void save(PluginGroupDTO reqDTO); 34 | 35 | /** 36 | * 批量删除 37 | * @param ids 38 | * @return 39 | */ 40 | void delete(List ids); 41 | 42 | /** 43 | * 查找详情 44 | * @param id 45 | * @return 46 | */ 47 | PluginGroupDTO detail(String id); 48 | 49 | /** 50 | * 查找列表 51 | * @param reqDTO 52 | * @return 53 | */ 54 | List list(PluginGroupDTO reqDTO); 55 | } 56 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/plugin/service/PluginSchemaService.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.plugin.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.yf.base.api.api.dto.PagingReqDTO; 6 | import com.yf.system.modules.plugin.dto.PluginSchemaDTO; 7 | import com.yf.system.modules.plugin.entity.PluginSchema; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 插件元数据业务接口类 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2022-09-05 10:05 18 | */ 19 | public interface PluginSchemaService extends IService { 20 | 21 | /** 22 | * 分页查询数据 23 | * @param reqDTO 24 | * @return 25 | */ 26 | IPage paging(PagingReqDTO reqDTO); 27 | 28 | /** 29 | * 添加或保存 30 | * @param reqDTO 31 | * @return 32 | */ 33 | void save(PluginSchemaDTO reqDTO); 34 | 35 | /** 36 | * 批量删除 37 | * @param ids 38 | * @return 39 | */ 40 | void delete(List ids); 41 | 42 | /** 43 | * 查找详情 44 | * @param id 45 | * @return 46 | */ 47 | PluginSchemaDTO detail(String id); 48 | 49 | /** 50 | * 查找列表 51 | * @param reqDTO 52 | * @return 53 | */ 54 | List list(PluginSchemaDTO reqDTO); 55 | } 56 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/role/dto/SysRoleMenuDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.role.dto; 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 | /** 10 | *

11 | * 角色菜单授权数据传输类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2021-03-02 15:44 16 | */ 17 | @Data 18 | @ApiModel(value="角色菜单授权", description="角色菜单授权") 19 | public class SysRoleMenuDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | @ApiModelProperty(value = "ID", required=true) 25 | private String id; 26 | 27 | @ApiModelProperty(value = "角色ID", required=true) 28 | private String roleId; 29 | 30 | @ApiModelProperty(value = "菜单ID", required=true) 31 | private String menuId; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/role/entity/SysRoleMenu.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.role.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.baomidou.mybatisplus.extension.activerecord.Model; 8 | import lombok.Data; 9 | 10 | /** 11 | *

12 | * 角色菜单授权实体类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2021-03-02 15:44 17 | */ 18 | @Data 19 | @TableName("el_sys_role_menu") 20 | public class SysRoleMenu extends Model { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * ID 26 | */ 27 | @TableId(value = "id", type = IdType.ASSIGN_ID) 28 | private String id; 29 | 30 | /** 31 | * 角色ID 32 | */ 33 | @TableField("role_id") 34 | private String roleId; 35 | 36 | /** 37 | * 菜单ID 38 | */ 39 | @TableField("menu_id") 40 | private String menuId; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/role/mapper/SysRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.role.mapper; 2 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 3 | import com.yf.system.modules.role.entity.SysRole; 4 | 5 | /** 6 | *

7 | * 角色Mapper 8 | *

9 | * 10 | * @author 聪明笨狗 11 | * @since 2020-04-13 16:57 12 | */ 13 | public interface SysRoleMapper extends BaseMapper { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/role/mapper/SysRoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.role.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.role.entity.SysRoleMenu; 5 | /** 6 | *

7 | * 角色菜单授权Mapper 8 | *

9 | * 10 | * @author 聪明笨狗 11 | * @since 2021-03-02 15:44 12 | */ 13 | public interface SysRoleMenuMapper extends BaseMapper { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/role/service/SysRoleMenuService.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.role.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.yf.system.modules.role.entity.SysRoleMenu; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | *

10 | * 角色菜单授权业务类 11 | *

12 | * 13 | * @author 聪明笨狗 14 | * @since 2021-03-02 15:44 15 | */ 16 | public interface SysRoleMenuService extends IService { 17 | 18 | /** 19 | * 查找角色授权 20 | * @param roleId 21 | * @return 22 | */ 23 | List findRoleMenus(String roleId); 24 | 25 | 26 | /** 27 | * 保存角色授权 28 | * @param roleId 29 | * @param ids 30 | */ 31 | void saveRoleIds(String roleId, List ids); 32 | } 33 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/role/service/SysRoleService.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.role.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | import com.yf.system.modules.role.dto.SysRoleDTO; 6 | import com.yf.system.modules.role.entity.SysRole; 7 | import com.yf.base.api.api.dto.PagingReqDTO; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | *

13 | * 角色业务类 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2020-04-13 16:57 18 | */ 19 | public interface SysRoleService extends IService { 20 | 21 | /** 22 | * 分页查询数据 23 | * @param reqDTO 24 | * @return 25 | */ 26 | IPage paging(PagingReqDTO reqDTO); 27 | 28 | /** 29 | * 查找最大级别的角色 30 | * @param ids 31 | * @return 32 | */ 33 | int findMaxLevel(List ids); 34 | 35 | /** 36 | * 保存 37 | * @param reqDTO 38 | */ 39 | void save(SysRoleDTO reqDTO); 40 | 41 | /** 42 | * 删除列表 43 | * @param ids 44 | */ 45 | void delete(List ids); 46 | } 47 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/SysUserBindDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import java.util.Date; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | *

12 | * 登录绑定数据传输类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2021-08-02 14:49 17 | */ 18 | @Data 19 | @ApiModel(value="登录绑定", description="登录绑定") 20 | public class SysUserBindDTO implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | @ApiModelProperty(value = "ID", required=true) 26 | private String id; 27 | 28 | @ApiModelProperty(value = "用户ID") 29 | private String userId; 30 | 31 | @ApiModelProperty(value = "登录类型") 32 | private String loginType; 33 | 34 | @ApiModelProperty(value = "三方ID") 35 | private String openId; 36 | 37 | @ApiModelProperty(value = "创建时间") 38 | private Date createTime; 39 | 40 | @ApiModelProperty(value = "更新时间") 41 | private Date updateTime; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/SysUserRoleDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto; 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 | /** 10 | *

11 | * 用户角色请求类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2020-04-13 16:57 16 | */ 17 | @Data 18 | @ApiModel(value="用户角色", description="用户角色") 19 | public class SysUserRoleDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | @ApiModelProperty(value = "ID", required=true) 25 | private String id; 26 | 27 | @ApiModelProperty(value = "用户ID", required=true) 28 | private String userId; 29 | 30 | @ApiModelProperty(value = "角色ID", required=true) 31 | private String roleId; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/SysRoleMenuReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto.request; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 角色菜单授权请求类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-04-13 16:57 17 | */ 18 | @Data 19 | @ApiModel(value="角色菜单授权请求类", description="角色菜单授权请求类") 20 | public class SysRoleMenuReqDTO implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | @ApiModelProperty(value = "角色ID", required=true) 25 | private String id; 26 | 27 | @ApiModelProperty(value = "菜单ID列表", required=true) 28 | private List menuIds; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/SysUserLoginReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto.request; 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 | /** 10 | *

11 | * 管理员登录请求类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2020-04-13 16:57 16 | */ 17 | @Data 18 | @ApiModel(value="管理员登录请求类", description="管理员登录请求类") 19 | public class SysUserLoginReqDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | @ApiModelProperty(value = "用户名", required=true) 24 | private String userName; 25 | 26 | @ApiModelProperty(value = "密码", required=true) 27 | private String password; 28 | 29 | @ApiModelProperty(value = "验证码key", required=true) 30 | private String captchaKey; 31 | 32 | @ApiModelProperty(value = "用户输入的验证码值", required=true) 33 | private String captchaValue; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/SysUserPassReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto.request; 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 | /** 10 | *

11 | * 管理员登录请求类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2020-04-13 16:57 16 | */ 17 | @Data 18 | @ApiModel(value="密码修改请求类", description="密码修改请求类") 19 | public class SysUserPassReqDTO implements Serializable { 20 | 21 | 22 | @ApiModelProperty(value = "旧密码", required=true) 23 | private String oldPassword; 24 | 25 | @ApiModelProperty(value = "新密码", required=true) 26 | private String password; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/SysUserQueryReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto.request; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 用户搜索请求类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-04-13 16:57 17 | */ 18 | @Data 19 | @ApiModel(value="用户搜索请求类", description="用户搜索请求类") 20 | public class SysUserQueryReqDTO implements Serializable { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | @ApiModelProperty(value = "角色ID", required=true) 26 | private List roleIds; 27 | 28 | @ApiModelProperty(value = "用户名", required=true) 29 | private String userName; 30 | 31 | @ApiModelProperty(value = "机构编码", required=true) 32 | private String deptCode; 33 | 34 | @ApiModelProperty(value = "排除列表", required=true) 35 | private List excludes; 36 | 37 | @ApiModelProperty(value = "状态", required=true) 38 | private Integer state; 39 | 40 | @ApiModelProperty(value = "手机号码", required=true) 41 | private String mobile; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/SysUserSaveReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto.request; 2 | 3 | import com.yf.system.modules.user.dto.SysUserDTO; 4 | import io.swagger.annotations.ApiModel; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 管理员登录请求类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-04-13 16:57 17 | */ 18 | @Data 19 | @ApiModel(value="管理员保存请求类", description="管理员保存请求类") 20 | public class SysUserSaveReqDTO extends SysUserDTO { 21 | 22 | @ApiModelProperty(value = "角色列表", required=true) 23 | private List roles; 24 | } 25 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/SysUserUpdateReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto.request; 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 | /** 10 | *

11 | * 用户修改请求类 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2020-04-13 16:57 16 | */ 17 | @Data 18 | @ApiModel(value="用户修改请求类", description="用户修改请求类") 19 | public class SysUserUpdateReqDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | @ApiModelProperty(value = "头像", required=true) 25 | private String avatar; 26 | 27 | @ApiModelProperty(value = "真实姓名", required=true) 28 | private String realName; 29 | 30 | @ApiModelProperty(value = "密码", required=true) 31 | private String password; 32 | 33 | @ApiModelProperty(value = "身份证号码") 34 | private String idCard; 35 | 36 | @ApiModelProperty(value = "手机号") 37 | private String mobile; 38 | 39 | @ApiModelProperty(value = "邮箱") 40 | private String email; 41 | } 42 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/UserRegReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto.request; 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 | /** 10 | *

11 | * 12 | *

13 | * 14 | * @author 聪明笨狗 15 | * @since 2020-04-13 16:57 16 | */ 17 | @Data 18 | @ApiModel(value="用户注册请求类", description="用户注册请求类") 19 | public class UserRegReqDTO implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | @ApiModelProperty(value = "帐号", required=true) 24 | private String userName; 25 | 26 | @ApiModelProperty(value = "密码", required=true) 27 | private String password; 28 | 29 | @ApiModelProperty(value = "姓名", required=true) 30 | private String realName; 31 | 32 | @ApiModelProperty(value = "部门", required=true) 33 | private String deptCode; 34 | 35 | @ApiModelProperty(value = "验证码KEY", required=true) 36 | private String captchaKey; 37 | 38 | @ApiModelProperty(value = "验证码值", required=true) 39 | private String captchaValue; 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/UserRoleReqDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto.request; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | /** 11 | * @author bool 12 | */ 13 | @Data 14 | @ApiModel(value="用户角色批量操作请求类", description="用户角色批量操作请求类") 15 | public class UserRoleReqDTO implements Serializable { 16 | 17 | @ApiModelProperty(value = "用户列表", required=true) 18 | private List userIds; 19 | 20 | @ApiModelProperty(value = "角色列表", required=true) 21 | private List roleIds; 22 | 23 | @ApiModelProperty(value = "操作1增加,0移除", required=true) 24 | private Integer flag; 25 | } 26 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/dto/response/UserExportDTO.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.dto.response; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import com.yf.ability.excel.annotation.ExcelField; 5 | import lombok.Data; 6 | 7 | /** 8 | * 用于导入导出的用户结构 9 | * @author bool 10 | */ 11 | @Data 12 | public class UserExportDTO { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | /** 17 | * 题目ID 18 | */ 19 | @JsonIgnore 20 | private String id; 21 | 22 | @ExcelField(title="账号", sort=1) 23 | private String userName; 24 | 25 | @ExcelField(title="姓名", sort=2) 26 | private String realName; 27 | 28 | @ExcelField(title="部门", sort=3, dictTable = "el_sys_depart", dicText = "dept_name", dictCode = "dept_code") 29 | private String deptCode; 30 | 31 | @ExcelField(title="手机", sort=4) 32 | private String mobile; 33 | 34 | @ExcelField(title="邮箱", sort=5) 35 | private String email; 36 | 37 | @ExcelField(title="身份证号", sort=6) 38 | private String idCard; 39 | 40 | @ExcelField(title="角色", sort=8) 41 | private String roleIds; 42 | 43 | @ExcelField(title="密码", sort=9) 44 | private String password; 45 | } 46 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/entity/SysUserBind.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.baomidou.mybatisplus.extension.activerecord.Model; 8 | import lombok.Data; 9 | import java.util.Date; 10 | 11 | /** 12 | *

13 | * 登录绑定实体类 14 | *

15 | * 16 | * @author 聪明笨狗 17 | * @since 2021-08-02 14:49 18 | */ 19 | @Data 20 | @TableName("el_sys_user_bind") 21 | public class SysUserBind extends Model { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * ID 27 | */ 28 | @TableId(value = "id", type = IdType.ASSIGN_ID) 29 | private String id; 30 | 31 | /** 32 | * 用户ID 33 | */ 34 | @TableField("user_id") 35 | private String userId; 36 | 37 | /** 38 | * 登录类型 39 | */ 40 | @TableField("login_type") 41 | private String loginType; 42 | 43 | /** 44 | * 三方ID 45 | */ 46 | @TableField("open_id") 47 | private String openId; 48 | 49 | /** 50 | * 创建时间 51 | */ 52 | @TableField("create_time") 53 | private Date createTime; 54 | 55 | /** 56 | * 更新时间 57 | */ 58 | @TableField("update_time") 59 | private Date updateTime; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/entity/SysUserRole.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | import com.baomidou.mybatisplus.extension.activerecord.Model; 8 | import lombok.Data; 9 | 10 | /** 11 | *

12 | * 用户角色实体类 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-04-13 16:57 17 | */ 18 | @Data 19 | @TableName("el_sys_user_role") 20 | public class SysUserRole extends Model { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * ID 26 | */ 27 | @TableId(value = "id", type = IdType.ASSIGN_ID) 28 | private String id; 29 | 30 | /** 31 | * 用户ID 32 | */ 33 | @TableField("user_id") 34 | private String userId; 35 | 36 | /** 37 | * 角色ID 38 | */ 39 | @TableField("role_id") 40 | private String roleId; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/enums/LoginType.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.enums; 2 | 3 | 4 | /** 5 | * 登录类型 6 | * @author bool 7 | * @date 2019-10-30 13:11 8 | */ 9 | public interface LoginType { 10 | 11 | /** 12 | * 微信登录 13 | */ 14 | String WECHAT = "wechat"; 15 | 16 | 17 | /** 18 | * 企业微信 19 | */ 20 | String CROP_WECHAT = "crop-wechat"; 21 | 22 | /** 23 | * 钉钉 24 | */ 25 | String DING_TALK = "ding-talk"; 26 | 27 | /** 28 | * 手机号 29 | */ 30 | String MOBILE = "mobile"; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/enums/RoleType.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.enums; 2 | 3 | 4 | /** 5 | * 角色类型 6 | * @author bool 7 | * @date 2019-10-30 13:11 8 | */ 9 | public interface RoleType { 10 | 11 | /** 12 | * 管理角色 13 | */ 14 | Integer ROLE_ADMIN = 2; 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/enums/SysRoleId.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.enums; 2 | 3 | 4 | /** 5 | * 默认角色信息 6 | * @author bool 7 | * @date 2019-10-30 13:11 8 | */ 9 | public interface SysRoleId { 10 | 11 | /** 12 | * 超级管理员 13 | */ 14 | String ADMIN = "admin"; 15 | 16 | /** 17 | * 普通用户 18 | */ 19 | String USER = "user"; 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/enums/UserState.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.enums; 2 | 3 | 4 | /** 5 | * 用户待审核状态 6 | * @author bool 7 | * @date 2019-10-30 13:11 8 | */ 9 | public interface UserState { 10 | 11 | /** 12 | * 正常状态 13 | */ 14 | Integer NORMAL = 0; 15 | 16 | /** 17 | * 被禁用 18 | */ 19 | Integer DISABLED = 1; 20 | 21 | /** 22 | * 待审核 23 | */ 24 | Integer AUDIT = 2; 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/mapper/SysUserBindMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.user.entity.SysUserBind; 5 | /** 6 | *

7 | * 登录绑定Mapper 8 | *

9 | * 10 | * @author 聪明笨狗 11 | * @since 2021-08-02 14:49 12 | */ 13 | public interface SysUserBindMapper extends BaseMapper { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/mapper/SysUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.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 com.yf.system.modules.user.dto.request.SysUserQueryReqDTO; 7 | import com.yf.system.modules.user.dto.response.UserExportDTO; 8 | import com.yf.system.modules.user.dto.response.UserListRespDTO; 9 | import com.yf.system.modules.user.entity.SysUser; 10 | import org.apache.ibatis.annotations.Param; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | *

16 | * 管理用户Mapper 17 | *

18 | * 19 | * @author 聪明笨狗 20 | * @since 2020-04-13 16:57 21 | */ 22 | public interface SysUserMapper extends BaseMapper { 23 | 24 | /** 25 | * 查找数据用于导出 26 | * @param reqDTO 27 | * @return 28 | */ 29 | List listForExport(@Param("query") SysUserQueryReqDTO reqDTO); 30 | 31 | /** 32 | * 查找用户分页 33 | * @param page 34 | * @param reqDTO 35 | * @return 36 | */ 37 | IPage paging(Page page, @Param("query") SysUserQueryReqDTO reqDTO); 38 | } 39 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/java/com/yf/system/modules/user/mapper/SysUserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.yf.system.modules.user.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.yf.system.modules.role.entity.SysRole; 5 | import com.yf.system.modules.user.entity.SysUserRole; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | *

12 | * 用户角色Mapper 13 | *

14 | * 15 | * @author 聪明笨狗 16 | * @since 2020-04-13 16:57 17 | */ 18 | public interface SysUserRoleMapper extends BaseMapper { 19 | 20 | /** 21 | * 查找用户的角色列表 22 | * @param userId 23 | * @return 24 | */ 25 | List listByUser(@Param("userId") String userId); 26 | 27 | /** 28 | * 查找用户的权限标签 29 | * @param userId 30 | * @return 31 | */ 32 | List findUserPermission(@Param("userId") String userId); 33 | 34 | /** 35 | * 查找权限最大的一个角色 36 | * @param userId 37 | * @return 38 | */ 39 | SysUserRole findMaxRole(@Param("userId") String userId); 40 | 41 | /** 42 | * 统计数量 43 | * @param userIds 44 | * @param roleLevel 45 | * @return 46 | */ 47 | int countWithLevel(@Param("userIds") List userIds, @Param("roleLevel") Integer roleLevel); 48 | 49 | 50 | /** 51 | * 查找最大的角色级别 52 | * @param userId 53 | * @return 54 | */ 55 | int findMaxLevel(@Param("userId") String userId); 56 | } 57 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: yf-boot-api 4 | profiles: 5 | active: dev 6 | main: 7 | allow-bean-definition-overriding: true 8 | jackson: 9 | date-format: yyyy-MM-dd HH:mm:ss 10 | time-zone: GMT+8 11 | default-property-inclusion: non_null 12 | deserialization: 13 | fail_on_unknown_properties: false 14 | accept-empty-string-as-null-object: true 15 | parser: 16 | # 允许出现特殊字符和转义符 17 | allow_unquoted_control_chars: true 18 | #允许出现单引号 19 | allow_single_quotes: true 20 | serialization: 21 | fail-on-empty-beans: false 22 | mapper: 23 | # 支持类型转换 24 | allow-coercion-of-scalars: true 25 | server: 26 | port: 8080 27 | # 启用服务端压缩 28 | compression: 29 | enabled: true 30 | min-response-size: 10 31 | mime-types: application/json,application/xml,text/html,text/xml,text/plain,application/javascript,text/css 32 | 33 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/excel/user_template.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yf-team/yf-boot/41d247cac588f96a59a50adbe108846605c3d5b2/yf-boot-api/src/main/resources/excel/user_template.xlsx -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/mapper/sys/config/CfgBaseMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | `id`,`site_name`,`login_logo`,`login_bg`,`back_logo`,`copy_right` 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/mapper/sys/config/CfgSwitchMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | `id`,`is_on` 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/mapper/sys/dict/SysDicMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | `id`,`code`,`type`,`title`,`remark` 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/mapper/sys/dict/SysDicValueMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | `id`,`dic_code`,`value`,`title`,`parent_id`,`remark` 18 | 19 | 20 | 23 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/mapper/sys/plugin/PluginGroupMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | `id`,`title`,`single` 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/mapper/sys/plugin/PluginSchemaMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | `id`,`schema_data`,`group_id` 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/mapper/sys/role/SysRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | `id`,`role_name`,`data_scope`,`role_level`,`remark`,`create_time`,`update_time`,`create_by`,`update_by` 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/mapper/sys/role/SysRoleMenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | `id`,`role_id`,`menu_id` 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /yf-boot-api/src/main/resources/mapper/sys/user/SysUserBindMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | `id`,`user_id`,`login_type`,`open_id`,`create_time`,`update_time` 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /yf-boot-vue/.env.base: -------------------------------------------------------------------------------- 1 | # 环境 2 | NODE_ENV=development 3 | 4 | # 接口域名 5 | VITE_API_HOST=http://localhost:8080 6 | 7 | # 接口前缀 8 | VITE_API_BASE_PATH= 9 | 10 | # 打包路径 11 | VITE_BASE_PATH=/ 12 | -------------------------------------------------------------------------------- /yf-boot-vue/.env.dev: -------------------------------------------------------------------------------- 1 | # 环境 2 | NODE_ENV=production 3 | 4 | # 接口域名 5 | VITE_API_HOST=http://localhost:8080 6 | 7 | # 接口前缀 8 | VITE_API_BASE_PATH= 9 | 10 | # 打包路径 11 | VITE_BASE_PATH=/dist-dev/ 12 | 13 | # 是否删除debugger 14 | VITE_DROP_DEBUGGER=false 15 | 16 | # 是否删除console.log 17 | VITE_DROP_CONSOLE=false 18 | 19 | # 是否sourcemap 20 | VITE_SOURCEMAP=true 21 | 22 | # 输出路径 23 | VITE_OUT_DIR=dist-dev 24 | -------------------------------------------------------------------------------- /yf-boot-vue/.env.pro: -------------------------------------------------------------------------------- 1 | # 环境 2 | NODE_ENV=production 3 | 4 | # 接口域名 5 | VITE_API_HOST=http://localhost:8080 6 | 7 | # 接口前缀 8 | VITE_API_BASE_PATH=pro 9 | 10 | # 打包路径 11 | VITE_BASE_PATH=/ 12 | 13 | # 是否删除debugger 14 | VITE_DROP_DEBUGGER=true 15 | 16 | # 是否删除console.log 17 | VITE_DROP_CONSOLE=true 18 | 19 | # 是否sourcemap 20 | VITE_SOURCEMAP=false 21 | 22 | # 输出路径 23 | VITE_OUT_DIR=dist-pro 24 | -------------------------------------------------------------------------------- /yf-boot-vue/.env.test: -------------------------------------------------------------------------------- 1 | # 环境 2 | NODE_ENV=production 3 | 4 | # 接口域名 5 | VITE_API_HOST=http://localhost:8080 6 | 7 | # 接口前缀 8 | VITE_API_BASE_PATH=test 9 | 10 | # 打包路径 11 | VITE_BASE_PATH=/dist-test/ 12 | 13 | # 是否删除debugger 14 | VITE_DROP_DEBUGGER=false 15 | 16 | # 是否删除console.log 17 | VITE_DROP_CONSOLE=false 18 | 19 | # 是否sourcemap 20 | VITE_SOURCEMAP=true 21 | 22 | # 输出路径 23 | VITE_OUT_DIR=dist-test 24 | -------------------------------------------------------------------------------- /yf-boot-vue/.eslintignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /config/ 3 | /dist/ 4 | /*.js 5 | /test/unit/coverage/ 6 | /node_modules/* 7 | /dist* 8 | /src/main.ts 9 | -------------------------------------------------------------------------------- /yf-boot-vue/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | /dist* 7 | *-lock.* 8 | pnpm-debug 9 | -------------------------------------------------------------------------------- /yf-boot-vue/.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | pnpm commitlint --edit "$1" 5 | -------------------------------------------------------------------------------- /yf-boot-vue/.husky/lintstagedrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'], 3 | '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'], 4 | 'package.json': ['prettier --write'], 5 | '*.vue': ['prettier --write', 'stylelint --fix'], 6 | '*.{scss,less,styl,css,html}': ['stylelint --fix', 'prettier --write'], 7 | '*.md': ['prettier --write'], 8 | '*.hbs': ['prettier --write'] 9 | } 10 | -------------------------------------------------------------------------------- /yf-boot-vue/.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | [ -n "$CI" ] && exit 0 5 | 6 | # Format and submit code according to lintstagedrc.js configuration 7 | npm run ts:check 8 | npm run lint:lint-staged 9 | -------------------------------------------------------------------------------- /yf-boot-vue/.prettierignore: -------------------------------------------------------------------------------- 1 | /node_modules/** 2 | /dist/ 3 | /dist* 4 | /public/* 5 | /docs/* 6 | /vite.config.ts 7 | /src/types/env.d.ts 8 | /docs/**/* 9 | /plop/**/* 10 | CHANGELOG 11 | -------------------------------------------------------------------------------- /yf-boot-vue/.stylelintignore: -------------------------------------------------------------------------------- 1 | /dist/* 2 | /public/* 3 | public/* 4 | /dist* 5 | /src/types/env.d.ts 6 | /docs/**/* 7 | -------------------------------------------------------------------------------- /yf-boot-vue/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | rules: { 4 | 'type-enum': [ 5 | 2, 6 | 'always', 7 | [ 8 | 'feat', // 新功能(feature) 9 | 'fix', // 修补bug 10 | 'docs', // 文档(documentation) 11 | 'style', // 格式、样式(不影响代码运行的变动) 12 | 'refactor', // 重构(即不是新增功能,也不是修改BUG的代码) 13 | 'perf', // 优化相关,比如提升性能、体验 14 | 'test', // 添加测试 15 | 'ci', // 持续集成修改 16 | 'chore', // 构建过程或辅助工具的变动 17 | 'revert', // 回滚到上一个版本 18 | 'workflow', // 工作流改进 19 | 'mod', // 不确定分类的修改 20 | 'wip', // 开发中 21 | 'types', // 类型修改 22 | 'release' // 版本发布 23 | ] 24 | ], 25 | 'subject-full-stop': [0, 'never'], 26 | 'subject-case': [0, 'never'] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /yf-boot-vue/plop/component/component.hbs: -------------------------------------------------------------------------------- 1 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /yf-boot-vue/plop/component/index.hbs: -------------------------------------------------------------------------------- 1 | import {{ upperFirstName }} from './src/{{ upperFirstName }}.vue' 2 | 3 | export { {{ upperFirstName }} } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/plop/component/prompt.js: -------------------------------------------------------------------------------- 1 | const toUpperCase = (str) => str.charAt(0).toUpperCase() + str.slice(1) 2 | 3 | module.exports = { 4 | description: 'Create vue component', 5 | prompts: [ 6 | { 7 | type: 'input', 8 | name: 'name', 9 | message: '请输入组件名称(Please enter the component name)' 10 | } 11 | ], 12 | actions: (data) => { 13 | const { name } = data 14 | const upperFirstName = toUpperCase(name) 15 | 16 | const actions = [] 17 | if (name) { 18 | actions.push({ 19 | type: 'add', 20 | path: `./src/components/${upperFirstName}/src/${upperFirstName}.vue`, 21 | templateFile: './plop/component/component.hbs', 22 | data: { 23 | name, 24 | upperFirstName 25 | } 26 | }, { 27 | type: 'add', 28 | path: `./src/components/${upperFirstName}/index.ts`, 29 | templateFile: './plop/component/index.hbs', 30 | data: { 31 | upperFirstName 32 | } 33 | }) 34 | } 35 | 36 | return actions 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /yf-boot-vue/plop/view/prompt.js: -------------------------------------------------------------------------------- 1 | const toUpperCase = (str) => str.charAt(0).toUpperCase() + str.slice(1) 2 | 3 | module.exports = { 4 | description: 'Create vue view', 5 | prompts: [ 6 | { 7 | type: 'input', 8 | name: 'path', 9 | message: '请输入路径(Please enter a path)', 10 | default: 'views' 11 | }, 12 | { 13 | type: 'input', 14 | name: 'name', 15 | message: '请输入模块名称(Please enter module name)' 16 | } 17 | ], 18 | actions: (data) => { 19 | const { name, path } = data 20 | const upperFirstName = toUpperCase(name) 21 | 22 | const actions = [] 23 | if (name) { 24 | actions.push({ 25 | type: 'add', 26 | path: `./src/${path}/${upperFirstName}.vue`, 27 | templateFile: './plop/view/view.hbs', 28 | data: { 29 | name, 30 | upperFirstName 31 | } 32 | }) 33 | } 34 | 35 | return actions 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /yf-boot-vue/plop/view/view.hbs: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /yf-boot-vue/plopfile.js: -------------------------------------------------------------------------------- 1 | const viewGenerator = require('./plop/view/prompt.js') 2 | const componentGenerator = require('./plop/component/prompt.js') 3 | 4 | module.exports = function (plop) { 5 | plop.setGenerator('view', viewGenerator) 6 | plop.setGenerator('component', componentGenerator) 7 | } 8 | -------------------------------------------------------------------------------- /yf-boot-vue/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | printWidth: 100, 3 | tabWidth: 2, 4 | useTabs: false, 5 | semi: false, 6 | vueIndentScriptAndStyle: false, 7 | singleQuote: true, 8 | quoteProps: 'as-needed', 9 | bracketSpacing: true, 10 | trailingComma: 'none', 11 | jsxSingleQuote: false, 12 | arrowParens: 'always', 13 | insertPragma: false, 14 | requirePragma: false, 15 | proseWrap: 'never', 16 | htmlWhitespaceSensitivity: 'strict', 17 | endOfLine: 'auto', 18 | rangeStart: 0 19 | } 20 | -------------------------------------------------------------------------------- /yf-boot-vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yf-team/yf-boot/41d247cac588f96a59a50adbe108846605c3d5b2/yf-boot-vue/public/favicon.ico -------------------------------------------------------------------------------- /yf-boot-vue/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yf-team/yf-boot/41d247cac588f96a59a50adbe108846605c3d5b2/yf-boot-vue/public/logo.png -------------------------------------------------------------------------------- /yf-boot-vue/src/api/login/index.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const apiLogin = (data) => { 4 | return request.post({ 5 | url: '/api/sys/user/login', 6 | data 7 | }) 8 | } 9 | 10 | // 用户注册 11 | export const apiRegister = (data) => { 12 | return request.post({ 13 | url: '/api/sys/user/reg', 14 | data 15 | }) 16 | } 17 | 18 | export const loginOutApi = () => { 19 | return request.post({ url: '/api/sys/user/logout' }) 20 | } 21 | 22 | export const routesApi = (data: any) => { 23 | return request.post({ 24 | url: '/api/sys/menu/routes', 25 | data 26 | }) 27 | } 28 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/login/types.ts: -------------------------------------------------------------------------------- 1 | export type UserLoginType = { 2 | captchaKey?: string 3 | captchaValue?: string 4 | password?: string 5 | userName?: string 6 | checkPassword?: string 7 | realName?: string 8 | } 9 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/config/index.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const detailApi = (data?: any) => { 4 | return request.post({ url: '/api/sys/config/detail', data }) 5 | } 6 | 7 | export const saveApi = (data?: any) => { 8 | return request.post({ 9 | url: '/api/sys/config/save', 10 | data 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/config/switch.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const apiDetail = () => { 4 | return request.post({ url: '/api/sys/config/switch/detail', data: {} }) 5 | } 6 | 7 | export const apiSave = (data?: any) => { 8 | return request.post({ 9 | url: '/api/sys/config/switch/save', 10 | data 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/depart/index.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const saveApi = (data: any) => { 4 | return request.post({ 5 | url: '/api/sys/depart/save', 6 | data 7 | }) 8 | } 9 | 10 | export const treeApi = (data?: any) => { 11 | return request.post({ 12 | url: '/api/sys/depart/tree', 13 | data 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/dict/index.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const pagingApi = (data: any) => { 4 | return request.post({ 5 | url: '/api/sys/dic/paging', 6 | data 7 | }) 8 | } 9 | 10 | export const saveApi = (data: any) => { 11 | return request.post({ 12 | url: '/api/sys/dic/save', 13 | data 14 | }) 15 | } 16 | 17 | export const detailApi = (data: any) => { 18 | return request.post({ 19 | url: '/api/sys/dic/detail', 20 | data 21 | }) 22 | } 23 | 24 | export const subListApi = (data: any) => { 25 | return request.post({ 26 | url: '/api/sys/dic/value/tree', 27 | data 28 | }) 29 | } 30 | 31 | export const subSaveApi = (data: any) => { 32 | return request.post({ 33 | url: '/api/sys/dic/value/save', 34 | data 35 | }) 36 | } 37 | 38 | export const subDeleteApi = (data: any) => { 39 | return request.post({ 40 | url: '/api/sys/dic/value/delete', 41 | data 42 | }) 43 | } 44 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/menu/index.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const treeApi = () => { 4 | return request.post({ 5 | url: '/api/sys/menu/tree' 6 | }) 7 | } 8 | 9 | export const saveApi = (data: any) => { 10 | return request.post({ 11 | url: '/api/sys/menu/save', 12 | data 13 | }) 14 | } 15 | 16 | export const deleteApi = (data: any) => { 17 | return request.post({ 18 | url: '/api/sys/menu/delete', 19 | data 20 | }) 21 | } 22 | 23 | export const detailApi = (data: any) => { 24 | return request.post({ 25 | url: '/api/sys/menu/detail', 26 | data 27 | }) 28 | } 29 | 30 | export const sortApi = (data: any) => { 31 | return request.post({ 32 | url: '/api/sys/menu/sort', 33 | data 34 | }) 35 | } 36 | 37 | // export const subListApi = (data: any) => { 38 | // return request.post({ 39 | // url: '/api/sys/dic/value/tree', 40 | // data 41 | // }) 42 | // } 43 | 44 | // export const subSaveApi = (data: any) => { 45 | // return request.post({ 46 | // url: '/api/sys/dic/value/save', 47 | // data 48 | // }) 49 | // } 50 | 51 | // export const subDeleteApi = (data: any) => { 52 | // return request.post({ 53 | // url: '/api/sys/dic/value/delete', 54 | // data 55 | // }) 56 | // } 57 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/plugin/data.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const saveConfig = (data?: any) => { 4 | return request.post({ 5 | url: '/api/sys/plugin/data/save', 6 | data 7 | }) 8 | } 9 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/plugin/index.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const detailApi = (data?: any) => { 4 | return request.post({ 5 | url: '/api/sys/config/detail', 6 | data 7 | }) 8 | } 9 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/plugin/schema.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const detailApi = (data?: any) => { 4 | return request.post({ 5 | url: '/api/sys/plugin/schema/detail', 6 | data 7 | }) 8 | } 9 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/role/index.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const pagingApi = (data?: any) => { 4 | return request.post({ 5 | url: '/api/sys/role/paging', 6 | data 7 | }) 8 | } 9 | 10 | export const saveApi = (data: any) => { 11 | return request.post({ 12 | url: '/api/sys/role/save', 13 | data 14 | }) 15 | } 16 | 17 | export const listMenuApi = (data: any) => { 18 | return request.post({ 19 | url: '/api/sys/role/list-menus', 20 | data 21 | }) 22 | } 23 | 24 | export const saveMenuApi = (data: any) => { 25 | return request.post({ 26 | url: '/api/sys/role/save-menus', 27 | data 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /yf-boot-vue/src/api/sys/user/index.ts: -------------------------------------------------------------------------------- 1 | import request from '@/config/axios' 2 | 3 | export const saveApi = (data: any) => { 4 | return request.post({ 5 | url: '/api/sys/user/save', 6 | data 7 | }) 8 | } 9 | 10 | export const detailApi = (data: any) => { 11 | return request.post({ 12 | url: '/api/sys/user/detail', 13 | data 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-vue/src/assets/imgs/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yf-team/yf-boot/41d247cac588f96a59a50adbe108846605c3d5b2/yf-boot-vue/src/assets/imgs/avatar.jpg -------------------------------------------------------------------------------- /yf-boot-vue/src/assets/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yf-team/yf-boot/41d247cac588f96a59a50adbe108846605c3d5b2/yf-boot-vue/src/assets/imgs/logo.png -------------------------------------------------------------------------------- /yf-boot-vue/src/assets/svgs/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /yf-boot-vue/src/assets/svgs/message.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /yf-boot-vue/src/assets/svgs/money.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /yf-boot-vue/src/assets/svgs/peoples.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Backtop/index.ts: -------------------------------------------------------------------------------- 1 | import Backtop from './src/Backtop.vue' 2 | 3 | export { Backtop } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Backtop/src/Backtop.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 16 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Breadcrumb/index.ts: -------------------------------------------------------------------------------- 1 | import Breadcrumb from './src/Breadcrumb.vue' 2 | 3 | export { Breadcrumb } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Breadcrumb/src/helper.ts: -------------------------------------------------------------------------------- 1 | import { pathResolve } from '@/utils/routerHelper' 2 | 3 | export const filterBreadcrumb = ( 4 | routes: AppRouteRecordRaw[], 5 | parentPath = '' 6 | ): AppRouteRecordRaw[] => { 7 | const res: AppRouteRecordRaw[] = [] 8 | 9 | for (const route of routes) { 10 | const meta = route?.meta 11 | if (meta.hidden && !meta.canTo) { 12 | continue 13 | } 14 | 15 | const data: AppRouteRecordRaw = 16 | !meta.alwaysShow && route.children?.length === 1 17 | ? { ...route.children[0], path: pathResolve(route.path, route.children[0].path) } 18 | : { ...route } 19 | 20 | data.path = pathResolve(parentPath, data.path) 21 | 22 | if (data.children) { 23 | data.children = filterBreadcrumb(data.children, data.path) 24 | } 25 | if (data) { 26 | res.push(data) 27 | } 28 | } 29 | return res 30 | } 31 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Collapse/index.ts: -------------------------------------------------------------------------------- 1 | import Collapse from './src/Collapse.vue' 2 | 3 | export { Collapse } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Collapse/src/Collapse.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 35 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ConfigGlobal/index.ts: -------------------------------------------------------------------------------- 1 | import ConfigGlobal from './src/ConfigGlobal.vue' 2 | 3 | export type { ConfigGlobalTypes } from './src/types' 4 | 5 | export { ConfigGlobal } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ConfigGlobal/src/types/index.ts: -------------------------------------------------------------------------------- 1 | import { ComponentSize } from 'element-plus' 2 | 3 | export interface ConfigGlobalTypes { 4 | size?: ComponentSize 5 | } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ContentDetailWrap/index.ts: -------------------------------------------------------------------------------- 1 | import ContentDetailWrap from './src/ContentDetailWrap.vue' 2 | 3 | export { ContentDetailWrap } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ContentDetailWrap/src/ContentDetailWrap.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 26 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ContentWrap/index.ts: -------------------------------------------------------------------------------- 1 | import ContentWrap from './src/ContentWrap.vue' 2 | 3 | export { ContentWrap } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ContentWrap/src/ContentWrap.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 37 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ContextMenu/index.ts: -------------------------------------------------------------------------------- 1 | import ContextMenu from './src/ContextMenu.vue' 2 | import { ElDropdown } from 'element-plus' 3 | import type { RouteLocationNormalizedLoaded } from 'vue-router' 4 | 5 | export type { ContextMenuSchema } from './src/types' 6 | 7 | export interface ContextMenuExpose { 8 | elDropdownMenuRef: ComponentRef 9 | tagItem: RouteLocationNormalizedLoaded 10 | } 11 | 12 | export { ContextMenu } 13 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ContextMenu/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface ContextMenuSchema { 2 | disabled?: boolean 3 | divided?: boolean 4 | icon?: string 5 | label: string 6 | command?: (item: ContextMenuSchema) => void 7 | } 8 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/CountTo/index.ts: -------------------------------------------------------------------------------- 1 | import CountTo from './src/CountTo.vue' 2 | 3 | export { CountTo } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/DataTable/index.ts: -------------------------------------------------------------------------------- 1 | import DataTable from './src/DataTable.vue' 2 | 3 | export { DataTable } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/DataTable/src/types.ts: -------------------------------------------------------------------------------- 1 | // 按钮对应的类型 2 | export type ButtonType = { 3 | enable: boolean 4 | permission?: string[] 5 | router?: string 6 | action?: string 7 | } 8 | 9 | // 表格列属性 10 | export type TableQueryType = { 11 | current: number 12 | size: number 13 | params: any 14 | } 15 | 16 | // 批量操作 17 | export type BatchType = { 18 | key: string 19 | label: string 20 | params?: any 21 | action?: string // 操作请求提交URL 22 | idsKey?: string // 数据ids的JSON名称 23 | } 24 | 25 | // 完整的表格Options参数 26 | export type OptionsType = { 27 | listUrl: string // 分页接口 28 | delUrl?: string // 删除接口 29 | rowKey?: string 30 | ip?: ButtonType // 导入 31 | op?: ButtonType // 导出 32 | add?: ButtonType 33 | edit?: ButtonType 34 | del?: ButtonType 35 | batch?: BatchType[] 36 | } 37 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/DataTree/index.ts: -------------------------------------------------------------------------------- 1 | import DataTable from './src/DataTable.vue' 2 | 3 | export { DataTable } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/DataTree/src/types.ts: -------------------------------------------------------------------------------- 1 | // 树形结构列 2 | export type TreeColumnType = { 3 | title: string 4 | prop: string 5 | width: number 6 | center?: boolean 7 | icon?: string 8 | } 9 | 10 | export type TreeOptionType = { 11 | add?: boolean 12 | edit?: boolean 13 | delete?: boolean 14 | } 15 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Descriptions/index.ts: -------------------------------------------------------------------------------- 1 | import Descriptions from './src/Descriptions.vue' 2 | 3 | export type { DescriptionsSchema } from './src/types' 4 | 5 | export { Descriptions } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Descriptions/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface DescriptionsSchema { 2 | span?: number // 占多少分 3 | field: string // 字段名 4 | label?: string // label名 5 | width?: string | number 6 | minWidth?: string | number 7 | align?: 'left' | 'center' | 'right' 8 | labelAlign?: 'left' | 'center' | 'right' 9 | className?: string 10 | labelClassName?: string 11 | slots?: { 12 | default?: (...args: any[]) => JSX.Element | null 13 | label?: (...args: any[]) => JSX.Element | null 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/DictListSelect/index.ts: -------------------------------------------------------------------------------- 1 | import DictListSelect from './src/DictListSelect.vue' 2 | 3 | export { DictListSelect } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/DictListSelect/src/types.ts: -------------------------------------------------------------------------------- 1 | // 数据字典类型 2 | export type DictValueType = { 3 | title: string 4 | value: string 5 | } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Echart/index.ts: -------------------------------------------------------------------------------- 1 | import Echart from './src/Echart.vue' 2 | 3 | export { Echart } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Editor/index.ts: -------------------------------------------------------------------------------- 1 | import Editor from './src/Editor.vue' 2 | import { IDomEditor } from '@wangeditor/editor' 3 | 4 | export interface EditorExpose { 5 | getEditorRef: () => Promise 6 | } 7 | 8 | export { Editor } 9 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Error/index.ts: -------------------------------------------------------------------------------- 1 | import Error from './src/Error.vue' 2 | 3 | export { Error } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Footer/index.ts: -------------------------------------------------------------------------------- 1 | import Footer from './src/Footer.vue' 2 | 3 | export { Footer } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Footer/src/Footer.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 23 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Highlight/index.ts: -------------------------------------------------------------------------------- 1 | import Highlight from './src/Highlight.vue' 2 | 3 | export { Highlight } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Icon/index.ts: -------------------------------------------------------------------------------- 1 | import Icon from './src/Icon.vue' 2 | 3 | export type { IconTypes } from './src/types' 4 | 5 | export { Icon } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Icon/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface IconTypes { 2 | size?: number 3 | color?: string 4 | icon: string 5 | hoverColor?: string 6 | } 7 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ImageViewer/index.ts: -------------------------------------------------------------------------------- 1 | import ImageViewer from './src/ImageViewer.vue' 2 | import { isClient } from '@/utils/is' 3 | import { createVNode, render, VNode } from 'vue' 4 | import { ImageViewerProps } from './src/types' 5 | 6 | let instance: Nullable = null 7 | 8 | export function createImageViewer(options: ImageViewerProps) { 9 | if (!isClient) return 10 | const { 11 | urlList, 12 | initialIndex = 0, 13 | infinite = true, 14 | hideOnClickModal = false, 15 | teleported = false, 16 | zIndex = 2000, 17 | show = true 18 | } = options 19 | 20 | const propsData: Partial = {} 21 | const container = document.createElement('div') 22 | propsData.urlList = urlList 23 | propsData.initialIndex = initialIndex 24 | propsData.infinite = infinite 25 | propsData.hideOnClickModal = hideOnClickModal 26 | propsData.teleported = teleported 27 | propsData.zIndex = zIndex 28 | propsData.show = show 29 | 30 | document.body.appendChild(container) 31 | instance = createVNode(ImageViewer, propsData) 32 | render(instance, container) 33 | } 34 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ImageViewer/src/ImageViewer.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 35 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ImageViewer/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface ImageViewerProps { 2 | urlList?: string[] 3 | zIndex?: number 4 | initialIndex?: number 5 | infinite?: boolean 6 | hideOnClickModal?: boolean 7 | teleported?: boolean 8 | show?: boolean 9 | } 10 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Infotip/index.ts: -------------------------------------------------------------------------------- 1 | import Infotip from './src/Infotip.vue' 2 | 3 | export type { InfoTipSchema } from './src/types' 4 | 5 | export { Infotip } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Infotip/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface InfoTipSchema { 2 | label: string 3 | keys?: string[] 4 | } 5 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/InputCaptcha/index.ts: -------------------------------------------------------------------------------- 1 | import InputCaptcha from './src/InputCaptcha.vue' 2 | 3 | export { InputCaptcha } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/InputPassword/index.ts: -------------------------------------------------------------------------------- 1 | import InputPassword from './src/InputPassword.vue' 2 | 3 | export { InputPassword } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/LocaleDropdown/index.ts: -------------------------------------------------------------------------------- 1 | import LocaleDropdown from './src/LocaleDropdown.vue' 2 | 3 | export type { Language, LocaleDropdownType } from './src/types' 4 | 5 | export { LocaleDropdown } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/LocaleDropdown/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface Language { 2 | el: Recordable 3 | name: string 4 | } 5 | 6 | export interface LocaleDropdownType { 7 | lang: LocaleType 8 | name?: string 9 | elLocale?: Language 10 | } 11 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Logo/index.ts: -------------------------------------------------------------------------------- 1 | import Logo from './src/Logo.vue' 2 | 3 | export { Logo } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Menu/index.ts: -------------------------------------------------------------------------------- 1 | import Menu from './src/Menu.vue' 2 | 3 | export { Menu } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Menu/src/components/useRenderMenuTitle.tsx: -------------------------------------------------------------------------------- 1 | import type { RouteMeta } from 'vue-router' 2 | import { Icon } from '@/components/Icon' 3 | import { useI18n } from '@/hooks/web/useI18n' 4 | 5 | export const useRenderMenuTitle = () => { 6 | const renderMenuTitle = (meta: RouteMeta) => { 7 | const { t } = useI18n() 8 | const { title = 'Please set title', icon } = meta 9 | 10 | return icon ? ( 11 | <> 12 | 13 | {t(title as string)} 14 | 15 | ) : ( 16 | {t(title as string)} 17 | ) 18 | } 19 | 20 | return { 21 | renderMenuTitle 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Permission/index.ts: -------------------------------------------------------------------------------- 1 | import Permission from './src/Permission.vue' 2 | import { hasPermi } from './src/utils' 3 | 4 | export { Permission, hasPermi } 5 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Permission/src/Permission.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 30 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Permission/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { useI18n } from '@/hooks/web/useI18n' 2 | import router from '@/router' 3 | 4 | export const hasPermi = (value: string) => { 5 | const { t } = useI18n() 6 | const permission = (router.currentRoute.value.meta.permission || []) as string[] 7 | if (!value) { 8 | throw new Error(t('permission.hasPermission')) 9 | } 10 | if (permission.includes(value)) { 11 | return true 12 | } 13 | return false 14 | } 15 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Qrcode/index.ts: -------------------------------------------------------------------------------- 1 | import Qrcode from './src/Qrcode.vue' 2 | 3 | export type { QrcodeLogo } from './src/types' 4 | 5 | export { Qrcode } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Qrcode/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export interface QrcodeLogo { 2 | src?: string 3 | logoSize?: number 4 | bgColor?: string 5 | borderSize?: number 6 | crossOrigin?: string 7 | borderRadius?: number 8 | logoRadius?: number 9 | } 10 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Screenfull/index.ts: -------------------------------------------------------------------------------- 1 | import Screenfull from './src/Screenfull.vue' 2 | 3 | export { Screenfull } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Screenfull/src/Screenfull.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 31 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Search/index.ts: -------------------------------------------------------------------------------- 1 | import { FormSchema, FormSetProps } from '../Form' 2 | import Search from './src/Search.vue' 3 | 4 | export type { SearchProps } from './src/types' 5 | 6 | export interface SearchExpose { 7 | setValues: (data: Recordable) => void 8 | setProps: (props: Recordable) => void 9 | delSchema: (field: string) => void 10 | addSchema: (formSchema: FormSchema, index?: number) => void 11 | setSchema: (schemaProps: FormSetProps[]) => void 12 | formModel: Recordable 13 | } 14 | 15 | export { Search } 16 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Search/src/types/index.ts: -------------------------------------------------------------------------------- 1 | import { FormSchema } from '@/components/Form' 2 | 3 | export interface SearchProps { 4 | schema?: FormSchema[] 5 | isCol?: boolean 6 | labelWidth?: string | number 7 | layout?: 'inline' | 'bottom' 8 | buttonPosition?: 'left' | 'right' | 'center' 9 | showSearch?: boolean 10 | showReset?: boolean 11 | showExpand?: boolean 12 | expandField?: string 13 | inline?: boolean 14 | removeNoValueItem?: boolean 15 | model?: Recordable 16 | } 17 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Setting/index.ts: -------------------------------------------------------------------------------- 1 | import Setting from './src/Setting.vue' 2 | 3 | export { Setting } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/SizeDropdown/index.ts: -------------------------------------------------------------------------------- 1 | import SizeDropdown from './src/SizeDropdown.vue' 2 | 3 | export { SizeDropdown } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/SizeDropdown/src/SizeDropdown.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 40 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/TabMenu/index.ts: -------------------------------------------------------------------------------- 1 | import TabMenu from './src/TabMenu.vue' 2 | 3 | export { TabMenu } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Table/index.ts: -------------------------------------------------------------------------------- 1 | import Table from './src/Table.vue' 2 | import { ElTable } from 'element-plus' 3 | import { TableColumn, TableSetProps } from './src/types' 4 | 5 | export type { 6 | TableColumn, 7 | TableSlotDefault, 8 | Pagination, 9 | TableSetProps, 10 | TableProps 11 | } from './src/types' 12 | 13 | export interface TableExpose { 14 | setProps: (props: Recordable) => void 15 | setColumn: (columnProps: TableSetProps[]) => void 16 | addColumn: (column: TableColumn, index?: number) => void 17 | delColumn: (field: string) => void 18 | elTableRef: ComponentRef 19 | } 20 | 21 | export { Table } 22 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/Table/src/helper/index.ts: -------------------------------------------------------------------------------- 1 | export const setIndex = (reserveIndex: boolean, index: number, size: number, current: number) => { 2 | const newIndex = index + 1 3 | if (reserveIndex) { 4 | return size * (current - 1) + newIndex 5 | } else { 6 | return newIndex 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/TagsView/index.ts: -------------------------------------------------------------------------------- 1 | import TagsView from './src/TagsView.vue' 2 | 3 | export { TagsView } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/TagsView/src/helper.ts: -------------------------------------------------------------------------------- 1 | import type { RouteLocationNormalizedLoaded } from 'vue-router' 2 | import { pathResolve } from '@/utils/routerHelper' 3 | 4 | export const filterAffixTags = (routes: AppRouteRecordRaw[], parentPath = '') => { 5 | let tags: RouteLocationNormalizedLoaded[] = [] 6 | routes.forEach((route) => { 7 | const meta = route.meta ?? {} 8 | const tagPath = pathResolve(parentPath, route.path) 9 | if (meta?.affix) { 10 | tags.push({ ...route, path: tagPath, fullPath: tagPath } as RouteLocationNormalizedLoaded) 11 | } 12 | if (route.children) { 13 | const tempTags: RouteLocationNormalizedLoaded[] = filterAffixTags(route.children, tagPath) 14 | if (tempTags.length >= 1) { 15 | tags = [...tags, ...tempTags] 16 | } 17 | } 18 | }) 19 | 20 | return tags 21 | } 22 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ThemeSwitch/index.ts: -------------------------------------------------------------------------------- 1 | import ThemeSwitch from './src/ThemeSwitch.vue' 2 | 3 | export { ThemeSwitch } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/ThemeSwitch/src/ThemeSwitch.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 42 | 43 | 48 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/UserInfo/index.ts: -------------------------------------------------------------------------------- 1 | import UserInfo from './src/UserInfo.vue' 2 | 3 | export { UserInfo } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/components/index.ts: -------------------------------------------------------------------------------- 1 | import type { App } from 'vue' 2 | import { Icon } from './Icon' 3 | import { Permission } from './Permission' 4 | 5 | export const setupGlobCom = (app: App): void => { 6 | app.component('Icon', Icon) 7 | app.component('Permission', Permission) 8 | } 9 | -------------------------------------------------------------------------------- /yf-boot-vue/src/config/axios/config.ts: -------------------------------------------------------------------------------- 1 | import { AxiosConfig } from './types' 2 | const config: AxiosConfig = { 3 | /** 4 | * 接口成功返回状态码 5 | */ 6 | code: 0, 7 | 8 | /** 9 | * 接口请求超时时间 10 | */ 11 | timeout: 60000, 12 | 13 | /** 14 | * 默认接口请求类型 15 | * 可选值:application/x-www-form-urlencoded multipart/form-data 16 | */ 17 | defaultHeaders: 'application/json', 18 | 19 | interceptors: { 20 | // //请求拦截 21 | // requestInterceptors: (config) => { 22 | // return config 23 | // }, 24 | // // 响应拦截器 25 | // responseInterceptors: (result: AxiosResponse) => { 26 | // return result 27 | // } 28 | } 29 | } 30 | export default config 31 | -------------------------------------------------------------------------------- /yf-boot-vue/src/config/axios/index.ts: -------------------------------------------------------------------------------- 1 | import service from './service' 2 | 3 | import config from './config' 4 | 5 | const { defaultHeaders } = config 6 | 7 | const request = (option: AxiosConfig) => { 8 | const { url, method, params, data, headersType, responseType } = option 9 | return service.request({ 10 | url: url, 11 | method, 12 | params, 13 | data, 14 | responseType: responseType, 15 | headers: { 16 | 'Content-Type': headersType || defaultHeaders 17 | } 18 | }) 19 | } 20 | 21 | export default { 22 | get: (option: AxiosConfig) => { 23 | return request({ method: 'get', ...option }) as Promise> 24 | }, 25 | post: (option: AxiosConfig) => { 26 | return request({ method: 'post', ...option }) as Promise> 27 | }, 28 | delete: (option: AxiosConfig) => { 29 | return request({ method: 'delete', ...option }) as Promise> 30 | }, 31 | put: (option: AxiosConfig) => { 32 | return request({ method: 'put', ...option }) as Promise> 33 | }, 34 | cancelRequest: (url: string | string[]) => { 35 | return service.cancelRequest(url) 36 | }, 37 | cancelAllRequest: () => { 38 | return service.cancelAllRequest() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /yf-boot-vue/src/config/axios/types/index.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | InternalAxiosRequestConfig, 3 | AxiosResponse, 4 | AxiosRequestConfig, 5 | AxiosInstance, 6 | AxiosRequestHeaders, 7 | AxiosError 8 | } from 'axios' 9 | 10 | interface RequestInterceptors { 11 | // 请求拦截 12 | requestInterceptors?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig 13 | requestInterceptorsCatch?: (err: any) => any 14 | // 响应拦截 15 | responseInterceptors?: (config: T) => T 16 | responseInterceptorsCatch?: (err: any) => any 17 | } 18 | interface AxiosConfig { 19 | code: number 20 | defaultHeaders: AxiosHeaders 21 | timeout: number 22 | interceptors: RequestInterceptors 23 | } 24 | 25 | interface RequestConfig extends AxiosRequestConfig { 26 | interceptors?: RequestInterceptors 27 | } 28 | 29 | export { 30 | AxiosResponse, 31 | RequestInterceptors, 32 | RequestConfig, 33 | AxiosConfig, 34 | AxiosInstance, 35 | InternalAxiosRequestConfig, 36 | AxiosRequestHeaders, 37 | AxiosError 38 | } 39 | -------------------------------------------------------------------------------- /yf-boot-vue/src/directives/index.ts: -------------------------------------------------------------------------------- 1 | import type { App } from 'vue' 2 | import { setupPermissionDirective } from './permission/hasPermi' 3 | 4 | /** 5 | * 导出指令:v-xxx 6 | * @methods hasPermi 按钮权限,用法: v-hasPermi 7 | */ 8 | export const setupPermission = (app: App) => { 9 | setupPermissionDirective(app) 10 | } 11 | -------------------------------------------------------------------------------- /yf-boot-vue/src/directives/permission/hasPermi.ts: -------------------------------------------------------------------------------- 1 | import type { App, Directive, DirectiveBinding } from 'vue' 2 | import { useI18n } from '@/hooks/web/useI18n' 3 | import router from '@/router' 4 | 5 | const { t } = useI18n() 6 | 7 | const hasPermission = (value: string): boolean => { 8 | const permission = (router.currentRoute.value.meta.permission || []) as string[] 9 | if (!value) { 10 | throw new Error(t('permission.hasPermission')) 11 | } 12 | if (permission.includes(value)) { 13 | return true 14 | } 15 | return false 16 | } 17 | function hasPermi(el: Element, binding: DirectiveBinding) { 18 | const value = binding.value 19 | 20 | const flag = hasPermission(value) 21 | if (!flag) { 22 | el.parentNode?.removeChild(el) 23 | } 24 | } 25 | const mounted = (el: Element, binding: DirectiveBinding) => { 26 | hasPermi(el, binding) 27 | } 28 | 29 | const permiDirective: Directive = { 30 | mounted 31 | } 32 | 33 | export const setupPermissionDirective = (app: App) => { 34 | app.directive('hasPermi', permiDirective) 35 | } 36 | 37 | export default permiDirective 38 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/event/useEmitt.ts: -------------------------------------------------------------------------------- 1 | import mitt from 'mitt' 2 | import { onBeforeUnmount } from 'vue' 3 | 4 | interface Option { 5 | name: string // 事件名称 6 | callback: Fn // 回调 7 | } 8 | 9 | const emitter = mitt() 10 | 11 | export const useEmitt = (option?: Option) => { 12 | if (option) { 13 | emitter.on(option.name, option.callback) 14 | 15 | onBeforeUnmount(() => { 16 | emitter.off(option.name) 17 | }) 18 | } 19 | 20 | return { 21 | emitter 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/useConfigGlobal.ts: -------------------------------------------------------------------------------- 1 | import { ConfigGlobalTypes } from '@/components/ConfigGlobal' 2 | import { inject } from 'vue' 3 | 4 | export const useConfigGlobal = () => { 5 | const configGlobal = inject('configGlobal', {}) as ConfigGlobalTypes 6 | 7 | return { 8 | configGlobal 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/useDesign.ts: -------------------------------------------------------------------------------- 1 | import variables from '@/styles/variables.module.less' 2 | 3 | export const useDesign = () => { 4 | const lessVariables = variables 5 | 6 | /** 7 | * @param scope 类名 8 | * @returns 返回空间名-类名 9 | */ 10 | const getPrefixCls = (scope: string) => { 11 | return `${lessVariables.namespace}-${scope}` 12 | } 13 | 14 | return { 15 | variables: lessVariables, 16 | getPrefixCls 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/useGuide.ts: -------------------------------------------------------------------------------- 1 | import { Config, driver } from 'driver.js' 2 | import 'driver.js/dist/driver.css' 3 | import { useDesign } from '@/hooks/web/useDesign' 4 | import { useI18n } from '@/hooks/web/useI18n' 5 | 6 | const { t } = useI18n() 7 | 8 | const { variables } = useDesign() 9 | 10 | export const useGuide = (options?: Config) => { 11 | const driverObj = driver( 12 | options || { 13 | showProgress: true, 14 | nextBtnText: t('common.nextLabel'), 15 | prevBtnText: t('common.prevLabel'), 16 | doneBtnText: t('common.doneLabel'), 17 | steps: [ 18 | { 19 | element: `#${variables.namespace}-menu`, 20 | popover: { 21 | title: t('common.menu'), 22 | description: t('common.menuDes'), 23 | side: 'right' 24 | } 25 | }, 26 | { 27 | element: `#${variables.namespace}-tool-header`, 28 | popover: { 29 | title: t('common.tool'), 30 | description: t('common.toolDes'), 31 | side: 'left' 32 | } 33 | }, 34 | { 35 | element: `#${variables.namespace}-tags-view`, 36 | popover: { 37 | title: t('common.tagsView'), 38 | description: t('common.tagsViewDes'), 39 | side: 'bottom' 40 | } 41 | } 42 | ] 43 | } 44 | ) 45 | 46 | return { 47 | ...driverObj 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/useI18n.ts: -------------------------------------------------------------------------------- 1 | import { i18n } from '@/plugins/vueI18n' 2 | 3 | type I18nGlobalTranslation = { 4 | (key: string): string 5 | (key: string, locale: string): string 6 | (key: string, locale: string, list: unknown[]): string 7 | (key: string, locale: string, named: Record): string 8 | (key: string, list: unknown[]): string 9 | (key: string, named: Record): string 10 | } 11 | 12 | type I18nTranslationRestParameters = [string, any] 13 | 14 | const getKey = (namespace: string | undefined, key: string) => { 15 | if (!namespace) { 16 | return key 17 | } 18 | if (key.startsWith(namespace)) { 19 | return key 20 | } 21 | return `${namespace}.${key}` 22 | } 23 | 24 | export const useI18n = ( 25 | namespace?: string 26 | ): { 27 | t: I18nGlobalTranslation 28 | } => { 29 | const normalFn = { 30 | t: (key: string) => { 31 | return getKey(namespace, key) 32 | } 33 | } 34 | 35 | if (!i18n) { 36 | return normalFn 37 | } 38 | 39 | const { t, ...methods } = i18n.global 40 | 41 | const tFn: I18nGlobalTranslation = (key: string, ...arg: any[]) => { 42 | if (!key) return '' 43 | if (!key.includes('.') && !namespace) return key 44 | return (t as any)(getKey(namespace, key), ...(arg as I18nTranslationRestParameters)) 45 | } 46 | return { 47 | ...methods, 48 | t: tFn 49 | } 50 | } 51 | 52 | export const t = (key: string) => key 53 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/useIcon.ts: -------------------------------------------------------------------------------- 1 | import { h } from 'vue' 2 | import type { VNode } from 'vue' 3 | import { Icon, IconTypes } from '@/components/Icon' 4 | 5 | export const useIcon = (props: IconTypes): VNode => { 6 | return h(Icon, props) 7 | } 8 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/useLocale.ts: -------------------------------------------------------------------------------- 1 | import { i18n } from '@/plugins/vueI18n' 2 | import { useLocaleStoreWithOut } from '@/store/modules/locale' 3 | import { setHtmlPageLang } from '@/plugins/vueI18n/helper' 4 | 5 | const setI18nLanguage = (locale: LocaleType) => { 6 | const localeStore = useLocaleStoreWithOut() 7 | 8 | if (i18n.mode === 'legacy') { 9 | i18n.global.locale = locale 10 | } else { 11 | ;(i18n.global.locale as any).value = locale 12 | } 13 | localeStore.setCurrentLocale({ 14 | lang: locale 15 | }) 16 | setHtmlPageLang(locale) 17 | } 18 | 19 | export const useLocale = () => { 20 | // Switching the language will change the locale of useI18n 21 | // And submit to configuration modification 22 | const changeLocale = async (locale: LocaleType) => { 23 | const globalI18n = i18n.global 24 | 25 | const langModule = await import(`../../locales/${locale}.ts`) 26 | 27 | globalI18n.setLocaleMessage(locale, langModule.default) 28 | 29 | setI18nLanguage(locale) 30 | } 31 | 32 | return { 33 | changeLocale 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/useNProgress.ts: -------------------------------------------------------------------------------- 1 | import { nextTick, unref } from 'vue' 2 | import type { NProgressOptions } from 'nprogress' 3 | import NProgress from 'nprogress' 4 | import 'nprogress/nprogress.css' 5 | import { useCssVar } from '@vueuse/core' 6 | 7 | const primaryColor = useCssVar('--el-color-primary', document.documentElement) 8 | 9 | export const useNProgress = () => { 10 | NProgress.configure({ showSpinner: false } as NProgressOptions) 11 | 12 | const initColor = async () => { 13 | await nextTick() 14 | const bar = document.getElementById('nprogress')?.getElementsByClassName('bar')[0] as ElRef 15 | if (bar) { 16 | bar.style.background = unref(primaryColor.value) 17 | } 18 | } 19 | 20 | initColor() 21 | 22 | const start = () => { 23 | NProgress.start() 24 | } 25 | 26 | const done = () => { 27 | NProgress.done() 28 | } 29 | 30 | return { 31 | start, 32 | done 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/useNow.ts: -------------------------------------------------------------------------------- 1 | import { dateUtil } from '@/utils/dateUtil' 2 | import { reactive, toRefs } from 'vue' 3 | import { tryOnMounted, tryOnUnmounted } from '@vueuse/core' 4 | 5 | export const useNow = (immediate = true) => { 6 | let timer: IntervalHandle 7 | 8 | const state = reactive({ 9 | year: 0, 10 | month: 0, 11 | week: '', 12 | day: 0, 13 | hour: '', 14 | minute: '', 15 | second: 0, 16 | meridiem: '' 17 | }) 18 | 19 | const update = () => { 20 | const now = dateUtil() 21 | 22 | const h = now.format('HH') 23 | const m = now.format('mm') 24 | const s = now.get('s') 25 | 26 | state.year = now.get('y') 27 | state.month = now.get('M') + 1 28 | state.week = '星期' + ['日', '一', '二', '三', '四', '五', '六'][now.day()] 29 | state.day = now.get('date') 30 | state.hour = h 31 | state.minute = m 32 | state.second = s 33 | 34 | state.meridiem = now.format('A') 35 | } 36 | 37 | function start() { 38 | update() 39 | clearInterval(timer) 40 | timer = setInterval(() => update(), 1000) 41 | } 42 | 43 | function stop() { 44 | clearInterval(timer) 45 | } 46 | 47 | tryOnMounted(() => { 48 | immediate && start() 49 | }) 50 | 51 | tryOnUnmounted(() => { 52 | stop() 53 | }) 54 | 55 | return { 56 | ...toRefs(state), 57 | start, 58 | stop 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/usePageLoading.ts: -------------------------------------------------------------------------------- 1 | import { useAppStoreWithOut } from '@/store/modules/app' 2 | 3 | const appStore = useAppStoreWithOut() 4 | 5 | export const usePageLoading = () => { 6 | const loadStart = () => { 7 | appStore.setPageLoading(true) 8 | } 9 | 10 | const loadDone = () => { 11 | appStore.setPageLoading(false) 12 | } 13 | 14 | return { 15 | loadStart, 16 | loadDone 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /yf-boot-vue/src/hooks/web/useTitle.ts: -------------------------------------------------------------------------------- 1 | import { watch, ref } from 'vue' 2 | import { isString } from '@/utils/is' 3 | import { useAppStoreWithOut } from '@/store/modules/app' 4 | import { useI18n } from '@/hooks/web/useI18n' 5 | 6 | const appStore = useAppStoreWithOut() 7 | 8 | export const useTitle = (newTitle?: string) => { 9 | const { t } = useI18n() 10 | // 网站信息 11 | const siteInfo = appStore.getSiteInfo 12 | const title = ref( 13 | newTitle ? `${siteInfo.siteName} - ${t(newTitle as string)}` : siteInfo.siteName 14 | ) 15 | 16 | watch( 17 | title, 18 | (n, o) => { 19 | if (isString(n) && n !== o && document) { 20 | document.title = n 21 | } 22 | }, 23 | { immediate: true } 24 | ) 25 | 26 | return title 27 | } 28 | -------------------------------------------------------------------------------- /yf-boot-vue/src/main.ts: -------------------------------------------------------------------------------- 1 | // 引入windi css 2 | import '@/plugins/unocss' 3 | 4 | // 导入全局的svg图标 5 | import '@/plugins/svgIcon' 6 | 7 | // 初始化多语言 8 | import { setupI18n } from '@/plugins/vueI18n' 9 | 10 | // 引入状态管理 11 | import { setupStore } from '@/store' 12 | 13 | // 全局组件 14 | import { setupGlobCom } from '@/components' 15 | 16 | // 引入全局样式 17 | import '@/styles/index.less' 18 | 19 | // 引入动画 20 | import '@/plugins/animate.css' 21 | 22 | // 引入element-plus 23 | import { setupElementPlus } from '@/plugins/elementPlus' 24 | 25 | // 路由 26 | import { setupRouter } from './router' 27 | 28 | // 权限 29 | import { setupPermission } from './directives' 30 | 31 | import { createApp } from 'vue' 32 | 33 | import App from './App.vue' 34 | 35 | import './permission' 36 | 37 | // 创建实例 38 | const setupAll = async () => { 39 | const app = createApp(App) 40 | 41 | await setupI18n(app) 42 | 43 | setupStore(app) 44 | 45 | setupGlobCom(app) 46 | 47 | setupElementPlus(app) 48 | 49 | setupRouter(app) 50 | 51 | setupPermission(app) 52 | 53 | app.mount('#app') 54 | } 55 | 56 | setupAll() 57 | -------------------------------------------------------------------------------- /yf-boot-vue/src/plugins/animate.css/index.ts: -------------------------------------------------------------------------------- 1 | import 'animate.css' 2 | -------------------------------------------------------------------------------- /yf-boot-vue/src/plugins/echarts/index.ts: -------------------------------------------------------------------------------- 1 | import * as echarts from 'echarts/core' 2 | 3 | import { 4 | BarChart, 5 | LineChart, 6 | PieChart, 7 | MapChart, 8 | PictorialBarChart, 9 | RadarChart 10 | } from 'echarts/charts' 11 | 12 | import { 13 | TitleComponent, 14 | TooltipComponent, 15 | GridComponent, 16 | PolarComponent, 17 | AriaComponent, 18 | ParallelComponent, 19 | LegendComponent 20 | } from 'echarts/components' 21 | 22 | import { CanvasRenderer } from 'echarts/renderers' 23 | 24 | echarts.use([ 25 | LegendComponent, 26 | TitleComponent, 27 | TooltipComponent, 28 | GridComponent, 29 | PolarComponent, 30 | AriaComponent, 31 | ParallelComponent, 32 | BarChart, 33 | LineChart, 34 | PieChart, 35 | MapChart, 36 | CanvasRenderer, 37 | PictorialBarChart, 38 | RadarChart 39 | ]) 40 | 41 | export default echarts 42 | -------------------------------------------------------------------------------- /yf-boot-vue/src/plugins/elementPlus/index.ts: -------------------------------------------------------------------------------- 1 | import type { App } from 'vue' 2 | import ElementPlus from 'element-plus' 3 | import 'element-plus/dist/index.css' 4 | 5 | // 引入图标 6 | import * as ElementPlusIconsVue from '@element-plus/icons-vue' 7 | 8 | // 全局引入ElementPlus 9 | export const setupElementPlus = (app: App) => { 10 | // 全局引入 11 | app.use(ElementPlus) 12 | 13 | // 全局引入图标 14 | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { 15 | app.component(key, component) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /yf-boot-vue/src/plugins/svgIcon/index.ts: -------------------------------------------------------------------------------- 1 | import 'virtual:svg-icons-register' 2 | 3 | import '@purge-icons/generated' 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/plugins/unocss/index.ts: -------------------------------------------------------------------------------- 1 | import 'virtual:uno.css' 2 | -------------------------------------------------------------------------------- /yf-boot-vue/src/plugins/uploader/index.ts: -------------------------------------------------------------------------------- 1 | import FileUploader from './src/FileUploader.vue' 2 | 3 | export { FileUploader } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/plugins/uploader/src/types.ts: -------------------------------------------------------------------------------- 1 | // 按钮对应的类型 2 | export type ButtonType = { 3 | enable: boolean 4 | permission?: string[] 5 | router?: string 6 | action?: string 7 | } 8 | 9 | // 表格列属性 10 | export type TableQueryType = { 11 | current: number 12 | size: number 13 | params: any 14 | } 15 | 16 | // 批量操作 17 | export type BatchType = { 18 | key: string 19 | label: string 20 | params?: any 21 | action?: string // 操作请求提交URL 22 | idsKey?: string // 数据ids的JSON名称 23 | } 24 | 25 | // 完整的表格Options参数 26 | export type OptionsType = { 27 | listUrl: string // 分页接口 28 | delUrl?: string // 删除接口 29 | rowKey?: string 30 | ip?: ButtonType // 导入 31 | op?: ButtonType // 导出 32 | add?: ButtonType 33 | edit?: ButtonType 34 | del?: ButtonType 35 | batch?: BatchType[] 36 | } 37 | -------------------------------------------------------------------------------- /yf-boot-vue/src/plugins/vueI18n/helper.ts: -------------------------------------------------------------------------------- 1 | export const setHtmlPageLang = (locale: LocaleType) => { 2 | document.querySelector('html')?.setAttribute('lang', locale) 3 | } 4 | -------------------------------------------------------------------------------- /yf-boot-vue/src/plugins/vueI18n/index.ts: -------------------------------------------------------------------------------- 1 | import type { App } from 'vue' 2 | import { createI18n } from 'vue-i18n' 3 | import { useLocaleStoreWithOut } from '@/store/modules/locale' 4 | import type { I18n, I18nOptions } from 'vue-i18n' 5 | import { setHtmlPageLang } from './helper' 6 | 7 | export let i18n: ReturnType 8 | 9 | const createI18nOptions = async (): Promise => { 10 | const localeStore = useLocaleStoreWithOut() 11 | const locale = localeStore.getCurrentLocale 12 | const localeMap = localeStore.getLocaleMap 13 | const defaultLocal = await import(`../../locales/${locale.lang}.ts`) 14 | const message = defaultLocal.default ?? {} 15 | 16 | setHtmlPageLang(locale.lang) 17 | 18 | localeStore.setCurrentLocale({ 19 | lang: locale.lang 20 | // elLocale: elLocal 21 | }) 22 | 23 | return { 24 | legacy: false, 25 | locale: locale.lang, 26 | fallbackLocale: locale.lang, 27 | messages: { 28 | [locale.lang]: message 29 | }, 30 | availableLocales: localeMap.map((v) => v.lang), 31 | sync: true, 32 | silentTranslationWarn: true, 33 | missingWarn: false, 34 | silentFallbackWarn: true 35 | } 36 | } 37 | 38 | export const setupI18n = async (app: App) => { 39 | const options = await createI18nOptions() 40 | i18n = createI18n(options) as I18n 41 | app.use(i18n) 42 | } 43 | -------------------------------------------------------------------------------- /yf-boot-vue/src/store/index.ts: -------------------------------------------------------------------------------- 1 | import type { App } from 'vue' 2 | import { createPinia } from 'pinia' 3 | import piniaPersist from 'pinia-plugin-persist' 4 | 5 | const store = createPinia() 6 | 7 | store.use(piniaPersist) 8 | 9 | export const setupStore = (app: App) => { 10 | app.use(store) 11 | } 12 | 13 | export { store } 14 | -------------------------------------------------------------------------------- /yf-boot-vue/src/store/modules/lock.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from 'pinia' 2 | import { store } from '../index' 3 | 4 | interface lockInfo { 5 | isLock?: boolean 6 | password?: string 7 | } 8 | 9 | interface LockState { 10 | lockInfo: lockInfo 11 | } 12 | 13 | export const useLockStore = defineStore('lock', { 14 | state: (): LockState => { 15 | return { 16 | lockInfo: { 17 | // isLock: false, // 是否锁定屏幕 18 | // password: '' // 锁屏密码 19 | } 20 | } 21 | }, 22 | getters: { 23 | getLockInfo(): lockInfo { 24 | return this.lockInfo 25 | } 26 | }, 27 | actions: { 28 | setLockInfo(lockInfo: lockInfo) { 29 | this.lockInfo = lockInfo 30 | }, 31 | resetLockInfo() { 32 | this.lockInfo = {} 33 | }, 34 | unLock(password: string) { 35 | if (this.lockInfo?.password === password) { 36 | this.resetLockInfo() 37 | return true 38 | } else { 39 | return false 40 | } 41 | } 42 | }, 43 | persist: { 44 | enabled: true, 45 | strategies: [{ key: 'lock', storage: localStorage }] 46 | } 47 | }) 48 | 49 | export const useLockStoreWithOut = () => { 50 | return useLockStore(store) 51 | } 52 | -------------------------------------------------------------------------------- /yf-boot-vue/src/styles/index.css: -------------------------------------------------------------------------------- 1 | @import 'var.css'; 2 | @import 'element-plus/theme-chalk/dark/css-vars.css'; 3 | .el-popup-parent--hidden { 4 | width: 100% !important; 5 | } 6 | .search-box { 7 | height: 50px; 8 | display: flex; 9 | align-items: center; 10 | background: #eee; 11 | padding: 0px 10px 0px 10px; 12 | } 13 | .opt-box { 14 | height: 50px; 15 | display: flex; 16 | align-items: center; 17 | background: #f5f5f5; 18 | padding: 0px 10px 0px 10px; 19 | margin-top: 20px; 20 | } 21 | .opt-box-left { 22 | height: 50px; 23 | display: flex; 24 | align-items: center; 25 | background: #f5f5f5; 26 | flex-grow: 1; 27 | } 28 | .opt-box-right { 29 | height: 50px; 30 | display: flex; 31 | align-items: center; 32 | background: #f5f5f5; 33 | width: 100px; 34 | justify-content: flex-end; 35 | } 36 | .search-items { 37 | display: flex; 38 | align-items: center; 39 | } 40 | .search-items > .filter-item { 41 | margin-right: 10px !important; 42 | width: 200px; 43 | } 44 | .paging-box { 45 | margin-top: 50px; 46 | display: flex; 47 | align-items: center; 48 | justify-content: center; 49 | } 50 | /*# sourceMappingURL=index.css.map */ -------------------------------------------------------------------------------- /yf-boot-vue/src/styles/index.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["index.less"],"names":[],"mappings":"QAAQ;QACA;AAGR;EACE,sBAAA;;AAGF;EACE,YAAA;EACA,aAAA;EACA,mBAAA;EACA,gBAAA;EACA,0BAAA;;AAGF;EACE,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,0BAAA;EACA,gBAAA;;AAGF;EACE,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,YAAA;;AAGF;EACE,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,YAAA;EACA,yBAAA;;AAGF;EACE,aAAA;EACA,mBAAA;;AAGF,aAAc;EACZ,6BAAA;EACA,YAAA;;AAGF;EACE,gBAAA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA","file":"index.css"} -------------------------------------------------------------------------------- /yf-boot-vue/src/styles/index.less: -------------------------------------------------------------------------------- 1 | @import './var.css'; 2 | @import 'element-plus/theme-chalk/dark/css-vars.css'; 3 | 4 | // 解决抽屉弹出时,body宽度变化的问题 5 | .el-popup-parent--hidden { 6 | width: 100% !important; 7 | } 8 | 9 | .search-box { 10 | height: 50px; 11 | display: flex; 12 | align-items: center; 13 | background: #eee; 14 | padding: 0px 10px 0px 10px; 15 | } 16 | 17 | .opt-box { 18 | height: 50px; 19 | display: flex; 20 | align-items: center; 21 | background: #f5f5f5; 22 | padding: 0px 10px 0px 10px; 23 | margin-top: 20px; 24 | } 25 | 26 | .opt-box-left { 27 | height: 50px; 28 | display: flex; 29 | align-items: center; 30 | background: #f5f5f5; 31 | flex-grow: 1; 32 | } 33 | 34 | .opt-box-right { 35 | height: 50px; 36 | display: flex; 37 | align-items: center; 38 | background: #f5f5f5; 39 | width: 100px; 40 | justify-content: flex-end; 41 | } 42 | 43 | .search-items { 44 | display: flex; 45 | align-items: center; 46 | } 47 | 48 | .search-items > .filter-item { 49 | margin-right: 10px !important; 50 | width: 200px; 51 | } 52 | 53 | .paging-box { 54 | margin-top: 50px; 55 | display: flex; 56 | align-items: center; 57 | justify-content: center; 58 | } 59 | -------------------------------------------------------------------------------- /yf-boot-vue/src/styles/var.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --login-bg-color: #293146; 3 | 4 | /* left menu start */ 5 | --left-menu-max-width: 200px; 6 | 7 | --left-menu-min-width: 64px; 8 | 9 | --left-menu-bg-color: #001529; 10 | 11 | --left-menu-bg-light-color: #0f2438; 12 | 13 | --left-menu-bg-active-color: var(--el-color-primary); 14 | 15 | --left-menu-text-color: #bfcbd9; 16 | 17 | --left-menu-text-active-color: #fff; 18 | 19 | --left-menu-collapse-bg-active-color: var(--el-color-primary); 20 | /* left menu end */ 21 | 22 | /* logo start */ 23 | --logo-height: 50px; 24 | 25 | --logo-title-text-color: #fff; 26 | /* logo end */ 27 | 28 | /* header start */ 29 | --top-header-bg-color: '#fff'; 30 | 31 | --top-header-text-color: 'inherit'; 32 | 33 | --top-header-hover-color: #f6f6f6; 34 | 35 | --top-tool-height: var(--logo-height); 36 | 37 | --top-tool-p-x: 0; 38 | 39 | --tags-view-height: 35px; 40 | /* header start */ 41 | 42 | /* tab menu start */ 43 | --tab-menu-max-width: 80px; 44 | 45 | --tab-menu-min-width: 30px; 46 | 47 | --tab-menu-collapse-height: 36px; 48 | /* tab menu end */ 49 | 50 | --app-content-padding: 20px; 51 | 52 | --app-content-bg-color: #f5f7f9; 53 | 54 | --app-footer-height: 50px; 55 | 56 | --transition-time-02: 0.2s; 57 | } 58 | 59 | .dark { 60 | --app-content-bg-color: var(--el-bg-color); 61 | } 62 | -------------------------------------------------------------------------------- /yf-boot-vue/src/styles/variables.module.less: -------------------------------------------------------------------------------- 1 | // 命名空间 2 | @namespace: v; 3 | // el命名空间 4 | @elNamespace: el; 5 | // 导出变量 6 | :export { 7 | namespace: @namespace; 8 | elNamespace: @elNamespace; 9 | } 10 | -------------------------------------------------------------------------------- /yf-boot-vue/src/utils/dateUtil.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Independent time operation tool to facilitate subsequent switch to dayjs 3 | */ 4 | import dayjs from 'dayjs' 5 | 6 | const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss' 7 | const DATE_FORMAT = 'YYYY-MM-DD' 8 | 9 | export function formatToDateTime(date?: dayjs.ConfigType, format = DATE_TIME_FORMAT): string { 10 | return dayjs(date).format(format) 11 | } 12 | 13 | export function formatToDate(date?: dayjs.ConfigType, format = DATE_FORMAT): string { 14 | return dayjs(date).format(format) 15 | } 16 | 17 | export const dateUtil = dayjs 18 | -------------------------------------------------------------------------------- /yf-boot-vue/src/utils/propTypes.ts: -------------------------------------------------------------------------------- 1 | import { createTypes, VueTypesInterface, VueTypeValidableDef } from 'vue-types' 2 | import { CSSProperties } from 'vue' 3 | 4 | // 自定义扩展vue-types 5 | type PropTypes = VueTypesInterface & { 6 | readonly style: VueTypeValidableDef 7 | } 8 | 9 | const propTypes = createTypes({ 10 | func: undefined, 11 | bool: undefined, 12 | string: undefined, 13 | number: undefined, 14 | object: undefined, 15 | integer: undefined 16 | }) as PropTypes 17 | 18 | // 需要自定义扩展的类型 19 | // see: https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method 20 | propTypes.extend([ 21 | { 22 | name: 'style', 23 | getter: true, 24 | type: [String, Object], 25 | default: undefined 26 | } 27 | ]) 28 | 29 | export { propTypes } 30 | -------------------------------------------------------------------------------- /yf-boot-vue/src/utils/tsxHelper.ts: -------------------------------------------------------------------------------- 1 | import { Slots } from 'vue' 2 | import { isFunction } from '@/utils/is' 3 | 4 | export const getSlot = (slots: Slots, slot = 'default', data?: Recordable) => { 5 | // Reflect.has 判断一个对象是否存在某个属性 6 | if (!slots || !Reflect.has(slots, slot)) { 7 | return null 8 | } 9 | if (!isFunction(slots[slot])) { 10 | console.error(`${slot} is not a function!`) 11 | return null 12 | } 13 | const slotFn = slots[slot] 14 | if (!slotFn) return null 15 | return slotFn(data) 16 | } 17 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/Dashboard/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/Error/403.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/Error/404.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/Error/500.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/Login/components/index.ts: -------------------------------------------------------------------------------- 1 | import LoginForm from './LoginForm.vue' 2 | import RegisterForm from './RegisterForm.vue' 3 | 4 | export { LoginForm, RegisterForm } 5 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/Redirect/Redirect.vue: -------------------------------------------------------------------------------- 1 | 4 | 31 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/System/Config/Config.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 21 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/System/DataDict/DataDict.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/System/DataDict/components/types.ts: -------------------------------------------------------------------------------- 1 | // 数据字典实体 2 | export type DictDataType = { 3 | id?: string 4 | type?: string 5 | code?: string 6 | title?: string 7 | remark?: string 8 | } 9 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/System/Depart/components/DepartSelect.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 61 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/System/Menu/types.ts: -------------------------------------------------------------------------------- 1 | // 菜单实体对象 2 | export type MenuDataType = { 3 | id?: string 4 | menuType?: number 5 | metaTitle?: string 6 | parentId?: string 7 | component?: string 8 | path?: string 9 | permissionTag?: string 10 | metaIcon?: string 11 | name?: string 12 | hidden?: boolean 13 | } 14 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/System/Plugin/types.ts: -------------------------------------------------------------------------------- 1 | // 实体对象 2 | export type ConfigIem = { 3 | title?: string 4 | name?: string 5 | } 6 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/System/Role/types.ts: -------------------------------------------------------------------------------- 1 | // 实体对象 2 | export type RoleDataType = { 3 | id?: string 4 | roleName?: string 5 | dataScope?: string 6 | roleLevel?: string 7 | } 8 | -------------------------------------------------------------------------------- /yf-boot-vue/src/views/System/User/types.ts: -------------------------------------------------------------------------------- 1 | // 实体对象 2 | export type RoleDataType = { 3 | id?: string 4 | roleName?: string 5 | dataScope?: string 6 | roleLevel?: string 7 | } 8 | 9 | // 用户对象 10 | export type UserDataType = { 11 | id?: string 12 | userName?: string 13 | realName?: string 14 | deptCode?: string 15 | roles?: string[] 16 | mobile?: string 17 | idCard?: string 18 | avatar?: string 19 | } 20 | -------------------------------------------------------------------------------- /yf-boot-vue/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true, 12 | "lib": ["esnext", "dom"], 13 | "baseUrl": "./", 14 | "allowJs": true, 15 | "forceConsistentCasingInFileNames": true, 16 | "allowSyntheticDefaultImports": true, 17 | "strictFunctionTypes": false, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "experimentalDecorators": true, 21 | "noImplicitAny": false, 22 | "skipLibCheck": true, 23 | "paths": { 24 | "@/*": ["src/*"] 25 | }, 26 | "types": [ 27 | "@intlify/unplugin-vue-i18n/types", 28 | "vite/client", 29 | "element-plus/global", 30 | "@types/qrcode", 31 | "vite-plugin-svg-icons/client" 32 | ] 33 | }, 34 | "include": ["src", "types/**/*.d.ts", "mock/**/*.ts"] 35 | // "exclude": ["dist", "node_modules"] 36 | } 37 | -------------------------------------------------------------------------------- /yf-boot-vue/types/components.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'vue' { 2 | export interface GlobalComponents { 3 | Icon: typeof import('../components/Icon/src/Icon.vue')['default'] 4 | Permission: typeof import('../components/Permission/src/Permission.vue')['default'] 5 | } 6 | } 7 | 8 | export {} 9 | -------------------------------------------------------------------------------- /yf-boot-vue/types/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | 10 | interface ImportMetaEnv { 11 | readonly VITE_APP_TITLE: string 12 | readonly VITE_API_BASE_PATH: string 13 | readonly VITE_BASE_PATH: string 14 | readonly VITE_DROP_DEBUGGER: string 15 | readonly VITE_DROP_CONSOLE: string 16 | readonly VITE_SOURCEMAP: string 17 | readonly VITE_OUT_DIR: string 18 | } 19 | 20 | declare global { 21 | interface ImportMeta { 22 | readonly env: ImportMetaEnv 23 | } 24 | } 25 | --------------------------------------------------------------------------------